MK25-RAMBo13a_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 5f 85 jmp 0x10abe ; 0x10abe <__vector_12> 34: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 38: 0d 94 10 11 jmp 0x22220 ; 0x22220 <__vector_14> 3c: 0d 94 54 0e jmp 0x21ca8 ; 0x21ca8 <__vector_15> 40: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 44: 0d 94 fa 18 jmp 0x231f4 ; 0x231f4 <__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 34 77 jmp 0xee68 ; 0xee68 <__vector_23> 60: 0c 94 b0 51 jmp 0xa360 ; 0xa360 <__bad_interrupt> 64: 0c 94 b3 63 jmp 0xc766 ; 0xc766 <__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 3a ba jmp 0x17474 ; 0x17474 <__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 5e 13 jmp 0x226bc ; 0x226bc <__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 6f 63 jmp 0xc6de ; 0xc6de <__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 38 0b jmp 0x21670 ; 0x21670 <__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 1a 0b jmp 0x21634 ; 0x21634 <__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 da 0a jmp 0x215b4 ; 0x215b4 <__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.481>: 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.480>: 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.479>: 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.478>: 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.477>: 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.476>: 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.475>: 5bf2: ff ff 51 55 45 55 45 20 46 55 4c 4c 00 ..QUEUE FULL. 00005bff <_ZN4MMU2L22MSG_TITLE_INVALID_TOOLE.lto_priv.474>: 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.473>: 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.472>: 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.471>: 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.470>: 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.469>: 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.468>: 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.467>: 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.466>: 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.465>: 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.464>: 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.463>: 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.462>: 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.461>: 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.460>: 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.459>: 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.458>: 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.457>: 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.456>: 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.455>: 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.454>: 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.453>: 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.452>: 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.451>: 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.492>: 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: 0d 94 a6 9d jmp 0x33b4c ; 0x33b4c 6e2c: 0d 94 74 02 jmp 0x204e8 ; 0x204e8 6e30: 0c 94 b7 cd jmp 0x19b6e ; 0x19b6e 6e34: 0c 94 81 d6 jmp 0x1ad02 ; 0x1ad02 6e38: 0d 94 d1 08 jmp 0x211a2 ; 0x211a2 6e3c: 0c 94 8e d1 jmp 0x1a31c ; 0x1a31c 6e40: 0d 94 ce 01 jmp 0x2039c ; 0x2039c 6e44: 0c 94 86 c1 jmp 0x1830c ; 0x1830c 6e48: 0c 94 b9 d1 jmp 0x1a372 ; 0x1a372 6e4c: 0c 94 61 f8 jmp 0x1f0c2 ; 0x1f0c2 6e50: 0c 94 3e d7 jmp 0x1ae7c ; 0x1ae7c 6e54: 0c 94 20 c6 jmp 0x18c40 ; 0x18c40 6e58: 0c 94 2a bd jmp 0x17a54 ; 0x17a54 6e5c: 0c 94 48 bd jmp 0x17a90 ; 0x17a90 6e60: 0c 94 08 bb jmp 0x17610 ; 0x17610 6e64: 0d 94 ad 24 jmp 0x2495a ; 0x2495a 6e68: 0d 94 d0 02 jmp 0x205a0 ; 0x205a0 6e6c: 0c 94 7d bd jmp 0x17afa ; 0x17afa 6e70: 0c 94 00 d2 jmp 0x1a400 ; 0x1a400 6e74: 0c 94 47 ce jmp 0x19c8e ; 0x19c8e 6e78: 0d 94 1c 24 jmp 0x24838 ; 0x24838 6e7c: 0d 94 c2 9d jmp 0x33b84 ; 0x33b84 6e80: 0c 94 1b be jmp 0x17c36 ; 0x17c36 6e84: 0d 94 03 31 jmp 0x26206 ; 0x26206 6e88: 0c 94 66 f7 jmp 0x1eecc ; 0x1eecc 6e8c: 0d 94 dd 0d jmp 0x21bba ; 0x21bba 6e90: 0d 94 df 02 jmp 0x205be ; 0x205be 6e94: 0c 94 1c bb jmp 0x17638 ; 0x17638 6e98: 0c 94 9c 77 jmp 0xef38 ; 0xef38 <__vector_23+0xd0> 6e9c: 0d 94 4b 24 jmp 0x24896 ; 0x24896 6ea0: 0c 94 72 bd jmp 0x17ae4 ; 0x17ae4 6ea4: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 6ea8: 0c 94 40 bb jmp 0x17680 ; 0x17680 6eac: 0c 94 d3 d1 jmp 0x1a3a6 ; 0x1a3a6 6eb0: 0d 94 4c 97 jmp 0x32e98 ; 0x32e98 6eb4: 0c 94 c9 cd jmp 0x19b92 ; 0x19b92 6eb8: 0c 94 0d d9 jmp 0x1b21a ; 0x1b21a 6ebc: 0c 94 e1 ea jmp 0x1d5c2 ; 0x1d5c2 6ec0: 0c 94 33 bb jmp 0x17666 ; 0x17666 6ec4: 0c 94 b6 ea jmp 0x1d56c ; 0x1d56c 6ec8: 0c 94 0e c0 jmp 0x1801c ; 0x1801c 6ecc: 0c 94 d4 fc jmp 0x1f9a8 ; 0x1f9a8 6ed0: 0c 94 57 ce jmp 0x19cae ; 0x19cae 6ed4: 0d 94 72 09 jmp 0x212e4 ; 0x212e4 6ed8: 0c 94 28 d2 jmp 0x1a450 ; 0x1a450 6edc: 0c 94 82 c1 jmp 0x18304 ; 0x18304 ()> 6ee0: 0d 94 ea 24 jmp 0x249d4 ; 0x249d4 6ee4: 0c 94 2a dd jmp 0x1ba54 ; 0x1ba54 6ee8: 0c 94 63 ce jmp 0x19cc6 ; 0x19cc6 6eec: 0d 94 95 0b jmp 0x2172a ; 0x2172a 6ef0: 0c 94 42 c6 jmp 0x18c84 ; 0x18c84 6ef4: 0c 94 7d ce jmp 0x19cfa ; 0x19cfa 6ef8: 0c 94 9b d1 jmp 0x1a336 ; 0x1a336 6efc: 0c 94 0e bb jmp 0x1761c ; 0x1761c 6f00: 0c 94 86 77 jmp 0xef0c ; 0xef0c <__vector_23+0xa4> 6f04: 0c 94 09 bd jmp 0x17a12 ; 0x17a12 6f08: 0d 94 2f 0a jmp 0x2145e ; 0x2145e 6f0c: 0d 94 0e 02 jmp 0x2041c ; 0x2041c 6f10: 0c 94 d6 ce jmp 0x19dac ; 0x19dac 6f14: 0c 94 01 d9 jmp 0x1b202 ; 0x1b202 6f18: 0c 94 4b c6 jmp 0x18c96 ; 0x18c96 6f1c: 0c 94 f6 d1 jmp 0x1a3ec ; 0x1a3ec 6f20: 0d 94 f2 24 jmp 0x249e4 ; 0x249e4 6f24: 0c 94 69 c1 jmp 0x182d2 ; 0x182d2 ()> 6f28: 0c 94 14 d2 jmp 0x1a428 ; 0x1a428 6f2c: 0c 94 1b cf jmp 0x19e36 ; 0x19e36 6f30: 0c 94 ac bc jmp 0x17958 ; 0x17958 6f34: 0d 94 7d 0d jmp 0x21afa ; 0x21afa 6f38: 0c 94 16 d9 jmp 0x1b22c ; 0x1b22c 6f3c: 0c 94 73 c1 jmp 0x182e6 ; 0x182e6 ()> 6f40: 0c 94 7a cd jmp 0x19af4 ; 0x19af4 6f44: 0d 94 1a 25 jmp 0x24a34 ; 0x24a34 6f48: 0c 94 f0 bf jmp 0x17fe0 ; 0x17fe0 6f4c: 0c 94 30 f5 jmp 0x1ea60 ; 0x1ea60 6f50: 0c 94 e5 f7 jmp 0x1efca ; 0x1efca 6f54: 0d 94 38 15 jmp 0x22a70 ; 0x22a70 6f58: 0c 94 5c c2 jmp 0x184b8 ; 0x184b8 6f5c: 0c 94 c4 ea jmp 0x1d588 ; 0x1d588 6f60: 0c 94 fb 78 jmp 0xf1f6 ; 0xf1f6 6f64: 0c 94 7d c1 jmp 0x182fa ; 0x182fa ()> 6f68: 0d 94 04 24 jmp 0x24808 ; 0x24808 6f6c: 0d 94 c7 97 jmp 0x32f8e ; 0x32f8e 6f70: 0d 94 a7 97 jmp 0x32f4e ; 0x32f4e 6f74: 0c 94 63 c2 jmp 0x184c6 ; 0x184c6 6f78: 0d 94 22 25 jmp 0x24a44 ; 0x24a44 6f7c: 0d 94 c4 97 jmp 0x32f88 ; 0x32f88 6f80: 0d 94 2a 25 jmp 0x24a54 ; 0x24a54 6f84: 0c 94 c1 d1 jmp 0x1a382 ; 0x1a382 6f88: 0c 94 45 bb jmp 0x1768a ; 0x1768a 6f8c: 0c 94 c3 e3 jmp 0x1c786 ; 0x1c786 6f90: 0c 94 b0 cc jmp 0x19960 ; 0x19960 6f94: 0d 94 21 0d jmp 0x21a42 ; 0x21a42 6f98: 0c 94 78 77 jmp 0xeef0 ; 0xeef0 <__vector_23+0x88> 6f9c: 0c 94 dd d1 jmp 0x1a3ba ; 0x1a3ba 6fa0: 0c 94 f3 ba jmp 0x175e6 ; 0x175e6 6fa4: 0d 94 c7 63 jmp 0x2c78e ; 0x2c78e 6fa8: 0c 94 39 c6 jmp 0x18c72 ; 0x18c72 6fac: 0d 94 b0 24 jmp 0x24960 ; 0x24960 6fb0: 0c 94 18 bb jmp 0x17630 ; 0x17630 6fb4: 0c 94 c4 e7 jmp 0x1cf88 ; 0x1cf88 6fb8: 0c 94 bd cd jmp 0x19b7a ; 0x19b7a 6fbc: 0c 94 34 bb jmp 0x17668 ; 0x17668 6fc0: 0d 94 6a 05 jmp 0x20ad4 ; 0x20ad4 6fc4: 0d 94 b0 0d jmp 0x21b60 ; 0x21b60 6fc8: 0c 94 20 bd jmp 0x17a40 ; 0x17a40 6fcc: 0d 94 02 25 jmp 0x24a04 ; 0x24a04 6fd0: 0c 94 c0 cd jmp 0x19b80 ; 0x19b80 6fd4: 0c 94 3e bd jmp 0x17a7c ; 0x17a7c 6fd8: 0d 94 87 0a jmp 0x2150e ; 0x2150e 6fdc: 0c 94 bd c5 jmp 0x18b7a ; 0x18b7a 6fe0: 0c 94 c4 c1 jmp 0x18388 ; 0x18388 6fe4: 0d 94 c5 9d jmp 0x33b8a ; 0x33b8a 6fe8: 0c 94 71 c2 jmp 0x184e2 ; 0x184e2 6fec: 0c 94 10 d9 jmp 0x1b220 ; 0x1b220 6ff0: 0c 94 47 ea jmp 0x1d48e ; 0x1d48e 6ff4: 0c 94 70 be jmp 0x17ce0 ; 0x17ce0 6ff8: 0c 94 cd ea jmp 0x1d59a ; 0x1d59a 6ffc: 0c 94 50 d5 jmp 0x1aaa0 ; 0x1aaa0 7000: 0c 94 e7 d1 jmp 0x1a3ce ; 0x1a3ce 7004: 0c 94 e1 f6 jmp 0x1edc2 ; 0x1edc2 7008: 0c 94 64 c1 jmp 0x182c8 ; 0x182c8 ()> 700c: 0c 94 64 e1 jmp 0x1c2c8 ; 0x1c2c8 7010: 0c 94 ac ea jmp 0x1d558 ; 0x1d558 7014: 0c 94 ee bc jmp 0x179dc ; 0x179dc 7018: 0d 94 4e 24 jmp 0x2489c ; 0x2489c 701c: 0d 94 b3 0e jmp 0x21d66 ; 0x21d66 7020: 0c 94 76 f6 jmp 0x1ecec ; 0x1ecec 7024: 0c 94 78 c2 jmp 0x184f0 ; 0x184f0 7028: 0d 94 3a 25 jmp 0x24a74 ; 0x24a74 702c: 0d 94 fa 24 jmp 0x249f4 ; 0x249f4 7030: 0c 94 c9 d1 jmp 0x1a392 ; 0x1a392 7034: 0c 94 26 bb jmp 0x1764c ; 0x1764c 7038: 0c 94 dd f6 jmp 0x1edba ; 0x1edba 703c: 0c 94 7f ce jmp 0x19cfe ; 0x19cfe 7040: 0c 94 12 bb jmp 0x17624 ; 0x17624 7044: 0c 94 31 ea jmp 0x1d462 ; 0x1d462 7048: 0d 94 25 02 jmp 0x2044a ; 0x2044a 704c: 0c 94 6a c2 jmp 0x184d4 ; 0x184d4 7050: 0d 94 12 25 jmp 0x24a24 ; 0x24a24 7054: 0d 94 bf 02 jmp 0x2057e ; 0x2057e 7058: 0d 94 41 24 jmp 0x24882 ; 0x24882 705c: 0c 94 cd ca jmp 0x1959a ; 0x1959a 7060: 0c 94 ba cd jmp 0x19b74 ; 0x19b74 7064: 0c 94 bb d8 jmp 0x1b176 ; 0x1b176 7068: 0c 94 82 ce jmp 0x19d04 ; 0x19d04 706c: 0c 94 db f7 jmp 0x1efb6 ; 0x1efb6 7070: 0c 94 8d dc jmp 0x1b91a ; 0x1b91a 7074: 0d 94 4b 05 jmp 0x20a96 ; 0x20a96 7078: 0c 94 15 bd jmp 0x17a2a ; 0x17a2a 707c: 0c 94 ed f7 jmp 0x1efda ; 0x1efda 7080: 0c 94 5e bd jmp 0x17abc ; 0x17abc 7084: 0c 94 6f fc jmp 0x1f8de ; 0x1f8de 7088: 0c 94 81 ea jmp 0x1d502 ; 0x1d502 708c: 0d 94 e4 24 jmp 0x249c8 ; 0x249c8 7090: 0c 94 ec fc jmp 0x1f9d8 ; 0x1f9d8 7094: 0c 94 45 cd jmp 0x19a8a ; 0x19a8a 7098: 0c 94 2d e4 jmp 0x1c85a ; 0x1c85a 709c: 0c 94 2a f5 jmp 0x1ea54 ; 0x1ea54 70a0: 0c 94 2e bb jmp 0x1765c ; 0x1765c 70a4: 0c 94 96 d1 jmp 0x1a32c ; 0x1a32c 70a8: 0d 94 90 04 jmp 0x20920 ; 0x20920 70ac: 0c 94 af d1 jmp 0x1a35e ; 0x1a35e 70b0: 0c 94 e3 c6 jmp 0x18dc6 ; 0x18dc6 70b4: 0c 94 5f c1 jmp 0x182be ; 0x182be ()> 70b8: 0d 94 e1 24 jmp 0x249c2 ; 0x249c2 70bc: 0c 94 97 d8 jmp 0x1b12e ; 0x1b12e 70c0: 0c 94 01 bb jmp 0x17602 ; 0x17602 70c4: 0c 94 a5 77 jmp 0xef4a ; 0xef4a <__vector_23+0xe2> 70c8: 0d 94 88 01 jmp 0x20310 ; 0x20310 70cc: 0c 94 22 d9 jmp 0x1b244 ; 0x1b244 70d0: 0c 94 4d be jmp 0x17c9a ; 0x17c9a 70d4: 0c 94 2e d9 jmp 0x1b25c ; 0x1b25c 70d8: 0c 94 44 bf jmp 0x17e88 ; 0x17e88 70dc: 0d 94 60 9d jmp 0x33ac0 ; 0x33ac0 70e0: 0c 94 b7 bc jmp 0x1796e ; 0x1796e 70e4: 0d 94 42 25 jmp 0x24a84 ; 0x24a84 70e8: 0c 94 53 77 jmp 0xeea6 ; 0xeea6 <__vector_23+0x3e> 70ec: 0c 94 2a bb jmp 0x17654 ; 0x17654 70f0: 0c 94 4b c0 jmp 0x18096 ; 0x18096 70f4: 0c 94 4f cd jmp 0x19a9e ; 0x19a9e 70f8: 0c 94 3f e7 jmp 0x1ce7e ; 0x1ce7e 70fc: 0c 94 b4 cd jmp 0x19b68 ; 0x19b68 7100: 0c 94 f5 c3 jmp 0x187ea ; 0x187ea 7104: 0c 94 b1 cd jmp 0x19b62 ; 0x19b62 7108: 0d 94 d7 9d jmp 0x33bae ; 0x33bae 710c: 0c 94 a1 dc jmp 0x1b942 ; 0x1b942 7110: 0c 94 56 c9 jmp 0x192ac ; 0x192ac 7114: 0c 94 55 e7 jmp 0x1ceaa ; 0x1ceaa 7118: 0c 94 68 bd jmp 0x17ad0 ; 0x17ad0 711c: 0c 94 78 c1 jmp 0x182f0 ; 0x182f0 ()> 7120: 0c 94 55 dd jmp 0x1baaa ; 0x1baaa 7124: 0c 94 6e ce jmp 0x19cdc ; 0x19cdc 7128: 0c 94 84 fc jmp 0x1f908 ; 0x1f908 712c: 0c 94 29 cc jmp 0x19852 ; 0x19852 7130: 0c 94 05 bb jmp 0x1760a ; 0x1760a 7134: 0c 94 36 c9 jmp 0x1926c ; 0x1926c 7138: 0c 94 e1 f7 jmp 0x1efc2 ; 0x1efc2 713c: 0c 94 fa bc jmp 0x179f4 ; 0x179f4 7140: 0c 94 05 fc jmp 0x1f80a ; 0x1f80a 7144: 0d 94 cb 97 jmp 0x32f96 ; 0x32f96 7148: 0c 94 32 c2 jmp 0x18464 ; 0x18464 714c: 0c 94 0d e9 jmp 0x1d21a ; 0x1d21a 7150: 0c 94 6e c1 jmp 0x182dc ; 0x182dc ()> 7154: 0c 94 10 7b jmp 0xf620 ; 0xf620 7158: 0c 94 3f ce jmp 0x19c7e ; 0x19c7e 715c: 0c 94 34 bd jmp 0x17a68 ; 0x17a68 7160: 0c 94 0a d2 jmp 0x1a414 ; 0x1a414 7164: 0c 94 a3 d8 jmp 0x1b146 ; 0x1b146 7168: 0c 94 0f ca jmp 0x1941e ; 0x1941e 716c: 0c 94 11 ea jmp 0x1d422 ; 0x1d422 7170: 0c 94 54 bd jmp 0x17aa8 ; 0x17aa8 7174: 0d 94 d2 9d jmp 0x33ba4 ; 0x33ba4 7178: 0c 94 13 d9 jmp 0x1b226 ; 0x1b226 717c: 0d 94 c1 0d jmp 0x21b82 ; 0x21b82 7180: 0c 94 20 bb jmp 0x17640 ; 0x17640 7184: 0c 94 7b c4 jmp 0x188f6 ; 0x188f6 7188: 0c 94 f9 ba jmp 0x175f2 ; 0x175f2 718c: 0d 94 32 25 jmp 0x24a64 ; 0x24a64 7190: 0c 94 38 bb jmp 0x17670 ; 0x17670 7194: 0c 94 da 77 jmp 0xefb4 ; 0xefb4 <__vector_23+0x14c> 7198: 0c 94 c8 77 jmp 0xef90 ; 0xef90 <__vector_23+0x128> 719c: 0d 94 34 0d jmp 0x21a68 ; 0x21a68 71a0: 0c 94 a5 d1 jmp 0x1a34a ; 0x1a34a 71a4: 0c 94 b2 ea jmp 0x1d564 ; 0x1d564 71a8: 0c 94 a6 bc jmp 0x1794c ; 0x1794c 71ac: 0c 94 37 be jmp 0x17c6e ; 0x17c6e 71b0: 0c 94 3c bb jmp 0x17678 ; 0x17678 71b4: 0d 94 b3 24 jmp 0x24966 ; 0x24966 71b8: 0c 94 73 dc jmp 0x1b8e6 ; 0x1b8e6 71bc: 0c 94 1e d2 jmp 0x1a43c ; 0x1a43c 71c0: 0c 94 5a f9 jmp 0x1f2b4 ; 0x1f2b4 71c4: 0d 94 44 24 jmp 0x24888 ; 0x24888 71c8: 0c 94 a7 bd jmp 0x17b4e ; 0x17b4e 71cc: 0c 94 d3 73 jmp 0xe7a6 ; 0xe7a6 <_menu_edit_P()> 71d0: 0d 94 81 24 jmp 0x24902 ; 0x24902 71d4: 0c 94 4f ce jmp 0x19c9e ; 0x19c9e 71d8: 0c 94 54 c6 jmp 0x18ca8 ; 0x18ca8 71dc: 0c 94 3d ea jmp 0x1d47a ; 0x1d47a 71e0: 0c 94 d1 ce jmp 0x19da2 ; 0x19da2 71e4: 0d 94 e7 24 jmp 0x249ce ; 0x249ce 71e8: 0c 94 e9 f7 jmp 0x1efd2 ; 0x1efd2 71ec: 0c 94 ef d4 jmp 0x1a9de ; 0x1a9de 71f0: 0d 94 0a 25 jmp 0x24a14 ; 0x24a14 71f4: 0d 94 b3 02 jmp 0x20566 ; 0x20566 71f8: 0d 94 c9 9d jmp 0x33b92 ; 0x33b92 71fc: 0c 94 20 64 jmp 0xc840 ; 0xc840 <_GLOBAL__sub_D_card> 7200: 0d 94 65 97 jmp 0x32eca ; 0x32eca 7204: 0d 94 e4 04 jmp 0x209c8 ; 0x209c8 7208: 0d 94 dc 02 jmp 0x205b8 ; 0x205b8 720c: 0c 94 6d 77 jmp 0xeeda ; 0xeeda <__vector_23+0x72> 7210: 0c 94 fd ba jmp 0x175fa ; 0x175fa 7214: 0c 94 bc 73 jmp 0xe778 ; 0xe778 7218: 0c 94 03 f8 jmp 0x1f006 ; 0x1f006 721c: 0c 94 94 bd jmp 0x17b28 ; 0x17b28 7220: 0c 94 54 be jmp 0x17ca8 ; 0x17ca8 7224: 0c 94 9b ea jmp 0x1d536 ; 0x1d536 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 33 61 2d 45 33 44 76 36 66 75 6c 6c 00 o13a-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.415>: 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.491>: 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.494>: 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 33 61 00 RAMBo13a. 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.383>: 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.447>: 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.446>: 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.513>: 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.362>: a2d8: 4d 4d 55 32 3a 00 MMU2:. 0000a2de <_ZL9mmu2Magic.lto_priv.363>: 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: d2 37 cpi r29, 0x72 ; 114 0000a2fc <__ctors_end>: a2fc: 20 64 ori r18, 0x40 ; 64 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: ea e9 ldi r30, 0x9A ; 154 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 91 a5 call 0x34b22 ; 0x34b22 <__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 02 eb call 0x1d604 ; 0x1d604
a35c: 0d 94 3b ab jmp 0x35676 ; 0x35676 <__do_global_dtors> 0000a360 <__bad_interrupt>: a360: 0c 94 57 85 jmp 0x10aae ; 0x10aae <__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 3a a1 call 0x34274 ; 0x34274 <__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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 7d a2 call 0x344fa ; 0x344fa 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 a2 a2 call 0x34544 ; 0x34544 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 10 a4 call 0x34820 ; 0x34820 <__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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 10 a4 call 0x34820 ; 0x34820 <__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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 e9 a2 call 0x345d2 ; 0x345d2 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 9e a6 call 0x34d3c ; 0x34d3c <__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 b7 a4 call 0x3496e ; 0x3496e 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 b7 a4 call 0x3496e ; 0x3496e 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 b7 a4 call 0x3496e ; 0x3496e 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 b7 a4 call 0x3496e ; 0x3496e 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 b7 a4 call 0x3496e ; 0x3496e 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 b7 a4 call 0x3496e ; 0x3496e 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 b7 a4 call 0x3496e ; 0x3496e 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 b7 a4 call 0x3496e ; 0x3496e 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 b7 a4 call 0x3496e ; 0x3496e 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 b7 a4 jmp 0x3496e ; 0x3496e 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.511> abf0: 30 91 4a 10 lds r19, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+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 b3 aa call 0x35566 ; 0x35566 // 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.511+0x1> ac64: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.511> (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 43 a3 call 0x34686 ; 0x34686 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 81 a4 call 0x34902 ; 0x34902 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 d8 aa call 0x355b0 ; 0x355b0 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 0c a0 call 0x34018 ; 0x34018 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 0c a0 call 0x34018 ; 0x34018 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 43 a3 call 0x34686 ; 0x34686 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 81 a4 jmp 0x34902 ; 0x34902 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 0c a0 jmp 0x34018 ; 0x34018 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 a5 a4 call 0x3494a ; 0x3494a adf0: 60 e0 ldi r22, 0x00 ; 0 adf2: 88 e6 ldi r24, 0x68 ; 104 adf4: 9f e0 ldi r25, 0x0F ; 15 adf6: 0f 94 a5 a4 call 0x3494a ; 0x3494a adfa: 60 e0 ldi r22, 0x00 ; 0 adfc: 85 e6 ldi r24, 0x65 ; 101 adfe: 9f e0 ldi r25, 0x0F ; 15 ae00: 0f 94 a5 a4 call 0x3494a ; 0x3494a ae04: 60 e0 ldi r22, 0x00 ; 0 ae06: 84 e6 ldi r24, 0x64 ; 100 ae08: 9f e0 ldi r25, 0x0F ; 15 ae0a: 0f 94 a5 a4 call 0x3494a ; 0x3494a ae0e: 60 e0 ldi r22, 0x00 ; 0 ae10: 82 ed ldi r24, 0xD2 ; 210 ae12: 9e e0 ldi r25, 0x0E ; 14 ae14: 0f 94 a5 a4 call 0x3494a ; 0x3494a ae18: 60 e0 ldi r22, 0x00 ; 0 ae1a: 8f ec ldi r24, 0xCF ; 207 ae1c: 9e e0 ldi r25, 0x0E ; 14 ae1e: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 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 0f 9f call 0x33e1e ; 0x33e1e <__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 0f 9f call 0x33e1e ; 0x33e1e <__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 32 a8 call 0x35064 ; 0x35064 <__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 a8 a5 call 0x34b50 ; 0x34b50 <__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 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> afd0: a5 01 movw r20, r10 afd2: 94 01 movw r18, r8 afd4: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__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 a9 a5 call 0x34b52 ; 0x34b52 <__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 a8 a5 call 0x34b50 ; 0x34b50 <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 a8 a5 call 0x34b50 ; 0x34b50 <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 a9 a5 call 0x34b52 ; 0x34b52 <__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 a8 a5 call 0x34b50 ; 0x34b50 <__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 a8 a6 call 0x34d50 ; 0x34d50 <__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 9e a6 call 0x34d3c ; 0x34d3c <__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 32 a8 call 0x35064 ; 0x35064 <__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 9e a6 call 0x34d3c ; 0x34d3c <__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 a8 a5 call 0x34b50 ; 0x34b50 <__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 19 a9 call 0x35232 ; 0x35232 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 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> b3c0: a3 01 movw r20, r6 b3c2: 92 01 movw r18, r4 b3c4: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__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 a9 a5 call 0x34b52 ; 0x34b52 <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 a9 a5 call 0x34b52 ; 0x34b52 <__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 a8 a6 call 0x34d50 ; 0x34d50 <__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 a8 a5 call 0x34b50 ; 0x34b50 <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 a8 a5 call 0x34b50 ; 0x34b50 <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 a8 a6 call 0x34d50 ; 0x34d50 <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 a9 a5 call 0x34b52 ; 0x34b52 <__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 a9 a5 call 0x34b52 ; 0x34b52 <__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 a9 a5 call 0x34b52 ; 0x34b52 <__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 8f a4 call 0x3491e ; 0x3491e 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 2a 9e jmp 0x33c54 ; 0x33c54 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 6d 9e jmp 0x33cda ; 0x33cda 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 81 a4 call 0x34902 ; 0x34902 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 47 7a call 0x2f48e ; 0x2f48e 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 ea 9e jmp 0x33dd4 ; 0x33dd4 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 12 a2 call 0x34424 ; 0x34424 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 48 a2 call 0x34490 ; 0x34490 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 48 a2 call 0x34490 ; 0x34490 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 16 a5 call 0x34a2c ; 0x34a2c <__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 0d 9f call 0x33e1a ; 0x33e1a <__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 9e a6 call 0x34d3c ; 0x34d3c <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 9e a6 call 0x34d3c ; 0x34d3c <__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 9e a6 call 0x34d3c ; 0x34d3c <__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 a8 a5 call 0x34b50 ; 0x34b50 <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 a9 a5 call 0x34b52 ; 0x34b52 <__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 9e a6 call 0x34d3c ; 0x34d3c <__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 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> ba12: 8d 2d mov r24, r13 ba14: 0f 94 f7 17 call 0x22fee ; 0x22fee //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 32 a8 call 0x35064 ; 0x35064 <__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 32 a8 call 0x35064 ; 0x35064 <__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 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> baca: 8d 2d mov r24, r13 bacc: 0f 94 f7 17 call 0x22fee ; 0x22fee 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 a8 a5 call 0x34b50 ; 0x34b50 <__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 a8 a6 call 0x34d50 ; 0x34d50 <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 4e 9f call 0x33e9c ; 0x33e9c <__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 a8 a5 call 0x34b50 ; 0x34b50 <__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 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> st_current_set(i, tmp_motor[i]); bb62: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> bb66: 8b 8d ldd r24, Y+27 ; 0x1b bb68: 0f 94 f7 17 call 0x22fee ; 0x22fee 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 e9 a2 jmp 0x345d2 ; 0x345d2 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: 84 ff sbrs r24, 4 bbc2: 18 c0 rjmp .+48 ; 0xbbf4 bbc4: 5a 9a sbi 0x0b, 2 ; 11 WRITE(LCD_PINS_D5, value & 0x20); bbc6: 85 ff sbrs r24, 5 bbc8: 17 c0 rjmp .+46 ; 0xbbf8 bbca: a4 9a sbi 0x14, 4 ; 20 WRITE(LCD_PINS_D6, value & 0x40); bbcc: 2f b7 in r18, 0x3f ; 63 bbce: 86 ff sbrs r24, 6 bbd0: 15 c0 rjmp .+42 ; 0xbbfc bbd2: f8 94 cli bbd4: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> bbd8: 90 68 ori r25, 0x80 ; 128 bbda: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> bbde: 2f bf out 0x3f, r18 ; 63 WRITE(LCD_PINS_D7, value & 0x80); bbe0: 87 ff sbrs r24, 7 bbe2: 11 c0 rjmp .+34 ; 0xbc06 bbe4: a3 9a sbi 0x14, 3 ; 20 static void lcd_print_custom(uint8_t c); static void lcd_invalidate_custom_characters(); static void lcd_pulseEnable(void) { WRITE(LCD_PINS_ENABLE,HIGH); bbe6: 5b 9a sbi 0x0b, 3 ; 11 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); bbe8: 85 e0 ldi r24, 0x05 ; 5 bbea: 8a 95 dec r24 bbec: f1 f7 brne .-4 ; 0xbbea bbee: 00 00 nop _delay_us(1); // enable pulse must be >450ns WRITE(LCD_PINS_ENABLE,LOW); bbf0: 5b 98 cbi 0x0b, 3 ; 11 WRITE(LCD_PINS_D5, value & 0x20); WRITE(LCD_PINS_D6, value & 0x40); WRITE(LCD_PINS_D7, value & 0x80); lcd_pulseEnable(); } bbf2: 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); bbf4: 5a 98 cbi 0x0b, 2 ; 11 bbf6: e7 cf rjmp .-50 ; 0xbbc6 WRITE(LCD_PINS_D5, value & 0x20); bbf8: a4 98 cbi 0x14, 4 ; 20 bbfa: e8 cf rjmp .-48 ; 0xbbcc WRITE(LCD_PINS_D6, value & 0x40); bbfc: f8 94 cli bbfe: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> bc02: 9f 77 andi r25, 0x7F ; 127 bc04: ea cf rjmp .-44 ; 0xbbda WRITE(LCD_PINS_D7, value & 0x80); bc06: a3 98 cbi 0x14, 3 ; 20 bc08: ee cf rjmp .-36 ; 0xbbe6 0000bc0a : lcd_pulseEnable(); } static void lcd_send(uint8_t data, uint8_t flags, uint16_t duration = LCD_DEFAULT_DELAY) { bc0a: 0f 93 push r16 bc0c: 1f 93 push r17 bc0e: cf 93 push r28 bc10: df 93 push r29 bc12: c8 2f mov r28, r24 bc14: d6 2f mov r29, r22 bc16: 8a 01 movw r16, r20 WRITE(LCD_PINS_RS,flags&LCD_RS_FLAG); bc18: 60 ff sbrs r22, 0 bc1a: 15 c0 rjmp .+42 ; 0xbc46 bc1c: 5d 9a sbi 0x0b, 5 ; 11 bc1e: 8a e1 ldi r24, 0x1A ; 26 bc20: 8a 95 dec r24 bc22: f1 f7 brne .-4 ; 0xbc20 bc24: 00 c0 rjmp .+0 ; 0xbc26 _delay_us(5); lcd_writebits(data); bc26: 8c 2f mov r24, r28 bc28: 0e 94 e0 5d call 0xbbc0 ; 0xbbc0 #ifndef LCD_8BIT if (!(flags & LCD_HALF_FLAG)) { bc2c: d1 fd sbrc r29, 1 bc2e: 04 c0 rjmp .+8 ; 0xbc38 // _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 bc30: 8c 2f mov r24, r28 bc32: 82 95 swap r24 bc34: 0e 94 e0 5d call 0xbbc0 ; 0xbbc0 } #endif delayMicroseconds(duration); bc38: c8 01 movw r24, r16 } bc3a: df 91 pop r29 bc3c: cf 91 pop r28 bc3e: 1f 91 pop r17 bc40: 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); bc42: 0c 94 c3 d0 jmp 0x1a186 ; 0x1a186 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); bc46: 5d 98 cbi 0x0b, 5 ; 11 bc48: ea cf rjmp .-44 ; 0xbc1e 0000bc4a : return def; } return val; } void __attribute__((noinline)) eeprom_init_default_float(float *__p, float def) { bc4a: cf 92 push r12 bc4c: df 92 push r13 bc4e: ef 92 push r14 bc50: ff 92 push r15 bc52: cf 93 push r28 bc54: df 93 push r29 bc56: ec 01 movw r28, r24 bc58: 6a 01 movw r12, r20 bc5a: 7b 01 movw r14, r22 if (eeprom_read_dword((uint32_t*)__p) == EEPROM_EMPTY_VALUE32) bc5c: 0f 94 89 a4 call 0x34912 ; 0x34912 bc60: 6f 3f cpi r22, 0xFF ; 255 bc62: 7f 4f sbci r23, 0xFF ; 255 bc64: 8f 4f sbci r24, 0xFF ; 255 bc66: 9f 4f sbci r25, 0xFF ; 255 bc68: 59 f4 brne .+22 ; 0xbc80 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); bc6a: b7 01 movw r22, r14 bc6c: a6 01 movw r20, r12 bc6e: 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); } bc70: df 91 pop r29 bc72: cf 91 pop r28 bc74: ff 90 pop r15 bc76: ef 90 pop r14 bc78: df 90 pop r13 bc7a: 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); bc7c: 0d 94 d7 a4 jmp 0x349ae ; 0x349ae } 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); } bc80: df 91 pop r29 bc82: cf 91 pop r28 bc84: ff 90 pop r15 bc86: ef 90 pop r14 bc88: df 90 pop r13 bc8a: cf 90 pop r12 bc8c: 08 95 ret 0000bc8e : } } void dcode_core(daddr_t addr_start, const daddr_t addr_end, const dcode_mem_t type, uint8_t dcode, const char* type_desc) { bc8e: 7f 92 push r7 bc90: 8f 92 push r8 bc92: 9f 92 push r9 bc94: af 92 push r10 bc96: bf 92 push r11 bc98: cf 92 push r12 bc9a: df 92 push r13 bc9c: ef 92 push r14 bc9e: ff 92 push r15 bca0: 0f 93 push r16 bca2: 1f 93 push r17 bca4: cf 93 push r28 bca6: df 93 push r29 bca8: cd b7 in r28, 0x3d ; 61 bcaa: de b7 in r29, 0x3e ; 62 bcac: 60 97 sbiw r28, 0x10 ; 16 bcae: 0f b6 in r0, 0x3f ; 63 bcb0: f8 94 cli bcb2: de bf out 0x3e, r29 ; 62 bcb4: 0f be out 0x3f, r0 ; 63 bcb6: cd bf out 0x3d, r28 ; 61 bcb8: 5c 01 movw r10, r24 bcba: 6b 01 movw r12, r22 bcbc: 74 2e mov r7, r20 KEEPALIVE_STATE(NOT_BUSY); bcbe: 81 e0 ldi r24, 0x01 ; 1 bcc0: 80 93 78 02 sts 0x0278, r24 ; 0x800278 DBG(_N("D%d - Read/Write %S\n"), dcode, type_desc); bcc4: 1f 93 push r17 bcc6: 0f 93 push r16 bcc8: 1f 92 push r1 bcca: 2f 93 push r18 bccc: 8f e4 ldi r24, 0x4F ; 79 bcce: 94 e6 ldi r25, 0x64 ; 100 bcd0: 9f 93 push r25 bcd2: 8f 93 push r24 bcd4: 0f 94 43 a3 call 0x34686 ; 0x34686 daddr_t count = -1; // RW the entire space by default if (code_seen('A')) bcd8: 81 e4 ldi r24, 0x41 ; 65 bcda: 0e 94 80 56 call 0xad00 ; 0xad00 bcde: 0f 90 pop r0 bce0: 0f 90 pop r0 bce2: 0f 90 pop r0 bce4: 0f 90 pop r0 bce6: 0f 90 pop r0 bce8: 0f 90 pop r0 bcea: 88 23 and r24, r24 bcec: 89 f0 breq .+34 ; 0xbd10 addr_start = (strchr_pointer[1] == 'x')?strtol(strchr_pointer + 2, 0, 16):(int)code_value(); bcee: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb bcf2: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc bcf6: fc 01 movw r30, r24 bcf8: 21 81 ldd r18, Z+1 ; 0x01 bcfa: 28 37 cpi r18, 0x78 ; 120 bcfc: 09 f0 breq .+2 ; 0xbd00 bcfe: 56 c0 rjmp .+172 ; 0xbdac bd00: 40 e1 ldi r20, 0x10 ; 16 bd02: 50 e0 ldi r21, 0x00 ; 0 bd04: 70 e0 ldi r23, 0x00 ; 0 bd06: 60 e0 ldi r22, 0x00 ; 0 bd08: 02 96 adiw r24, 0x02 ; 2 bd0a: 0f 94 0c a0 call 0x34018 ; 0x34018 bd0e: 5b 01 movw r10, r22 if (code_seen('C')) bd10: 83 e4 ldi r24, 0x43 ; 67 bd12: 0e 94 80 56 call 0xad00 ; 0xad00 bd16: 88 23 and r24, r24 bd18: 09 f4 brne .+2 ; 0xbd1c bd1a: 4d c0 rjmp .+154 ; 0xbdb6 count = code_value_long(); bd1c: 0e 94 e8 56 call 0xadd0 ; 0xadd0 bd20: 4b 01 movw r8, r22 bd22: 75 01 movw r14, r10 bd24: ca 14 cp r12, r10 bd26: db 04 cpc r13, r11 bd28: 08 f4 brcc .+2 ; 0xbd2c bd2a: 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) bd2c: c4 01 movw r24, r8 bd2e: 8e 0d add r24, r14 bd30: 9f 1d adc r25, r15 bd32: c8 16 cp r12, r24 bd34: d9 06 cpc r13, r25 bd36: 18 f0 brcs .+6 ; 0xbd3e bd38: 8e 15 cp r24, r14 bd3a: 9f 05 cpc r25, r15 bd3c: 18 f4 brcc .+6 ; 0xbd44 count = addr_end - addr_start; bd3e: 46 01 movw r8, r12 bd40: 8e 18 sub r8, r14 bd42: 9f 08 sbc r9, r15 if (code_seen('X')) bd44: 88 e5 ldi r24, 0x58 ; 88 bd46: 0e 94 80 56 call 0xad00 ; 0xad00 bd4a: 88 23 and r24, r24 bd4c: 09 f4 brne .+2 ; 0xbd50 bd4e: 71 c0 rjmp .+226 ; 0xbe32 { uint8_t data[16]; count = parse_hex(strchr_pointer + 1, data, 16); bd50: 20 91 bb 04 lds r18, 0x04BB ; 0x8004bb bd54: 30 91 bc 04 lds r19, 0x04BC ; 0x8004bc bd58: 2f 5f subi r18, 0xFF ; 255 bd5a: 3f 4f sbci r19, 0xFF ; 255 bd5c: ce 01 movw r24, r28 bd5e: 01 96 adiw r24, 0x01 ; 1 bd60: 5c 01 movw r10, r24 bd62: dc 01 movw r26, r24 print_hex_byte(val & 0xFF); } int parse_hex(const char* hex, uint8_t* data, int count) { int parsed = 0; bd64: d1 2c mov r13, r1 bd66: c1 2c mov r12, r1 bd68: f9 01 movw r30, r18 while (*hex) bd6a: 80 81 ld r24, Z bd6c: 2f 5f subi r18, 0xFF ; 255 bd6e: 3f 4f sbci r19, 0xFF ; 255 bd70: 88 23 and r24, r24 bd72: b9 f1 breq .+110 ; 0xbde2 { if (count && (parsed >= count)) break; bd74: 90 e1 ldi r25, 0x10 ; 16 bd76: c9 16 cp r12, r25 bd78: d1 04 cpc r13, r1 bd7a: 99 f1 breq .+102 ; 0xbde2 char c = *(hex++); if (c == ' ') continue; bd7c: 80 32 cpi r24, 0x20 ; 32 bd7e: a1 f3 breq .-24 ; 0xbd68 if (c == '\n') break; bd80: 8a 30 cpi r24, 0x0A ; 10 bd82: 79 f1 breq .+94 ; 0xbde2 uint8_t val = 0x00; if ((c >= '0') && (c <= '9')) val |= ((c - '0') << 4); bd84: 90 ed ldi r25, 0xD0 ; 208 bd86: 98 0f add r25, r24 bd88: 9a 30 cpi r25, 0x0A ; 10 bd8a: c8 f4 brcc .+50 ; 0xbdbe bd8c: 82 95 swap r24 bd8e: 80 7f andi r24, 0xF0 ; 240 else if ((c >= 'a') && (c <= 'f')) val |= ((c - 'a' + 10) << 4); else return -parsed; c = *(hex++); bd90: 9f 01 movw r18, r30 bd92: 2e 5f subi r18, 0xFE ; 254 bd94: 3f 4f sbci r19, 0xFF ; 255 if ((c >= '0') && (c <= '9')) val |= (c - '0'); bd96: 91 81 ldd r25, Z+1 ; 0x01 bd98: 40 ed ldi r20, 0xD0 ; 208 bd9a: 49 0f add r20, r25 bd9c: 4a 30 cpi r20, 0x0A ; 10 bd9e: b8 f4 brcc .+46 ; 0xbdce bda0: 84 2b or r24, r20 else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); else return -parsed; data[parsed] = val; bda2: 8d 93 st X+, r24 parsed++; bda4: ef ef ldi r30, 0xFF ; 255 bda6: ce 1a sub r12, r30 bda8: de 0a sbc r13, r30 bdaa: de cf rjmp .-68 ; 0xbd68 { 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(); bdac: 0e 94 10 5b call 0xb620 ; 0xb620 bdb0: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> bdb4: ac cf rjmp .-168 ; 0xbd0e 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 bdb6: 88 24 eor r8, r8 bdb8: 8a 94 dec r8 bdba: 98 2c mov r9, r8 bdbc: b2 cf rjmp .-156 ; 0xbd22 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); bdbe: 9f e9 ldi r25, 0x9F ; 159 bdc0: 98 0f add r25, r24 bdc2: 96 30 cpi r25, 0x06 ; 6 bdc4: 58 f4 brcc .+22 ; 0xbddc bdc6: 82 95 swap r24 bdc8: 80 7f andi r24, 0xF0 ; 240 bdca: 80 57 subi r24, 0x70 ; 112 bdcc: e1 cf rjmp .-62 ; 0xbd90 else return -parsed; c = *(hex++); if ((c >= '0') && (c <= '9')) val |= (c - '0'); else if ((c >= 'a') && (c <= 'f')) val |= (c - 'a' + 10); bdce: 4f e9 ldi r20, 0x9F ; 159 bdd0: 49 0f add r20, r25 bdd2: 46 30 cpi r20, 0x06 ; 6 bdd4: 18 f4 brcc .+6 ; 0xbddc bdd6: 97 55 subi r25, 0x57 ; 87 bdd8: 89 2b or r24, r25 bdda: e3 cf rjmp .-58 ; 0xbda2 else return -parsed; bddc: d1 94 neg r13 bdde: c1 94 neg r12 bde0: 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++) bde2: 91 2c mov r9, r1 bde4: 81 2c mov r8, r1 bde6: c8 14 cp r12, r8 bde8: d9 04 cpc r13, r9 bdea: 91 f0 breq .+36 ; 0xbe10 bdec: f5 01 movw r30, r10 bdee: 61 91 ld r22, Z+ bdf0: 5f 01 movw r10, r30 bdf2: c4 01 movw r24, r8 bdf4: 8e 0d add r24, r14 bdf6: 9f 1d adc r25, r15 { switch (type) bdf8: f1 e0 ldi r31, 0x01 ; 1 bdfa: 7f 16 cp r7, r31 bdfc: 31 f0 breq .+12 ; 0xbe0a { case dcode_mem_t::sram: *((uint8_t*)address) = data[i]; break; bdfe: fc 01 movw r30, r24 be00: 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++) be02: ff ef ldi r31, 0xFF ; 255 be04: 8f 1a sub r8, r31 be06: 9f 0a sbc r9, r31 be08: ee cf rjmp .-36 ; 0xbde6 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); be0a: 0f 94 c9 a4 call 0x34992 ; 0x34992 be0e: f9 cf rjmp .-14 ; 0xbe02 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); be10: ff 92 push r15 be12: ef 92 push r14 be14: 1f 93 push r17 be16: 0f 93 push r16 be18: 9f 92 push r9 be1a: 8f 92 push r8 be1c: 85 e2 ldi r24, 0x25 ; 37 be1e: 94 e6 ldi r25, 0x64 ; 100 be20: 9f 93 push r25 be22: 8f 93 push r24 be24: 0f 94 43 a3 call 0x34686 ; 0x34686 be28: 0f b6 in r0, 0x3f ; 63 be2a: f8 94 cli be2c: de bf out 0x3e, r29 ; 62 be2e: 0f be out 0x3f, r0 ; 63 be30: cd bf out 0x3d, r28 ; 61 #endif } print_mem(addr_start, count, type); be32: 47 2d mov r20, r7 be34: b4 01 movw r22, r8 be36: c7 01 movw r24, r14 } be38: 60 96 adiw r28, 0x10 ; 16 be3a: 0f b6 in r0, 0x3f ; 63 be3c: f8 94 cli be3e: de bf out 0x3e, r29 ; 62 be40: 0f be out 0x3f, r0 ; 63 be42: cd bf out 0x3d, r28 ; 61 be44: df 91 pop r29 be46: cf 91 pop r28 be48: 1f 91 pop r17 be4a: 0f 91 pop r16 be4c: ff 90 pop r15 be4e: ef 90 pop r14 be50: df 90 pop r13 be52: cf 90 pop r12 be54: bf 90 pop r11 be56: af 90 pop r10 be58: 9f 90 pop r9 be5a: 8f 90 pop r8 be5c: 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); be5e: 0d 94 70 78 jmp 0x2f0e0 ; 0x2f0e0 0000be62 : #define MESH_BED_CALIBRATION_SHOW_LCD float __attribute__((noinline)) BED_X(const uint8_t col) { return ((float)col * x_mesh_density + BED_X0); be62: 68 2f mov r22, r24 be64: 70 e0 ldi r23, 0x00 ; 0 be66: 90 e0 ldi r25, 0x00 ; 0 be68: 80 e0 ldi r24, 0x00 ; 0 be6a: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> be6e: 20 e0 ldi r18, 0x00 ; 0 be70: 30 e0 ldi r19, 0x00 ; 0 be72: 48 e0 ldi r20, 0x08 ; 8 be74: 52 e4 ldi r21, 0x42 ; 66 be76: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> be7a: 20 e0 ldi r18, 0x00 ; 0 be7c: 30 e0 ldi r19, 0x00 ; 0 be7e: 40 e8 ldi r20, 0x80 ; 128 be80: 5f e3 ldi r21, 0x3F ; 63 be82: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> } be86: 08 95 ret 0000be88 : plan_set_position_curposXYZE(); } static inline void update_current_position_z() { current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); be88: 82 e0 ldi r24, 0x02 ; 2 be8a: 0f 94 80 18 call 0x23100 ; 0x23100 be8e: 60 93 69 12 sts 0x1269, r22 ; 0x801269 be92: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a be96: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b be9a: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_set_z_position(current_position[Z_AXIS]); be9e: 89 e6 ldi r24, 0x69 ; 105 bea0: 92 e1 ldi r25, 0x12 ; 18 bea2: 0d 94 98 3a jmp 0x27530 ; 0x27530 0000bea6 : * 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() { bea6: 4f 92 push r4 bea8: 5f 92 push r5 beaa: 6f 92 push r6 beac: 7f 92 push r7 beae: 8f 92 push r8 beb0: 9f 92 push r9 beb2: af 92 push r10 beb4: bf 92 push r11 beb6: cf 92 push r12 beb8: df 92 push r13 beba: ef 92 push r14 bebc: ff 92 push r15 bebe: 0f 93 push r16 bec0: 1f 93 push r17 bec2: cf 93 push r28 bec4: df 93 push r29 float x = current_position[X_AXIS] - world2machine_shift[0]; bec6: 01 e6 ldi r16, 0x61 ; 97 bec8: 12 e1 ldi r17, 0x12 ; 18 beca: ca e9 ldi r28, 0x9A ; 154 becc: d4 e0 ldi r29, 0x04 ; 4 bece: 28 81 ld r18, Y bed0: 39 81 ldd r19, Y+1 ; 0x01 bed2: 4a 81 ldd r20, Y+2 ; 0x02 bed4: 5b 81 ldd r21, Y+3 ; 0x03 bed6: f8 01 movw r30, r16 bed8: 60 81 ld r22, Z beda: 71 81 ldd r23, Z+1 ; 0x01 bedc: 82 81 ldd r24, Z+2 ; 0x02 bede: 93 81 ldd r25, Z+3 ; 0x03 bee0: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> bee4: 4b 01 movw r8, r22 bee6: 5c 01 movw r10, r24 float y = current_position[Y_AXIS] - world2machine_shift[1]; bee8: 2c 81 ldd r18, Y+4 ; 0x04 beea: 3d 81 ldd r19, Y+5 ; 0x05 beec: 4e 81 ldd r20, Y+6 ; 0x06 beee: 5f 81 ldd r21, Y+7 ; 0x07 bef0: f8 01 movw r30, r16 bef2: 64 81 ldd r22, Z+4 ; 0x04 bef4: 75 81 ldd r23, Z+5 ; 0x05 bef6: 86 81 ldd r24, Z+6 ; 0x06 bef8: 97 81 ldd r25, Z+7 ; 0x07 befa: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> befe: 6b 01 movw r12, r22 bf00: 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; bf02: ca e8 ldi r28, 0x8A ; 138 bf04: d4 e0 ldi r29, 0x04 ; 4 bf06: 28 81 ld r18, Y bf08: 39 81 ldd r19, Y+1 ; 0x01 bf0a: 4a 81 ldd r20, Y+2 ; 0x02 bf0c: 5b 81 ldd r21, Y+3 ; 0x03 bf0e: c5 01 movw r24, r10 bf10: b4 01 movw r22, r8 bf12: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> bf16: 2b 01 movw r4, r22 bf18: 3c 01 movw r6, r24 bf1a: 2c 81 ldd r18, Y+4 ; 0x04 bf1c: 3d 81 ldd r19, Y+5 ; 0x05 bf1e: 4e 81 ldd r20, Y+6 ; 0x06 bf20: 5f 81 ldd r21, Y+7 ; 0x07 bf22: c7 01 movw r24, r14 bf24: b6 01 movw r22, r12 bf26: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> bf2a: 9b 01 movw r18, r22 bf2c: ac 01 movw r20, r24 bf2e: c3 01 movw r24, r6 bf30: b2 01 movw r22, r4 bf32: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> bf36: f8 01 movw r30, r16 bf38: 60 83 st Z, r22 bf3a: 71 83 std Z+1, r23 ; 0x01 bf3c: 82 83 std Z+2, r24 ; 0x02 bf3e: 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; bf40: 28 85 ldd r18, Y+8 ; 0x08 bf42: 39 85 ldd r19, Y+9 ; 0x09 bf44: 4a 85 ldd r20, Y+10 ; 0x0a bf46: 5b 85 ldd r21, Y+11 ; 0x0b bf48: c5 01 movw r24, r10 bf4a: b4 01 movw r22, r8 bf4c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> bf50: 4b 01 movw r8, r22 bf52: 5c 01 movw r10, r24 bf54: 2c 85 ldd r18, Y+12 ; 0x0c bf56: 3d 85 ldd r19, Y+13 ; 0x0d bf58: 4e 85 ldd r20, Y+14 ; 0x0e bf5a: 5f 85 ldd r21, Y+15 ; 0x0f bf5c: c7 01 movw r24, r14 bf5e: b6 01 movw r22, r12 bf60: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> bf64: 9b 01 movw r18, r22 bf66: ac 01 movw r20, r24 bf68: c5 01 movw r24, r10 bf6a: b4 01 movw r22, r8 bf6c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> bf70: f8 01 movw r30, r16 bf72: 64 83 std Z+4, r22 ; 0x04 bf74: 75 83 std Z+5, r23 ; 0x05 bf76: 86 83 std Z+6, r24 ; 0x06 bf78: 97 83 std Z+7, r25 ; 0x07 } bf7a: df 91 pop r29 bf7c: cf 91 pop r28 bf7e: 1f 91 pop r17 bf80: 0f 91 pop r16 bf82: ff 90 pop r15 bf84: ef 90 pop r14 bf86: df 90 pop r13 bf88: cf 90 pop r12 bf8a: bf 90 pop r11 bf8c: af 90 pop r10 bf8e: 9f 90 pop r9 bf90: 8f 90 pop r8 bf92: 7f 90 pop r7 bf94: 6f 90 pop r6 bf96: 5f 90 pop r5 bf98: 4f 90 pop r4 bf9a: 08 95 ret 0000bf9c : } return false; } static void world2machine_update(const float vec_x[2], const float vec_y[2], const float cntr[2]) { bf9c: 4f 92 push r4 bf9e: 5f 92 push r5 bfa0: 6f 92 push r6 bfa2: 7f 92 push r7 bfa4: 8f 92 push r8 bfa6: 9f 92 push r9 bfa8: af 92 push r10 bfaa: bf 92 push r11 bfac: cf 92 push r12 bfae: df 92 push r13 bfb0: ef 92 push r14 bfb2: ff 92 push r15 bfb4: 0f 93 push r16 bfb6: 1f 93 push r17 bfb8: cf 93 push r28 bfba: df 93 push r29 bfbc: 00 d0 rcall .+0 ; 0xbfbe bfbe: 00 d0 rcall .+0 ; 0xbfc0 bfc0: 1f 92 push r1 bfc2: 1f 92 push r1 bfc4: cd b7 in r28, 0x3d ; 61 bfc6: de b7 in r29, 0x3e ; 62 world2machine_rotation_and_skew[0][0] = vec_x[0]; bfc8: dc 01 movw r26, r24 bfca: cd 90 ld r12, X+ bfcc: dd 90 ld r13, X+ bfce: ed 90 ld r14, X+ bfd0: fc 90 ld r15, X bfd2: 13 97 sbiw r26, 0x03 ; 3 bfd4: c0 92 6f 03 sts 0x036F, r12 ; 0x80036f bfd8: d0 92 70 03 sts 0x0370, r13 ; 0x800370 bfdc: e0 92 71 03 sts 0x0371, r14 ; 0x800371 bfe0: f0 92 72 03 sts 0x0372, r15 ; 0x800372 world2machine_rotation_and_skew[1][0] = vec_x[1]; bfe4: 14 96 adiw r26, 0x04 ; 4 bfe6: 0d 91 ld r16, X+ bfe8: 1d 91 ld r17, X+ bfea: 2d 91 ld r18, X+ bfec: 3c 91 ld r19, X bfee: 17 97 sbiw r26, 0x07 ; 7 bff0: 09 83 std Y+1, r16 ; 0x01 bff2: 1a 83 std Y+2, r17 ; 0x02 bff4: 2b 83 std Y+3, r18 ; 0x03 bff6: 3c 83 std Y+4, r19 ; 0x04 bff8: 00 93 77 03 sts 0x0377, r16 ; 0x800377 bffc: 10 93 78 03 sts 0x0378, r17 ; 0x800378 c000: 20 93 79 03 sts 0x0379, r18 ; 0x800379 c004: 30 93 7a 03 sts 0x037A, r19 ; 0x80037a world2machine_rotation_and_skew[0][1] = vec_y[0]; c008: db 01 movw r26, r22 c00a: 0d 91 ld r16, X+ c00c: 1d 91 ld r17, X+ c00e: 2d 91 ld r18, X+ c010: 3c 91 ld r19, X c012: 13 97 sbiw r26, 0x03 ; 3 c014: 0d 83 std Y+5, r16 ; 0x05 c016: 1e 83 std Y+6, r17 ; 0x06 c018: 2f 83 std Y+7, r18 ; 0x07 c01a: 38 87 std Y+8, r19 ; 0x08 c01c: 00 93 73 03 sts 0x0373, r16 ; 0x800373 c020: 10 93 74 03 sts 0x0374, r17 ; 0x800374 c024: 20 93 75 03 sts 0x0375, r18 ; 0x800375 c028: 30 93 76 03 sts 0x0376, r19 ; 0x800376 world2machine_rotation_and_skew[1][1] = vec_y[1]; c02c: 14 96 adiw r26, 0x04 ; 4 c02e: 4d 90 ld r4, X+ c030: 5d 90 ld r5, X+ c032: 6d 90 ld r6, X+ c034: 7c 90 ld r7, X c036: 17 97 sbiw r26, 0x07 ; 7 c038: 40 92 7b 03 sts 0x037B, r4 ; 0x80037b c03c: 50 92 7c 03 sts 0x037C, r5 ; 0x80037c c040: 60 92 7d 03 sts 0x037D, r6 ; 0x80037d c044: 70 92 7e 03 sts 0x037E, r7 ; 0x80037e world2machine_shift[0] = cntr[0]; c048: fa 01 movw r30, r20 c04a: 60 81 ld r22, Z c04c: 71 81 ldd r23, Z+1 ; 0x01 c04e: 82 81 ldd r24, Z+2 ; 0x02 c050: 93 81 ldd r25, Z+3 ; 0x03 c052: 60 93 9a 04 sts 0x049A, r22 ; 0x80049a c056: 70 93 9b 04 sts 0x049B, r23 ; 0x80049b c05a: 80 93 9c 04 sts 0x049C, r24 ; 0x80049c c05e: 90 93 9d 04 sts 0x049D, r25 ; 0x80049d world2machine_shift[1] = cntr[1]; c062: 84 80 ldd r8, Z+4 ; 0x04 c064: 95 80 ldd r9, Z+5 ; 0x05 c066: a6 80 ldd r10, Z+6 ; 0x06 c068: b7 80 ldd r11, Z+7 ; 0x07 c06a: 80 92 9e 04 sts 0x049E, r8 ; 0x80049e c06e: 90 92 9f 04 sts 0x049F, r9 ; 0x80049f c072: a0 92 a0 04 sts 0x04A0, r10 ; 0x8004a0 c076: 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) c07a: 20 e0 ldi r18, 0x00 ; 0 c07c: 30 e0 ldi r19, 0x00 ; 0 c07e: a9 01 movw r20, r18 c080: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> c084: 81 11 cpse r24, r1 c086: aa c0 rjmp .+340 ; 0xc1dc c088: 20 e0 ldi r18, 0x00 ; 0 c08a: 30 e0 ldi r19, 0x00 ; 0 c08c: a9 01 movw r20, r18 c08e: c5 01 movw r24, r10 c090: b4 01 movw r22, r8 c092: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> c096: 81 11 cpse r24, r1 c098: a1 c0 rjmp .+322 ; 0xc1dc 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; c09a: 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 || c09e: 20 e0 ldi r18, 0x00 ; 0 c0a0: 30 e0 ldi r19, 0x00 ; 0 c0a2: 40 e8 ldi r20, 0x80 ; 128 c0a4: 5f e3 ldi r21, 0x3F ; 63 c0a6: c7 01 movw r24, r14 c0a8: b6 01 movw r22, r12 c0aa: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> c0ae: 81 11 cpse r24, r1 c0b0: 21 c0 rjmp .+66 ; 0xc0f4 c0b2: 20 e0 ldi r18, 0x00 ; 0 c0b4: 30 e0 ldi r19, 0x00 ; 0 c0b6: a9 01 movw r20, r18 c0b8: 6d 81 ldd r22, Y+5 ; 0x05 c0ba: 7e 81 ldd r23, Y+6 ; 0x06 c0bc: 8f 81 ldd r24, Y+7 ; 0x07 c0be: 98 85 ldd r25, Y+8 ; 0x08 c0c0: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> c0c4: 81 11 cpse r24, r1 c0c6: 16 c0 rjmp .+44 ; 0xc0f4 c0c8: 20 e0 ldi r18, 0x00 ; 0 c0ca: 30 e0 ldi r19, 0x00 ; 0 c0cc: a9 01 movw r20, r18 c0ce: 69 81 ldd r22, Y+1 ; 0x01 c0d0: 7a 81 ldd r23, Y+2 ; 0x02 c0d2: 8b 81 ldd r24, Y+3 ; 0x03 c0d4: 9c 81 ldd r25, Y+4 ; 0x04 c0d6: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> c0da: 81 11 cpse r24, r1 c0dc: 0b c0 rjmp .+22 ; 0xc0f4 world2machine_rotation_and_skew[1][0] != 0.f || world2machine_rotation_and_skew[1][1] != 1.f) { c0de: 20 e0 ldi r18, 0x00 ; 0 c0e0: 30 e0 ldi r19, 0x00 ; 0 c0e2: 40 e8 ldi r20, 0x80 ; 128 c0e4: 5f e3 ldi r21, 0x3F ; 63 c0e6: c3 01 movw r24, r6 c0e8: b2 01 movw r22, r4 c0ea: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> c0ee: 88 23 and r24, r24 c0f0: 09 f4 brne .+2 ; 0xc0f4 c0f2: 78 c0 rjmp .+240 ; 0xc1e4 // Rotation & skew correction. world2machine_correction_mode |= WORLD2MACHINE_CORRECTION_SKEW; c0f4: 80 91 a2 04 lds r24, 0x04A2 ; 0x8004a2 c0f8: 82 60 ori r24, 0x02 ; 2 c0fa: 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]; c0fe: a3 01 movw r20, r6 c100: 92 01 movw r18, r4 c102: c7 01 movw r24, r14 c104: b6 01 movw r22, r12 c106: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> c10a: 4b 01 movw r8, r22 c10c: 5c 01 movw r10, r24 c10e: 2d 81 ldd r18, Y+5 ; 0x05 c110: 3e 81 ldd r19, Y+6 ; 0x06 c112: 4f 81 ldd r20, Y+7 ; 0x07 c114: 58 85 ldd r21, Y+8 ; 0x08 c116: 69 81 ldd r22, Y+1 ; 0x01 c118: 7a 81 ldd r23, Y+2 ; 0x02 c11a: 8b 81 ldd r24, Y+3 ; 0x03 c11c: 9c 81 ldd r25, Y+4 ; 0x04 c11e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> c122: 9b 01 movw r18, r22 c124: ac 01 movw r20, r24 c126: c5 01 movw r24, r10 c128: b4 01 movw r22, r8 c12a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> c12e: 4b 01 movw r8, r22 c130: 5c 01 movw r10, r24 world2machine_rotation_and_skew_inv[0][0] = world2machine_rotation_and_skew[1][1] / d; c132: ac 01 movw r20, r24 c134: 9b 01 movw r18, r22 c136: c3 01 movw r24, r6 c138: b2 01 movw r22, r4 c13a: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> c13e: 60 93 8a 04 sts 0x048A, r22 ; 0x80048a c142: 70 93 8b 04 sts 0x048B, r23 ; 0x80048b c146: 80 93 8c 04 sts 0x048C, r24 ; 0x80048c c14a: 90 93 8d 04 sts 0x048D, r25 ; 0x80048d world2machine_rotation_and_skew_inv[0][1] = -world2machine_rotation_and_skew[0][1] / d; c14e: 6d 81 ldd r22, Y+5 ; 0x05 c150: 7e 81 ldd r23, Y+6 ; 0x06 c152: 8f 81 ldd r24, Y+7 ; 0x07 c154: 98 85 ldd r25, Y+8 ; 0x08 c156: 90 58 subi r25, 0x80 ; 128 c158: a5 01 movw r20, r10 c15a: 94 01 movw r18, r8 c15c: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> c160: 60 93 8e 04 sts 0x048E, r22 ; 0x80048e c164: 70 93 8f 04 sts 0x048F, r23 ; 0x80048f c168: 80 93 90 04 sts 0x0490, r24 ; 0x800490 c16c: 90 93 91 04 sts 0x0491, r25 ; 0x800491 world2machine_rotation_and_skew_inv[1][0] = -world2machine_rotation_and_skew[1][0] / d; c170: 69 81 ldd r22, Y+1 ; 0x01 c172: 7a 81 ldd r23, Y+2 ; 0x02 c174: 8b 81 ldd r24, Y+3 ; 0x03 c176: 9c 81 ldd r25, Y+4 ; 0x04 c178: 90 58 subi r25, 0x80 ; 128 c17a: a5 01 movw r20, r10 c17c: 94 01 movw r18, r8 c17e: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> c182: 60 93 92 04 sts 0x0492, r22 ; 0x800492 c186: 70 93 93 04 sts 0x0493, r23 ; 0x800493 c18a: 80 93 94 04 sts 0x0494, r24 ; 0x800494 c18e: 90 93 95 04 sts 0x0495, r25 ; 0x800495 world2machine_rotation_and_skew_inv[1][1] = world2machine_rotation_and_skew[0][0] / d; c192: a5 01 movw r20, r10 c194: 94 01 movw r18, r8 c196: c7 01 movw r24, r14 c198: b6 01 movw r22, r12 c19a: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> c19e: 60 93 96 04 sts 0x0496, r22 ; 0x800496 c1a2: 70 93 97 04 sts 0x0497, r23 ; 0x800497 c1a6: 80 93 98 04 sts 0x0498, r24 ; 0x800498 c1aa: 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; } } c1ae: 28 96 adiw r28, 0x08 ; 8 c1b0: 0f b6 in r0, 0x3f ; 63 c1b2: f8 94 cli c1b4: de bf out 0x3e, r29 ; 62 c1b6: 0f be out 0x3f, r0 ; 63 c1b8: cd bf out 0x3d, r28 ; 61 c1ba: df 91 pop r29 c1bc: cf 91 pop r28 c1be: 1f 91 pop r17 c1c0: 0f 91 pop r16 c1c2: ff 90 pop r15 c1c4: ef 90 pop r14 c1c6: df 90 pop r13 c1c8: cf 90 pop r12 c1ca: bf 90 pop r11 c1cc: af 90 pop r10 c1ce: 9f 90 pop r9 c1d0: 8f 90 pop r8 c1d2: 7f 90 pop r7 c1d4: 6f 90 pop r6 c1d6: 5f 90 pop r5 c1d8: 4f 90 pop r4 c1da: 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; c1dc: 81 e0 ldi r24, 0x01 ; 1 c1de: 80 93 a2 04 sts 0x04A2, r24 ; 0x8004a2 c1e2: 5d cf rjmp .-326 ; 0xc09e 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; c1e4: 80 e0 ldi r24, 0x00 ; 0 c1e6: 90 e0 ldi r25, 0x00 ; 0 c1e8: a0 e8 ldi r26, 0x80 ; 128 c1ea: bf e3 ldi r27, 0x3F ; 63 c1ec: 80 93 8a 04 sts 0x048A, r24 ; 0x80048a c1f0: 90 93 8b 04 sts 0x048B, r25 ; 0x80048b c1f4: a0 93 8c 04 sts 0x048C, r26 ; 0x80048c c1f8: b0 93 8d 04 sts 0x048D, r27 ; 0x80048d world2machine_rotation_and_skew_inv[0][1] = 0.f; c1fc: 10 92 8e 04 sts 0x048E, r1 ; 0x80048e c200: 10 92 8f 04 sts 0x048F, r1 ; 0x80048f c204: 10 92 90 04 sts 0x0490, r1 ; 0x800490 c208: 10 92 91 04 sts 0x0491, r1 ; 0x800491 world2machine_rotation_and_skew_inv[1][0] = 0.f; c20c: 10 92 92 04 sts 0x0492, r1 ; 0x800492 c210: 10 92 93 04 sts 0x0493, r1 ; 0x800493 c214: 10 92 94 04 sts 0x0494, r1 ; 0x800494 c218: 10 92 95 04 sts 0x0495, r1 ; 0x800495 world2machine_rotation_and_skew_inv[1][1] = 1.f; c21c: 80 93 96 04 sts 0x0496, r24 ; 0x800496 c220: 90 93 97 04 sts 0x0497, r25 ; 0x800497 c224: a0 93 98 04 sts 0x0498, r26 ; 0x800498 c228: b0 93 99 04 sts 0x0499, r27 ; 0x800499 c22c: c0 cf rjmp .-128 ; 0xc1ae 0000c22e : /** * @brief Read and apply validated calibration data from EEPROM */ void world2machine_initialize() { c22e: 4f 92 push r4 c230: 5f 92 push r5 c232: 6f 92 push r6 c234: 7f 92 push r7 c236: 8f 92 push r8 c238: 9f 92 push r9 c23a: af 92 push r10 c23c: bf 92 push r11 c23e: cf 92 push r12 c240: df 92 push r13 c242: ef 92 push r14 c244: ff 92 push r15 c246: 1f 93 push r17 c248: cf 93 push r28 c24a: df 93 push r29 c24c: cd b7 in r28, 0x3d ; 61 c24e: de b7 in r29, 0x3e ; 62 c250: a8 97 sbiw r28, 0x28 ; 40 c252: 0f b6 in r0, 0x3f ; 63 c254: f8 94 cli c256: de bf out 0x3e, r29 ; 62 c258: 0f be out 0x3f, r0 ; 63 c25a: 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); c25c: 48 e0 ldi r20, 0x08 ; 8 c25e: 50 e0 ldi r21, 0x00 ; 0 c260: 6d ed ldi r22, 0xDD ; 221 c262: 7f e0 ldi r23, 0x0F ; 15 c264: ce 01 movw r24, r28 c266: 01 96 adiw r24, 0x01 ; 1 c268: 0f 94 71 a4 call 0x348e2 ; 0x348e2 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); c26c: 48 e0 ldi r20, 0x08 ; 8 c26e: 50 e0 ldi r21, 0x00 ; 0 c270: 65 ed ldi r22, 0xD5 ; 213 c272: 7f e0 ldi r23, 0x0F ; 15 c274: ce 01 movw r24, r28 c276: 09 96 adiw r24, 0x09 ; 9 c278: 0f 94 71 a4 call 0x348e2 ; 0x348e2 eeprom_read_block(&cntr[0], (float*)(EEPROM_BED_CALIBRATION_CENTER), 8); c27c: 48 e0 ldi r20, 0x08 ; 8 c27e: 50 e0 ldi r21, 0x00 ; 0 c280: 65 ee ldi r22, 0xE5 ; 229 c282: 7f e0 ldi r23, 0x0F ; 15 c284: ce 01 movw r24, r28 c286: 41 96 adiw r24, 0x11 ; 17 c288: 0f 94 71 a4 call 0x348e2 ; 0x348e2 } static inline bool vec_undef(const float v[2]) { const uint32_t *vx = (const uint32_t*)v; return vx[0] == 0xFFFFFFFF || vx[1] == 0xFFFFFFFF; c28c: 89 89 ldd r24, Y+17 ; 0x11 c28e: 9a 89 ldd r25, Y+18 ; 0x12 c290: ab 89 ldd r26, Y+19 ; 0x13 c292: bc 89 ldd r27, Y+20 ; 0x14 c294: 89 a3 std Y+33, r24 ; 0x21 c296: 9a a3 std Y+34, r25 ; 0x22 c298: ab a3 std Y+35, r26 ; 0x23 c29a: bc a3 std Y+36, r27 ; 0x24 c29c: 8f 3f cpi r24, 0xFF ; 255 c29e: 9f 4f sbci r25, 0xFF ; 255 c2a0: af 4f sbci r26, 0xFF ; 255 c2a2: bf 4f sbci r27, 0xFF ; 255 c2a4: 09 f4 brne .+2 ; 0xc2a8 c2a6: b1 c0 rjmp .+354 ; 0xc40a c2a8: 8d 89 ldd r24, Y+21 ; 0x15 c2aa: 9e 89 ldd r25, Y+22 ; 0x16 c2ac: af 89 ldd r26, Y+23 ; 0x17 c2ae: b8 8d ldd r27, Y+24 ; 0x18 c2b0: 8d a3 std Y+37, r24 ; 0x25 c2b2: 9e a3 std Y+38, r25 ; 0x26 c2b4: af a3 std Y+39, r26 ; 0x27 c2b6: b8 a7 std Y+40, r27 ; 0x28 c2b8: 8f 3f cpi r24, 0xFF ; 255 c2ba: 9f 4f sbci r25, 0xFF ; 255 c2bc: af 4f sbci r26, 0xFF ; 255 c2be: bf 4f sbci r27, 0xFF ; 255 c2c0: 09 f4 brne .+2 ; 0xc2c4 c2c2: a3 c0 rjmp .+326 ; 0xc40a c2c4: 89 80 ldd r8, Y+1 ; 0x01 c2c6: 9a 80 ldd r9, Y+2 ; 0x02 c2c8: ab 80 ldd r10, Y+3 ; 0x03 c2ca: bc 80 ldd r11, Y+4 ; 0x04 c2cc: 8f ef ldi r24, 0xFF ; 255 c2ce: 88 16 cp r8, r24 c2d0: 98 06 cpc r9, r24 c2d2: a8 06 cpc r10, r24 c2d4: b8 06 cpc r11, r24 c2d6: 09 f4 brne .+2 ; 0xc2da c2d8: 98 c0 rjmp .+304 ; 0xc40a c2da: 8d 81 ldd r24, Y+5 ; 0x05 c2dc: 9e 81 ldd r25, Y+6 ; 0x06 c2de: af 81 ldd r26, Y+7 ; 0x07 c2e0: b8 85 ldd r27, Y+8 ; 0x08 c2e2: 89 8f std Y+25, r24 ; 0x19 c2e4: 9a 8f std Y+26, r25 ; 0x1a c2e6: ab 8f std Y+27, r26 ; 0x1b c2e8: bc 8f std Y+28, r27 ; 0x1c c2ea: 8f 3f cpi r24, 0xFF ; 255 c2ec: 9f 4f sbci r25, 0xFF ; 255 c2ee: af 4f sbci r26, 0xFF ; 255 c2f0: bf 4f sbci r27, 0xFF ; 255 c2f2: 09 f4 brne .+2 ; 0xc2f6 c2f4: 8a c0 rjmp .+276 ; 0xc40a c2f6: c9 84 ldd r12, Y+9 ; 0x09 c2f8: da 84 ldd r13, Y+10 ; 0x0a c2fa: eb 84 ldd r14, Y+11 ; 0x0b c2fc: fc 84 ldd r15, Y+12 ; 0x0c c2fe: 8f ef ldi r24, 0xFF ; 255 c300: c8 16 cp r12, r24 c302: d8 06 cpc r13, r24 c304: e8 06 cpc r14, r24 c306: f8 06 cpc r15, r24 c308: 09 f4 brne .+2 ; 0xc30c c30a: 7f c0 rjmp .+254 ; 0xc40a c30c: 8d 85 ldd r24, Y+13 ; 0x0d c30e: 9e 85 ldd r25, Y+14 ; 0x0e c310: af 85 ldd r26, Y+15 ; 0x0f c312: b8 89 ldd r27, Y+16 ; 0x10 c314: 8d 8f std Y+29, r24 ; 0x1d c316: 9e 8f std Y+30, r25 ; 0x1e c318: af 8f std Y+31, r26 ; 0x1f c31a: b8 a3 std Y+32, r27 ; 0x20 c31c: 8f 3f cpi r24, 0xFF ; 255 c31e: 9f 4f sbci r25, 0xFF ; 255 c320: af 4f sbci r26, 0xFF ; 255 c322: bf 4f sbci r27, 0xFF ; 255 c324: 09 f4 brne .+2 ; 0xc328 c326: 71 c0 rjmp .+226 ; 0xc40a reset = true; } else { // Length of the vec_x shall be close to unity. float l = hypot(vec_x[0], vec_x[1]); c328: 29 8d ldd r18, Y+25 ; 0x19 c32a: 3a 8d ldd r19, Y+26 ; 0x1a c32c: 4b 8d ldd r20, Y+27 ; 0x1b c32e: 5c 8d ldd r21, Y+28 ; 0x1c c330: c5 01 movw r24, r10 c332: b4 01 movw r22, r8 c334: 0f 94 45 a8 call 0x3508a ; 0x3508a c338: 2b 01 movw r4, r22 c33a: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) c33c: 26 e6 ldi r18, 0x66 ; 102 c33e: 36 e6 ldi r19, 0x66 ; 102 c340: 46 e6 ldi r20, 0x66 ; 102 c342: 5f e3 ldi r21, 0x3F ; 63 c344: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__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; c348: 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) c34a: 87 fd sbrc r24, 7 c34c: 0b c0 rjmp .+22 ; 0xc364 c34e: 2d ec ldi r18, 0xCD ; 205 c350: 3c ec ldi r19, 0xCC ; 204 c352: 4c e8 ldi r20, 0x8C ; 140 c354: 5f e3 ldi r21, 0x3F ; 63 c356: c3 01 movw r24, r6 c358: b2 01 movw r22, r4 c35a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> c35e: 18 16 cp r1, r24 c360: 0c f0 brlt .+2 ; 0xc364 c362: 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]); c364: 2d 8d ldd r18, Y+29 ; 0x1d c366: 3e 8d ldd r19, Y+30 ; 0x1e c368: 4f 8d ldd r20, Y+31 ; 0x1f c36a: 58 a1 ldd r21, Y+32 ; 0x20 c36c: c7 01 movw r24, r14 c36e: b6 01 movw r22, r12 c370: 0f 94 45 a8 call 0x3508a ; 0x3508a c374: 2b 01 movw r4, r22 c376: 3c 01 movw r6, r24 if (l < 0.9 || l > 1.1) c378: 26 e6 ldi r18, 0x66 ; 102 c37a: 36 e6 ldi r19, 0x66 ; 102 c37c: 46 e6 ldi r20, 0x66 ; 102 c37e: 5f e3 ldi r21, 0x3F ; 63 c380: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> c384: 87 fd sbrc r24, 7 c386: 7f c0 rjmp .+254 ; 0xc486 c388: 2d ec ldi r18, 0xCD ; 205 c38a: 3c ec ldi r19, 0xCC ; 204 c38c: 4c e8 ldi r20, 0x8C ; 140 c38e: 5f e3 ldi r21, 0x3F ; 63 c390: c3 01 movw r24, r6 c392: b2 01 movw r22, r4 c394: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> c398: 18 16 cp r1, r24 c39a: 0c f4 brge .+2 ; 0xc39e c39c: 74 c0 rjmp .+232 ; 0xc486 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]); c39e: 2d a1 ldd r18, Y+37 ; 0x25 c3a0: 3e a1 ldd r19, Y+38 ; 0x26 c3a2: 4f a1 ldd r20, Y+39 ; 0x27 c3a4: 58 a5 ldd r21, Y+40 ; 0x28 c3a6: 69 a1 ldd r22, Y+33 ; 0x21 c3a8: 7a a1 ldd r23, Y+34 ; 0x22 c3aa: 8b a1 ldd r24, Y+35 ; 0x23 c3ac: 9c a1 ldd r25, Y+36 ; 0x24 c3ae: 0f 94 45 a8 call 0x3508a ; 0x3508a if (l > 15.f) c3b2: 20 e0 ldi r18, 0x00 ; 0 c3b4: 30 e0 ldi r19, 0x00 ; 0 c3b6: 40 e7 ldi r20, 0x70 ; 112 c3b8: 51 e4 ldi r21, 0x41 ; 65 c3ba: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> c3be: 18 16 cp r1, r24 c3c0: 0c f4 brge .+2 ; 0xc3c4 #if 0 SERIAL_ECHOLNPGM("Zero point correction:"); MYSERIAL.println(l); SERIAL_ECHOLNPGM("Invalid bed correction matrix. Shift out of range."); #endif reset = true; c3c2: 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]; c3c4: a5 01 movw r20, r10 c3c6: 94 01 movw r18, r8 c3c8: c7 01 movw r24, r14 c3ca: b6 01 movw r22, r12 c3cc: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> c3d0: 6b 01 movw r12, r22 c3d2: 7c 01 movw r14, r24 c3d4: 2d 8d ldd r18, Y+29 ; 0x1d c3d6: 3e 8d ldd r19, Y+30 ; 0x1e c3d8: 4f 8d ldd r20, Y+31 ; 0x1f c3da: 58 a1 ldd r21, Y+32 ; 0x20 c3dc: 69 8d ldd r22, Y+25 ; 0x19 c3de: 7a 8d ldd r23, Y+26 ; 0x1a c3e0: 8b 8d ldd r24, Y+27 ; 0x1b c3e2: 9c 8d ldd r25, Y+28 ; 0x1c c3e4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> c3e8: 9b 01 movw r18, r22 c3ea: ac 01 movw r20, r24 c3ec: c7 01 movw r24, r14 c3ee: b6 01 movw r22, r12 c3f0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> if (fabs(l) > 0.1f) c3f4: 9f 77 andi r25, 0x7F ; 127 c3f6: 2d ec ldi r18, 0xCD ; 205 c3f8: 3c ec ldi r19, 0xCC ; 204 c3fa: 4c ec ldi r20, 0xCC ; 204 c3fc: 5d e3 ldi r21, 0x3D ; 61 c3fe: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> c402: 18 16 cp r1, r24 c404: 14 f0 brlt .+4 ; 0xc40a #endif reset = true; } } if (reset) c406: 11 23 and r17, r17 c408: f1 f0 breq .+60 ; 0xc446 { #if 0 SERIAL_ECHOLNPGM("Invalid bed correction matrix. Resetting to identity."); #endif reset_bed_offset_and_skew(); c40a: 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; c40e: 80 e0 ldi r24, 0x00 ; 0 c410: 90 e0 ldi r25, 0x00 ; 0 c412: a0 e8 ldi r26, 0x80 ; 128 c414: bf e3 ldi r27, 0x3F ; 63 c416: 89 83 std Y+1, r24 ; 0x01 c418: 9a 83 std Y+2, r25 ; 0x02 c41a: ab 83 std Y+3, r26 ; 0x03 c41c: bc 83 std Y+4, r27 ; 0x04 vec_x[1] = 0.f; c41e: 1d 82 std Y+5, r1 ; 0x05 c420: 1e 82 std Y+6, r1 ; 0x06 c422: 1f 82 std Y+7, r1 ; 0x07 c424: 18 86 std Y+8, r1 ; 0x08 vec_y[0] = 0.f; c426: 19 86 std Y+9, r1 ; 0x09 c428: 1a 86 std Y+10, r1 ; 0x0a c42a: 1b 86 std Y+11, r1 ; 0x0b c42c: 1c 86 std Y+12, r1 ; 0x0c vec_y[1] = 1.f; c42e: 8d 87 std Y+13, r24 ; 0x0d c430: 9e 87 std Y+14, r25 ; 0x0e c432: af 87 std Y+15, r26 ; 0x0f c434: b8 8b std Y+16, r27 ; 0x10 cntr[0] = 0.f; c436: 19 8a std Y+17, r1 ; 0x11 c438: 1a 8a std Y+18, r1 ; 0x12 c43a: 1b 8a std Y+19, r1 ; 0x13 c43c: 1c 8a std Y+20, r1 ; 0x14 #ifdef DEFAULT_Y_OFFSET cntr[1] = DEFAULT_Y_OFFSET; #else cntr[1] = 0.f; c43e: 1d 8a std Y+21, r1 ; 0x15 c440: 1e 8a std Y+22, r1 ; 0x16 c442: 1f 8a std Y+23, r1 ; 0x17 c444: 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); c446: ae 01 movw r20, r28 c448: 4f 5e subi r20, 0xEF ; 239 c44a: 5f 4f sbci r21, 0xFF ; 255 c44c: be 01 movw r22, r28 c44e: 67 5f subi r22, 0xF7 ; 247 c450: 7f 4f sbci r23, 0xFF ; 255 c452: ce 01 movw r24, r28 c454: 01 96 adiw r24, 0x01 ; 1 c456: 0e 94 ce 5f call 0xbf9c ; 0xbf9c MYSERIAL.print(world2machine_shift[0], 5); SERIAL_ECHOPGM(", "); MYSERIAL.print(world2machine_shift[1], 5); SERIAL_ECHOLNPGM(""); #endif } c45a: a8 96 adiw r28, 0x28 ; 40 c45c: 0f b6 in r0, 0x3f ; 63 c45e: f8 94 cli c460: de bf out 0x3e, r29 ; 62 c462: 0f be out 0x3f, r0 ; 63 c464: cd bf out 0x3d, r28 ; 61 c466: df 91 pop r29 c468: cf 91 pop r28 c46a: 1f 91 pop r17 c46c: ff 90 pop r15 c46e: ef 90 pop r14 c470: df 90 pop r13 c472: cf 90 pop r12 c474: bf 90 pop r11 c476: af 90 pop r10 c478: 9f 90 pop r9 c47a: 8f 90 pop r8 c47c: 7f 90 pop r7 c47e: 6f 90 pop r6 c480: 5f 90 pop r5 c482: 4f 90 pop r4 c484: 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; c486: 11 e0 ldi r17, 0x01 ; 1 c488: 8a cf rjmp .-236 ; 0xc39e 0000c48a : * * 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() { c48a: cf 93 push r28 c48c: df 93 push r29 c48e: cd b7 in r28, 0x3d ; 61 c490: de b7 in r29, 0x3e ; 62 c492: 68 97 sbiw r28, 0x18 ; 24 c494: 0f b6 in r0, 0x3f ; 63 c496: f8 94 cli c498: de bf out 0x3e, r29 ; 62 c49a: 0f be out 0x3f, r0 ; 63 c49c: cd bf out 0x3d, r28 ; 61 const float vx[] = { 1.f, 0.f }; c49e: 80 e0 ldi r24, 0x00 ; 0 c4a0: 90 e0 ldi r25, 0x00 ; 0 c4a2: a0 e8 ldi r26, 0x80 ; 128 c4a4: bf e3 ldi r27, 0x3F ; 63 c4a6: 89 83 std Y+1, r24 ; 0x01 c4a8: 9a 83 std Y+2, r25 ; 0x02 c4aa: ab 83 std Y+3, r26 ; 0x03 c4ac: bc 83 std Y+4, r27 ; 0x04 c4ae: 1d 82 std Y+5, r1 ; 0x05 c4b0: 1e 82 std Y+6, r1 ; 0x06 c4b2: 1f 82 std Y+7, r1 ; 0x07 c4b4: 18 86 std Y+8, r1 ; 0x08 const float vy[] = { 0.f, 1.f }; c4b6: 19 86 std Y+9, r1 ; 0x09 c4b8: 1a 86 std Y+10, r1 ; 0x0a c4ba: 1b 86 std Y+11, r1 ; 0x0b c4bc: 1c 86 std Y+12, r1 ; 0x0c c4be: 8d 87 std Y+13, r24 ; 0x0d c4c0: 9e 87 std Y+14, r25 ; 0x0e c4c2: af 87 std Y+15, r26 ; 0x0f c4c4: b8 8b std Y+16, r27 ; 0x10 const float cntr[] = { 0.f, 0.f }; c4c6: 19 8a std Y+17, r1 ; 0x11 c4c8: 1a 8a std Y+18, r1 ; 0x12 c4ca: 1b 8a std Y+19, r1 ; 0x13 c4cc: 1c 8a std Y+20, r1 ; 0x14 c4ce: 1d 8a std Y+21, r1 ; 0x15 c4d0: 1e 8a std Y+22, r1 ; 0x16 c4d2: 1f 8a std Y+23, r1 ; 0x17 c4d4: 18 8e std Y+24, r1 ; 0x18 world2machine_update(vx, vy, cntr); c4d6: ae 01 movw r20, r28 c4d8: 4f 5e subi r20, 0xEF ; 239 c4da: 5f 4f sbci r21, 0xFF ; 255 c4dc: be 01 movw r22, r28 c4de: 67 5f subi r22, 0xF7 ; 247 c4e0: 7f 4f sbci r23, 0xFF ; 255 c4e2: ce 01 movw r24, r28 c4e4: 01 96 adiw r24, 0x01 ; 1 c4e6: 0e 94 ce 5f call 0xbf9c ; 0xbf9c } c4ea: 68 96 adiw r28, 0x18 ; 24 c4ec: 0f b6 in r0, 0x3f ; 63 c4ee: f8 94 cli c4f0: de bf out 0x3e, r29 ; 62 c4f2: 0f be out 0x3f, r0 ; 63 c4f4: cd bf out 0x3d, r28 ; 61 c4f6: df 91 pop r29 c4f8: cf 91 pop r28 c4fa: 08 95 ret 0000c4fc : * * 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) { c4fc: 80 91 a2 04 lds r24, 0x04A2 ; 0x8004a2 c500: 88 23 and r24, r24 c502: d1 f0 breq .+52 ; 0xc538 world2machine_reset(); c504: 0e 94 45 62 call 0xc48a ; 0xc48a st_synchronize(); c508: 0f 94 94 18 call 0x23128 ; 0x23128 current_position[X_AXIS] = st_get_position_mm(X_AXIS); c50c: 80 e0 ldi r24, 0x00 ; 0 c50e: 0f 94 80 18 call 0x23100 ; 0x23100 c512: 60 93 61 12 sts 0x1261, r22 ; 0x801261 c516: 70 93 62 12 sts 0x1262, r23 ; 0x801262 c51a: 80 93 63 12 sts 0x1263, r24 ; 0x801263 c51e: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); c522: 81 e0 ldi r24, 0x01 ; 1 c524: 0f 94 80 18 call 0x23100 ; 0x23100 c528: 60 93 65 12 sts 0x1265, r22 ; 0x801265 c52c: 70 93 66 12 sts 0x1266, r23 ; 0x801266 c530: 80 93 67 12 sts 0x1267, r24 ; 0x801267 c534: 90 93 68 12 sts 0x1268, r25 ; 0x801268 } } c538: 08 95 ret 0000c53a : } menu_item++; } bool __attribute__((noinline)) menu_item_leave(){ return ((menu_item == menu_line) && menu_clicked && (lcd_encoder == menu_item)) || menu_leaving; c53a: 80 91 63 04 lds r24, 0x0463 ; 0x800463 c53e: 90 91 62 04 lds r25, 0x0462 ; 0x800462 c542: 89 13 cpse r24, r25 c544: 0b c0 rjmp .+22 ; 0xc55c c546: 90 91 61 04 lds r25, 0x0461 ; 0x800461 c54a: 99 23 and r25, r25 c54c: 39 f0 breq .+14 ; 0xc55c c54e: 20 91 1e 06 lds r18, 0x061E ; 0x80061e c552: 30 91 1f 06 lds r19, 0x061F ; 0x80061f c556: 82 17 cp r24, r18 c558: 13 06 cpc r1, r19 c55a: 39 f0 breq .+14 ; 0xc56a c55c: 81 e0 ldi r24, 0x01 ; 1 c55e: 90 91 c4 03 lds r25, 0x03C4 ; 0x8003c4 c562: 91 11 cpse r25, r1 c564: 03 c0 rjmp .+6 ; 0xc56c c566: 80 e0 ldi r24, 0x00 ; 0 c568: 08 95 ret c56a: 81 e0 ldi r24, 0x01 ; 1 } c56c: 08 95 ret 0000c56e : 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)?'>':' '; c56e: 20 91 63 04 lds r18, 0x0463 ; 0x800463 c572: 80 91 1e 06 lds r24, 0x061E ; 0x80061e c576: 90 91 1f 06 lds r25, 0x061F ; 0x80061f c57a: 28 17 cp r18, r24 c57c: 19 06 cpc r1, r25 c57e: 11 f0 breq .+4 ; 0xc584 c580: 80 e2 ldi r24, 0x20 ; 32 c582: 08 95 ret c584: 8e e3 ldi r24, 0x3E ; 62 } c586: 08 95 ret 0000c588 : } } void menu_item_ret(void) { lcd_draw_update = 2; c588: 82 e0 ldi r24, 0x02 ; 2 c58a: 80 93 59 02 sts 0x0259, r24 ; 0x800259 menu_item++; c58e: 80 91 63 04 lds r24, 0x0463 ; 0x800463 c592: 8f 5f subi r24, 0xFF ; 255 c594: 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 c598: 84 e0 ldi r24, 0x04 ; 4 c59a: 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 c59e: 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 c5a2: 10 92 61 04 sts 0x0461, r1 ; 0x800461 } c5a6: 08 95 ret 0000c5a8 : menu_clicked = lcd_clicked(); // Consume click event } void menu_end(void) { if (menu_row >= LCD_HEIGHT) c5a8: 80 91 60 04 lds r24, 0x0460 ; 0x800460 c5ac: 84 30 cpi r24, 0x04 ; 4 c5ae: 38 f5 brcc .+78 ; 0xc5fe { // Early abort if the menu was clicked. The current menu might have changed because of the click event return; } if (lcd_encoder >= menu_item) c5b0: 80 91 63 04 lds r24, 0x0463 ; 0x800463 c5b4: 90 e0 ldi r25, 0x00 ; 0 c5b6: 20 91 1e 06 lds r18, 0x061E ; 0x80061e c5ba: 30 91 1f 06 lds r19, 0x061F ; 0x80061f c5be: 28 17 cp r18, r24 c5c0: 39 07 cpc r19, r25 c5c2: 44 f0 brlt .+16 ; 0xc5d4 { lcd_encoder = menu_item - 1; c5c4: 01 97 sbiw r24, 0x01 ; 1 c5c6: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f c5ca: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e Sound_MakeSound(e_SOUND_TYPE_BlindAlert); c5ce: 87 e0 ldi r24, 0x07 ; 7 c5d0: 0f 94 3f 23 call 0x2467e ; 0x2467e } if (((uint8_t)lcd_encoder) >= menu_top + LCD_HEIGHT) c5d4: 80 91 1e 06 lds r24, 0x061E ; 0x80061e c5d8: 20 91 92 03 lds r18, 0x0392 ; 0x800392 c5dc: 30 e0 ldi r19, 0x00 ; 0 c5de: 2d 5f subi r18, 0xFD ; 253 c5e0: 3f 4f sbci r19, 0xFF ; 255 c5e2: 82 17 cp r24, r18 c5e4: 13 06 cpc r1, r19 c5e6: 59 f0 breq .+22 ; 0xc5fe c5e8: 54 f0 brlt .+20 ; 0xc5fe { menu_top = lcd_encoder - LCD_HEIGHT + 1; c5ea: 9d ef ldi r25, 0xFD ; 253 c5ec: 98 0f add r25, r24 c5ee: 90 93 92 03 sts 0x0392, r25 ; 0x800392 menu_line = menu_top - 1; c5f2: 84 50 subi r24, 0x04 ; 4 c5f4: 80 93 62 04 sts 0x0462, r24 ; 0x800462 menu_row = -1; c5f8: 8f ef ldi r24, 0xFF ; 255 c5fa: 80 93 60 04 sts 0x0460, r24 ; 0x800460 } } c5fe: 08 95 ret 0000c600 : 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)); c600: e6 e9 ldi r30, 0x96 ; 150 c602: f3 e0 ldi r31, 0x03 ; 3 c604: 80 e2 ldi r24, 0x20 ; 32 c606: df 01 movw r26, r30 c608: 1d 92 st X+, r1 c60a: 8a 95 dec r24 c60c: e9 f7 brne .-6 ; 0xc608 } c60e: 08 95 ret 0000c610 : void menu_goto(menu_func_t menu, const int16_t encoder, bool reset_menu_state, const bool feedback) { c610: cf 93 push r28 CRITICAL_SECTION_START; c612: 3f b7 in r19, 0x3f ; 63 c614: f8 94 cli if (menu_menu != menu) c616: e0 91 02 04 lds r30, 0x0402 ; 0x800402 c61a: f0 91 03 04 lds r31, 0x0403 ; 0x800403 c61e: e8 17 cp r30, r24 c620: f9 07 cpc r31, r25 c622: c9 f0 breq .+50 ; 0xc656 c624: c4 2f mov r28, r20 { menu_menu = menu; c626: 90 93 03 04 sts 0x0403, r25 ; 0x800403 c62a: 80 93 02 04 sts 0x0402, r24 ; 0x800402 lcd_encoder = encoder; c62e: 70 93 1f 06 sts 0x061F, r23 ; 0x80061f c632: 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 c636: 10 92 92 03 sts 0x0392, r1 ; 0x800392 lcd_draw_update = 2; // Full LCD re-draw c63a: 82 e0 ldi r24, 0x02 ; 2 c63c: 80 93 59 02 sts 0x0259, r24 ; 0x800259 CRITICAL_SECTION_END; c640: 3f bf out 0x3f, r19 ; 63 if (feedback) lcd_beeper_quick_feedback(); c642: 22 23 and r18, r18 c644: 19 f0 breq .+6 ; 0xc64c } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); c646: 80 e0 ldi r24, 0x00 ; 0 c648: 0f 94 3f 23 call 0x2467e ; 0x2467e if (reset_menu_state) menu_data_reset(); c64c: cc 23 and r28, r28 c64e: 21 f0 breq .+8 ; 0xc658 } else CRITICAL_SECTION_END; } c650: 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(); c652: 0c 94 00 63 jmp 0xc600 ; 0xc600 } else CRITICAL_SECTION_END; c656: 3f bf out 0x3f, r19 ; 63 } c658: cf 91 pop r28 c65a: 08 95 ret 0000c65c : if (lcd_clicked()) menu_back(); } void menu_submenu(menu_func_t submenu, const bool feedback) { c65c: dc 01 movw r26, r24 c65e: 26 2f mov r18, r22 if (menu_depth < MENU_DEPTH_MAX) c660: 90 91 df 03 lds r25, 0x03DF ; 0x8003df c664: 97 30 cpi r25, 0x07 ; 7 c666: d8 f4 brcc .+54 ; 0xc69e { menu_stack[menu_depth].menu = menu_menu; c668: 49 2f mov r20, r25 c66a: 50 e0 ldi r21, 0x00 ; 0 c66c: fa 01 movw r30, r20 c66e: ee 0f add r30, r30 c670: ff 1f adc r31, r31 c672: e4 0f add r30, r20 c674: f5 1f adc r31, r21 c676: e9 5a subi r30, 0xA9 ; 169 c678: fc 4f sbci r31, 0xFC ; 252 c67a: 40 91 02 04 lds r20, 0x0402 ; 0x800402 c67e: 50 91 03 04 lds r21, 0x0403 ; 0x800403 c682: 51 83 std Z+1, r21 ; 0x01 c684: 40 83 st Z, r20 menu_stack[menu_depth++].position = lcd_encoder; c686: 80 91 1e 06 lds r24, 0x061E ; 0x80061e c68a: 9f 5f subi r25, 0xFF ; 255 c68c: 90 93 df 03 sts 0x03DF, r25 ; 0x8003df c690: 82 83 std Z+2, r24 ; 0x02 menu_goto(submenu, 0, true, feedback); c692: 41 e0 ldi r20, 0x01 ; 1 c694: 70 e0 ldi r23, 0x00 ; 0 c696: 60 e0 ldi r22, 0x00 ; 0 c698: cd 01 movw r24, r26 c69a: 0c 94 08 63 jmp 0xc610 ; 0xc610 } } c69e: 08 95 ret 0000c6a0 : menu_row = -1; } } void menu_back(uint8_t nLevel) { c6a0: 98 2f mov r25, r24 menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); c6a2: 80 91 df 03 lds r24, 0x03DF ; 0x8003df c6a6: 98 17 cp r25, r24 c6a8: a8 f4 brcc .+42 ; 0xc6d4 c6aa: 89 1b sub r24, r25 c6ac: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); c6b0: 90 e0 ldi r25, 0x00 ; 0 c6b2: fc 01 movw r30, r24 c6b4: ee 0f add r30, r30 c6b6: ff 1f adc r31, r31 c6b8: e8 0f add r30, r24 c6ba: f9 1f adc r31, r25 c6bc: e9 5a subi r30, 0xA9 ; 169 c6be: fc 4f sbci r31, 0xFC ; 252 c6c0: 62 81 ldd r22, Z+2 ; 0x02 c6c2: 06 2e mov r0, r22 c6c4: 00 0c add r0, r0 c6c6: 77 0b sbc r23, r23 c6c8: 20 e0 ldi r18, 0x00 ; 0 c6ca: 41 e0 ldi r20, 0x01 ; 1 c6cc: 80 81 ld r24, Z c6ce: 91 81 ldd r25, Z+1 ; 0x01 c6d0: 0c 94 08 63 jmp 0xc610 ; 0xc610 } } void menu_back(uint8_t nLevel) { menu_depth = ((menu_depth > nLevel) ? (menu_depth - nLevel) : 0); c6d4: 80 e0 ldi r24, 0x00 ; 0 c6d6: ea cf rjmp .-44 ; 0xc6ac 0000c6d8 : menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, true); } void menu_back(void) { menu_back(1); c6d8: 81 e0 ldi r24, 0x01 ; 1 c6da: 0c 94 50 63 jmp 0xc6a0 ; 0xc6a0 0000c6de <__vector_36>: #endif //DEBUG_DUMP_TO_2ND_SERIAL } } ISR(USART1_RX_vect) { c6de: 1f 92 push r1 c6e0: 0f 92 push r0 c6e2: 0f b6 in r0, 0x3f ; 63 c6e4: 0f 92 push r0 c6e6: 11 24 eor r1, r1 c6e8: 0b b6 in r0, 0x3b ; 59 c6ea: 0f 92 push r0 c6ec: 2f 93 push r18 c6ee: 3f 93 push r19 c6f0: 4f 93 push r20 c6f2: 6f 93 push r22 c6f4: 7f 93 push r23 c6f6: 8f 93 push r24 c6f8: 9f 93 push r25 c6fa: ef 93 push r30 c6fc: ff 93 push r31 // Test for a framing error. if (UCSR1A & (1< c702: 84 ff sbrs r24, 4 c704: 12 c0 rjmp .+36 ; 0xc72a <__vector_36+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)UDR1); c706: 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 } } c70a: ff 91 pop r31 c70c: ef 91 pop r30 c70e: 9f 91 pop r25 c710: 8f 91 pop r24 c712: 7f 91 pop r23 c714: 6f 91 pop r22 c716: 4f 91 pop r20 c718: 3f 91 pop r19 c71a: 2f 91 pop r18 c71c: 0f 90 pop r0 c71e: 0b be out 0x3b, r0 ; 59 c720: 0f 90 pop r0 c722: 0f be out 0x3f, r0 ; 63 c724: 0f 90 pop r0 c726: 1f 90 pop r1 c728: 18 95 reti (void)(*(char *)UDR1); } else { // Read the input register. unsigned char c = UDR1; c72a: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> if (selectedSerialPort == 1) c72e: 80 91 1c 06 lds r24, 0x061C ; 0x80061c c732: 81 30 cpi r24, 0x01 ; 1 c734: 51 f7 brne .-44 ; 0xc70a <__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; c736: 20 91 42 05 lds r18, 0x0542 ; 0x800542 c73a: 30 91 43 05 lds r19, 0x0543 ; 0x800543 c73e: c9 01 movw r24, r18 c740: 01 96 adiw r24, 0x01 ; 1 c742: 8f 77 andi r24, 0x7F ; 127 c744: 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) { c746: 60 91 44 05 lds r22, 0x0544 ; 0x800544 c74a: 70 91 45 05 lds r23, 0x0545 ; 0x800545 c74e: 86 17 cp r24, r22 c750: 97 07 cpc r25, r23 c752: d9 f2 breq .-74 ; 0xc70a <__vector_36+0x2c> rx_buffer.buffer[rx_buffer.head] = c; c754: 2e 53 subi r18, 0x3E ; 62 c756: 3b 4f sbci r19, 0xFB ; 251 c758: f9 01 movw r30, r18 c75a: 40 83 st Z, r20 rx_buffer.head = i; c75c: 90 93 43 05 sts 0x0543, r25 ; 0x800543 c760: 80 93 42 05 sts 0x0542, r24 ; 0x800542 c764: d2 cf rjmp .-92 ; 0xc70a <__vector_36+0x2c> 0000c766 <__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) { c766: 1f 92 push r1 c768: 0f 92 push r0 c76a: 0f b6 in r0, 0x3f ; 63 c76c: 0f 92 push r0 c76e: 11 24 eor r1, r1 c770: 0b b6 in r0, 0x3b ; 59 c772: 0f 92 push r0 c774: 2f 93 push r18 c776: 3f 93 push r19 c778: 4f 93 push r20 c77a: 6f 93 push r22 c77c: 7f 93 push r23 c77e: 8f 93 push r24 c780: 9f 93 push r25 c782: ef 93 push r30 c784: ff 93 push r31 // Test for a framing error. if (M_UCSRxA & (1< c78a: 84 ff sbrs r24, 4 c78c: 12 c0 rjmp .+36 ; 0xc7b2 <__vector_25+0x4c> { // Characters received with the framing errors will be ignored. // Dummy register read (discard) (void)(*(char *)M_UDRx); c78e: 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 } } c792: ff 91 pop r31 c794: ef 91 pop r30 c796: 9f 91 pop r25 c798: 8f 91 pop r24 c79a: 7f 91 pop r23 c79c: 6f 91 pop r22 c79e: 4f 91 pop r20 c7a0: 3f 91 pop r19 c7a2: 2f 91 pop r18 c7a4: 0f 90 pop r0 c7a6: 0b be out 0x3b, r0 ; 59 c7a8: 0f 90 pop r0 c7aa: 0f be out 0x3f, r0 ; 63 c7ac: 0f 90 pop r0 c7ae: 1f 90 pop r1 c7b0: 18 95 reti (void)(*(char *)M_UDRx); } else { // Read the input register. unsigned char c = M_UDRx; c7b2: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> if (selectedSerialPort == 0) c7b6: 80 91 1c 06 lds r24, 0x061C ; 0x80061c c7ba: 81 11 cpse r24, r1 c7bc: ea cf rjmp .-44 ; 0xc792 <__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; c7be: 20 91 42 05 lds r18, 0x0542 ; 0x800542 c7c2: 30 91 43 05 lds r19, 0x0543 ; 0x800543 c7c6: c9 01 movw r24, r18 c7c8: 01 96 adiw r24, 0x01 ; 1 c7ca: 8f 77 andi r24, 0x7F ; 127 c7cc: 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) { c7ce: 60 91 44 05 lds r22, 0x0544 ; 0x800544 c7d2: 70 91 45 05 lds r23, 0x0545 ; 0x800545 c7d6: 86 17 cp r24, r22 c7d8: 97 07 cpc r25, r23 c7da: d9 f2 breq .-74 ; 0xc792 <__vector_25+0x2c> rx_buffer.buffer[rx_buffer.head] = c; c7dc: 2e 53 subi r18, 0x3E ; 62 c7de: 3b 4f sbci r19, 0xFB ; 251 c7e0: f9 01 movw r30, r18 c7e2: 40 83 st Z, r20 rx_buffer.head = i; c7e4: 90 93 43 05 sts 0x0543, r25 ; 0x800543 c7e8: 80 93 42 05 sts 0x0542, r24 ; 0x800542 c7ec: d2 cf rjmp .-92 ; 0xc792 <__vector_25+0x2c> 0000c7ee : /// 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)); c7ee: 80 e1 ldi r24, 0x10 ; 16 c7f0: e1 e6 ldi r30, 0x61 ; 97 c7f2: f2 e1 ldi r31, 0x12 ; 18 c7f4: a0 e9 ldi r26, 0x90 ; 144 c7f6: b2 e0 ldi r27, 0x02 ; 2 c7f8: 01 90 ld r0, Z+ c7fa: 0d 92 st X+, r0 c7fc: 8a 95 dec r24 c7fe: e1 f7 brne .-8 ; 0xc7f8 saved_feedmultiply2 = feedmultiply; //save feedmultiply c800: 80 91 8e 02 lds r24, 0x028E ; 0x80028e c804: 90 91 8f 02 lds r25, 0x028F ; 0x80028f c808: 90 93 60 12 sts 0x1260, r25 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.495+0x1> c80c: 80 93 5f 12 sts 0x125F, r24 ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.495> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); c810: 80 91 5d 12 lds r24, 0x125D ; 0x80125d c814: 90 91 5e 12 lds r25, 0x125E ; 0x80125e c818: 90 93 5c 12 sts 0x125C, r25 ; 0x80125c c81c: 80 93 5b 12 sts 0x125B, r24 ; 0x80125b saved_bed_temperature = (uint8_t)degTargetBed(); c820: 80 91 59 12 lds r24, 0x1259 ; 0x801259 c824: 80 93 58 12 sts 0x1258, r24 ; 0x801258 saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; c828: 80 91 57 12 lds r24, 0x1257 ; 0x801257 c82c: 83 fb bst r24, 3 c82e: 88 27 eor r24, r24 c830: 80 f9 bld r24, 0 c832: 80 93 56 12 sts 0x1256, r24 ; 0x801256 saved_fan_speed = fanSpeed; c836: 80 91 55 12 lds r24, 0x1255 ; 0x801255 c83a: 80 93 54 12 sts 0x1254, r24 ; 0x801254 isPartialBackupAvailable = true; } c83e: 08 95 ret 0000c840 <_GLOBAL__sub_D_card>: while(!lcd_clicked()) { delay_keep_alive(0); } KEEPALIVE_STATE(busy_state_backup); } c840: cf 93 push r28 c842: df 93 push r29 //------------------------------------------------------------------------------ /** * \class SdFile * \brief SdBaseFile with Print. */ class SdFile : public SdBaseFile/*, public Print*/ { c844: 87 e6 ldi r24, 0x67 ; 103 c846: 96 e1 ldi r25, 0x16 ; 22 c848: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 #ifdef SDSUPPORT #define MAX_DIR_DEPTH 6 #include "SdFile.h" class CardReader c84c: 85 ea ldi r24, 0xA5 ; 165 c84e: 94 e1 ldi r25, 0x14 ; 20 c850: 89 2b or r24, r25 c852: 51 f0 breq .+20 ; 0xc868 <_GLOBAL__sub_D_card+0x28> c854: c7 e7 ldi r28, 0x77 ; 119 c856: d5 e1 ldi r29, 0x15 ; 21 c858: a3 97 sbiw r28, 0x23 ; 35 c85a: ce 01 movw r24, r28 c85c: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 c860: 84 e1 ldi r24, 0x14 ; 20 c862: c5 3a cpi r28, 0xA5 ; 165 c864: d8 07 cpc r29, r24 c866: c1 f7 brne .-16 ; 0xc858 <_GLOBAL__sub_D_card+0x18> c868: 82 e8 ldi r24, 0x82 ; 130 c86a: 94 e1 ldi r25, 0x14 ; 20 c86c: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 c870: 8d e5 ldi r24, 0x5D ; 93 c872: 94 e1 ldi r25, 0x14 ; 20 c874: df 91 pop r29 c876: cf 91 pop r28 c878: 0c 94 fc 79 jmp 0xf3f8 ; 0xf3f8 0000c87c : print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; } void load_filament_final_feed() { c87c: cf 93 push r28 c87e: df 93 push r29 current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; c880: c1 e6 ldi r28, 0x61 ; 97 c882: d2 e1 ldi r29, 0x12 ; 18 c884: 20 e0 ldi r18, 0x00 ; 0 c886: 30 e0 ldi r19, 0x00 ; 0 c888: 48 ec ldi r20, 0xC8 ; 200 c88a: 51 e4 ldi r21, 0x41 ; 65 c88c: 6c 85 ldd r22, Y+12 ; 0x0c c88e: 7d 85 ldd r23, Y+13 ; 0x0d c890: 8e 85 ldd r24, Y+14 ; 0x0e c892: 9f 85 ldd r25, Y+15 ; 0x0f c894: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> c898: 6c 87 std Y+12, r22 ; 0x0c c89a: 7d 87 std Y+13, r23 ; 0x0d c89c: 8e 87 std Y+14, r24 ; 0x0e c89e: 9f 87 std Y+15, r25 ; 0x0f plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c8a0: 63 e3 ldi r22, 0x33 ; 51 c8a2: 73 e3 ldi r23, 0x33 ; 51 c8a4: 83 e5 ldi r24, 0x53 ; 83 c8a6: 90 e4 ldi r25, 0x40 ; 64 } c8a8: df 91 pop r29 c8aa: cf 91 pop r28 } void load_filament_final_feed() { current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED; plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FINAL); c8ac: 0d 94 0d 4a jmp 0x2941a ; 0x2941a 0000c8b0 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); c8b0: 60 e0 ldi r22, 0x00 ; 0 c8b2: 85 ea ldi r24, 0xA5 ; 165 c8b4: 9f e0 ldi r25, 0x0F ; 15 c8b6: 0f 94 a5 a4 call 0x3494a ; 0x3494a c8ba: 60 e0 ldi r22, 0x00 ; 0 c8bc: 8f e7 ldi r24, 0x7F ; 127 c8be: 9c e0 ldi r25, 0x0C ; 12 c8c0: 0f 94 a5 a4 call 0x3494a ; 0x3494a // 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; c8c4: 80 e0 ldi r24, 0x00 ; 0 c8c6: 90 e0 ldi r25, 0x00 ; 0 c8c8: a0 e8 ldi r26, 0x80 ; 128 c8ca: bf eb ldi r27, 0xBF ; 191 c8cc: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e c8d0: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f c8d4: a0 93 80 02 sts 0x0280, r26 ; 0x800280 c8d8: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; c8dc: 82 e0 ldi r24, 0x02 ; 2 c8de: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; c8e2: 10 92 73 12 sts 0x1273, r1 ; 0x801273 } c8e6: 08 95 ret 0000c8e8 : enquecommandf_P(MSG_M23, filename); } void restore_extruder_temperature_from_ram() { if ((uint16_t)degTargetHotend(active_extruder) != saved_extruder_temperature) c8e8: 80 91 5b 12 lds r24, 0x125B ; 0x80125b c8ec: 90 91 5c 12 lds r25, 0x125C ; 0x80125c c8f0: 20 91 5d 12 lds r18, 0x125D ; 0x80125d c8f4: 30 91 5e 12 lds r19, 0x125E ; 0x80125e c8f8: 28 17 cp r18, r24 c8fa: 39 07 cpc r19, r25 c8fc: 71 f0 breq .+28 ; 0xc91a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; c8fe: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e c902: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d { setTargetHotend(saved_extruder_temperature); heating_status = HeatingStatus::EXTRUDER_HEATING; c906: 81 e0 ldi r24, 0x01 ; 1 c908: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb wait_for_heater(_millis(), active_extruder); c90c: 0f 94 89 0b call 0x21712 ; 0x21712 c910: 0f 94 23 74 call 0x2e846 ; 0x2e846 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; c914: 82 e0 ldi r24, 0x02 ; 2 c916: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb } } c91a: 08 95 ret 0000c91c : saved_fan_speed = fanSpeed; isPartialBackupAvailable = true; } void __attribute__((noinline)) refresh_saved_feedrate_multiplier_in_ram() { if (!saved_printing) { c91c: 80 91 73 12 lds r24, 0x1273 ; 0x801273 c920: 88 23 and r24, r24 c922: 41 f0 breq .+16 ; 0xc934 // There is no saved print, therefore nothing to refresh return; } saved_feedmultiply2 = feedmultiply; c924: 80 91 8e 02 lds r24, 0x028E ; 0x80028e c928: 90 91 8f 02 lds r25, 0x028F ; 0x80028f c92c: 90 93 60 12 sts 0x1260, r25 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.495+0x1> c930: 80 93 5f 12 sts 0x125F, r24 ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.495> } c934: 08 95 ret 0000c936 : if (extrudemultiply != 100) out *= float(extrudemultiply) * 0.01f; return out; } void calculate_extruder_multipliers() { c936: cf 92 push r12 c938: df 92 push r13 c93a: ef 92 push r14 c93c: ff 92 push r15 extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); c93e: c0 90 ff 0d lds r12, 0x0DFF ; 0x800dff c942: d0 90 00 0e lds r13, 0x0E00 ; 0x800e00 c946: e0 90 01 0e lds r14, 0x0E01 ; 0x800e01 c94a: 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) { c94e: 80 91 fe 0d lds r24, 0x0DFE ; 0x800dfe c952: 88 23 and r24, r24 c954: 09 f4 brne .+2 ; 0xc958 c956: 4e c0 rjmp .+156 ; 0xc9f4 c958: 20 e0 ldi r18, 0x00 ; 0 c95a: 30 e0 ldi r19, 0x00 ; 0 c95c: a9 01 movw r20, r18 c95e: c7 01 movw r24, r14 c960: b6 01 movw r22, r12 c962: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> c966: 18 16 cp r1, r24 c968: 0c f0 brlt .+2 ; 0xc96c c96a: 44 c0 rjmp .+136 ; 0xc9f4 float area = M_PI * diameter * diameter * 0.25; c96c: 2b ed ldi r18, 0xDB ; 219 c96e: 3f e0 ldi r19, 0x0F ; 15 c970: 49 e4 ldi r20, 0x49 ; 73 c972: 50 e4 ldi r21, 0x40 ; 64 c974: c7 01 movw r24, r14 c976: b6 01 movw r22, r12 c978: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> c97c: a7 01 movw r20, r14 c97e: 96 01 movw r18, r12 c980: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> c984: 20 e0 ldi r18, 0x00 ; 0 c986: 30 e0 ldi r19, 0x00 ; 0 c988: 40 e8 ldi r20, 0x80 ; 128 c98a: 5e e3 ldi r21, 0x3E ; 62 c98c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> c990: 9b 01 movw r18, r22 c992: ac 01 movw r20, r24 out = 1.f / area; c994: 60 e0 ldi r22, 0x00 ; 0 c996: 70 e0 ldi r23, 0x00 ; 0 c998: 80 e8 ldi r24, 0x80 ; 128 c99a: 9f e3 ldi r25, 0x3F ; 63 c99c: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> c9a0: 6b 01 movw r12, r22 c9a2: 7c 01 movw r14, r24 } if (extrudemultiply != 100) c9a4: 60 91 75 02 lds r22, 0x0275 ; 0x800275 c9a8: 70 91 76 02 lds r23, 0x0276 ; 0x800276 c9ac: 64 36 cpi r22, 0x64 ; 100 c9ae: 71 05 cpc r23, r1 c9b0: a1 f0 breq .+40 ; 0xc9da out *= float(extrudemultiply) * 0.01f; c9b2: 07 2e mov r0, r23 c9b4: 00 0c add r0, r0 c9b6: 88 0b sbc r24, r24 c9b8: 99 0b sbc r25, r25 c9ba: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> c9be: 2a e0 ldi r18, 0x0A ; 10 c9c0: 37 ed ldi r19, 0xD7 ; 215 c9c2: 43 e2 ldi r20, 0x23 ; 35 c9c4: 5c e3 ldi r21, 0x3C ; 60 c9c6: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> c9ca: 9b 01 movw r18, r22 c9cc: ac 01 movw r20, r24 c9ce: c7 01 movw r24, r14 c9d0: b6 01 movw r22, r12 c9d2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> c9d6: 6b 01 movw r12, r22 c9d8: 7c 01 movw r14, r24 return out; } void calculate_extruder_multipliers() { extruder_multiplier[0] = calculate_extruder_multiplier(cs.filament_size[0]); c9da: c0 92 10 02 sts 0x0210, r12 ; 0x800210 c9de: d0 92 11 02 sts 0x0211, r13 ; 0x800211 c9e2: e0 92 12 02 sts 0x0212, r14 ; 0x800212 c9e6: 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 } c9ea: ff 90 pop r15 c9ec: ef 90 pop r14 c9ee: df 90 pop r13 c9f0: cf 90 pop r12 c9f2: 08 95 ret MMU2::mmu2.ClearTMCFailures(); // not stored into EEPROM } } float calculate_extruder_multiplier(float diameter) { float out = 1.f; c9f4: c1 2c mov r12, r1 c9f6: d1 2c mov r13, r1 c9f8: 80 e8 ldi r24, 0x80 ; 128 c9fa: e8 2e mov r14, r24 c9fc: 8f e3 ldi r24, 0x3F ; 63 c9fe: f8 2e mov r15, r24 ca00: d1 cf rjmp .-94 ; 0xc9a4 0000ca02 : } } #endif //FAST_PWM_FAN void save_statistics() { ca02: 8f 92 push r8 ca04: 9f 92 push r9 ca06: af 92 push r10 ca08: bf 92 push r11 ca0a: cf 92 push r12 ca0c: df 92 push r13 ca0e: ef 92 push r14 ca10: ff 92 push r15 uint32_t _previous_filament = eeprom_init_default_dword((uint32_t *)EEPROM_FILAMENTUSED, 0); //_previous_filament unit: meter ca12: 81 ef ldi r24, 0xF1 ; 241 ca14: 9f e0 ldi r25, 0x0F ; 15 ca16: 0f 94 76 6c call 0x2d8ec ; 0x2d8ec ca1a: 6b 01 movw r12, r22 ca1c: 7c 01 movw r14, r24 uint32_t _previous_time = eeprom_init_default_dword((uint32_t *)EEPROM_TOTALTIME, 0); //_previous_time unit: min ca1e: 8d ee ldi r24, 0xED ; 237 ca20: 9f e0 ldi r25, 0x0F ; 15 ca22: 0f 94 76 6c call 0x2d8ec ; 0x2d8ec ca26: 4b 01 movw r8, r22 ca28: 5c 01 movw r10, r24 uint32_t time_minutes = print_job_timer.duration() / 60; ca2a: 0f 94 06 15 call 0x22a0c ; 0x22a0c ca2e: 2c e3 ldi r18, 0x3C ; 60 ca30: 30 e0 ldi r19, 0x00 ; 0 ca32: 40 e0 ldi r20, 0x00 ; 0 ca34: 50 e0 ldi r21, 0x00 ; 0 ca36: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> eeprom_update_dword_notify((uint32_t *)EEPROM_TOTALTIME, _previous_time + time_minutes); // EEPROM_TOTALTIME unit: min ca3a: ba 01 movw r22, r20 ca3c: a9 01 movw r20, r18 ca3e: 48 0d add r20, r8 ca40: 59 1d adc r21, r9 ca42: 6a 1d adc r22, r10 ca44: 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); ca46: 8d ee ldi r24, 0xED ; 237 ca48: 9f e0 ldi r25, 0x0F ; 15 ca4a: 0f 94 b7 a4 call 0x3496e ; 0x3496e eeprom_update_dword_notify((uint32_t *)EEPROM_FILAMENTUSED, _previous_filament + (total_filament_used / 1000)); ca4e: 60 91 17 06 lds r22, 0x0617 ; 0x800617 ca52: 70 91 18 06 lds r23, 0x0618 ; 0x800618 ca56: 80 91 19 06 lds r24, 0x0619 ; 0x800619 ca5a: 90 91 1a 06 lds r25, 0x061A ; 0x80061a ca5e: 28 ee ldi r18, 0xE8 ; 232 ca60: 33 e0 ldi r19, 0x03 ; 3 ca62: 40 e0 ldi r20, 0x00 ; 0 ca64: 50 e0 ldi r21, 0x00 ; 0 ca66: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> ca6a: ba 01 movw r22, r20 ca6c: a9 01 movw r20, r18 ca6e: 4c 0d add r20, r12 ca70: 5d 1d adc r21, r13 ca72: 6e 1d adc r22, r14 ca74: 7f 1d adc r23, r15 ca76: 81 ef ldi r24, 0xF1 ; 241 ca78: 9f e0 ldi r25, 0x0F ; 15 ca7a: 0f 94 b7 a4 call 0x3496e ; 0x3496e print_job_timer.reset(); ca7e: 0f 94 a3 16 call 0x22d46 ; 0x22d46 total_filament_used = 0; ca82: 10 92 17 06 sts 0x0617, r1 ; 0x800617 ca86: 10 92 18 06 sts 0x0618, r1 ; 0x800618 ca8a: 10 92 19 06 sts 0x0619, r1 ; 0x800619 ca8e: 10 92 1a 06 sts 0x061A, r1 ; 0x80061a if (MMU2::mmu2.Enabled()) { ca92: 80 91 01 13 lds r24, 0x1301 ; 0x801301 ca96: 81 30 cpi r24, 0x01 ; 1 ca98: 81 f4 brne .+32 ; 0xcaba eeprom_add_dword((uint32_t *)EEPROM_MMU_MATERIAL_CHANGES, MMU2::mmu2.ToolChangeCounter()); ca9a: 60 91 05 13 lds r22, 0x1305 ; 0x801305 ca9e: 70 91 06 13 lds r23, 0x1306 ; 0x801306 caa2: 90 e0 ldi r25, 0x00 ; 0 caa4: 80 e0 ldi r24, 0x00 ; 0 caa6: 0f 94 5e 6c call 0x2d8bc ; 0x2d8bc /// @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; }; caaa: 10 92 06 13 sts 0x1306, r1 ; 0x801306 caae: 10 92 05 13 sts 0x1305, r1 ; 0x801305 inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } inline void ClearTMCFailures() { tmcFailures = 0; } cab2: 10 92 08 13 sts 0x1308, r1 ; 0x801308 cab6: 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 } } caba: ff 90 pop r15 cabc: ef 90 pop r14 cabe: df 90 pop r13 cac0: cf 90 pop r12 cac2: bf 90 pop r11 cac4: af 90 pop r10 cac6: 9f 90 pop r9 cac8: 8f 90 pop r8 caca: 08 95 ret 0000cacc : } #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); cacc: 80 91 55 12 lds r24, 0x1255 ; 0x801255 cad0: 1f 92 push r1 cad2: 8f 93 push r24 cad4: 80 91 3e 03 lds r24, 0x033E ; 0x80033e cad8: 1f 92 push r1 cada: 8f 93 push r24 cadc: e7 eb ldi r30, 0xB7 ; 183 cade: f3 e0 ldi r31, 0x03 ; 3 cae0: 42 81 ldd r20, Z+2 ; 0x02 cae2: 53 81 ldd r21, Z+3 ; 0x03 cae4: 2c e3 ldi r18, 0x3C ; 60 cae6: 24 9f mul r18, r20 cae8: c0 01 movw r24, r0 caea: 25 9f mul r18, r21 caec: 90 0d add r25, r0 caee: 11 24 eor r1, r1 caf0: 9f 93 push r25 caf2: 8f 93 push r24 caf4: 40 81 ld r20, Z caf6: 51 81 ldd r21, Z+1 ; 0x01 caf8: 24 9f mul r18, r20 cafa: c0 01 movw r24, r0 cafc: 25 9f mul r18, r21 cafe: 90 0d add r25, r0 cb00: 11 24 eor r1, r1 cb02: 9f 93 push r25 cb04: 8f 93 push r24 cb06: 86 ee ldi r24, 0xE6 ; 230 cb08: 94 e6 ldi r25, 0x64 ; 100 cb0a: 9f 93 push r25 cb0c: 8f 93 push r24 cb0e: 0f 94 43 a3 call 0x34686 ; 0x34686 cb12: 8d b7 in r24, 0x3d ; 61 cb14: 9e b7 in r25, 0x3e ; 62 cb16: 0a 96 adiw r24, 0x0a ; 10 cb18: 0f b6 in r0, 0x3f ; 63 cb1a: f8 94 cli cb1c: 9e bf out 0x3e, r25 ; 62 cb1e: 0f be out 0x3f, r0 ; 63 cb20: 8d bf out 0x3d, r24 ; 61 } cb22: 08 95 ret 0000cb24 : endstops_hit_on_purpose(); } void refresh_cmd_timeout(void) { previous_millis_cmd.start(); cb24: 88 e4 ldi r24, 0x48 ; 72 cb26: 93 e0 ldi r25, 0x03 ; 3 cb28: 0d 94 e0 0d jmp 0x21bc0 ; 0x21bc0 ::start()> 0000cb2c : } } #endif //TMC2130 float __attribute__((noinline)) get_feedrate_mm_s(const float feedrate_mm_min) { return feedrate_mm_min / 60.f; cb2c: 20 e0 ldi r18, 0x00 ; 0 cb2e: 30 e0 ldi r19, 0x00 ; 0 cb30: 40 e7 ldi r20, 0x70 ; 112 cb32: 52 e4 ldi r21, 0x42 ; 66 cb34: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> } cb38: 08 95 ret 0000cb3a : } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; cb3a: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.385> //! @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; cb3e: 40 91 39 03 lds r20, 0x0339 ; 0x800339 cb42: 50 91 3a 03 lds r21, 0x033A ; 0x80033a cb46: 60 91 3b 03 lds r22, 0x033B ; 0x80033b cb4a: 70 91 3c 03 lds r23, 0x033C ; 0x80033c cb4e: 40 93 7a 02 sts 0x027A, r20 ; 0x80027a cb52: 50 93 7b 02 sts 0x027B, r21 ; 0x80027b cb56: 60 93 7c 02 sts 0x027C, r22 ; 0x80027c cb5a: 70 93 7d 02 sts 0x027D, r23 ; 0x80027d feedmultiply = original_feedmultiply; cb5e: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f cb62: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); cb66: 88 e4 ldi r24, 0x48 ; 72 cb68: 93 e0 ldi r25, 0x03 ; 3 cb6a: 0d 94 e0 0d jmp 0x21bc0 ; 0x21bc0 ::start()> 0000cb6e : 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) { cb6e: 1f 93 push r17 cb70: cf 93 push r28 cb72: df 93 push r29 cb74: 18 2f mov r17, r24 saved_feedrate = feedrate; cb76: 80 91 7a 02 lds r24, 0x027A ; 0x80027a cb7a: 90 91 7b 02 lds r25, 0x027B ; 0x80027b cb7e: a0 91 7c 02 lds r26, 0x027C ; 0x80027c cb82: b0 91 7d 02 lds r27, 0x027D ; 0x80027d cb86: 80 93 39 03 sts 0x0339, r24 ; 0x800339 cb8a: 90 93 3a 03 sts 0x033A, r25 ; 0x80033a cb8e: a0 93 3b 03 sts 0x033B, r26 ; 0x80033b cb92: b0 93 3c 03 sts 0x033C, r27 ; 0x80033c int l_feedmultiply = feedmultiply; cb96: c0 91 8e 02 lds r28, 0x028E ; 0x80028e cb9a: d0 91 8f 02 lds r29, 0x028F ; 0x80028f feedmultiply = 100; cb9e: 84 e6 ldi r24, 0x64 ; 100 cba0: 90 e0 ldi r25, 0x00 ; 0 cba2: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f cba6: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e previous_millis_cmd.start(); cbaa: 88 e4 ldi r24, 0x48 ; 72 cbac: 93 e0 ldi r25, 0x03 ; 3 cbae: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> cbb2: 10 93 77 02 sts 0x0277, r17 ; 0x800277 <_ZL14check_endstops.lto_priv.385> enable_endstops(enable_endstops_now); return l_feedmultiply; } cbb6: ce 01 movw r24, r28 cbb8: df 91 pop r29 cbba: cf 91 pop r28 cbbc: 1f 91 pop r17 cbbe: 08 95 ret 0000cbc0 : 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) { cbc0: cf 92 push r12 cbc2: df 92 push r13 cbc4: ef 92 push r14 cbc6: ff 92 push r15 cbc8: 0f 93 push r16 cbca: 1f 93 push r17 cbcc: cf 93 push r28 cbce: 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); cbd0: 90 e0 ldi r25, 0x00 ; 0 cbd2: ec 01 movw r28, r24 cbd4: cc 0f add r28, r28 cbd6: dd 1f adc r29, r29 cbd8: cc 0f add r28, r28 cbda: dd 1f adc r29, r29 cbdc: fe 01 movw r30, r28 cbde: e1 5b subi r30, 0xB1 ; 177 cbe0: 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); cbe2: 25 91 lpm r18, Z+ cbe4: 35 91 lpm r19, Z+ cbe6: 45 91 lpm r20, Z+ cbe8: 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]; cbea: fe 01 movw r30, r28 cbec: e1 54 subi r30, 0x41 ; 65 cbee: f2 4f sbci r31, 0xF2 ; 242 cbf0: c0 80 ld r12, Z cbf2: d1 80 ldd r13, Z+1 ; 0x01 cbf4: e2 80 ldd r14, Z+2 ; 0x02 cbf6: f3 80 ldd r15, Z+3 ; 0x03 cbf8: 8e 01 movw r16, r28 cbfa: 0f 59 subi r16, 0x9F ; 159 cbfc: 1d 4e sbci r17, 0xED ; 237 cbfe: c7 01 movw r24, r14 cc00: b6 01 movw r22, r12 cc02: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> cc06: f8 01 movw r30, r16 cc08: 60 83 st Z, r22 cc0a: 71 83 std Z+1, r23 ; 0x01 cc0c: 82 83 std Z+2, r24 ; 0x02 cc0e: 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); cc10: fe 01 movw r30, r28 cc12: ed 5b subi r30, 0xBD ; 189 cc14: 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); cc16: 25 91 lpm r18, Z+ cc18: 35 91 lpm r19, Z+ cc1a: 45 91 lpm r20, Z+ cc1c: 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]; cc1e: 8e 01 movw r16, r28 cc20: 0c 5d subi r16, 0xDC ; 220 cc22: 1d 4f sbci r17, 0xFD ; 253 cc24: c7 01 movw r24, r14 cc26: b6 01 movw r22, r12 cc28: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> cc2c: f8 01 movw r30, r16 cc2e: 60 83 st Z, r22 cc30: 71 83 std Z+1, r23 ; 0x01 cc32: 82 83 std Z+2, r24 ; 0x02 cc34: 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); cc36: fe 01 movw r30, r28 cc38: e9 5c subi r30, 0xC9 ; 201 cc3a: 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); cc3c: 25 91 lpm r18, Z+ cc3e: 35 91 lpm r19, Z+ cc40: 45 91 lpm r20, Z+ cc42: 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]; cc44: c8 5e subi r28, 0xE8 ; 232 cc46: dd 4f sbci r29, 0xFD ; 253 cc48: c7 01 movw r24, r14 cc4a: b6 01 movw r22, r12 cc4c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> cc50: 68 83 st Y, r22 cc52: 79 83 std Y+1, r23 ; 0x01 cc54: 8a 83 std Y+2, r24 ; 0x02 cc56: 9b 83 std Y+3, r25 ; 0x03 } cc58: df 91 pop r29 cc5a: cf 91 pop r28 cc5c: 1f 91 pop r17 cc5e: 0f 91 pop r16 cc60: ff 90 pop r15 cc62: ef 90 pop r14 cc64: df 90 pop r13 cc66: cf 90 pop r12 cc68: 08 95 ret 0000cc6a : cc6a: 40 e0 ldi r20, 0x00 ; 0 cc6c: 50 e0 ldi r21, 0x00 ; 0 cc6e: ba 01 movw r22, r20 cc70: 8d ee ldi r24, 0xED ; 237 cc72: 9f e0 ldi r25, 0x0F ; 15 cc74: 0f 94 b7 a4 call 0x3496e ; 0x3496e cc78: 40 e0 ldi r20, 0x00 ; 0 cc7a: 50 e0 ldi r21, 0x00 ; 0 cc7c: ba 01 movw r22, r20 cc7e: 81 ef ldi r24, 0xF1 ; 241 cc80: 9f e0 ldi r25, 0x0F ; 15 cc82: 0f 94 b7 a4 call 0x3496e ; 0x3496e 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(); cc86: 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); cc8a: 70 e0 ldi r23, 0x00 ; 0 cc8c: 60 e0 ldi r22, 0x00 ; 0 cc8e: 85 e0 ldi r24, 0x05 ; 5 cc90: 9f e0 ldi r25, 0x0F ; 15 cc92: 0f 94 c3 a4 call 0x34986 ; 0x34986 cc96: 70 e0 ldi r23, 0x00 ; 0 cc98: 60 e0 ldi r22, 0x00 ; 0 cc9a: 83 e0 ldi r24, 0x03 ; 3 cc9c: 9f e0 ldi r25, 0x0F ; 15 cc9e: 0f 94 c3 a4 call 0x34986 ; 0x34986 cca2: 70 e0 ldi r23, 0x00 ; 0 cca4: 60 e0 ldi r22, 0x00 ; 0 cca6: 81 e0 ldi r24, 0x01 ; 1 cca8: 9f e0 ldi r25, 0x0F ; 15 ccaa: 0f 94 c3 a4 call 0x34986 ; 0x34986 ccae: 70 e0 ldi r23, 0x00 ; 0 ccb0: 60 e0 ldi r22, 0x00 ; 0 ccb2: 8f ef ldi r24, 0xFF ; 255 ccb4: 9e e0 ldi r25, 0x0E ; 14 ccb6: 0f 94 c3 a4 call 0x34986 ; 0x34986 ccba: 70 e0 ldi r23, 0x00 ; 0 ccbc: 60 e0 ldi r22, 0x00 ; 0 ccbe: 83 ed ldi r24, 0xD3 ; 211 ccc0: 9e e0 ldi r25, 0x0E ; 14 ccc2: 0f 94 c3 a4 call 0x34986 ; 0x34986 ccc6: 70 e0 ldi r23, 0x00 ; 0 ccc8: 60 e0 ldi r22, 0x00 ; 0 ccca: 80 ed ldi r24, 0xD0 ; 208 cccc: 9e e0 ldi r25, 0x0E ; 14 ccce: 0f 94 c3 a4 call 0x34986 ; 0x34986 if (previous_value != value) { eeprom_dword_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_dword(dst, value); ccd2: 40 e0 ldi r20, 0x00 ; 0 ccd4: 50 e0 ldi r21, 0x00 ; 0 ccd6: ba 01 movw r22, r20 ccd8: 88 ea ldi r24, 0xA8 ; 168 ccda: 9c e0 ldi r25, 0x0C ; 12 ccdc: 0d 94 b7 a4 jmp 0x3496e ; 0x3496e 0000cce0 : wdt_disable(); } } void softReset(void) { cli(); cce0: 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" ); cce2: 88 e1 ldi r24, 0x18 ; 24 cce4: 9f e0 ldi r25, 0x0F ; 15 cce6: 0f b6 in r0, 0x3f ; 63 cce8: f8 94 cli ccea: a8 95 wdr ccec: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> ccf0: 0f be out 0x3f, r0 ; 63 ccf2: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> ccf6: ff cf rjmp .-2 ; 0xccf6 0000ccf8 : } #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); ccf8: 85 ea ldi r24, 0xA5 ; 165 ccfa: 9f e0 ldi r25, 0x0F ; 15 ccfc: 0f 94 81 a4 call 0x34902 ; 0x34902 cd00: 91 e0 ldi r25, 0x01 ; 1 cd02: 81 11 cpse r24, r1 cd04: 01 c0 rjmp .+2 ; 0xcd08 cd06: 90 e0 ldi r25, 0x00 ; 0 } cd08: 89 2f mov r24, r25 cd0a: 08 95 ret 0000cd0c : 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(); cd0c: 80 91 cd 03 lds r24, 0x03CD ; 0x8003cd cd10: 81 11 cpse r24, r1 cd12: 06 c0 rjmp .+12 ; 0xcd20 cd14: 81 e0 ldi r24, 0x01 ; 1 cd16: 90 91 8b 03 lds r25, 0x038B ; 0x80038b cd1a: 92 30 cpi r25, 0x02 ; 2 cd1c: 09 f0 breq .+2 ; 0xcd20 cd1e: 80 e0 ldi r24, 0x00 ; 0 } cd20: 08 95 ret 0000cd22 : WRITE(SUICIDE_PIN, LOW); #endif } bool __attribute__((noinline)) printJobOngoing() { return (IS_SD_PRINTING || usb_timer.running() || print_job_timer.isRunning()); cd22: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 cd26: 81 11 cpse r24, r1 cd28: 0a c0 rjmp .+20 ; 0xcd3e cd2a: 80 91 42 12 lds r24, 0x1242 ; 0x801242 cd2e: 81 11 cpse r24, r1 cd30: 06 c0 rjmp .+12 ; 0xcd3e cd32: 81 e0 ldi r24, 0x01 ; 1 cd34: 90 91 8b 03 lds r25, 0x038B ; 0x80038b cd38: 91 30 cpi r25, 0x01 ; 1 cd3a: 09 f0 breq .+2 ; 0xcd3e cd3c: 80 e0 ldi r24, 0x00 ; 0 } cd3e: 08 95 ret 0000cd40 : && !mesh_bed_leveling_flag && !homing_flag && e_active(); } bool __attribute__((noinline)) babystep_allowed() { cd40: cf 93 push r28 cd42: df 93 push r29 return ( !homing_flag cd44: c0 91 71 12 lds r28, 0x1271 ; 0x801271 && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cd48: c1 11 cpse r28, r1 cd4a: 1f c0 rjmp .+62 ; 0xcd8a && e_active(); } bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag cd4c: 80 91 72 12 lds r24, 0x1272 ; 0x801272 cd50: 81 11 cpse r24, r1 cd52: 1c c0 rjmp .+56 ; 0xcd8c && !printingIsPaused() cd54: 0e 94 86 66 call 0xcd0c ; 0xcd0c cd58: 81 11 cpse r24, r1 cd5a: 18 c0 rjmp .+48 ; 0xcd8c && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cd5c: d0 91 5e 0d lds r29, 0x0D5E ; 0x800d5e cd60: d4 30 cpi r29, 0x04 ; 4 cd62: 61 f4 brne .+24 ; 0xcd7c cd64: 80 91 5d 12 lds r24, 0x125D ; 0x80125d cd68: 90 91 5e 12 lds r25, 0x125E ; 0x80125e cd6c: 89 2b or r24, r25 cd6e: 91 f4 brne .+36 ; 0xcd94 cd70: 80 91 59 12 lds r24, 0x1259 ; 0x801259 cd74: 90 91 5a 12 lds r25, 0x125A ; 0x80125a cd78: 89 2b or r24, r25 cd7a: 61 f4 brne .+24 ; 0xcd94 || printJobOngoing() cd7c: 0e 94 91 66 call 0xcd22 ; 0xcd22 cd80: c8 2f mov r28, r24 cd82: 81 11 cpse r24, r1 cd84: 03 c0 rjmp .+6 ; 0xcd8c || lcd_commands_type == LcdCommands::Idle cd86: c1 e0 ldi r28, 0x01 ; 1 cd88: 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) cd8a: c0 e0 ldi r28, 0x00 ; 0 || printJobOngoing() || lcd_commands_type == LcdCommands::Idle ) ); } cd8c: 8c 2f mov r24, r28 cd8e: df 91 pop r29 cd90: cf 91 pop r28 cd92: 08 95 ret bool __attribute__((noinline)) babystep_allowed() { return ( !homing_flag && !mesh_bed_leveling_flag && !printingIsPaused() && ((lcd_commands_type == LcdCommands::Layer1Cal && CHECK_ALL_HEATERS) cd94: c1 e0 ldi r28, 0x01 ; 1 cd96: fa cf rjmp .-12 ; 0xcd8c 0000cd98 : ) ); } bool __attribute__((noinline)) babystep_allowed_strict() { return ( babystep_allowed() && current_position[Z_AXIS] < Z_HEIGHT_HIDE_LIVE_ADJUST_MENU); cd98: 0e 94 a0 66 call 0xcd40 ; 0xcd40 cd9c: 88 23 and r24, r24 cd9e: 89 f0 breq .+34 ; 0xcdc2 cda0: 20 e0 ldi r18, 0x00 ; 0 cda2: 30 e0 ldi r19, 0x00 ; 0 cda4: 40 e0 ldi r20, 0x00 ; 0 cda6: 50 e4 ldi r21, 0x40 ; 64 cda8: 60 91 69 12 lds r22, 0x1269 ; 0x801269 cdac: 70 91 6a 12 lds r23, 0x126A ; 0x80126a cdb0: 80 91 6b 12 lds r24, 0x126B ; 0x80126b cdb4: 90 91 6c 12 lds r25, 0x126C ; 0x80126c cdb8: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> cdbc: 88 1f adc r24, r24 cdbe: 88 27 eor r24, r24 cdc0: 88 1f adc r24, r24 } cdc2: 08 95 ret 0000cdc4 : bool printingIsPaused() { return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() cdc4: 0e 94 91 66 call 0xcd22 ; 0xcd22 || printingIsPaused() || saved_printing || (lcd_commands_type != LcdCommands::Idle) || MMU2::mmu2.MMU_PRINT_SAVED() || homing_flag || mesh_bed_leveling_flag; cdc8: 81 11 cpse r24, r1 cdca: 18 c0 rjmp .+48 ; 0xcdfc return did_pause_print || print_job_timer.isPaused(); } bool __attribute__((noinline)) printer_active() { return printJobOngoing() || printingIsPaused() cdcc: 0e 94 86 66 call 0xcd0c ; 0xcd0c cdd0: 81 11 cpse r24, r1 cdd2: 14 c0 rjmp .+40 ; 0xcdfc || saved_printing cdd4: 80 91 73 12 lds r24, 0x1273 ; 0x801273 cdd8: 81 11 cpse r24, r1 cdda: 10 c0 rjmp .+32 ; 0xcdfc || (lcd_commands_type != LcdCommands::Idle) cddc: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e cde0: 81 11 cpse r24, r1 cde2: 0b c0 rjmp .+22 ; 0xcdfa || MMU2::mmu2.MMU_PRINT_SAVED() cde4: 80 91 02 13 lds r24, 0x1302 ; 0x801302 cde8: 81 11 cpse r24, r1 cdea: 07 c0 rjmp .+14 ; 0xcdfa || homing_flag cdec: 80 91 71 12 lds r24, 0x1271 ; 0x801271 cdf0: 81 11 cpse r24, r1 cdf2: 04 c0 rjmp .+8 ; 0xcdfc || mesh_bed_leveling_flag; cdf4: 80 91 72 12 lds r24, 0x1272 ; 0x801272 cdf8: 08 95 ret cdfa: 81 e0 ldi r24, 0x01 ; 1 } cdfc: 08 95 ret 0000cdfe : inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); } cdfe: 80 e1 ldi r24, 0x10 ; 16 ce00: e1 e6 ldi r30, 0x61 ; 97 ce02: f2 e1 ldi r31, 0x12 ; 18 ce04: a9 e2 ldi r26, 0x29 ; 41 ce06: b6 e0 ldi r27, 0x06 ; 6 ce08: 01 90 ld r0, Z+ ce0a: 0d 92 st X+, r0 ce0c: 8a 95 dec r24 ce0e: e1 f7 brne .-8 ; 0xce08 ce10: 08 95 ret 0000ce12 : //! //! Internally lcd_update() is called by wait_for_heater(). //! //! @param e_move void restore_print_from_ram_and_continue(float e_move) { ce12: 4f 92 push r4 ce14: 5f 92 push r5 ce16: 6f 92 push r6 ce18: 7f 92 push r7 ce1a: 8f 92 push r8 ce1c: 9f 92 push r9 ce1e: af 92 push r10 ce20: bf 92 push r11 ce22: cf 92 push r12 ce24: df 92 push r13 ce26: ef 92 push r14 ce28: ff 92 push r15 ce2a: 0f 93 push r16 ce2c: 1f 93 push r17 ce2e: cf 93 push r28 ce30: df 93 push r29 ce32: 00 d0 rcall .+0 ; 0xce34 ce34: 00 d0 rcall .+0 ; 0xce36 ce36: 1f 92 push r1 ce38: 1f 92 push r1 ce3a: cd b7 in r28, 0x3d ; 61 ce3c: de b7 in r29, 0x3e ; 62 if (!saved_printing) return; ce3e: 20 91 73 12 lds r18, 0x1273 ; 0x801273 ce42: 22 23 and r18, r18 ce44: 09 f4 brne .+2 ; 0xce48 ce46: 73 c1 rjmp .+742 ; 0xd12e #ifdef FANCHECK // Do not allow resume printing if fans are still not ok if (fan_check_error == EFCE_REPORTED) return; ce48: 20 91 ce 03 lds r18, 0x03CE ; 0x8003ce ce4c: 22 30 cpi r18, 0x02 ; 2 ce4e: 09 f4 brne .+2 ; 0xce52 ce50: 6e c1 rjmp .+732 ; 0xd12e if (fan_check_error == EFCE_FIXED) fan_check_error = EFCE_OK; //reenable serial stream processing if printing from usb ce52: 20 91 ce 03 lds r18, 0x03CE ; 0x8003ce ce56: 21 30 cpi r18, 0x01 ; 1 ce58: 11 f4 brne .+4 ; 0xce5e ce5a: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce ce5e: 2b 01 movw r4, r22 ce60: 3c 01 movw r6, r24 #endif // Make sure fan is turned off fanSpeed = 0; ce62: 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) ce66: 10 91 58 12 lds r17, 0x1258 ; 0x801258 ce6a: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc ce6e: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd ce72: 80 91 be 03 lds r24, 0x03BE ; 0x8003be ce76: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf ce7a: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> ce7e: 61 17 cp r22, r17 ce80: 31 f0 breq .+12 ; 0xce8e resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; ce82: 81 2f mov r24, r17 ce84: 90 e0 ldi r25, 0x00 ; 0 ce86: 90 93 5a 12 sts 0x125A, r25 ; 0x80125a ce8a: 80 93 59 12 sts 0x1259, r24 ; 0x801259 setTargetBed(saved_bed_temperature); restore_extruder_temperature_from_ram(); ce8e: 0e 94 74 64 call 0xc8e8 ; 0xc8e8 // Restore saved fan speed fanSpeed = saved_fan_speed; ce92: 80 91 54 12 lds r24, 0x1254 ; 0x801254 ce96: 80 93 55 12 sts 0x1255, r24 ; 0x801255 axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; ce9a: 90 91 57 12 lds r25, 0x1257 ; 0x801257 ce9e: 80 91 56 12 lds r24, 0x1256 ; 0x801256 cea2: 81 95 neg r24 cea4: 89 27 eor r24, r25 cea6: 88 70 andi r24, 0x08 ; 8 cea8: 89 27 eor r24, r25 ceaa: 80 93 57 12 sts 0x1257, r24 ; 0x801257 float e = saved_pos[E_AXIS] - e_move; ceae: a3 01 movw r20, r6 ceb0: 92 01 movw r18, r4 ceb2: 60 91 9c 02 lds r22, 0x029C ; 0x80029c ceb6: 70 91 9d 02 lds r23, 0x029D ; 0x80029d ceba: 80 91 9e 02 lds r24, 0x029E ; 0x80029e cebe: 90 91 9f 02 lds r25, 0x029F ; 0x80029f cec2: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> cec6: 6d 83 std Y+5, r22 ; 0x05 cec8: 7e 83 std Y+6, r23 ; 0x06 ceca: 8f 83 std Y+7, r24 ; 0x07 cecc: 98 87 std Y+8, r25 ; 0x08 plan_set_e_position(e); cece: ce 01 movw r24, r28 ced0: 05 96 adiw r24, 0x05 ; 5 ced2: 0f 94 65 3a call 0x274ca ; 0x274ca #ifdef FANCHECK fans_check_enabled = false; ced6: 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) ceda: 20 e0 ldi r18, 0x00 ; 0 cedc: 30 e0 ldi r19, 0x00 ; 0 cede: 40 e8 ldi r20, 0x80 ; 128 cee0: 5f eb ldi r21, 0xBF ; 191 cee2: 60 91 90 02 lds r22, 0x0290 ; 0x800290 cee6: 70 91 91 02 lds r23, 0x0291 ; 0x800291 ceea: 80 91 92 02 lds r24, 0x0292 ; 0x800292 ceee: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cef2: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> cef6: 81 11 cpse r24, r1 cef8: 20 c0 rjmp .+64 ; 0xcf3a { saved_pos[X_AXIS] = current_position[X_AXIS]; cefa: 80 91 61 12 lds r24, 0x1261 ; 0x801261 cefe: 90 91 62 12 lds r25, 0x1262 ; 0x801262 cf02: a0 91 63 12 lds r26, 0x1263 ; 0x801263 cf06: b0 91 64 12 lds r27, 0x1264 ; 0x801264 cf0a: 80 93 90 02 sts 0x0290, r24 ; 0x800290 cf0e: 90 93 91 02 sts 0x0291, r25 ; 0x800291 cf12: a0 93 92 02 sts 0x0292, r26 ; 0x800292 cf16: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_pos[Y_AXIS] = current_position[Y_AXIS]; cf1a: 80 91 65 12 lds r24, 0x1265 ; 0x801265 cf1e: 90 91 66 12 lds r25, 0x1266 ; 0x801266 cf22: a0 91 67 12 lds r26, 0x1267 ; 0x801267 cf26: b0 91 68 12 lds r27, 0x1268 ; 0x801268 cf2a: 80 93 94 02 sts 0x0294, r24 ; 0x800294 cf2e: 90 93 95 02 sts 0x0295, r25 ; 0x800295 cf32: a0 93 96 02 sts 0x0296, r26 ; 0x800296 cf36: 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); cf3a: a3 01 movw r20, r6 cf3c: 92 01 movw r18, r4 cf3e: 60 91 9c 02 lds r22, 0x029C ; 0x80029c cf42: 70 91 9d 02 lds r23, 0x029D ; 0x80029d cf46: 80 91 9e 02 lds r24, 0x029E ; 0x80029e cf4a: 90 91 9f 02 lds r25, 0x029F ; 0x80029f cf4e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> cf52: 69 83 std Y+1, r22 ; 0x01 cf54: 7a 83 std Y+2, r23 ; 0x02 cf56: 8b 83 std Y+3, r24 ; 0x03 cf58: 9c 83 std Y+4, r25 ; 0x04 cf5a: e0 90 69 12 lds r14, 0x1269 ; 0x801269 cf5e: f0 90 6a 12 lds r15, 0x126A ; 0x80126a cf62: 00 91 6b 12 lds r16, 0x126B ; 0x80126b cf66: 10 91 6c 12 lds r17, 0x126C ; 0x80126c cf6a: 20 91 94 02 lds r18, 0x0294 ; 0x800294 cf6e: 30 91 95 02 lds r19, 0x0295 ; 0x800295 cf72: 40 91 96 02 lds r20, 0x0296 ; 0x800296 cf76: 50 91 97 02 lds r21, 0x0297 ; 0x800297 cf7a: 60 91 90 02 lds r22, 0x0290 ; 0x800290 cf7e: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cf82: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cf86: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cf8a: 1f 92 push r1 cf8c: 1f 92 push r1 cf8e: 1f 92 push r1 cf90: 1f 92 push r1 cf92: e2 e6 ldi r30, 0x62 ; 98 cf94: 8e 2e mov r8, r30 cf96: e7 e2 ldi r30, 0x27 ; 39 cf98: 9e 2e mov r9, r30 cf9a: e6 e7 ldi r30, 0x76 ; 118 cf9c: ae 2e mov r10, r30 cf9e: e2 e4 ldi r30, 0x42 ; 66 cfa0: be 2e mov r11, r30 cfa2: fe 01 movw r30, r28 cfa4: 31 96 adiw r30, 0x01 ; 1 cfa6: 6f 01 movw r12, r30 cfa8: 0f 94 bf 3a call 0x2757e ; 0x2757e //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); cfac: a3 01 movw r20, r6 cfae: 92 01 movw r18, r4 cfb0: 60 91 9c 02 lds r22, 0x029C ; 0x80029c cfb4: 70 91 9d 02 lds r23, 0x029D ; 0x80029d cfb8: 80 91 9e 02 lds r24, 0x029E ; 0x80029e cfbc: 90 91 9f 02 lds r25, 0x029F ; 0x80029f cfc0: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> cfc4: 69 83 std Y+1, r22 ; 0x01 cfc6: 7a 83 std Y+2, r23 ; 0x02 cfc8: 8b 83 std Y+3, r24 ; 0x03 cfca: 9c 83 std Y+4, r25 ; 0x04 cfcc: e0 90 98 02 lds r14, 0x0298 ; 0x800298 cfd0: f0 90 99 02 lds r15, 0x0299 ; 0x800299 cfd4: 00 91 9a 02 lds r16, 0x029A ; 0x80029a cfd8: 10 91 9b 02 lds r17, 0x029B ; 0x80029b cfdc: 20 91 94 02 lds r18, 0x0294 ; 0x800294 cfe0: 30 91 95 02 lds r19, 0x0295 ; 0x800295 cfe4: 40 91 96 02 lds r20, 0x0296 ; 0x800296 cfe8: 50 91 97 02 lds r21, 0x0297 ; 0x800297 cfec: 60 91 90 02 lds r22, 0x0290 ; 0x800290 cff0: 70 91 91 02 lds r23, 0x0291 ; 0x800291 cff4: 80 91 92 02 lds r24, 0x0292 ; 0x800292 cff8: 90 91 93 02 lds r25, 0x0293 ; 0x800293 cffc: 1f 92 push r1 cffe: 1f 92 push r1 d000: 1f 92 push r1 d002: 1f 92 push r1 d004: 0f 94 bf 3a call 0x2757e ; 0x2757e //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); d008: e0 90 98 02 lds r14, 0x0298 ; 0x800298 d00c: f0 90 99 02 lds r15, 0x0299 ; 0x800299 d010: 00 91 9a 02 lds r16, 0x029A ; 0x80029a d014: 10 91 9b 02 lds r17, 0x029B ; 0x80029b d018: 20 91 94 02 lds r18, 0x0294 ; 0x800294 d01c: 30 91 95 02 lds r19, 0x0295 ; 0x800295 d020: 40 91 96 02 lds r20, 0x0296 ; 0x800296 d024: 50 91 97 02 lds r21, 0x0297 ; 0x800297 d028: 60 91 90 02 lds r22, 0x0290 ; 0x800290 d02c: 70 91 91 02 lds r23, 0x0291 ; 0x800291 d030: 80 91 92 02 lds r24, 0x0292 ; 0x800292 d034: 90 91 93 02 lds r25, 0x0293 ; 0x800293 d038: 1f 92 push r1 d03a: 1f 92 push r1 d03c: 1f 92 push r1 d03e: 1f 92 push r1 d040: 81 2c mov r8, r1 d042: 91 2c mov r9, r1 d044: f8 ee ldi r31, 0xE8 ; 232 d046: af 2e mov r10, r31 d048: f2 e4 ldi r31, 0x42 ; 66 d04a: bf 2e mov r11, r31 d04c: ac e9 ldi r26, 0x9C ; 156 d04e: ca 2e mov r12, r26 d050: a2 e0 ldi r26, 0x02 ; 2 d052: da 2e mov r13, r26 d054: 0f 94 bf 3a call 0x2757e ; 0x2757e st_synchronize(); d058: 0f 94 94 18 call 0x23128 ; 0x23128 #ifdef FANCHECK fans_check_enabled = true; d05c: 11 e0 ldi r17, 0x01 ; 1 d05e: 10 93 40 02 sts 0x0240, r17 ; 0x800240 #endif // restore original feedrate/feedmultiply _after_ restoring the extruder position feedrate = saved_feedrate2; d062: 60 91 4f 12 lds r22, 0x124F ; 0x80124f d066: 70 91 50 12 lds r23, 0x1250 ; 0x801250 d06a: 90 e0 ldi r25, 0x00 ; 0 d06c: 80 e0 ldi r24, 0x00 ; 0 d06e: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> d072: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a d076: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b d07a: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c d07e: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedmultiply = saved_feedmultiply2; d082: 80 91 5f 12 lds r24, 0x125F ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.495> d086: 90 91 60 12 lds r25, 0x1260 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.495+0x1> d08a: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f d08e: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e memcpy(current_position, saved_pos, sizeof(saved_pos)); d092: 80 e1 ldi r24, 0x10 ; 16 d094: e0 e9 ldi r30, 0x90 ; 144 d096: f2 e0 ldi r31, 0x02 ; 2 d098: a1 e6 ldi r26, 0x61 ; 97 d09a: b2 e1 ldi r27, 0x12 ; 18 d09c: 01 90 ld r0, Z+ d09e: 0d 92 st X+, r0 d0a0: 8a 95 dec r24 d0a2: e1 f7 brne .-8 ; 0xd09c set_destination_to_current(); d0a4: 0e 94 ff 66 call 0xcdfe ; 0xcdfe //not sd printing nor usb printing } } void restore_print_file_state() { if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { //was sd printing d0a8: 80 91 79 02 lds r24, 0x0279 ; 0x800279 d0ac: 0f b6 in r0, 0x3f ; 63 d0ae: f8 94 cli d0b0: de bf out 0x3e, r29 ; 62 d0b2: 0f be out 0x3f, r0 ; 63 d0b4: cd bf out 0x3d, r28 ; 61 d0b6: 81 11 cpse r24, r1 d0b8: 51 c0 rjmp .+162 ; 0xd15c card.setIndex(saved_sdpos); d0ba: 60 91 45 12 lds r22, 0x1245 ; 0x801245 d0be: 70 91 46 12 lds r23, 0x1246 ; 0x801246 d0c2: 80 91 47 12 lds r24, 0x1247 ; 0x801247 d0c6: 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);}; d0ca: 60 93 eb 16 sts 0x16EB, r22 ; 0x8016eb d0ce: 70 93 ec 16 sts 0x16EC, r23 ; 0x8016ec d0d2: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed d0d6: 90 93 ee 16 sts 0x16EE, r25 ; 0x8016ee d0da: 0f 94 b5 67 call 0x2cf6a ; 0x2cf6a sdpos_atomic = saved_sdpos; d0de: 80 91 45 12 lds r24, 0x1245 ; 0x801245 d0e2: 90 91 46 12 lds r25, 0x1246 ; 0x801246 d0e6: a0 91 47 12 lds r26, 0x1247 ; 0x801247 d0ea: b0 91 48 12 lds r27, 0x1248 ; 0x801248 d0ee: 80 93 49 12 sts 0x1249, r24 ; 0x801249 d0f2: 90 93 4a 12 sts 0x124A, r25 ; 0x80124a d0f6: a0 93 4b 12 sts 0x124B, r26 ; 0x80124b d0fa: b0 93 4c 12 sts 0x124C, r27 ; 0x80124c card.sdprinting = true; d0fe: 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); d102: 60 e0 ldi r22, 0x00 ; 0 d104: 85 ea ldi r24, 0xA5 ; 165 d106: 9f e0 ldi r25, 0x0F ; 15 d108: 0f 94 a5 a4 call 0x3494a ; 0x3494a d10c: 60 e0 ldi r22, 0x00 ; 0 d10e: 8f e7 ldi r24, 0x7F ; 127 d110: 9c e0 ldi r25, 0x0C ; 12 d112: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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); d116: 8a e8 ldi r24, 0x8A ; 138 d118: 9c e6 ldi r25, 0x6C ; 108 d11a: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 saved_printing_type = PowerPanic::PRINT_TYPE_NONE; d11e: 82 e0 ldi r24, 0x02 ; 2 d120: 80 93 79 02 sts 0x0279, r24 ; 0x800279 saved_printing = false; d124: 10 92 73 12 sts 0x1273, r1 ; 0x801273 planner_aborted = true; // unroll the stack d128: 81 e0 ldi r24, 0x01 ; 1 d12a: 80 93 42 0d sts 0x0D42, r24 ; 0x800d42 } d12e: 28 96 adiw r28, 0x08 ; 8 d130: 0f b6 in r0, 0x3f ; 63 d132: f8 94 cli d134: de bf out 0x3e, r29 ; 62 d136: 0f be out 0x3f, r0 ; 63 d138: cd bf out 0x3d, r28 ; 61 d13a: df 91 pop r29 d13c: cf 91 pop r28 d13e: 1f 91 pop r17 d140: 0f 91 pop r16 d142: ff 90 pop r15 d144: ef 90 pop r14 d146: df 90 pop r13 d148: cf 90 pop r12 d14a: bf 90 pop r11 d14c: af 90 pop r10 d14e: 9f 90 pop r9 d150: 8f 90 pop r8 d152: 7f 90 pop r7 d154: 6f 90 pop r6 d156: 5f 90 pop r5 d158: 4f 90 pop r4 d15a: 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 d15c: 81 30 cpi r24, 0x01 ; 1 d15e: 89 f6 brne .-94 ; 0xd102 gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing d160: 80 91 45 12 lds r24, 0x1245 ; 0x801245 d164: 90 91 46 12 lds r25, 0x1246 ; 0x801246 d168: a0 91 47 12 lds r26, 0x1247 ; 0x801247 d16c: b0 91 48 12 lds r27, 0x1248 ; 0x801248 d170: 80 93 3e 12 sts 0x123E, r24 ; 0x80123e d174: 90 93 3f 12 sts 0x123F, r25 ; 0x80123f d178: a0 93 40 12 sts 0x1240, r26 ; 0x801240 d17c: b0 93 41 12 sts 0x1241, r27 ; 0x801241 serial_count = 0; d180: 10 92 48 10 sts 0x1048, r1 ; 0x801048 d184: 10 92 47 10 sts 0x1047, r1 ; 0x801047 FlushSerialRequestResend(); d188: 0e 94 37 56 call 0xac6e ; 0xac6e d18c: ba cf rjmp .-140 ; 0xd102 0000d18e : 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) { d18e: 3f 92 push r3 d190: 4f 92 push r4 d192: 5f 92 push r5 d194: 6f 92 push r6 d196: 7f 92 push r7 d198: 8f 92 push r8 d19a: 9f 92 push r9 d19c: af 92 push r10 d19e: bf 92 push r11 d1a0: cf 92 push r12 d1a2: df 92 push r13 d1a4: ef 92 push r14 d1a6: ff 92 push r15 d1a8: 0f 93 push r16 d1aa: 1f 93 push r17 d1ac: cf 93 push r28 d1ae: df 93 push r29 if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { d1b0: 30 90 a2 04 lds r3, 0x04A2 ; 0x8004a2 d1b4: 33 20 and r3, r3 d1b6: 09 f4 brne .+2 ; 0xd1ba d1b8: 80 c0 rjmp .+256 ; 0xd2ba d1ba: 8b 01 movw r16, r22 d1bc: ec 01 movw r28, r24 // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d1be: 31 fe sbrs r3, 1 d1c0: 54 c0 rjmp .+168 ; 0xd26a // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew[0][0] * x + world2machine_rotation_and_skew[0][1] * y; d1c2: 88 80 ld r8, Y d1c4: 99 80 ldd r9, Y+1 ; 0x01 d1c6: aa 80 ldd r10, Y+2 ; 0x02 d1c8: bb 80 ldd r11, Y+3 ; 0x03 d1ca: fb 01 movw r30, r22 d1cc: c0 80 ld r12, Z d1ce: d1 80 ldd r13, Z+1 ; 0x01 d1d0: e2 80 ldd r14, Z+2 ; 0x02 d1d2: f3 80 ldd r15, Z+3 ; 0x03 float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; d1d4: 20 91 77 03 lds r18, 0x0377 ; 0x800377 d1d8: 30 91 78 03 lds r19, 0x0378 ; 0x800378 d1dc: 40 91 79 03 lds r20, 0x0379 ; 0x800379 d1e0: 50 91 7a 03 lds r21, 0x037A ; 0x80037a d1e4: c5 01 movw r24, r10 d1e6: b4 01 movw r22, r8 d1e8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d1ec: 2b 01 movw r4, r22 d1ee: 3c 01 movw r6, r24 d1f0: 20 91 7b 03 lds r18, 0x037B ; 0x80037b d1f4: 30 91 7c 03 lds r19, 0x037C ; 0x80037c d1f8: 40 91 7d 03 lds r20, 0x037D ; 0x80037d d1fc: 50 91 7e 03 lds r21, 0x037E ; 0x80037e d200: c7 01 movw r24, r14 d202: b6 01 movw r22, r12 d204: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d208: 9b 01 movw r18, r22 d20a: ac 01 movw r20, r24 d20c: c3 01 movw r24, r6 d20e: b2 01 movw r22, r4 d210: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d214: 2b 01 movw r4, r22 d216: 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; d218: 20 91 6f 03 lds r18, 0x036F ; 0x80036f d21c: 30 91 70 03 lds r19, 0x0370 ; 0x800370 d220: 40 91 71 03 lds r20, 0x0371 ; 0x800371 d224: 50 91 72 03 lds r21, 0x0372 ; 0x800372 d228: c5 01 movw r24, r10 d22a: b4 01 movw r22, r8 d22c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d230: 4b 01 movw r8, r22 d232: 5c 01 movw r10, r24 d234: 20 91 73 03 lds r18, 0x0373 ; 0x800373 d238: 30 91 74 03 lds r19, 0x0374 ; 0x800374 d23c: 40 91 75 03 lds r20, 0x0375 ; 0x800375 d240: 50 91 76 03 lds r21, 0x0376 ; 0x800376 d244: c7 01 movw r24, r14 d246: b6 01 movw r22, r12 d248: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d24c: 9b 01 movw r18, r22 d24e: ac 01 movw r20, r24 d250: c5 01 movw r24, r10 d252: b4 01 movw r22, r8 d254: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> float out_y = world2machine_rotation_and_skew[1][0] * x + world2machine_rotation_and_skew[1][1] * y; x = out_x; d258: 68 83 st Y, r22 d25a: 79 83 std Y+1, r23 ; 0x01 d25c: 8a 83 std Y+2, r24 ; 0x02 d25e: 9b 83 std Y+3, r25 ; 0x03 y = out_y; d260: f8 01 movw r30, r16 d262: 40 82 st Z, r4 d264: 51 82 std Z+1, r5 ; 0x01 d266: 62 82 std Z+2, r6 ; 0x02 d268: 73 82 std Z+3, r7 ; 0x03 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { d26a: 30 fe sbrs r3, 0 d26c: 26 c0 rjmp .+76 ; 0xd2ba // Then add the offset. x += world2machine_shift[0]; d26e: 20 91 9a 04 lds r18, 0x049A ; 0x80049a d272: 30 91 9b 04 lds r19, 0x049B ; 0x80049b d276: 40 91 9c 04 lds r20, 0x049C ; 0x80049c d27a: 50 91 9d 04 lds r21, 0x049D ; 0x80049d d27e: 68 81 ld r22, Y d280: 79 81 ldd r23, Y+1 ; 0x01 d282: 8a 81 ldd r24, Y+2 ; 0x02 d284: 9b 81 ldd r25, Y+3 ; 0x03 d286: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d28a: 68 83 st Y, r22 d28c: 79 83 std Y+1, r23 ; 0x01 d28e: 8a 83 std Y+2, r24 ; 0x02 d290: 9b 83 std Y+3, r25 ; 0x03 y += world2machine_shift[1]; d292: 20 91 9e 04 lds r18, 0x049E ; 0x80049e d296: 30 91 9f 04 lds r19, 0x049F ; 0x80049f d29a: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 d29e: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 d2a2: f8 01 movw r30, r16 d2a4: 60 81 ld r22, Z d2a6: 71 81 ldd r23, Z+1 ; 0x01 d2a8: 82 81 ldd r24, Z+2 ; 0x02 d2aa: 93 81 ldd r25, Z+3 ; 0x03 d2ac: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d2b0: f8 01 movw r30, r16 d2b2: 60 83 st Z, r22 d2b4: 71 83 std Z+1, r23 ; 0x01 d2b6: 82 83 std Z+2, r24 ; 0x02 d2b8: 93 83 std Z+3, r25 ; 0x03 } } } d2ba: df 91 pop r29 d2bc: cf 91 pop r28 d2be: 1f 91 pop r17 d2c0: 0f 91 pop r16 d2c2: ff 90 pop r15 d2c4: ef 90 pop r14 d2c6: df 90 pop r13 d2c8: cf 90 pop r12 d2ca: bf 90 pop r11 d2cc: af 90 pop r10 d2ce: 9f 90 pop r9 d2d0: 8f 90 pop r8 d2d2: 7f 90 pop r7 d2d4: 6f 90 pop r6 d2d6: 5f 90 pop r5 d2d8: 4f 90 pop r4 d2da: 3f 90 pop r3 d2dc: 08 95 ret 0000d2de : } } } inline bool world2machine_clamp(float &x, float &y) { d2de: 2f 92 push r2 d2e0: 3f 92 push r3 d2e2: 4f 92 push r4 d2e4: 5f 92 push r5 d2e6: 6f 92 push r6 d2e8: 7f 92 push r7 d2ea: 8f 92 push r8 d2ec: 9f 92 push r9 d2ee: af 92 push r10 d2f0: bf 92 push r11 d2f2: cf 92 push r12 d2f4: df 92 push r13 d2f6: ef 92 push r14 d2f8: ff 92 push r15 d2fa: 0f 93 push r16 d2fc: 1f 93 push r17 d2fe: cf 93 push r28 d300: df 93 push r29 d302: 00 d0 rcall .+0 ; 0xd304 d304: 00 d0 rcall .+0 ; 0xd306 d306: 1f 92 push r1 d308: 1f 92 push r1 d30a: cd b7 in r28, 0x3d ; 61 d30c: de b7 in r29, 0x3e ; 62 d30e: 8c 01 movw r16, r24 d310: 1b 01 movw r2, r22 } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; d312: fc 01 movw r30, r24 d314: 80 81 ld r24, Z d316: 91 81 ldd r25, Z+1 ; 0x01 d318: a2 81 ldd r26, Z+2 ; 0x02 d31a: b3 81 ldd r27, Z+3 ; 0x03 d31c: 89 83 std Y+1, r24 ; 0x01 d31e: 9a 83 std Y+2, r25 ; 0x02 d320: ab 83 std Y+3, r26 ; 0x03 d322: bc 83 std Y+4, r27 ; 0x04 out_y = y; d324: fb 01 movw r30, r22 d326: 80 81 ld r24, Z d328: 91 81 ldd r25, Z+1 ; 0x01 d32a: a2 81 ldd r26, Z+2 ; 0x02 d32c: b3 81 ldd r27, Z+3 ; 0x03 d32e: 8d 83 std Y+5, r24 ; 0x05 d330: 9e 83 std Y+6, r25 ; 0x06 d332: af 83 std Y+7, r26 ; 0x07 d334: b8 87 std Y+8, r27 ; 0x08 world2machine(out_x, out_y); d336: be 01 movw r22, r28 d338: 6b 5f subi r22, 0xFB ; 251 d33a: 7f 4f sbci r23, 0xFF ; 255 d33c: ce 01 movw r24, r28 d33e: 01 96 adiw r24, 0x01 ; 1 d340: 0e 94 c7 68 call 0xd18e ; 0xd18e inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; float tmpx, tmpy; world2machine(x, y, tmpx, tmpy); if (tmpx < X_MIN_POS) { d344: c9 80 ldd r12, Y+1 ; 0x01 d346: da 80 ldd r13, Y+2 ; 0x02 d348: eb 80 ldd r14, Y+3 ; 0x03 d34a: fc 80 ldd r15, Y+4 ; 0x04 d34c: 20 e0 ldi r18, 0x00 ; 0 d34e: 30 e0 ldi r19, 0x00 ; 0 d350: a9 01 movw r20, r18 d352: c7 01 movw r24, r14 d354: b6 01 movw r22, r12 d356: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> d35a: 87 ff sbrs r24, 7 d35c: 35 c0 rjmp .+106 ; 0xd3c8 tmpx = X_MIN_POS; d35e: 19 82 std Y+1, r1 ; 0x01 d360: 1a 82 std Y+2, r1 ; 0x02 d362: 1b 82 std Y+3, r1 ; 0x03 d364: 1c 82 std Y+4, r1 ; 0x04 clamped = true; } else if (tmpx > X_MAX_POS) { tmpx = X_MAX_POS; clamped = true; d366: ff 24 eor r15, r15 d368: f3 94 inc r15 } if (tmpy < Y_MIN_POS) { d36a: 8d 80 ldd r8, Y+5 ; 0x05 d36c: 9e 80 ldd r9, Y+6 ; 0x06 d36e: af 80 ldd r10, Y+7 ; 0x07 d370: b8 84 ldd r11, Y+8 ; 0x08 d372: 20 e0 ldi r18, 0x00 ; 0 d374: 30 e0 ldi r19, 0x00 ; 0 d376: 40 e8 ldi r20, 0x80 ; 128 d378: 50 ec ldi r21, 0xC0 ; 192 d37a: c5 01 movw r24, r10 d37c: b4 01 movw r22, r8 d37e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> d382: 87 ff sbrs r24, 7 d384: 35 c0 rjmp .+106 ; 0xd3f0 tmpy = Y_MIN_POS; d386: 80 e0 ldi r24, 0x00 ; 0 d388: 90 e0 ldi r25, 0x00 ; 0 d38a: a0 e8 ldi r26, 0x80 ; 128 d38c: b0 ec ldi r27, 0xC0 ; 192 clamped = true; } else if (tmpy > Y_MAX_POS) { tmpy = Y_MAX_POS; d38e: 8d 83 std Y+5, r24 ; 0x05 d390: 9e 83 std Y+6, r25 ; 0x06 d392: af 83 std Y+7, r26 ; 0x07 d394: b8 87 std Y+8, r27 ; 0x08 clamped = true; } if (clamped) machine2world(tmpx, tmpy, x, y); d396: cd 80 ldd r12, Y+5 ; 0x05 d398: de 80 ldd r13, Y+6 ; 0x06 d39a: ef 80 ldd r14, Y+7 ; 0x07 d39c: f8 84 ldd r15, Y+8 ; 0x08 d39e: 89 80 ldd r8, Y+1 ; 0x01 d3a0: 9a 80 ldd r9, Y+2 ; 0x02 d3a2: ab 80 ldd r10, Y+3 ; 0x03 d3a4: 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) { d3a6: 70 90 a2 04 lds r7, 0x04A2 ; 0x8004a2 d3aa: 71 10 cpse r7, r1 d3ac: 4c c0 rjmp .+152 ; 0xd446 // No correction. out_x = x; d3ae: f8 01 movw r30, r16 d3b0: 80 82 st Z, r8 d3b2: 91 82 std Z+1, r9 ; 0x01 d3b4: a2 82 std Z+2, r10 ; 0x02 d3b6: b3 82 std Z+3, r11 ; 0x03 out_y = y; d3b8: f1 01 movw r30, r2 d3ba: c0 82 st Z, r12 d3bc: d1 82 std Z+1, r13 ; 0x01 d3be: e2 82 std Z+2, r14 ; 0x02 d3c0: 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) { d3c2: ff 24 eor r15, r15 d3c4: f3 94 inc r15 d3c6: 25 c0 rjmp .+74 ; 0xd412 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) { d3c8: 20 e0 ldi r18, 0x00 ; 0 d3ca: 30 e0 ldi r19, 0x00 ; 0 d3cc: 4a e7 ldi r20, 0x7A ; 122 d3ce: 53 e4 ldi r21, 0x43 ; 67 d3d0: c7 01 movw r24, r14 d3d2: b6 01 movw r22, r12 d3d4: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> } } inline bool world2machine_clamp(float &x, float &y) { bool clamped = false; d3d8: 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) { d3da: 18 16 cp r1, r24 d3dc: 34 f6 brge .-116 ; 0xd36a tmpx = X_MAX_POS; d3de: 80 e0 ldi r24, 0x00 ; 0 d3e0: 90 e0 ldi r25, 0x00 ; 0 d3e2: aa e7 ldi r26, 0x7A ; 122 d3e4: b3 e4 ldi r27, 0x43 ; 67 d3e6: 89 83 std Y+1, r24 ; 0x01 d3e8: 9a 83 std Y+2, r25 ; 0x02 d3ea: ab 83 std Y+3, r26 ; 0x03 d3ec: bc 83 std Y+4, r27 ; 0x04 d3ee: bb cf rjmp .-138 ; 0xd366 } if (tmpy < Y_MIN_POS) { tmpy = Y_MIN_POS; clamped = true; } else if (tmpy > Y_MAX_POS) { d3f0: 20 e0 ldi r18, 0x00 ; 0 d3f2: 30 e0 ldi r19, 0x00 ; 0 d3f4: 42 e5 ldi r20, 0x52 ; 82 d3f6: 53 e4 ldi r21, 0x43 ; 67 d3f8: c5 01 movw r24, r10 d3fa: b4 01 movw r22, r8 d3fc: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> d400: 18 16 cp r1, r24 d402: 2c f4 brge .+10 ; 0xd40e tmpy = Y_MAX_POS; d404: 80 e0 ldi r24, 0x00 ; 0 d406: 90 e0 ldi r25, 0x00 ; 0 d408: a2 e5 ldi r26, 0x52 ; 82 d40a: b3 e4 ldi r27, 0x43 ; 67 d40c: c0 cf rjmp .-128 ; 0xd38e clamped = true; } if (clamped) d40e: f1 10 cpse r15, r1 d410: c2 cf rjmp .-124 ; 0xd396 machine2world(tmpx, tmpy, x, y); return clamped; } d412: 8f 2d mov r24, r15 d414: 28 96 adiw r28, 0x08 ; 8 d416: 0f b6 in r0, 0x3f ; 63 d418: f8 94 cli d41a: de bf out 0x3e, r29 ; 62 d41c: 0f be out 0x3f, r0 ; 63 d41e: cd bf out 0x3d, r28 ; 61 d420: df 91 pop r29 d422: cf 91 pop r28 d424: 1f 91 pop r17 d426: 0f 91 pop r16 d428: ff 90 pop r15 d42a: ef 90 pop r14 d42c: df 90 pop r13 d42e: cf 90 pop r12 d430: bf 90 pop r11 d432: af 90 pop r10 d434: 9f 90 pop r9 d436: 8f 90 pop r8 d438: 7f 90 pop r7 d43a: 6f 90 pop r6 d43c: 5f 90 pop r5 d43e: 4f 90 pop r4 d440: 3f 90 pop r3 d442: 2f 90 pop r2 d444: 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) { d446: 70 fe sbrs r7, 0 d448: 1c c0 rjmp .+56 ; 0xd482 // Then add the offset. x -= world2machine_shift[0]; d44a: 20 91 9a 04 lds r18, 0x049A ; 0x80049a d44e: 30 91 9b 04 lds r19, 0x049B ; 0x80049b d452: 40 91 9c 04 lds r20, 0x049C ; 0x80049c d456: 50 91 9d 04 lds r21, 0x049D ; 0x80049d d45a: c5 01 movw r24, r10 d45c: b4 01 movw r22, r8 d45e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> d462: 4b 01 movw r8, r22 d464: 5c 01 movw r10, r24 y -= world2machine_shift[1]; d466: 20 91 9e 04 lds r18, 0x049E ; 0x80049e d46a: 30 91 9f 04 lds r19, 0x049F ; 0x80049f d46e: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 d472: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 d476: c7 01 movw r24, r14 d478: b6 01 movw r22, r12 d47a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> d47e: 6b 01 movw r12, r22 d480: 7c 01 movw r14, r24 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { d482: 71 fe sbrs r7, 1 d484: 9e cf rjmp .-196 ; 0xd3c2 // Firs the skew & rotation correction. out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; d486: 20 91 8a 04 lds r18, 0x048A ; 0x80048a d48a: 30 91 8b 04 lds r19, 0x048B ; 0x80048b d48e: 40 91 8c 04 lds r20, 0x048C ; 0x80048c d492: 50 91 8d 04 lds r21, 0x048D ; 0x80048d d496: c5 01 movw r24, r10 d498: b4 01 movw r22, r8 d49a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d49e: 2b 01 movw r4, r22 d4a0: 3c 01 movw r6, r24 d4a2: 20 91 8e 04 lds r18, 0x048E ; 0x80048e d4a6: 30 91 8f 04 lds r19, 0x048F ; 0x80048f d4aa: 40 91 90 04 lds r20, 0x0490 ; 0x800490 d4ae: 50 91 91 04 lds r21, 0x0491 ; 0x800491 d4b2: c7 01 movw r24, r14 d4b4: b6 01 movw r22, r12 d4b6: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d4ba: 9b 01 movw r18, r22 d4bc: ac 01 movw r20, r24 d4be: c3 01 movw r24, r6 d4c0: b2 01 movw r22, r4 d4c2: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d4c6: f8 01 movw r30, r16 d4c8: 60 83 st Z, r22 d4ca: 71 83 std Z+1, r23 ; 0x01 d4cc: 82 83 std Z+2, r24 ; 0x02 d4ce: 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; d4d0: 20 91 92 04 lds r18, 0x0492 ; 0x800492 d4d4: 30 91 93 04 lds r19, 0x0493 ; 0x800493 d4d8: 40 91 94 04 lds r20, 0x0494 ; 0x800494 d4dc: 50 91 95 04 lds r21, 0x0495 ; 0x800495 d4e0: c5 01 movw r24, r10 d4e2: b4 01 movw r22, r8 d4e4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d4e8: 4b 01 movw r8, r22 d4ea: 5c 01 movw r10, r24 d4ec: 20 91 96 04 lds r18, 0x0496 ; 0x800496 d4f0: 30 91 97 04 lds r19, 0x0497 ; 0x800497 d4f4: 40 91 98 04 lds r20, 0x0498 ; 0x800498 d4f8: 50 91 99 04 lds r21, 0x0499 ; 0x800499 d4fc: c7 01 movw r24, r14 d4fe: b6 01 movw r22, r12 d500: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d504: 9b 01 movw r18, r22 d506: ac 01 movw r20, r24 d508: c5 01 movw r24, r10 d50a: b4 01 movw r22, r8 d50c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d510: f1 01 movw r30, r2 d512: 60 83 st Z, r22 d514: 71 83 std Z+1, r23 ; 0x01 d516: 82 83 std Z+2, r24 ; 0x02 d518: 93 83 std Z+3, r25 ; 0x03 d51a: 53 cf rjmp .-346 ; 0xd3c2 0000d51c : return sampled; } void go_home_with_z_lift() { d51c: cf 93 push r28 d51e: df 93 push r29 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); d520: 0e 94 92 65 call 0xcb24 ; 0xcb24 // Go home. // First move up to a safe height. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; d524: c1 e6 ldi r28, 0x61 ; 97 d526: d2 e1 ldi r29, 0x12 ; 18 d528: 80 e0 ldi r24, 0x00 ; 0 d52a: 90 e0 ldi r25, 0x00 ; 0 d52c: a0 ea ldi r26, 0xA0 ; 160 d52e: b0 e4 ldi r27, 0x40 ; 64 d530: 88 87 std Y+8, r24 ; 0x08 d532: 99 87 std Y+9, r25 ; 0x09 d534: aa 87 std Y+10, r26 ; 0x0a d536: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); d538: 65 e5 ldi r22, 0x55 ; 85 d53a: 75 e5 ldi r23, 0x55 ; 85 d53c: 85 e5 ldi r24, 0x55 ; 85 d53e: 91 e4 ldi r25, 0x41 ; 65 d540: 0f 94 82 4e call 0x29d04 ; 0x29d04 // Second move to XY [0, 0]. current_position[X_AXIS] = X_MIN_POS + 0.2; d544: 8d ec ldi r24, 0xCD ; 205 d546: 9c ec ldi r25, 0xCC ; 204 d548: ac e4 ldi r26, 0x4C ; 76 d54a: be e3 ldi r27, 0x3E ; 62 d54c: 88 83 st Y, r24 d54e: 99 83 std Y+1, r25 ; 0x01 d550: aa 83 std Y+2, r26 ; 0x02 d552: bb 83 std Y+3, r27 ; 0x03 current_position[Y_AXIS] = Y_MIN_POS + 0.2; d554: 83 e3 ldi r24, 0x33 ; 51 d556: 93 e3 ldi r25, 0x33 ; 51 d558: a3 e7 ldi r26, 0x73 ; 115 d55a: b0 ec ldi r27, 0xC0 ; 192 d55c: 8c 83 std Y+4, r24 ; 0x04 d55e: 9d 83 std Y+5, r25 ; 0x05 d560: ae 83 std Y+6, r26 ; 0x06 d562: bf 83 std Y+7, r27 ; 0x07 // Clamp to the physical coordinates. world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); d564: 65 e6 ldi r22, 0x65 ; 101 d566: 72 e1 ldi r23, 0x12 ; 18 d568: ce 01 movw r24, r28 d56a: 0e 94 6f 69 call 0xd2de ; 0xd2de go_to_current((3 * homing_feedrate[X_AXIS]) / 60); d56e: 60 e0 ldi r22, 0x00 ; 0 d570: 70 e0 ldi r23, 0x00 ; 0 d572: 86 e1 ldi r24, 0x16 ; 22 d574: 93 e4 ldi r25, 0x43 ; 67 d576: 0f 94 82 4e call 0x29d04 ; 0x29d04 // Third move up to a safe height. current_position[Z_AXIS] = Z_MIN_POS; d57a: 8a e9 ldi r24, 0x9A ; 154 d57c: 99 e9 ldi r25, 0x99 ; 153 d57e: a9 e1 ldi r26, 0x19 ; 25 d580: be e3 ldi r27, 0x3E ; 62 d582: 88 87 std Y+8, r24 ; 0x08 d584: 99 87 std Y+9, r25 ; 0x09 d586: aa 87 std Y+10, r26 ; 0x0a d588: bb 87 std Y+11, r27 ; 0x0b go_to_current(homing_feedrate[Z_AXIS] / 60); d58a: 65 e5 ldi r22, 0x55 ; 85 d58c: 75 e5 ldi r23, 0x55 ; 85 d58e: 85 e5 ldi r24, 0x55 ; 85 d590: 91 e4 ldi r25, 0x41 ; 65 } d592: df 91 pop r29 d594: 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); d596: 0d 94 82 4e jmp 0x29d04 ; 0x29d04 0000d59a : if(next_feedrate > 0.f) feedrate = next_feedrate; } } void clamp_to_software_endstops(float target[3]) { d59a: cf 92 push r12 d59c: df 92 push r13 d59e: ef 92 push r14 d5a0: ff 92 push r15 d5a2: cf 93 push r28 d5a4: df 93 push r29 d5a6: ec 01 movw r28, r24 #ifdef DEBUG_DISABLE_SWLIMITS return; #endif //DEBUG_DISABLE_SWLIMITS world2machine_clamp(target[0], target[1]); d5a8: bc 01 movw r22, r24 d5aa: 6c 5f subi r22, 0xFC ; 252 d5ac: 7f 4f sbci r23, 0xFF ; 255 d5ae: 0e 94 6f 69 call 0xd2de ; 0xd2de // Clamp the Z coordinate. if (min_software_endstops) { if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS]; d5b2: c0 90 2c 02 lds r12, 0x022C ; 0x80022c d5b6: d0 90 2d 02 lds r13, 0x022D ; 0x80022d d5ba: e0 90 2e 02 lds r14, 0x022E ; 0x80022e d5be: f0 90 2f 02 lds r15, 0x022F ; 0x80022f d5c2: a7 01 movw r20, r14 d5c4: 96 01 movw r18, r12 d5c6: 68 85 ldd r22, Y+8 ; 0x08 d5c8: 79 85 ldd r23, Y+9 ; 0x09 d5ca: 8a 85 ldd r24, Y+10 ; 0x0a d5cc: 9b 85 ldd r25, Y+11 ; 0x0b d5ce: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> d5d2: 87 ff sbrs r24, 7 d5d4: 04 c0 rjmp .+8 ; 0xd5de d5d6: c8 86 std Y+8, r12 ; 0x08 d5d8: d9 86 std Y+9, r13 ; 0x09 d5da: ea 86 std Y+10, r14 ; 0x0a d5dc: 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]; d5de: c0 90 20 02 lds r12, 0x0220 ; 0x800220 d5e2: d0 90 21 02 lds r13, 0x0221 ; 0x800221 d5e6: e0 90 22 02 lds r14, 0x0222 ; 0x800222 d5ea: f0 90 23 02 lds r15, 0x0223 ; 0x800223 d5ee: a7 01 movw r20, r14 d5f0: 96 01 movw r18, r12 d5f2: 68 85 ldd r22, Y+8 ; 0x08 d5f4: 79 85 ldd r23, Y+9 ; 0x09 d5f6: 8a 85 ldd r24, Y+10 ; 0x0a d5f8: 9b 85 ldd r25, Y+11 ; 0x0b d5fa: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> d5fe: 18 16 cp r1, r24 d600: 24 f4 brge .+8 ; 0xd60a d602: c8 86 std Y+8, r12 ; 0x08 d604: d9 86 std Y+9, r13 ; 0x09 d606: ea 86 std Y+10, r14 ; 0x0a d608: fb 86 std Y+11, r15 ; 0x0b } } d60a: df 91 pop r29 d60c: cf 91 pop r28 d60e: ff 90 pop r15 d610: ef 90 pop r14 d612: df 90 pop r13 d614: cf 90 pop r12 d616: 08 95 ret 0000d618 : plan_buffer_line(x, y, z, e, feed_rate, current_position); } #endif // MESH_BED_LEVELING void prepare_move(uint16_t start_segment_idx) { d618: 2f 92 push r2 d61a: 3f 92 push r3 d61c: 4f 92 push r4 d61e: 5f 92 push r5 d620: 6f 92 push r6 d622: 7f 92 push r7 d624: 8f 92 push r8 d626: 9f 92 push r9 d628: af 92 push r10 d62a: bf 92 push r11 d62c: cf 92 push r12 d62e: df 92 push r13 d630: ef 92 push r14 d632: ff 92 push r15 d634: 0f 93 push r16 d636: 1f 93 push r17 d638: cf 93 push r28 d63a: df 93 push r29 d63c: cd b7 in r28, 0x3d ; 61 d63e: de b7 in r29, 0x3e ; 62 d640: a2 97 sbiw r28, 0x22 ; 34 d642: 0f b6 in r0, 0x3f ; 63 d644: f8 94 cli d646: de bf out 0x3e, r29 ; 62 d648: 0f be out 0x3f, r0 ; 63 d64a: cd bf out 0x3d, r28 ; 61 d64c: 1c 01 movw r2, r24 clamp_to_software_endstops(destination); d64e: 89 e2 ldi r24, 0x29 ; 41 d650: 96 e0 ldi r25, 0x06 ; 6 d652: 0e 94 cd 6a call 0xd59a ; 0xd59a previous_millis_cmd.start(); d656: 88 e4 ldi r24, 0x48 ; 72 d658: 93 e0 ldi r25, 0x03 ; 3 d65a: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::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])) { d65e: 40 90 61 12 lds r4, 0x1261 ; 0x801261 d662: 50 90 62 12 lds r5, 0x1262 ; 0x801262 d666: 60 90 63 12 lds r6, 0x1263 ; 0x801263 d66a: 70 90 64 12 lds r7, 0x1264 ; 0x801264 d66e: c0 90 29 06 lds r12, 0x0629 ; 0x800629 d672: d0 90 2a 06 lds r13, 0x062A ; 0x80062a d676: e0 90 2b 06 lds r14, 0x062B ; 0x80062b d67a: f0 90 2c 06 lds r15, 0x062C ; 0x80062c d67e: a7 01 movw r20, r14 d680: 96 01 movw r18, r12 d682: c3 01 movw r24, r6 d684: b2 01 movw r22, r4 d686: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> d68a: 81 11 cpse r24, r1 d68c: 3f c0 rjmp .+126 ; 0xd70c d68e: 20 91 2d 06 lds r18, 0x062D ; 0x80062d d692: 30 91 2e 06 lds r19, 0x062E ; 0x80062e d696: 40 91 2f 06 lds r20, 0x062F ; 0x80062f d69a: 50 91 30 06 lds r21, 0x0630 ; 0x800630 d69e: 60 91 65 12 lds r22, 0x1265 ; 0x801265 d6a2: 70 91 66 12 lds r23, 0x1266 ; 0x801266 d6a6: 80 91 67 12 lds r24, 0x1267 ; 0x801267 d6aa: 90 91 68 12 lds r25, 0x1268 ; 0x801268 d6ae: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> d6b2: 81 11 cpse r24, r1 d6b4: 2b c0 rjmp .+86 ; 0xd70c plan_buffer_line_destinationXYZE(feedrate/60); d6b6: 20 e0 ldi r18, 0x00 ; 0 d6b8: 30 e0 ldi r19, 0x00 ; 0 d6ba: 40 e7 ldi r20, 0x70 ; 112 d6bc: 52 e4 ldi r21, 0x42 ; 66 d6be: 60 91 7a 02 lds r22, 0x027A ; 0x80027a d6c2: 70 91 7b 02 lds r23, 0x027B ; 0x80027b d6c6: 80 91 7c 02 lds r24, 0x027C ; 0x80027c d6ca: 90 91 7d 02 lds r25, 0x027D ; 0x80027d d6ce: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> d6d2: 0f 94 da 49 call 0x293b4 ; 0x293b4 #else plan_buffer_line_destinationXYZE(feedrate*feedmultiply*(1./(60.f*100.f))); #endif } set_current_to_destination(); d6d6: 0e 94 73 55 call 0xaae6 ; 0xaae6 } d6da: a2 96 adiw r28, 0x22 ; 34 d6dc: 0f b6 in r0, 0x3f ; 63 d6de: f8 94 cli d6e0: de bf out 0x3e, r29 ; 62 d6e2: 0f be out 0x3f, r0 ; 63 d6e4: cd bf out 0x3d, r28 ; 61 d6e6: df 91 pop r29 d6e8: cf 91 pop r28 d6ea: 1f 91 pop r17 d6ec: 0f 91 pop r16 d6ee: ff 90 pop r15 d6f0: ef 90 pop r14 d6f2: df 90 pop r13 d6f4: cf 90 pop r12 d6f6: bf 90 pop r11 d6f8: af 90 pop r10 d6fa: 9f 90 pop r9 d6fc: 8f 90 pop r8 d6fe: 7f 90 pop r7 d700: 6f 90 pop r6 d702: 5f 90 pop r5 d704: 4f 90 pop r4 d706: 3f 90 pop r3 d708: 2f 90 pop r2 d70a: 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); d70c: 60 91 8e 02 lds r22, 0x028E ; 0x80028e d710: 70 91 8f 02 lds r23, 0x028F ; 0x80028f d714: 07 2e mov r0, r23 d716: 00 0c add r0, r0 d718: 88 0b sbc r24, r24 d71a: 99 0b sbc r25, r25 d71c: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> d720: 20 91 7a 02 lds r18, 0x027A ; 0x80027a d724: 30 91 7b 02 lds r19, 0x027B ; 0x80027b d728: 40 91 7c 02 lds r20, 0x027C ; 0x80027c d72c: 50 91 7d 02 lds r21, 0x027D ; 0x80027d d730: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d734: 2e e3 ldi r18, 0x3E ; 62 d736: 33 ec ldi r19, 0xC3 ; 195 d738: 4e e2 ldi r20, 0x2E ; 46 d73a: 59 e3 ldi r21, 0x39 ; 57 d73c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d740: 6f 83 std Y+7, r22 ; 0x07 d742: 78 87 std Y+8, r23 ; 0x08 d744: 89 87 std Y+9, r24 ; 0x09 d746: 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) { d748: 80 91 09 13 lds r24, 0x1309 ; 0x801309 d74c: 88 23 and r24, r24 d74e: 09 f4 brne .+2 ; 0xd752 d750: 0f c1 rjmp .+542 ; 0xd970 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]; d752: a3 01 movw r20, r6 d754: 92 01 movw r18, r4 d756: c7 01 movw r24, r14 d758: b6 01 movw r22, r12 d75a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> d75e: 2b 01 movw r4, r22 d760: 3c 01 movw r6, r24 float dy = y - current_position[Y_AXIS]; d762: 20 91 65 12 lds r18, 0x1265 ; 0x801265 d766: 30 91 66 12 lds r19, 0x1266 ; 0x801266 d76a: 40 91 67 12 lds r20, 0x1267 ; 0x801267 d76e: 50 91 68 12 lds r21, 0x1268 ; 0x801268 d772: 60 91 2d 06 lds r22, 0x062D ; 0x80062d d776: 70 91 2e 06 lds r23, 0x062E ; 0x80062e d77a: 80 91 2f 06 lds r24, 0x062F ; 0x80062f d77e: 90 91 30 06 lds r25, 0x0630 ; 0x800630 d782: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> d786: 6b 87 std Y+11, r22 ; 0x0b d788: 7c 87 std Y+12, r23 ; 0x0c d78a: 8d 87 std Y+13, r24 ; 0x0d d78c: 9e 87 std Y+14, r25 ; 0x0e uint16_t n_segments = 0; if (mbl.active) { float len = fabs(dx) + fabs(dy); d78e: c3 01 movw r24, r6 d790: b2 01 movw r22, r4 d792: 9f 77 andi r25, 0x7F ; 127 d794: 2b 85 ldd r18, Y+11 ; 0x0b d796: 3c 85 ldd r19, Y+12 ; 0x0c d798: 4d 85 ldd r20, Y+13 ; 0x0d d79a: 5e 85 ldd r21, Y+14 ; 0x0e d79c: 5f 77 andi r21, 0x7F ; 127 d79e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d7a2: 6b 01 movw r12, r22 d7a4: 7c 01 movw r14, r24 if (len > 0) d7a6: 20 e0 ldi r18, 0x00 ; 0 d7a8: 30 e0 ldi r19, 0x00 ; 0 d7aa: a9 01 movw r20, r18 d7ac: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> d7b0: 18 16 cp r1, r24 d7b2: 0c f0 brlt .+2 ; 0xd7b6 d7b4: dd c0 rjmp .+442 ; 0xd970 // Split to 3cm segments or shorter. n_segments = uint16_t(ceil(len / 30.f)); d7b6: 20 e0 ldi r18, 0x00 ; 0 d7b8: 30 e0 ldi r19, 0x00 ; 0 d7ba: 40 ef ldi r20, 0xF0 ; 240 d7bc: 51 e4 ldi r21, 0x41 ; 65 d7be: c7 01 movw r24, r14 d7c0: b6 01 movw r22, r12 d7c2: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> d7c6: 0f 94 87 a6 call 0x34d0e ; 0x34d0e d7ca: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> d7ce: 7e 83 std Y+6, r23 ; 0x06 d7d0: 6d 83 std Y+5, r22 ; 0x05 } if (n_segments > 1 && start_segment_idx) { d7d2: 62 30 cpi r22, 0x02 ; 2 d7d4: 71 05 cpc r23, r1 d7d6: 08 f4 brcc .+2 ; 0xd7da d7d8: cb c0 rjmp .+406 ; 0xd970 d7da: 21 14 cp r2, r1 d7dc: 31 04 cpc r3, r1 d7de: 09 f4 brne .+2 ; 0xd7e2 d7e0: c7 c0 rjmp .+398 ; 0xd970 float dz = z - current_position[Z_AXIS]; d7e2: 20 91 69 12 lds r18, 0x1269 ; 0x801269 d7e6: 30 91 6a 12 lds r19, 0x126A ; 0x80126a d7ea: 40 91 6b 12 lds r20, 0x126B ; 0x80126b d7ee: 50 91 6c 12 lds r21, 0x126C ; 0x80126c d7f2: 60 91 31 06 lds r22, 0x0631 ; 0x800631 d7f6: 70 91 32 06 lds r23, 0x0632 ; 0x800632 d7fa: 80 91 33 06 lds r24, 0x0633 ; 0x800633 d7fe: 90 91 34 06 lds r25, 0x0634 ; 0x800634 d802: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> d806: 6f 87 std Y+15, r22 ; 0x0f d808: 78 8b std Y+16, r23 ; 0x10 d80a: 89 8b std Y+17, r24 ; 0x11 d80c: 9a 8b std Y+18, r25 ; 0x12 float de = e - current_position[E_AXIS]; d80e: 20 91 6d 12 lds r18, 0x126D ; 0x80126d d812: 30 91 6e 12 lds r19, 0x126E ; 0x80126e d816: 40 91 6f 12 lds r20, 0x126F ; 0x80126f d81a: 50 91 70 12 lds r21, 0x1270 ; 0x801270 d81e: 60 91 35 06 lds r22, 0x0635 ; 0x800635 d822: 70 91 36 06 lds r23, 0x0636 ; 0x800636 d826: 80 91 37 06 lds r24, 0x0637 ; 0x800637 d82a: 90 91 38 06 lds r25, 0x0638 ; 0x800638 d82e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> d832: 6b 8b std Y+19, r22 ; 0x13 d834: 7c 8b std Y+20, r23 ; 0x14 d836: 8d 8b std Y+21, r24 ; 0x15 d838: 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); d83a: ad 81 ldd r26, Y+5 ; 0x05 d83c: be 81 ldd r27, Y+6 ; 0x06 d83e: cd 01 movw r24, r26 d840: b0 e0 ldi r27, 0x00 ; 0 d842: a0 e0 ldi r26, 0x00 ; 0 d844: 8f 8f std Y+31, r24 ; 0x1f d846: 98 a3 std Y+32, r25 ; 0x20 d848: a9 a3 std Y+33, r26 ; 0x21 d84a: 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) { d84c: 2d 81 ldd r18, Y+5 ; 0x05 d84e: 3e 81 ldd r19, Y+6 ; 0x06 d850: 22 16 cp r2, r18 d852: 33 06 cpc r3, r19 d854: 08 f0 brcs .+2 ; 0xd858 d856: 8c c0 rjmp .+280 ; 0xd970 float t = float(i) / float(n_segments); d858: b1 01 movw r22, r2 d85a: 90 e0 ldi r25, 0x00 ; 0 d85c: 80 e0 ldi r24, 0x00 ; 0 d85e: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> d862: 6b 01 movw r12, r22 d864: 7c 01 movw r14, r24 d866: 6f 8d ldd r22, Y+31 ; 0x1f d868: 78 a1 ldd r23, Y+32 ; 0x20 d86a: 89 a1 ldd r24, Y+33 ; 0x21 d86c: 9a a1 ldd r25, Y+34 ; 0x22 d86e: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> d872: 9b 01 movw r18, r22 d874: ac 01 movw r20, r24 d876: c7 01 movw r24, r14 d878: b6 01 movw r22, r12 d87a: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> d87e: 6b 01 movw r12, r22 d880: 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, d882: ac 01 movw r20, r24 d884: 9b 01 movw r18, r22 d886: 6b 89 ldd r22, Y+19 ; 0x13 d888: 7c 89 ldd r23, Y+20 ; 0x14 d88a: 8d 89 ldd r24, Y+21 ; 0x15 d88c: 9e 89 ldd r25, Y+22 ; 0x16 d88e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d892: 9b 01 movw r18, r22 d894: ac 01 movw r20, r24 d896: 60 91 6d 12 lds r22, 0x126D ; 0x80126d d89a: 70 91 6e 12 lds r23, 0x126E ; 0x80126e d89e: 80 91 6f 12 lds r24, 0x126F ; 0x80126f d8a2: 90 91 70 12 lds r25, 0x1270 ; 0x801270 d8a6: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d8aa: 69 83 std Y+1, r22 ; 0x01 d8ac: 7a 83 std Y+2, r23 ; 0x02 d8ae: 8b 83 std Y+3, r24 ; 0x03 d8b0: 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, d8b2: a7 01 movw r20, r14 d8b4: 96 01 movw r18, r12 d8b6: 6f 85 ldd r22, Y+15 ; 0x0f d8b8: 78 89 ldd r23, Y+16 ; 0x10 d8ba: 89 89 ldd r24, Y+17 ; 0x11 d8bc: 9a 89 ldd r25, Y+18 ; 0x12 d8be: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__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, d8c2: 20 91 69 12 lds r18, 0x1269 ; 0x801269 d8c6: 30 91 6a 12 lds r19, 0x126A ; 0x80126a d8ca: 40 91 6b 12 lds r20, 0x126B ; 0x80126b d8ce: 50 91 6c 12 lds r21, 0x126C ; 0x80126c d8d2: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d8d6: 6f 8b std Y+23, r22 ; 0x17 d8d8: 78 8f std Y+24, r23 ; 0x18 d8da: 89 8f std Y+25, r24 ; 0x19 d8dc: 9a 8f std Y+26, r25 ; 0x1a current_position[Y_AXIS] + t * dy, d8de: a7 01 movw r20, r14 d8e0: 96 01 movw r18, r12 d8e2: 6b 85 ldd r22, Y+11 ; 0x0b d8e4: 7c 85 ldd r23, Y+12 ; 0x0c d8e6: 8d 85 ldd r24, Y+13 ; 0x0d d8e8: 9e 85 ldd r25, Y+14 ; 0x0e d8ea: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__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, d8ee: 20 91 65 12 lds r18, 0x1265 ; 0x801265 d8f2: 30 91 66 12 lds r19, 0x1266 ; 0x801266 d8f6: 40 91 67 12 lds r20, 0x1267 ; 0x801267 d8fa: 50 91 68 12 lds r21, 0x1268 ; 0x801268 d8fe: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d902: 6b 8f std Y+27, r22 ; 0x1b d904: 7c 8f std Y+28, r23 ; 0x1c d906: 8d 8f std Y+29, r24 ; 0x1d d908: 9e 8f std Y+30, r25 ; 0x1e d90a: a7 01 movw r20, r14 d90c: 96 01 movw r18, r12 d90e: c3 01 movw r24, r6 d910: b2 01 movw r22, r4 d912: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> d916: 20 91 61 12 lds r18, 0x1261 ; 0x801261 d91a: 30 91 62 12 lds r19, 0x1262 ; 0x801262 d91e: 40 91 63 12 lds r20, 0x1263 ; 0x801263 d922: 50 91 64 12 lds r21, 0x1264 ; 0x801264 d926: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d92a: 3f 92 push r3 d92c: 2f 92 push r2 d92e: a1 e6 ldi r26, 0x61 ; 97 d930: b2 e1 ldi r27, 0x12 ; 18 d932: bf 93 push r27 d934: af 93 push r26 d936: 8f 80 ldd r8, Y+7 ; 0x07 d938: 98 84 ldd r9, Y+8 ; 0x08 d93a: a9 84 ldd r10, Y+9 ; 0x09 d93c: ba 84 ldd r11, Y+10 ; 0x0a d93e: de 01 movw r26, r28 d940: 11 96 adiw r26, 0x01 ; 1 d942: 6d 01 movw r12, r26 d944: ef 88 ldd r14, Y+23 ; 0x17 d946: f8 8c ldd r15, Y+24 ; 0x18 d948: 09 8d ldd r16, Y+25 ; 0x19 d94a: 1a 8d ldd r17, Y+26 ; 0x1a d94c: 2b 8d ldd r18, Y+27 ; 0x1b d94e: 3c 8d ldd r19, Y+28 ; 0x1c d950: 4d 8d ldd r20, Y+29 ; 0x1d d952: 5e 8d ldd r21, Y+30 ; 0x1e d954: 0f 94 bf 3a call 0x2757e ; 0x2757e 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) d958: 0f 90 pop r0 d95a: 0f 90 pop r0 d95c: 0f 90 pop r0 d95e: 0f 90 pop r0 d960: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 d964: 81 11 cpse r24, r1 d966: b7 ce rjmp .-658 ; 0xd6d6 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) { d968: bf ef ldi r27, 0xFF ; 255 d96a: 2b 1a sub r2, r27 d96c: 3b 0a sbc r3, r27 d96e: 6e cf rjmp .-292 ; 0xd84c if (planner_aborted) return; } } // The rest of the path. plan_buffer_line(x, y, z, e, feed_rate, current_position); d970: e0 90 31 06 lds r14, 0x0631 ; 0x800631 d974: f0 90 32 06 lds r15, 0x0632 ; 0x800632 d978: 00 91 33 06 lds r16, 0x0633 ; 0x800633 d97c: 10 91 34 06 lds r17, 0x0634 ; 0x800634 d980: 20 91 2d 06 lds r18, 0x062D ; 0x80062d d984: 30 91 2e 06 lds r19, 0x062E ; 0x80062e d988: 40 91 2f 06 lds r20, 0x062F ; 0x80062f d98c: 50 91 30 06 lds r21, 0x0630 ; 0x800630 d990: 60 91 29 06 lds r22, 0x0629 ; 0x800629 d994: 70 91 2a 06 lds r23, 0x062A ; 0x80062a d998: 80 91 2b 06 lds r24, 0x062B ; 0x80062b d99c: 90 91 2c 06 lds r25, 0x062C ; 0x80062c d9a0: 1f 92 push r1 d9a2: 1f 92 push r1 d9a4: e1 e6 ldi r30, 0x61 ; 97 d9a6: f2 e1 ldi r31, 0x12 ; 18 d9a8: ff 93 push r31 d9aa: ef 93 push r30 d9ac: 8f 80 ldd r8, Y+7 ; 0x07 d9ae: 98 84 ldd r9, Y+8 ; 0x08 d9b0: a9 84 ldd r10, Y+9 ; 0x09 d9b2: ba 84 ldd r11, Y+10 ; 0x0a d9b4: e5 e3 ldi r30, 0x35 ; 53 d9b6: ce 2e mov r12, r30 d9b8: e6 e0 ldi r30, 0x06 ; 6 d9ba: de 2e mov r13, r30 d9bc: 0f 94 bf 3a call 0x2757e ; 0x2757e d9c0: 0f 90 pop r0 d9c2: 0f 90 pop r0 d9c4: 0f 90 pop r0 d9c6: 0f 90 pop r0 d9c8: 86 ce rjmp .-756 ; 0xd6d6 0000d9ca : /// @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) { d9ca: cf 92 push r12 d9cc: df 92 push r13 d9ce: ef 92 push r14 d9d0: ff 92 push r15 d9d2: cf 93 push r28 float travel_z = current_position[Z_AXIS]; d9d4: c0 90 69 12 lds r12, 0x1269 ; 0x801269 d9d8: d0 90 6a 12 lds r13, 0x126A ; 0x80126a d9dc: e0 90 6b 12 lds r14, 0x126B ; 0x80126b d9e0: f0 90 6c 12 lds r15, 0x126C ; 0x80126c // Prepare to move Z axis current_position[Z_AXIS] += delta; d9e4: a7 01 movw r20, r14 d9e6: 96 01 movw r18, r12 d9e8: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> d9ec: 60 93 69 12 sts 0x1269, r22 ; 0x801269 d9f0: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a d9f4: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b d9f8: 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); d9fc: 83 b1 in r24, 0x03 ; 3 #else bool z_min_endstop = false; #endif if (axis_known_position[Z_AXIS] || z_min_endstop) d9fe: 90 91 3b 06 lds r25, 0x063B ; 0x80063b da02: 91 11 cpse r25, r1 da04: 02 c0 rjmp .+4 ; 0xda0a da06: 84 ff sbrs r24, 4 da08: 26 c0 rjmp .+76 ; 0xda56 { // current position is known or very low, it's safe to raise Z clamp_to_software_endstops(current_position); da0a: 81 e6 ldi r24, 0x61 ; 97 da0c: 92 e1 ldi r25, 0x12 ; 18 da0e: 0e 94 cd 6a call 0xd59a ; 0xd59a plan_buffer_line_curposXYZE(max_feedrate[Z_AXIS]); da12: 60 91 83 0d lds r22, 0x0D83 ; 0x800d83 da16: 70 91 84 0d lds r23, 0x0D84 ; 0x800d84 da1a: 80 91 85 0d lds r24, 0x0D85 ; 0x800d85 da1e: 90 91 86 0d lds r25, 0x0D86 ; 0x800d86 da22: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); da26: 0f 94 94 18 call 0x23128 ; 0x23128 // Get the final travel distance travel_z = current_position[Z_AXIS] - travel_z; da2a: a7 01 movw r20, r14 da2c: 96 01 movw r18, r12 da2e: 60 91 69 12 lds r22, 0x1269 ; 0x801269 da32: 70 91 6a 12 lds r23, 0x126A ; 0x80126a da36: 80 91 6b 12 lds r24, 0x126B ; 0x80126b da3a: 90 91 6c 12 lds r25, 0x126C ; 0x80126c da3e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> da42: 6b 01 movw r12, r22 da44: 7c 01 movw r14, r24 #endif //TMC2130 enable_z_endstop(z_endstop_enabled); } return travel_z; } da46: c7 01 movw r24, r14 da48: b6 01 movw r22, r12 da4a: cf 91 pop r28 da4c: ff 90 pop r15 da4e: ef 90 pop r14 da50: df 90 pop r13 da52: cf 90 pop r12 da54: 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(); da56: 15 98 cbi 0x02, 5 ; 2 st_synchronize(); da58: 0f 94 94 18 call 0x23128 ; 0x23128 // rely on crashguard to limit damage bool z_endstop_enabled = enable_z_endstop(true); da5c: 81 e0 ldi r24, 0x01 ; 1 da5e: 0f 94 1a 23 call 0x24634 ; 0x24634 da62: c8 2f mov r28, r24 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); da64: 65 e5 ldi r22, 0x55 ; 85 da66: 75 e5 ldi r23, 0x55 ; 85 da68: 85 e5 ldi r24, 0x55 ; 85 da6a: 91 e4 ldi r25, 0x41 ; 65 da6c: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); da70: 0f 94 94 18 call 0x23128 ; 0x23128 // Get the final travel distance travel_z = st_get_position_mm(Z_AXIS) - travel_z; da74: 82 e0 ldi r24, 0x02 ; 2 da76: 0f 94 80 18 call 0x23100 ; 0x23100 da7a: a7 01 movw r20, r14 da7c: 96 01 movw r18, r12 da7e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> da82: 6b 01 movw r12, r22 da84: 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); da86: 8c 2f mov r24, r28 da88: 0f 94 1a 23 call 0x24634 ; 0x24634 da8c: dc cf rjmp .-72 ; 0xda46 0000da8e : // // 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) { da8e: 8f 92 push r8 da90: 9f 92 push r9 da92: af 92 push r10 da94: bf 92 push r11 da96: cf 92 push r12 da98: df 92 push r13 da9a: ef 92 push r14 da9c: ff 92 push r15 da9e: 4b 01 movw r8, r22 daa0: 5c 01 movw r10, r24 if (current_position[Z_AXIS] >= target) daa2: c0 90 69 12 lds r12, 0x1269 ; 0x801269 daa6: d0 90 6a 12 lds r13, 0x126A ; 0x80126a daaa: e0 90 6b 12 lds r14, 0x126B ; 0x80126b daae: f0 90 6c 12 lds r15, 0x126C ; 0x80126c dab2: ac 01 movw r20, r24 dab4: 9b 01 movw r18, r22 dab6: c7 01 movw r24, r14 dab8: b6 01 movw r22, r12 daba: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> dabe: 87 ff sbrs r24, 7 dac0: 11 c0 rjmp .+34 ; 0xdae4 return; // Use absolute value in case the current position is unknown raise_z(fabs(current_position[Z_AXIS] - target)); dac2: a5 01 movw r20, r10 dac4: 94 01 movw r18, r8 dac6: c7 01 movw r24, r14 dac8: b6 01 movw r22, r12 daca: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> dace: 9f 77 andi r25, 0x7F ; 127 } dad0: ff 90 pop r15 dad2: ef 90 pop r14 dad4: df 90 pop r13 dad6: cf 90 pop r12 dad8: bf 90 pop r11 dada: af 90 pop r10 dadc: 9f 90 pop r9 dade: 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)); dae0: 0c 94 e5 6c jmp 0xd9ca ; 0xd9ca } 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 daf4: 08 95 ret 0000daf6 : #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 { daf6: 2f 92 push r2 daf8: 3f 92 push r3 dafa: 4f 92 push r4 dafc: 5f 92 push r5 dafe: 6f 92 push r6 db00: 7f 92 push r7 db02: 8f 92 push r8 db04: 9f 92 push r9 db06: af 92 push r10 db08: bf 92 push r11 db0a: cf 92 push r12 db0c: df 92 push r13 db0e: ef 92 push r14 db10: ff 92 push r15 db12: 0f 93 push r16 db14: 1f 93 push r17 db16: cf 93 push r28 db18: df 93 push r29 db1a: 00 d0 rcall .+0 ; 0xdb1c db1c: 1f 92 push r1 db1e: 1f 92 push r1 db20: cd b7 in r28, 0x3d ; 61 db22: de b7 in r29, 0x3e ; 62 db24: d8 2e mov r13, r24 db26: 2a 01 movw r4, r20 db28: 3b 01 movw r6, r22 db2a: 32 2e mov r3, r18 db2c: e9 82 std Y+1, r14 ; 0x01 db2e: fa 82 std Y+2, r15 ; 0x02 db30: 0b 83 std Y+3, r16 ; 0x03 db32: 1c 83 std Y+4, r17 ; 0x04 // Flag for the display update routine and to disable the print cancelation during homing. st_synchronize(); db34: 0f 94 94 18 call 0x23128 ; 0x23128 homing_flag = true; db38: 81 e0 ldi r24, 0x01 ; 1 db3a: 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; db3e: fc 2c mov r15, r12 db40: e3 2c mov r14, r3 db42: d3 10 cpse r13, r3 db44: 10 c0 rjmp .+32 ; 0xdb66 db46: ed 2c mov r14, r13 db48: dc 10 cpse r13, r12 db4a: 0d c0 rjmp .+26 ; 0xdb66 // 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); db4c: 60 e0 ldi r22, 0x00 ; 0 db4e: 70 e0 ldi r23, 0x00 ; 0 db50: 80 ea ldi r24, 0xA0 ; 160 db52: 90 e4 ldi r25, 0x40 ; 64 db54: 0e 94 47 6d call 0xda8e ; 0xda8e // 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; db58: ff 24 eor r15, r15 db5a: f3 94 inc r15 db5c: ee 24 eor r14, r14 db5e: e3 94 inc r14 db60: 22 24 eor r2, r2 db62: 23 94 inc r2 db64: 01 c0 rjmp .+2 ; 0xdb68 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; db66: 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(); db68: 0e 94 7e 62 call 0xc4fc ; 0xc4fc // 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; db6c: 80 91 09 13 lds r24, 0x1309 ; 0x801309 db70: 8d 83 std Y+5, r24 ; 0x05 mbl.active = 0; db72: 10 92 09 13 sts 0x1309, r1 ; 0x801309 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); db76: 82 e0 ldi r24, 0x02 ; 2 db78: 0f 94 80 18 call 0x23100 ; 0x23100 db7c: 60 93 69 12 sts 0x1269, r22 ; 0x801269 db80: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a db84: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b db88: 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) db8c: f1 10 cpse r15, r1 babystep_undo(); db8e: 0f 94 70 52 call 0x2a4e0 ; 0x2a4e0 int l_feedmultiply = setup_for_endstop_move(); db92: 81 e0 ldi r24, 0x01 ; 1 db94: 0e 94 b7 65 call 0xcb6e ; 0xcb6e db98: 8c 01 movw r16, r24 set_destination_to_current(); db9a: 0e 94 ff 66 call 0xcdfe ; 0xcdfe feedrate = 0.0; db9e: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a dba2: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b dba6: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c dbaa: 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); dbae: 22 20 and r2, r2 dbb0: 19 f0 breq .+6 ; 0xdbb8 dbb2: 80 e0 ldi r24, 0x00 ; 0 dbb4: 0f 94 4f 7a call 0x2f49e ; 0x2f49e if(home_y) homeaxis(Y_AXIS); dbb8: ee 20 and r14, r14 dbba: 19 f0 breq .+6 ; 0xdbc2 dbbc: 81 e0 ldi r24, 0x01 ; 1 dbbe: 0f 94 4f 7a call 0x2f49e ; 0x2f49e #endif //TMC2130 if(home_x_axis && home_x_value != 0) dbc2: dd 20 and r13, r13 dbc4: e9 f0 breq .+58 ; 0xdc00 dbc6: 41 14 cp r4, r1 dbc8: 51 04 cpc r5, r1 dbca: 61 04 cpc r6, r1 dbcc: 71 04 cpc r7, r1 dbce: c1 f0 breq .+48 ; 0xdc00 current_position[X_AXIS]=home_x_value+cs.add_homing[X_AXIS]; dbd0: c3 01 movw r24, r6 dbd2: b2 01 movw r22, r4 dbd4: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> dbd8: 9b 01 movw r18, r22 dbda: ac 01 movw r20, r24 dbdc: 60 91 bf 0d lds r22, 0x0DBF ; 0x800dbf dbe0: 70 91 c0 0d lds r23, 0x0DC0 ; 0x800dc0 dbe4: 80 91 c1 0d lds r24, 0x0DC1 ; 0x800dc1 dbe8: 90 91 c2 0d lds r25, 0x0DC2 ; 0x800dc2 dbec: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> dbf0: 60 93 61 12 sts 0x1261, r22 ; 0x801261 dbf4: 70 93 62 12 sts 0x1262, r23 ; 0x801262 dbf8: 80 93 63 12 sts 0x1263, r24 ; 0x801263 dbfc: 90 93 64 12 sts 0x1264, r25 ; 0x801264 if(home_y_axis && home_y_value != 0) dc00: 33 20 and r3, r3 dc02: 01 f1 breq .+64 ; 0xdc44 dc04: 89 81 ldd r24, Y+1 ; 0x01 dc06: 9a 81 ldd r25, Y+2 ; 0x02 dc08: ab 81 ldd r26, Y+3 ; 0x03 dc0a: bc 81 ldd r27, Y+4 ; 0x04 dc0c: 00 97 sbiw r24, 0x00 ; 0 dc0e: a1 05 cpc r26, r1 dc10: b1 05 cpc r27, r1 dc12: c1 f0 breq .+48 ; 0xdc44 current_position[Y_AXIS]=home_y_value+cs.add_homing[Y_AXIS]; dc14: bc 01 movw r22, r24 dc16: cd 01 movw r24, r26 dc18: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> dc1c: 9b 01 movw r18, r22 dc1e: ac 01 movw r20, r24 dc20: 60 91 c3 0d lds r22, 0x0DC3 ; 0x800dc3 dc24: 70 91 c4 0d lds r23, 0x0DC4 ; 0x800dc4 dc28: 80 91 c5 0d lds r24, 0x0DC5 ; 0x800dc5 dc2c: 90 91 c6 0d lds r25, 0x0DC6 ; 0x800dc6 dc30: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> dc34: 60 93 65 12 sts 0x1265, r22 ; 0x801265 dc38: 70 93 66 12 sts 0x1266, r23 ; 0x801266 dc3c: 80 93 67 12 sts 0x1267, r24 ; 0x801267 dc40: 90 93 68 12 sts 0x1268, r25 ; 0x801268 #if Z_HOME_DIR < 0 // If homing towards BED do Z last if(home_z) { dc44: ff 20 and r15, r15 dc46: 09 f4 brne .+2 ; 0xdc4a dc48: 99 c0 rjmp .+306 ; 0xdd7c #ifdef MESH_BED_LEVELING // If Mesh bed leveling, move X&Y to safe position for home raise_z_above(MESH_HOME_Z_SEARCH); dc4a: 60 e0 ldi r22, 0x00 ; 0 dc4c: 70 e0 ldi r23, 0x00 ; 0 dc4e: 80 ea ldi r24, 0xA0 ; 160 dc50: 90 e4 ldi r25, 0x40 ; 64 dc52: 0e 94 47 6d call 0xda8e ; 0xda8e if (!axis_known_position[X_AXIS]) homeaxis(X_AXIS); dc56: 80 91 39 06 lds r24, 0x0639 ; 0x800639 dc5a: 81 11 cpse r24, r1 dc5c: 02 c0 rjmp .+4 ; 0xdc62 dc5e: 0f 94 4f 7a call 0x2f49e ; 0x2f49e if (!axis_known_position[Y_AXIS]) homeaxis(Y_AXIS); dc62: 80 91 3a 06 lds r24, 0x063A ; 0x80063a dc66: 81 11 cpse r24, r1 dc68: 03 c0 rjmp .+6 ; 0xdc70 dc6a: 81 e0 ldi r24, 0x01 ; 1 dc6c: 0f 94 4f 7a call 0x2f49e ; 0x2f49e // 1st mesh bed leveling measurement point, corrected. world2machine_initialize(); dc70: 0e 94 17 61 call 0xc22e ; 0xc22e world2machine(pgm_read_float(bed_ref_points_4), pgm_read_float(bed_ref_points_4+1), destination[X_AXIS], destination[Y_AXIS]); dc74: e5 e0 ldi r30, 0x05 ; 5 dc76: fd e9 ldi r31, 0x9D ; 157 dc78: 85 91 lpm r24, Z+ dc7a: 95 91 lpm r25, Z+ dc7c: a5 91 lpm r26, Z+ dc7e: b4 91 lpm r27, Z dc80: e1 e0 ldi r30, 0x01 ; 1 dc82: fd e9 ldi r31, 0x9D ; 157 dc84: 45 91 lpm r20, Z+ dc86: 55 91 lpm r21, Z+ dc88: 65 91 lpm r22, Z+ dc8a: 74 91 lpm r23, Z } } inline void world2machine(const float &x, const float &y, float &out_x, float &out_y) { out_x = x; dc8c: 40 93 29 06 sts 0x0629, r20 ; 0x800629 dc90: 50 93 2a 06 sts 0x062A, r21 ; 0x80062a dc94: 60 93 2b 06 sts 0x062B, r22 ; 0x80062b dc98: 70 93 2c 06 sts 0x062C, r23 ; 0x80062c out_y = y; dc9c: 80 93 2d 06 sts 0x062D, r24 ; 0x80062d dca0: 90 93 2e 06 sts 0x062E, r25 ; 0x80062e dca4: a0 93 2f 06 sts 0x062F, r26 ; 0x80062f dca8: b0 93 30 06 sts 0x0630, r27 ; 0x800630 world2machine(out_x, out_y); dcac: 6d e2 ldi r22, 0x2D ; 45 dcae: 76 e0 ldi r23, 0x06 ; 6 dcb0: 89 e2 ldi r24, 0x29 ; 41 dcb2: 96 e0 ldi r25, 0x06 ; 6 dcb4: 0e 94 c7 68 call 0xd18e ; 0xd18e world2machine_reset(); dcb8: 0e 94 45 62 call 0xc48a ; 0xc48a if (destination[Y_AXIS] < Y_MIN_POS) dcbc: 20 e0 ldi r18, 0x00 ; 0 dcbe: 30 e0 ldi r19, 0x00 ; 0 dcc0: 40 e8 ldi r20, 0x80 ; 128 dcc2: 50 ec ldi r21, 0xC0 ; 192 dcc4: 60 91 2d 06 lds r22, 0x062D ; 0x80062d dcc8: 70 91 2e 06 lds r23, 0x062E ; 0x80062e dccc: 80 91 2f 06 lds r24, 0x062F ; 0x80062f dcd0: 90 91 30 06 lds r25, 0x0630 ; 0x800630 dcd4: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> dcd8: 87 ff sbrs r24, 7 dcda: 0c c0 rjmp .+24 ; 0xdcf4 destination[Y_AXIS] = Y_MIN_POS; dcdc: 80 e0 ldi r24, 0x00 ; 0 dcde: 90 e0 ldi r25, 0x00 ; 0 dce0: a0 e8 ldi r26, 0x80 ; 128 dce2: b0 ec ldi r27, 0xC0 ; 192 dce4: 80 93 2d 06 sts 0x062D, r24 ; 0x80062d dce8: 90 93 2e 06 sts 0x062E, r25 ; 0x80062e dcec: a0 93 2f 06 sts 0x062F, r26 ; 0x80062f dcf0: b0 93 30 06 sts 0x0630, r27 ; 0x800630 feedrate = homing_feedrate[X_AXIS] / 20; dcf4: 80 e0 ldi r24, 0x00 ; 0 dcf6: 90 e0 ldi r25, 0x00 ; 0 dcf8: a6 e1 ldi r26, 0x16 ; 22 dcfa: b3 e4 ldi r27, 0x43 ; 67 dcfc: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a dd00: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b dd04: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c dd08: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d dd0c: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.385> #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(); dd10: 0f 94 cd 48 call 0x2919a ; 0x2919a 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); dd14: 60 91 7a 02 lds r22, 0x027A ; 0x80027a dd18: 70 91 7b 02 lds r23, 0x027B ; 0x80027b dd1c: 80 91 7c 02 lds r24, 0x027C ; 0x80027c dd20: 90 91 7d 02 lds r25, 0x027D ; 0x80027d dd24: 0f 94 da 49 call 0x293b4 ; 0x293b4 st_synchronize(); dd28: 0f 94 94 18 call 0x23128 ; 0x23128 current_position[X_AXIS] = destination[X_AXIS]; dd2c: 80 91 29 06 lds r24, 0x0629 ; 0x800629 dd30: 90 91 2a 06 lds r25, 0x062A ; 0x80062a dd34: a0 91 2b 06 lds r26, 0x062B ; 0x80062b dd38: b0 91 2c 06 lds r27, 0x062C ; 0x80062c dd3c: 80 93 61 12 sts 0x1261, r24 ; 0x801261 dd40: 90 93 62 12 sts 0x1262, r25 ; 0x801262 dd44: a0 93 63 12 sts 0x1263, r26 ; 0x801263 dd48: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = destination[Y_AXIS]; dd4c: 80 91 2d 06 lds r24, 0x062D ; 0x80062d dd50: 90 91 2e 06 lds r25, 0x062E ; 0x80062e dd54: a0 91 2f 06 lds r26, 0x062F ; 0x80062f dd58: b0 91 30 06 lds r27, 0x0630 ; 0x800630 dd5c: 80 93 65 12 sts 0x1265, r24 ; 0x801265 dd60: 90 93 66 12 sts 0x1266, r25 ; 0x801266 dd64: a0 93 67 12 sts 0x1267, r26 ; 0x801267 dd68: b0 93 68 12 sts 0x1268, r27 ; 0x801268 dd6c: 81 e0 ldi r24, 0x01 ; 1 dd6e: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.385> enable_endstops(true); endstops_hit_on_purpose(); dd72: 0f 94 36 23 call 0x2466c ; 0x2466c homeaxis(Z_AXIS); dd76: 82 e0 ldi r24, 0x02 ; 2 dd78: 0f 94 4f 7a call 0x2f49e ; 0x2f49e homeaxis(Z_AXIS); #endif // MESH_BED_LEVELING } #endif // Z_HOME_DIR < 0 if(home_z_axis && home_z_value != 0) dd7c: cc 20 and r12, r12 dd7e: e9 f0 breq .+58 ; 0xddba dd80: 81 14 cp r8, r1 dd82: 91 04 cpc r9, r1 dd84: a1 04 cpc r10, r1 dd86: b1 04 cpc r11, r1 dd88: c1 f0 breq .+48 ; 0xddba current_position[Z_AXIS]=home_z_value+cs.add_homing[Z_AXIS]; dd8a: c5 01 movw r24, r10 dd8c: b4 01 movw r22, r8 dd8e: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> dd92: 9b 01 movw r18, r22 dd94: ac 01 movw r20, r24 dd96: 60 91 c7 0d lds r22, 0x0DC7 ; 0x800dc7 dd9a: 70 91 c8 0d lds r23, 0x0DC8 ; 0x800dc8 dd9e: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 dda2: 90 91 ca 0d lds r25, 0x0DCA ; 0x800dca dda6: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> ddaa: 60 93 69 12 sts 0x1269, r22 ; 0x801269 ddae: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a ddb2: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b ddb6: 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(); ddba: 0f 94 cd 48 call 0x2919a ; 0x2919a clean_up_after_endstop_move(l_feedmultiply); ddbe: c8 01 movw r24, r16 ddc0: 0e 94 9d 65 call 0xcb3a ; 0xcb3a endstops_hit_on_purpose(); ddc4: 0f 94 36 23 call 0x2466c ; 0x2466c // Load the machine correction matrix world2machine_initialize(); ddc8: 0e 94 17 61 call 0xc22e ; 0xc22e // and correct the current_position XY axes to match the transformed coordinate system. world2machine_update_current(); ddcc: 0e 94 53 5f call 0xbea6 ; 0xbea6 #ifdef MESH_BED_LEVELING if (home_x_axis || home_y_axis || without_mbl || home_z_axis) ddd0: d1 10 cpse r13, r1 ddd2: 07 c0 rjmp .+14 ; 0xdde2 ddd4: 31 10 cpse r3, r1 ddd6: 05 c0 rjmp .+10 ; 0xdde2 ddd8: 8b 8d ldd r24, Y+27 ; 0x1b ddda: 81 11 cpse r24, r1 dddc: 02 c0 rjmp .+4 ; 0xdde2 ddde: cc 20 and r12, r12 dde0: 39 f1 breq .+78 ; 0xde30 { if (! home_z && mbl_was_active) { dde2: f1 10 cpse r15, r1 dde4: 25 c0 rjmp .+74 ; 0xde30 dde6: 9d 81 ldd r25, Y+5 ; 0x05 dde8: 99 23 and r25, r25 ddea: 11 f1 breq .+68 ; 0xde30 // Re-enable the mesh bed leveling if only the X and Y axes were re-homed. mbl.active = true; ddec: 81 e0 ldi r24, 0x01 ; 1 ddee: 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)); ddf2: 0f 94 80 18 call 0x23100 ; 0x23100 ddf6: 6b 01 movw r12, r22 ddf8: 7c 01 movw r14, r24 ddfa: 80 e0 ldi r24, 0x00 ; 0 ddfc: 0f 94 80 18 call 0x23100 ; 0x23100 de00: a7 01 movw r20, r14 de02: 96 01 movw r18, r12 de04: 0f 94 19 92 call 0x32432 ; 0x32432 de08: 9b 01 movw r18, r22 de0a: ac 01 movw r20, r24 de0c: 60 91 69 12 lds r22, 0x1269 ; 0x801269 de10: 70 91 6a 12 lds r23, 0x126A ; 0x80126a de14: 80 91 6b 12 lds r24, 0x126B ; 0x80126b de18: 90 91 6c 12 lds r25, 0x126C ; 0x80126c de1c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> de20: 60 93 69 12 sts 0x1269, r22 ; 0x801269 de24: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a de28: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b de2c: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c } } #endif prusa_statistics(20); de30: 84 e1 ldi r24, 0x14 ; 20 de32: 0f 94 05 30 call 0x2600a ; 0x2600a st_synchronize(); de36: 0f 94 94 18 call 0x23128 ; 0x23128 homing_flag = false; de3a: 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 } de3e: 0f 90 pop r0 de40: 0f 90 pop r0 de42: 0f 90 pop r0 de44: 0f 90 pop r0 de46: 0f 90 pop r0 de48: df 91 pop r29 de4a: cf 91 pop r28 de4c: 1f 91 pop r17 de4e: 0f 91 pop r16 de50: ff 90 pop r15 de52: ef 90 pop r14 de54: df 90 pop r13 de56: cf 90 pop r12 de58: bf 90 pop r11 de5a: af 90 pop r10 de5c: 9f 90 pop r9 de5e: 8f 90 pop r8 de60: 7f 90 pop r7 de62: 6f 90 pop r6 de64: 5f 90 pop r5 de66: 4f 90 pop r4 de68: 3f 90 pop r3 de6a: 2f 90 pop r2 de6c: 08 95 ret 0000de6e : static void lcd_invalidate_custom_characters() { memset(lcd_custom_characters, 0x7F, sizeof(lcd_custom_characters)); } void lcd_frame_start() { de6e: e1 e3 ldi r30, 0x31 ; 49 de70: 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; de72: 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]; de74: 81 91 ld r24, Z+ if (c == 0x7F) { //slot empty de76: 8f 37 cpi r24, 0x7F ; 127 de78: 31 f0 breq .+12 ; 0xde86 de7a: df 01 movw r26, r30 de7c: 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 de7e: 87 ff sbrs r24, 7 de80: 07 c0 rjmp .+14 ; 0xde90 lcd_custom_characters[i] = c & 0x7F; de82: 8f 77 andi r24, 0x7F ; 127 de84: 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++) { de86: 83 e0 ldi r24, 0x03 ; 3 de88: e9 33 cpi r30, 0x39 ; 57 de8a: f8 07 cpc r31, r24 de8c: 99 f7 brne .-26 ; 0xde74 for (uint8_t i = 0; i < 8; i++) { printf_P(PSTR(" %02x"), lcd_custom_characters[i]); } printf_P(PSTR("\n")); #endif // DEBUG_CUSTOM_CHARACTERS } de8e: 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; de90: 9c 93 st X, r25 de92: f9 cf rjmp .-14 ; 0xde86 0000de94 : } } void lcd_update(uint8_t lcdDrawUpdateOverride) { if (lcd_draw_update < lcdDrawUpdateOverride) de94: 90 91 59 02 lds r25, 0x0259 ; 0x800259 de98: 98 17 cp r25, r24 de9a: 10 f4 brcc .+4 ; 0xdea0 lcd_draw_update = lcdDrawUpdateOverride; de9c: 80 93 59 02 sts 0x0259, r24 ; 0x800259 if (!lcd_update_enabled) return; dea0: 80 91 5a 02 lds r24, 0x025A ; 0x80025a dea4: 88 23 and r24, r24 dea6: 39 f0 breq .+14 ; 0xdeb6 if (lcd_lcdupdate_func) dea8: e0 91 04 04 lds r30, 0x0404 ; 0x800404 deac: f0 91 05 04 lds r31, 0x0405 ; 0x800405 deb0: 30 97 sbiw r30, 0x00 ; 0 deb2: 09 f0 breq .+2 ; 0xdeb6 lcd_lcdupdate_func(); deb4: 19 94 eijmp } deb6: 08 95 ret 0000deb8 : lcd_set_cursor(c, r); return fputs_P(str, lcdout); } int lcd_printf_P(const char* format, ...) { deb8: cf 93 push r28 deba: df 93 push r29 debc: cd b7 in r28, 0x3d ; 61 debe: de b7 in r29, 0x3e ; 62 dec0: ae 01 movw r20, r28 dec2: 4a 5f subi r20, 0xFA ; 250 dec4: 5f 4f sbci r21, 0xFF ; 255 dec6: fa 01 movw r30, r20 dec8: 61 91 ld r22, Z+ deca: 71 91 ld r23, Z+ decc: af 01 movw r20, r30 va_list args; va_start(args, format); int ret = vfprintf_P(lcdout, format, args); dece: 82 ef ldi r24, 0xF2 ; 242 ded0: 93 e0 ldi r25, 0x03 ; 3 ded2: 0f 94 c8 a3 call 0x34790 ; 0x34790 va_end(args); return ret; } ded6: df 91 pop r29 ded8: cf 91 pop r28 deda: 08 95 ret 0000dedc : return fputc(ch, lcdout); } int lcd_puts_P(const char* str) { return fputs_P(str, lcdout); dedc: 62 ef ldi r22, 0xF2 ; 242 dede: 73 e0 ldi r23, 0x03 ; 3 dee0: 0d 94 19 a3 jmp 0x34632 ; 0x34632 0000dee4 : lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address } int lcd_putc(char c) { return fputc(c, lcdout); dee4: 62 ef ldi r22, 0xF2 ; 242 dee6: 73 e0 ldi r23, 0x03 ; 3 dee8: 08 2e mov r0, r24 deea: 00 0c add r0, r0 deec: 99 0b sbc r25, r25 deee: 0d 94 e9 a2 jmp 0x345d2 ; 0x345d2 0000def2 : va_end(args); return ret; } void lcd_space(uint8_t n) { def2: cf 93 push r28 def4: c8 2f mov r28, r24 while (n--) lcd_putc(' '); def6: c1 50 subi r28, 0x01 ; 1 def8: 20 f0 brcs .+8 ; 0xdf02 defa: 80 e2 ldi r24, 0x20 ; 32 defc: 0e 94 72 6f call 0xdee4 ; 0xdee4 df00: fa cf rjmp .-12 ; 0xdef6 } df02: cf 91 pop r28 df04: 08 95 ret 0000df06 : /// @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) { df06: 0f 93 push r16 df08: 1f 93 push r17 df0a: cf 93 push r28 df0c: df 93 push r29 df0e: eb 01 movw r28, r22 df10: 14 2f mov r17, r20 df12: 05 2f mov r16, r21 lcd_putc(chr); df14: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_puts_P(str); df18: ce 01 movw r24, r28 df1a: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_putc(':'); df1e: 8a e3 ldi r24, 0x3A ; 58 df20: 0e 94 72 6f call 0xdee4 ; 0xdee4 #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); df24: ce 01 movw r24, r28 df26: 0f 94 3f a2 call 0x3447e ; 0x3447e <__strlen_P> // Padding to compensate variable string length const uint8_t len = strlen_P(str); lcd_space((LCD_WIDTH - 4) - (2 + len)); df2a: 9e e0 ldi r25, 0x0E ; 14 df2c: 98 1b sub r25, r24 df2e: 89 2f mov r24, r25 df30: 0e 94 79 6f call 0xdef2 ; 0xdef2 // Right adjusted value lcd_printf_P(PSTR("%4d"), val); df34: 0f 93 push r16 df36: 1f 93 push r17 df38: 84 e0 ldi r24, 0x04 ; 4 df3a: 92 e8 ldi r25, 0x82 ; 130 df3c: 9f 93 push r25 df3e: 8f 93 push r24 df40: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 df44: 0f 90 pop r0 df46: 0f 90 pop r0 df48: 0f 90 pop r0 df4a: 0f 90 pop r0 } df4c: df 91 pop r29 df4e: cf 91 pop r28 df50: 1f 91 pop r17 df52: 0f 91 pop r16 df54: 08 95 ret 0000df56 : { return pgm_read_byte(row_offsets + min(row, LCD_HEIGHT - 1)); } void lcd_set_cursor(uint8_t col, uint8_t row) { df56: cf 93 push r28 df58: c8 2f mov r28, r24 df5a: 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); df5c: 64 30 cpi r22, 0x04 ; 4 df5e: 08 f0 brcs .+2 ; 0xdf62 df60: 83 e0 ldi r24, 0x03 ; 3 df62: 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); df66: 0e 94 7d 55 call 0xaafa ; 0xaafa df6a: 8c 0f add r24, r28 lcd_ddram_address = addr; df6c: 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); df70: 44 e6 ldi r20, 0x64 ; 100 df72: 50 e0 ldi r21, 0x00 ; 0 df74: 60 e0 ldi r22, 0x00 ; 0 df76: 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); } df78: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); df7a: 0c 94 05 5e jmp 0xbc0a ; 0xbc0a 0000df7e : 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) { df7e: 7f 92 push r7 df80: 8f 92 push r8 df82: 9f 92 push r9 df84: af 92 push r10 df86: bf 92 push r11 df88: cf 92 push r12 df8a: df 92 push r13 df8c: ef 92 push r14 df8e: ff 92 push r15 df90: 0f 93 push r16 df92: 1f 93 push r17 df94: cf 93 push r28 df96: df 93 push r29 menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (menu_item == menu_line) df98: e0 91 63 04 lds r30, 0x0463 ; 0x800463 df9c: 50 91 62 04 lds r21, 0x0462 ; 0x800462 dfa0: e5 13 cpse r30, r21 dfa2: 73 c0 rjmp .+230 ; 0xe08a { int16_t cur_val = (pbits == 8 ? *((uint8_t*)pval) : *((int16_t*)pval)); dfa4: fb 01 movw r30, r22 dfa6: 48 30 cpi r20, 0x08 ; 8 dfa8: 09 f0 breq .+2 ; 0xdfac dfaa: 6c c0 rjmp .+216 ; 0xe084 dfac: c0 81 ld r28, Z dfae: d0 e0 ldi r29, 0x00 ; 0 dfb0: 49 01 movw r8, r18 dfb2: 74 2e mov r7, r20 dfb4: 6b 01 movw r12, r22 dfb6: 5c 01 movw r10, r24 if (lcd_draw_update) dfb8: 80 91 59 02 lds r24, 0x0259 ; 0x800259 dfbc: 88 23 and r24, r24 dfbe: 59 f0 breq .+22 ; 0xdfd6 { lcd_set_cursor(0, menu_row); dfc0: 60 91 60 04 lds r22, 0x0460 ; 0x800460 dfc4: 80 e0 ldi r24, 0x00 ; 0 dfc6: 0e 94 ab 6f call 0xdf56 ; 0xdf56 menu_draw_P(menu_selection_mark(), str, cur_val); dfca: 0e 94 b7 62 call 0xc56e ; 0xc56e dfce: ae 01 movw r20, r28 dfd0: b5 01 movw r22, r10 dfd2: 0e 94 83 6f call 0xdf06 ; 0xdf06 } if (menu_clicked && (lcd_encoder == menu_item)) dfd6: 80 91 61 04 lds r24, 0x0461 ; 0x800461 dfda: 88 23 and r24, r24 dfdc: 09 f4 brne .+2 ; 0xdfe0 dfde: 55 c0 rjmp .+170 ; 0xe08a dfe0: 90 91 63 04 lds r25, 0x0463 ; 0x800463 dfe4: 20 91 1e 06 lds r18, 0x061E ; 0x80061e dfe8: 30 91 1f 06 lds r19, 0x061F ; 0x80061f dfec: 92 17 cp r25, r18 dfee: 13 06 cpc r1, r19 dff0: 09 f0 breq .+2 ; 0xdff4 dff2: 4b c0 rjmp .+150 ; 0xe08a } } void menu_submenu_no_reset(menu_func_t submenu, const bool feedback) { if (menu_depth < MENU_DEPTH_MAX) dff4: 80 91 df 03 lds r24, 0x03DF ; 0x8003df dff8: 87 30 cpi r24, 0x07 ; 7 dffa: d8 f4 brcc .+54 ; 0xe032 { menu_stack[menu_depth].menu = menu_menu; dffc: 28 2f mov r18, r24 dffe: 30 e0 ldi r19, 0x00 ; 0 e000: f9 01 movw r30, r18 e002: ee 0f add r30, r30 e004: ff 1f adc r31, r31 e006: e2 0f add r30, r18 e008: f3 1f adc r31, r19 e00a: e9 5a subi r30, 0xA9 ; 169 e00c: fc 4f sbci r31, 0xFC ; 252 e00e: 20 91 02 04 lds r18, 0x0402 ; 0x800402 e012: 30 91 03 04 lds r19, 0x0403 ; 0x800403 e016: 31 83 std Z+1, r19 ; 0x01 e018: 20 83 st Z, r18 menu_stack[menu_depth++].position = lcd_encoder; e01a: 8f 5f subi r24, 0xFF ; 255 e01c: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df e020: 92 83 std Z+2, r25 ; 0x02 menu_goto(submenu, 0, false, feedback); e022: 20 e0 ldi r18, 0x00 ; 0 e024: 40 e0 ldi r20, 0x00 ; 0 e026: 70 e0 ldi r23, 0x00 ; 0 e028: 60 e0 ldi r22, 0x00 ; 0 e02a: 83 ed ldi r24, 0xD3 ; 211 e02c: 93 e7 ldi r25, 0x73 ; 115 e02e: 0e 94 08 63 call 0xc610 ; 0xc610 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; e032: b0 92 97 03 sts 0x0397, r11 ; 0x800397 e036: a0 92 96 03 sts 0x0396, r10 ; 0x800396 _md->editValuePtr = pval; e03a: d0 92 9a 03 sts 0x039A, r13 ; 0x80039a e03e: c0 92 99 03 sts 0x0399, r12 ; 0x800399 _md->editValueBits = pbits; e042: 70 92 98 03 sts 0x0398, r7 ; 0x800398 _md->currentValue = cur_val; e046: d0 93 9c 03 sts 0x039C, r29 ; 0x80039c e04a: c0 93 9b 03 sts 0x039B, r28 ; 0x80039b _md->minEditValue = min_val; e04e: 90 92 9e 03 sts 0x039E, r9 ; 0x80039e e052: 80 92 9d 03 sts 0x039D, r8 ; 0x80039d _md->maxEditValue = max_val; e056: 10 93 a0 03 sts 0x03A0, r17 ; 0x8003a0 e05a: 00 93 9f 03 sts 0x039F, r16 ; 0x80039f _md->minJumpValue = jmp_val; e05e: f0 92 a2 03 sts 0x03A2, r15 ; 0x8003a2 e062: e0 92 a1 03 sts 0x03A1, r14 ; 0x8003a1 menu_item_ret(); return; } } menu_item++; } e066: df 91 pop r29 e068: cf 91 pop r28 e06a: 1f 91 pop r17 e06c: 0f 91 pop r16 e06e: ff 90 pop r15 e070: ef 90 pop r14 e072: df 90 pop r13 e074: cf 90 pop r12 e076: bf 90 pop r11 e078: af 90 pop r10 e07a: 9f 90 pop r9 e07c: 8f 90 pop r8 e07e: 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(); e080: 0c 94 c4 62 jmp 0xc588 ; 0xc588 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)); e084: c0 81 ld r28, Z e086: d1 81 ldd r29, Z+1 ; 0x01 e088: 93 cf rjmp .-218 ; 0xdfb0 _md->minJumpValue = jmp_val; menu_item_ret(); return; } } menu_item++; e08a: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e08e: 8f 5f subi r24, 0xFF ; 255 e090: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e094: df 91 pop r29 e096: cf 91 pop r28 e098: 1f 91 pop r17 e09a: 0f 91 pop r16 e09c: ff 90 pop r15 e09e: ef 90 pop r14 e0a0: df 90 pop r13 e0a2: cf 90 pop r12 e0a4: bf 90 pop r11 e0a6: af 90 pop r10 e0a8: 9f 90 pop r9 e0aa: 8f 90 pop r8 e0ac: 7f 90 pop r7 e0ae: 08 95 ret 0000e0b0 : { return fputs_P(str, lcdout); } int lcd_puts_at_P(uint8_t c, uint8_t r, const char* str) { e0b0: cf 93 push r28 e0b2: df 93 push r29 e0b4: ea 01 movw r28, r20 lcd_set_cursor(c, r); e0b6: 0e 94 ab 6f call 0xdf56 ; 0xdf56 return fputs_P(str, lcdout); e0ba: 62 ef ldi r22, 0xF2 ; 242 e0bc: 73 e0 ldi r23, 0x03 ; 3 e0be: ce 01 movw r24, r28 } e0c0: df 91 pop r29 e0c2: 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); e0c4: 0d 94 19 a3 jmp 0x34632 ; 0x34632 0000e0c8 : { return fputc(c, lcdout); } int lcd_putc_at(uint8_t c, uint8_t r, char ch) { e0c8: cf 93 push r28 e0ca: c4 2f mov r28, r20 lcd_set_cursor(c, r); e0cc: 0e 94 ab 6f call 0xdf56 ; 0xdf56 return fputc(ch, lcdout); e0d0: 62 ef ldi r22, 0xF2 ; 242 e0d2: 73 e0 ldi r23, 0x03 ; 3 e0d4: 8c 2f mov r24, r28 e0d6: cc 0f add r28, r28 e0d8: 99 0b sbc r25, r25 } e0da: 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); e0dc: 0d 94 e9 a2 jmp 0x345d2 ; 0x345d2 0000e0e0 : } // Set cursor position to zero and in DDRAM. It does not unshift the display. void lcd_home(void) { lcd_set_cursor(0, 0); e0e0: 60 e0 ldi r22, 0x00 ; 0 e0e2: 80 e0 ldi r24, 0x00 ; 0 e0e4: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_ddram_address = 0; e0e8: 10 92 2f 03 sts 0x032F, r1 ; 0x80032f } e0ec: 08 95 ret 0000e0ee : delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e0ee: 40 e4 ldi r20, 0x40 ; 64 e0f0: 56 e0 ldi r21, 0x06 ; 6 e0f2: 60 e0 ldi r22, 0x00 ; 0 e0f4: 81 e0 ldi r24, 0x01 ; 1 e0f6: 0e 94 05 5e call 0xbc0a ; 0xbc0a // 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; e0fa: 10 92 30 03 sts 0x0330, r1 ; 0x800330 lcd_ddram_address = 0; e0fe: 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)); e102: 48 e0 ldi r20, 0x08 ; 8 e104: 50 e0 ldi r21, 0x00 ; 0 e106: 6f e7 ldi r22, 0x7F ; 127 e108: 70 e0 ldi r23, 0x00 ; 0 e10a: 81 e3 ldi r24, 0x31 ; 49 e10c: 93 e0 ldi r25, 0x03 ; 3 e10e: 0d 94 b3 aa jmp 0x35566 ; 0x35566 0000e112 : } 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) e112: 90 91 5a 02 lds r25, 0x025A ; 0x80025a e116: 98 17 cp r25, r24 e118: 09 f1 breq .+66 ; 0xe15c { lcd_update_enabled = enabled; e11a: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a if (enabled) e11e: 88 23 and r24, r24 e120: e9 f0 breq .+58 ; 0xe15c { // Reset encoder position. This is equivalent to re-entering a menu. lcd_encoder = 0; e122: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e126: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e lcd_encoder_diff = 0; e12a: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.499> // Enabling the normal LCD update procedure. // Reset the timeout interval. lcd_timeoutToStatus.start(); e12e: 83 ee ldi r24, 0xE3 ; 227 e130: 93 e0 ldi r25, 0x03 ; 3 e132: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> // Force the keypad update now. lcd_next_update_millis = _millis() - 1; e136: 0f 94 89 0b call 0x21712 ; 0x21712 e13a: 61 50 subi r22, 0x01 ; 1 e13c: 71 09 sbc r23, r1 e13e: 81 09 sbc r24, r1 e140: 91 09 sbc r25, r1 e142: 60 93 c5 03 sts 0x03C5, r22 ; 0x8003c5 e146: 70 93 c6 03 sts 0x03C6, r23 ; 0x8003c6 e14a: 80 93 c7 03 sts 0x03C7, r24 ; 0x8003c7 e14e: 90 93 c8 03 sts 0x03C8, r25 ; 0x8003c8 // Full update. lcd_clear(); e152: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_update(2); e156: 82 e0 ldi r24, 0x02 ; 2 e158: 0c 94 4a 6f jmp 0xde94 ; 0xde94 } else { // Clear the LCD always, or let it to the caller? } } } e15c: 08 95 ret 0000e15e : lcd_ddram_address++; // no need for preventing ddram overflow } } static void lcd_begin(uint8_t clear) { e15e: cf 93 push r28 e160: c8 2f mov r28, r24 lcd_currline = 0; e162: 10 92 30 03 sts 0x0330, r1 ; 0x800330 lcd_ddram_address = 0; e166: 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)); e16a: 48 e0 ldi r20, 0x08 ; 8 e16c: 50 e0 ldi r21, 0x00 ; 0 e16e: 6f e7 ldi r22, 0x7F ; 127 e170: 70 e0 ldi r23, 0x00 ; 0 e172: 81 e3 ldi r24, 0x31 ; 49 e174: 93 e0 ldi r25, 0x03 ; 3 e176: 0f 94 b3 aa call 0x35566 ; 0x35566 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 e17a: 44 e9 ldi r20, 0x94 ; 148 e17c: 51 e1 ldi r21, 0x11 ; 17 e17e: 62 e0 ldi r22, 0x02 ; 2 e180: 80 e3 ldi r24, 0x30 ; 48 e182: 0e 94 05 5e call 0xbc0a ; 0xbc0a // second try lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e186: 46 e9 ldi r20, 0x96 ; 150 e188: 50 e0 ldi r21, 0x00 ; 0 e18a: 62 e0 ldi r22, 0x02 ; 2 e18c: 80 e3 ldi r24, 0x30 ; 48 e18e: 0e 94 05 5e call 0xbc0a ; 0xbc0a // third go! lcd_send(LCD_FUNCTIONSET | LCD_8BITMODE, LOW | LCD_HALF_FLAG, 150); e192: 46 e9 ldi r20, 0x96 ; 150 e194: 50 e0 ldi r21, 0x00 ; 0 e196: 62 e0 ldi r22, 0x02 ; 2 e198: 80 e3 ldi r24, 0x30 ; 48 e19a: 0e 94 05 5e call 0xbc0a ; 0xbc0a #ifndef LCD_8BIT // set to 4-bit interface lcd_send(LCD_FUNCTIONSET | LCD_4BITMODE, LOW | LCD_HALF_FLAG, 150); e19e: 46 e9 ldi r20, 0x96 ; 150 e1a0: 50 e0 ldi r21, 0x00 ; 0 e1a2: 62 e0 ldi r22, 0x02 ; 2 e1a4: 80 e2 ldi r24, 0x20 ; 32 e1a6: 0e 94 05 5e call 0xbc0a ; 0xbc0a #endif // finally, set # lines, font size, etc.0 lcd_command(LCD_FUNCTIONSET | lcd_displayfunction); e1aa: 80 91 00 04 lds r24, 0x0400 ; 0x800400 <_ZL19lcd_displayfunction.lto_priv.510> delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e1ae: 44 e6 ldi r20, 0x64 ; 100 e1b0: 50 e0 ldi r21, 0x00 ; 0 e1b2: 60 e0 ldi r22, 0x00 ; 0 e1b4: 80 62 ori r24, 0x20 ; 32 e1b6: 0e 94 05 5e call 0xbc0a ; 0xbc0a } // Turn the display on/off (quickly) void lcd_display(void) { lcd_displaycontrol |= LCD_DISPLAYON; e1ba: 84 e0 ldi r24, 0x04 ; 4 e1bc: 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); e1c0: 44 e6 ldi r20, 0x64 ; 100 e1c2: 50 e0 ldi r21, 0x00 ; 0 e1c4: 60 e0 ldi r22, 0x00 ; 0 e1c6: 8c e0 ldi r24, 0x0C ; 12 e1c8: 0e 94 05 5e call 0xbc0a ; 0xbc0a 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(); e1cc: c1 11 cpse r28, r1 e1ce: 0e 94 77 70 call 0xe0ee ; 0xe0ee delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e1d2: 44 e6 ldi r20, 0x64 ; 100 e1d4: 50 e0 ldi r21, 0x00 ; 0 e1d6: 60 e0 ldi r22, 0x00 ; 0 e1d8: 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); } e1da: cf 91 pop r28 delayMicroseconds(duration); } static void lcd_command(uint8_t value, uint16_t duration = LCD_DEFAULT_DELAY) { lcd_send(value, LOW, duration); e1dc: 0c 94 05 5e jmp 0xbc0a ; 0xbc0a 0000e1e0 : fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream } void lcd_refresh(void) { lcd_begin(1); e1e0: 81 e0 ldi r24, 0x01 ; 1 e1e2: 0c 94 af 70 jmp 0xe15e ; 0xe15e 0000e1e6 : { lcd_send(value, LOW, duration); } static void lcd_write(uint8_t value) { e1e6: cf 92 push r12 e1e8: df 92 push r13 e1ea: ff 92 push r15 e1ec: 0f 93 push r16 e1ee: 1f 93 push r17 e1f0: cf 93 push r28 e1f2: df 93 push r29 e1f4: 00 d0 rcall .+0 ; 0xe1f6 e1f6: 00 d0 rcall .+0 ; 0xe1f8 e1f8: 1f 92 push r1 e1fa: 1f 92 push r1 e1fc: cd b7 in r28, 0x3d ; 61 e1fe: de b7 in r29, 0x3e ; 62 if (value == '\n') { e200: 8a 30 cpi r24, 0x0A ; 10 e202: d9 f4 brne .+54 ; 0xe23a if (lcd_currline > 3) lcd_currline = -1; e204: 80 91 30 03 lds r24, 0x0330 ; 0x800330 e208: 84 30 cpi r24, 0x04 ; 4 e20a: 18 f0 brcs .+6 ; 0xe212 e20c: 8f ef ldi r24, 0xFF ; 255 e20e: 80 93 30 03 sts 0x0330, r24 ; 0x800330 lcd_set_cursor(0, lcd_currline + 1); // LF e212: 60 91 30 03 lds r22, 0x0330 ; 0x800330 e216: 6f 5f subi r22, 0xFF ; 255 e218: 80 e0 ldi r24, 0x00 ; 0 e21a: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_print_custom(value); } else { lcd_send(value, HIGH); lcd_ddram_address++; // no need for preventing ddram overflow } } e21e: 28 96 adiw r28, 0x08 ; 8 e220: 0f b6 in r0, 0x3f ; 63 e222: f8 94 cli e224: de bf out 0x3e, r29 ; 62 e226: 0f be out 0x3f, r0 ; 63 e228: cd bf out 0x3d, r28 ; 61 e22a: df 91 pop r29 e22c: cf 91 pop r28 e22e: 1f 91 pop r17 e230: 0f 91 pop r16 e232: ff 90 pop r15 e234: df 90 pop r13 e236: cf 90 pop r12 e238: 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))) { e23a: 90 e8 ldi r25, 0x80 ; 128 e23c: 98 0f add r25, r24 lcd_print_custom(value); } else { lcd_send(value, HIGH); e23e: 44 e6 ldi r20, 0x64 ; 100 e240: 50 e0 ldi r21, 0x00 ; 0 e242: 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))) { e244: 9a 34 cpi r25, 0x4A ; 74 e246: 08 f5 brcc .+66 ; 0xe28a // 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. e248: 48 2f mov r20, r24 e24a: 40 58 subi r20, 0x80 ; 128 e24c: 55 0b sbc r21, r21 e24e: 9a 01 movw r18, r20 e250: 96 e0 ldi r25, 0x06 ; 6 e252: 92 9f mul r25, r18 e254: a0 01 movw r20, r0 e256: 93 9f mul r25, r19 e258: 50 0d add r21, r0 e25a: 11 24 eor r1, r1 e25c: fa 01 movw r30, r20 e25e: ea 5b subi r30, 0xBA ; 186 e260: fa 48 sbci r31, 0x8A ; 138 e262: f4 90 lpm r15, Z e264: e1 e3 ldi r30, 0x31 ; 49 e266: f3 e0 ldi r31, 0x03 ; 3 e268: 30 e0 ldi r19, 0x00 ; 0 e26a: 20 e0 ldi r18, 0x00 ; 0 int8_t slotToUse = -1; e26c: 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)) { e26e: 61 91 ld r22, Z+ e270: 78 2f mov r23, r24 e272: 76 27 eor r23, r22 e274: 7f 77 andi r23, 0x7F ; 127 e276: 89 f4 brne .+34 ; 0xe29a lcd_custom_characters[i] = c; // mark the custom character as used e278: f9 01 movw r30, r18 e27a: ef 5c subi r30, 0xCF ; 207 e27c: fc 4f sbci r31, 0xFC ; 252 e27e: 80 83 st Z, r24 e280: 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); e282: 44 e6 ldi r20, 0x64 ; 100 e284: 50 e0 ldi r21, 0x00 ; 0 e286: 61 e0 ldi r22, 0x01 ; 1 e288: 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); e28a: 0e 94 05 5e call 0xbc0a ; 0xbc0a lcd_ddram_address++; // no need for preventing ddram overflow e28e: 80 91 2f 03 lds r24, 0x032F ; 0x80032f e292: 8f 5f subi r24, 0xFF ; 255 e294: 80 93 2f 03 sts 0x032F, r24 ; 0x80032f e298: c2 cf rjmp .-124 ; 0xe21e 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 e29a: 6f 37 cpi r22, 0x7F ; 127 e29c: 09 f0 breq .+2 ; 0xe2a0 e29e: 3c c0 rjmp .+120 ; 0xe318 lcd_custom_characters[i] = c; // mark the custom character as used e2a0: f9 01 movw r30, r18 e2a2: ef 5c subi r30, 0xCF ; 207 e2a4: fc 4f sbci r31, 0xFC ; 252 e2a6: 80 83 st Z, r24 slotToUse = i; e2a8: 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; e2aa: f9 2e mov r15, r25 lcd_createChar_P(slotToUse, &Font[c - 0x80]); e2ac: fa 01 movw r30, r20 e2ae: ef 5b subi r30, 0xBF ; 191 e2b0: fa 48 sbci r31, 0x8A ; 138 "dec __zero_reg__" "\n\t" "brne forBegin_%=" "\n\t" : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); e2b2: 8e 01 movw r16, r28 e2b4: 0f 5f subi r16, 0xFF ; 255 e2b6: 1f 4f sbci r17, 0xFF ; 255 e2b8: d8 01 movw r26, r16 e2ba: 95 91 lpm r25, Z+ e2bc: 88 e0 ldi r24, 0x08 ; 8 e2be: 18 2e mov r1, r24 0000e2c0 : e2c0: 10 fe sbrs r1, 0 e2c2: 05 90 lpm r0, Z+ e2c4: 02 94 swap r0 e2c6: 80 2d mov r24, r0 e2c8: 97 95 ror r25 e2ca: 88 1f adc r24, r24 e2cc: 8d 93 st X+, r24 e2ce: 1a 94 dec r1 e2d0: b9 f7 brne .-18 ; 0xe2c0 lcd_command(LCD_SETCGRAMADDR | (location << 3)); e2d2: bf 2d mov r27, r15 e2d4: e8 e0 ldi r30, 0x08 ; 8 e2d6: be 02 muls r27, r30 e2d8: c0 01 movw r24, r0 e2da: 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); e2dc: 44 e6 ldi r20, 0x64 ; 100 e2de: 50 e0 ldi r21, 0x00 ; 0 e2e0: 60 e0 ldi r22, 0x00 ; 0 e2e2: 80 64 ori r24, 0x40 ; 64 e2e4: 0e 94 05 5e call 0xbc0a ; 0xbc0a e2e8: 6e 01 movw r12, r28 e2ea: f9 e0 ldi r31, 0x09 ; 9 e2ec: cf 0e add r12, r31 e2ee: 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); e2f0: 44 e6 ldi r20, 0x64 ; 100 e2f2: 50 e0 ldi r21, 0x00 ; 0 e2f4: 61 e0 ldi r22, 0x01 ; 1 e2f6: d8 01 movw r26, r16 e2f8: 8d 91 ld r24, X+ e2fa: 8d 01 movw r16, r26 e2fc: 0e 94 05 5e call 0xbc0a ; 0xbc0a : "=&d" (temp), "=&r" (colByte) : "z" (char_p), "e" (charmap) ); lcd_command(LCD_SETCGRAMADDR | (location << 3)); for (uint8_t i = 0; i < 8; i++) { e300: c0 16 cp r12, r16 e302: d1 06 cpc r13, r17 e304: a9 f7 brne .-22 ; 0xe2f0 lcd_send(charmap[i], HIGH); } lcd_command(LCD_SETDDRAMADDR | lcd_ddram_address); // no need for masking the address e306: 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); e30a: 44 e6 ldi r20, 0x64 ; 100 e30c: 50 e0 ldi r21, 0x00 ; 0 e30e: 60 e0 ldi r22, 0x00 ; 0 e310: 80 68 ori r24, 0x80 ; 128 e312: 0e 94 05 5e call 0xbc0a ; 0xbc0a e316: b5 cf rjmp .-150 ; 0xe282 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 e318: 67 ff sbrs r22, 7 slotToUse = i; e31a: 92 2f mov r25, r18 e31c: 2f 5f subi r18, 0xFF ; 255 e31e: 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++) { e320: 28 30 cpi r18, 0x08 ; 8 e322: 31 05 cpc r19, r1 e324: 09 f0 breq .+2 ; 0xe328 e326: a3 cf rjmp .-186 ; 0xe26e } // 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) { e328: 9f 3f cpi r25, 0xFF ; 255 e32a: 09 f0 breq .+2 ; 0xe32e e32c: be cf rjmp .-132 ; 0xe2aa e32e: a9 cf rjmp .-174 ; 0xe282 0000e330 : lcd_print_pad_P(title, LCD_WIDTH); lcd_set_cursor(0, 2); } void menu_progressbar_update(uint16_t newVal) { e330: cf 93 push r28 uint8_t newCnt = (newVal * LCD_WIDTH) / progressbar_total; e332: 24 e1 ldi r18, 0x14 ; 20 e334: ac 01 movw r20, r24 e336: 24 9f mul r18, r20 e338: c0 01 movw r24, r0 e33a: 25 9f mul r18, r21 e33c: 90 0d add r25, r0 e33e: 11 24 eor r1, r1 e340: 60 91 6d 03 lds r22, 0x036D ; 0x80036d e344: 70 91 6e 03 lds r23, 0x036E ; 0x80036e e348: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> e34c: c6 2f mov r28, r22 e34e: 65 31 cpi r22, 0x15 ; 21 e350: 08 f0 brcs .+2 ; 0xe354 e352: c4 e1 ldi r28, 0x14 ; 20 if (newCnt > LCD_WIDTH) newCnt = LCD_WIDTH; while (newCnt > progressbar_block_count) e354: 80 91 6c 03 lds r24, 0x036C ; 0x80036c e358: 8c 17 cp r24, r28 e35a: 48 f4 brcc .+18 ; 0xe36e } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e35c: 8f ef ldi r24, 0xFF ; 255 e35e: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 { lcd_print(LCD_STR_SOLID_BLOCK[0]); progressbar_block_count++; e362: 80 91 6c 03 lds r24, 0x036C ; 0x80036c e366: 8f 5f subi r24, 0xFF ; 255 e368: 80 93 6c 03 sts 0x036C, r24 ; 0x80036c e36c: f3 cf rjmp .-26 ; 0xe354 } } e36e: cf 91 pop r28 e370: 08 95 ret 0000e372 : void menu_progressbar_finish(void) { progressbar_total = 1; e372: 81 e0 ldi r24, 0x01 ; 1 e374: 90 e0 ldi r25, 0x00 ; 0 e376: 90 93 6e 03 sts 0x036E, r25 ; 0x80036e e37a: 80 93 6d 03 sts 0x036D, r24 ; 0x80036d menu_progressbar_update(1); e37e: 0e 94 98 71 call 0xe330 ; 0xe330 _delay(300); e382: 6c e2 ldi r22, 0x2C ; 44 e384: 71 e0 ldi r23, 0x01 ; 1 e386: 80 e0 ldi r24, 0x00 ; 0 e388: 90 e0 ldi r25, 0x00 ; 0 e38a: 0d 94 56 0b jmp 0x216ac ; 0x216ac 0000e38e : else lcd_printNumber(n, base); } void lcd_printNumber(unsigned long n, uint8_t base) { e38e: 8f 92 push r8 e390: 9f 92 push r9 e392: af 92 push r10 e394: bf 92 push r11 e396: ef 92 push r14 e398: ff 92 push r15 e39a: 0f 93 push r16 e39c: 1f 93 push r17 e39e: cf 93 push r28 e3a0: df 93 push r29 e3a2: cd b7 in r28, 0x3d ; 61 e3a4: de b7 in r29, 0x3e ; 62 e3a6: a0 97 sbiw r28, 0x20 ; 32 e3a8: 0f b6 in r0, 0x3f ; 63 e3aa: f8 94 cli e3ac: de bf out 0x3e, r29 ; 62 e3ae: 0f be out 0x3f, r0 ; 63 e3b0: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) e3b2: 61 15 cp r22, r1 e3b4: 71 05 cpc r23, r1 e3b6: 81 05 cpc r24, r1 e3b8: 91 05 cpc r25, r1 e3ba: 99 f4 brne .+38 ; 0xe3e2 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e3bc: 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)); } e3be: a0 96 adiw r28, 0x20 ; 32 e3c0: 0f b6 in r0, 0x3f ; 63 e3c2: f8 94 cli e3c4: de bf out 0x3e, r29 ; 62 e3c6: 0f be out 0x3f, r0 ; 63 e3c8: cd bf out 0x3d, r28 ; 61 e3ca: df 91 pop r29 e3cc: cf 91 pop r28 e3ce: 1f 91 pop r17 e3d0: 0f 91 pop r16 e3d2: ff 90 pop r15 e3d4: ef 90 pop r14 e3d6: bf 90 pop r11 e3d8: af 90 pop r10 e3da: 9f 90 pop r9 e3dc: 8f 90 pop r8 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e3de: 0c 94 f3 70 jmp 0xe1e6 ; 0xe1e6 } void lcd_printNumber(unsigned long n, uint8_t base) { unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; e3e2: 00 e0 ldi r16, 0x00 ; 0 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e3e4: 84 2e mov r8, r20 e3e6: 91 2c mov r9, r1 e3e8: b1 2c mov r11, r1 e3ea: a1 2c mov r10, r1 e3ec: 9e 01 movw r18, r28 e3ee: 2f 5f subi r18, 0xFF ; 255 e3f0: 3f 4f sbci r19, 0xFF ; 255 e3f2: 79 01 movw r14, r18 e3f4: a5 01 movw r20, r10 e3f6: 94 01 movw r18, r8 e3f8: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> e3fc: f7 01 movw r30, r14 e3fe: e0 0f add r30, r16 e400: f1 1d adc r31, r1 e402: 60 83 st Z, r22 n /= base; e404: b9 01 movw r22, r18 e406: ca 01 movw r24, r20 lcd_print('0'); return; } while (n > 0) { buf[i++] = n % base; e408: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { lcd_print('0'); return; } while (n > 0) e40a: 61 15 cp r22, r1 e40c: 71 05 cpc r23, r1 e40e: 81 05 cpc r24, r1 e410: 91 05 cpc r25, r1 e412: 81 f7 brne .-32 ; 0xe3f4 e414: 0e 0d add r16, r14 e416: 1f 2d mov r17, r15 e418: 11 1d adc r17, r1 { buf[i++] = n % base; n /= base; } for (; i > 0; i--) e41a: e0 16 cp r14, r16 e41c: f1 06 cpc r15, r17 e41e: 59 f0 breq .+22 ; 0xe436 lcd_print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); e420: f8 01 movw r30, r16 e422: 82 91 ld r24, -Z e424: 8f 01 movw r16, r30 e426: 8a 30 cpi r24, 0x0A ; 10 e428: 20 f4 brcc .+8 ; 0xe432 e42a: 80 5d subi r24, 0xD0 ; 208 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e42c: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 e430: f4 cf rjmp .-24 ; 0xe41a { 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)); e432: 89 5c subi r24, 0xC9 ; 201 e434: fb cf rjmp .-10 ; 0xe42c } e436: a0 96 adiw r28, 0x20 ; 32 e438: 0f b6 in r0, 0x3f ; 63 e43a: f8 94 cli e43c: de bf out 0x3e, r29 ; 62 e43e: 0f be out 0x3f, r0 ; 63 e440: cd bf out 0x3d, r28 ; 61 e442: df 91 pop r29 e444: cf 91 pop r28 e446: 1f 91 pop r17 e448: 0f 91 pop r16 e44a: ff 90 pop r15 e44c: ef 90 pop r14 e44e: bf 90 pop r11 e450: af 90 pop r10 e452: 9f 90 pop r9 e454: 8f 90 pop r8 e456: 08 95 ret 0000e458 : void lcd_print(unsigned int n, int base) { lcd_print((unsigned long) n, base); } void lcd_print(long n, int base) e458: cf 92 push r12 e45a: df 92 push r13 e45c: ef 92 push r14 e45e: ff 92 push r15 e460: 6b 01 movw r12, r22 e462: 7c 01 movw r14, r24 { if (base == 0) lcd_write(n); else if (base == 10) { if (n < 0) e464: f7 fe sbrs r15, 7 e466: 0b c0 rjmp .+22 ; 0xe47e } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); e468: 8d e2 ldi r24, 0x2D ; 45 e46a: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 else if (base == 10) { if (n < 0) { lcd_print('-'); n = -n; e46e: f0 94 com r15 e470: e0 94 com r14 e472: d0 94 com r13 e474: c0 94 com r12 e476: c1 1c adc r12, r1 e478: d1 1c adc r13, r1 e47a: e1 1c adc r14, r1 e47c: f1 1c adc r15, r1 } lcd_printNumber(n, 10); e47e: 4a e0 ldi r20, 0x0A ; 10 e480: c7 01 movw r24, r14 e482: b6 01 movw r22, r12 } else lcd_printNumber(n, base); } e484: ff 90 pop r15 e486: ef 90 pop r14 e488: df 90 pop r13 e48a: cf 90 pop r12 if (n < 0) { lcd_print('-'); n = -n; } lcd_printNumber(n, 10); e48c: 0c 94 c7 71 jmp 0xe38e ; 0xe38e 0000e490 : lcd_space(len); return len; } uint8_t lcd_print_pad_P(const char* s, uint8_t len) { e490: 0f 93 push r16 e492: 1f 93 push r17 e494: cf 93 push r28 e496: 8c 01 movw r16, r24 e498: c6 2f mov r28, r22 while (len && pgm_read_byte(s)) { e49a: cc 23 and r28, r28 e49c: 59 f0 breq .+22 ; 0xe4b4 e49e: f8 01 movw r30, r16 e4a0: 24 91 lpm r18, Z e4a2: 22 23 and r18, r18 e4a4: 39 f0 breq .+14 ; 0xe4b4 lcd_write(pgm_read_byte(s++)); e4a6: 0f 5f subi r16, 0xFF ; 255 e4a8: 1f 4f sbci r17, 0xFF ; 255 e4aa: 84 91 lpm r24, Z e4ac: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 --len; e4b0: c1 50 subi r28, 0x01 ; 1 e4b2: f3 cf rjmp .-26 ; 0xe49a } lcd_space(len); e4b4: 8c 2f mov r24, r28 e4b6: 0e 94 79 6f call 0xdef2 ; 0xdef2 return len; } e4ba: 8c 2f mov r24, r28 e4bc: cf 91 pop r28 e4be: 1f 91 pop r17 e4c0: 0f 91 pop r16 e4c2: 08 95 ret 0000e4c4 : } static uint8_t progressbar_block_count = 0; static uint16_t progressbar_total = 0; void menu_progressbar_init(uint16_t total, const char* title) { e4c4: 0f 93 push r16 e4c6: 1f 93 push r17 e4c8: cf 93 push r28 e4ca: df 93 push r29 e4cc: 8c 01 movw r16, r24 e4ce: eb 01 movw r28, r22 lcd_clear(); e4d0: 0e 94 77 70 call 0xe0ee ; 0xe0ee progressbar_block_count = 0; e4d4: 10 92 6c 03 sts 0x036C, r1 ; 0x80036c progressbar_total = total; e4d8: 10 93 6e 03 sts 0x036E, r17 ; 0x80036e e4dc: 00 93 6d 03 sts 0x036D, r16 ; 0x80036d lcd_set_cursor(0, 1); e4e0: 61 e0 ldi r22, 0x01 ; 1 e4e2: 80 e0 ldi r24, 0x00 ; 0 e4e4: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_print_pad_P(title, LCD_WIDTH); e4e8: 64 e1 ldi r22, 0x14 ; 20 e4ea: ce 01 movw r24, r28 e4ec: 0e 94 48 72 call 0xe490 ; 0xe490 lcd_set_cursor(0, 2); e4f0: 62 e0 ldi r22, 0x02 ; 2 e4f2: 80 e0 ldi r24, 0x00 ; 0 } e4f4: df 91 pop r29 e4f6: cf 91 pop r28 e4f8: 1f 91 pop r17 e4fa: 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); e4fc: 0c 94 ab 6f jmp 0xdf56 ; 0xdf56 0000e500 : //! @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) { e500: ef 92 push r14 e502: ff 92 push r15 e504: 0f 93 push r16 e506: 1f 93 push r17 e508: cf 93 push r28 e50a: df 93 push r29 if (menu_item == menu_line) e50c: 70 91 63 04 lds r23, 0x0463 ; 0x800463 e510: 30 91 62 04 lds r19, 0x0462 ; 0x800462 e514: 73 13 cpse r23, r19 e516: 3f c0 rjmp .+126 ; 0xe596 e518: 12 2f mov r17, r18 e51a: ea 01 movw r28, r20 e51c: 06 2f mov r16, r22 e51e: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str, number); e520: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e524: 88 23 and r24, r24 e526: d1 f0 breq .+52 ; 0xe55c } 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()); e528: 0e 94 b7 62 call 0xc56e ; 0xc56e e52c: 48 2f mov r20, r24 e52e: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e532: 80 e0 ldi r24, 0x00 ; 0 e534: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 uint8_t len = lcd_print_pad_P(str, max_strlen); e538: 61 e1 ldi r22, 0x11 ; 17 e53a: c7 01 movw r24, r14 e53c: 0e 94 48 72 call 0xe490 ; 0xe490 lcd_putc_at((max_strlen - len) + 2, menu_row, num); e540: 40 2f mov r20, r16 e542: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e546: 93 e1 ldi r25, 0x13 ; 19 e548: 98 1b sub r25, r24 e54a: 89 2f mov r24, r25 e54c: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); e550: 40 e2 ldi r20, 0x20 ; 32 e552: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e556: 83 e1 ldi r24, 0x13 ; 19 e558: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 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)) e55c: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e560: 88 23 and r24, r24 e562: c9 f0 breq .+50 ; 0xe596 e564: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e568: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e56c: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e570: 28 17 cp r18, r24 e572: 19 06 cpc r1, r25 e574: 81 f4 brne .+32 ; 0xe596 { lcd_update_enabled = 0; e576: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(fn_par); e57a: 81 2f mov r24, r17 e57c: fe 01 movw r30, r28 e57e: 19 95 eicall lcd_update_enabled = 1; e580: 81 e0 ldi r24, 0x01 ; 1 e582: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a menu_item_ret(); return; } } menu_item++; } e586: df 91 pop r29 e588: cf 91 pop r28 e58a: 1f 91 pop r17 e58c: 0f 91 pop r16 e58e: ff 90 pop r15 e590: 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(); e592: 0c 94 c4 62 jmp 0xc588 ; 0xc588 return; } } menu_item++; e596: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e59a: 8f 5f subi r24, 0xFF ; 255 e59c: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e5a0: df 91 pop r29 e5a2: cf 91 pop r28 e5a4: 1f 91 pop r17 e5a6: 0f 91 pop r16 e5a8: ff 90 pop r15 e5aa: ef 90 pop r14 e5ac: 08 95 ret 0000e5ae : static char menu_selection_mark(){ return (lcd_encoder == menu_item)?'>':' '; } static void menu_draw_item_puts_P(char type_char, const char* str) { e5ae: 0f 93 push r16 e5b0: 1f 93 push r17 e5b2: cf 93 push r28 e5b4: c8 2f mov r28, r24 e5b6: 8b 01 movw r16, r22 lcd_putc_at(0, menu_row, menu_selection_mark()); e5b8: 0e 94 b7 62 call 0xc56e ; 0xc56e e5bc: 48 2f mov r20, r24 e5be: 60 91 60 04 lds r22, 0x0460 ; 0x800460 e5c2: 80 e0 ldi r24, 0x00 ; 0 e5c4: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_print_pad_P(str, LCD_WIDTH - 2); e5c8: 62 e1 ldi r22, 0x12 ; 18 e5ca: c8 01 movw r24, r16 e5cc: 0e 94 48 72 call 0xe490 ; 0xe490 lcd_putc(type_char); e5d0: 8c 2f mov r24, r28 } e5d2: cf 91 pop r28 e5d4: 1f 91 pop r17 e5d6: 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); e5d8: 0c 94 72 6f jmp 0xdee4 ; 0xdee4 0000e5dc : 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) { e5dc: cf 93 push r28 e5de: df 93 push r29 if (menu_item == menu_line) e5e0: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e5e4: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e5e8: 32 13 cpse r19, r18 e5ea: 21 c0 rjmp .+66 ; 0xe62e e5ec: eb 01 movw r28, r22 e5ee: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); e5f0: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e5f4: 88 23 and r24, r24 e5f6: 19 f0 breq .+6 ; 0xe5fe e5f8: 80 e2 ldi r24, 0x20 ; 32 e5fa: 0e 94 d7 72 call 0xe5ae ; 0xe5ae if (menu_clicked && (lcd_encoder == menu_item)) e5fe: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e602: 88 23 and r24, r24 e604: a1 f0 breq .+40 ; 0xe62e e606: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e60a: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e60e: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e612: 28 17 cp r18, r24 e614: 19 06 cpc r1, r25 e616: 59 f4 brne .+22 ; 0xe62e { lcd_update_enabled = 0; e618: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(); e61c: fe 01 movw r30, r28 e61e: 19 95 eicall lcd_update_enabled = 1; e620: 81 e0 ldi r24, 0x01 ; 1 e622: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a menu_item_ret(); return; } } menu_item++; } e626: df 91 pop r29 e628: 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(); e62a: 0c 94 c4 62 jmp 0xc588 ; 0xc588 return; } } menu_item++; e62e: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e632: 8f 5f subi r24, 0xFF ; 255 e634: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e638: df 91 pop r29 e63a: cf 91 pop r28 e63c: 08 95 ret 0000e63e : menu_item++; } void menu_item_back_P(const char* str) { if (menu_item == menu_line) e63e: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e642: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e646: 32 13 cpse r19, r18 e648: 19 c0 rjmp .+50 ; 0xe67c e64a: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_UPLEVEL[0], str); e64c: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e650: 88 23 and r24, r24 e652: 19 f0 breq .+6 ; 0xe65a e654: 83 e8 ldi r24, 0x83 ; 131 e656: 0e 94 d7 72 call 0xe5ae ; 0xe5ae if (menu_clicked && (lcd_encoder == menu_item)) e65a: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e65e: 88 23 and r24, r24 e660: 69 f0 breq .+26 ; 0xe67c e662: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e666: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e66a: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e66e: 28 17 cp r18, r24 e670: 19 06 cpc r1, r25 e672: 21 f4 brne .+8 ; 0xe67c { menu_back(); e674: 0e 94 6c 63 call 0xc6d8 ; 0xc6d8 menu_item_ret(); e678: 0c 94 c4 62 jmp 0xc588 ; 0xc588 return; } } menu_item++; e67c: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e680: 8f 5f subi r24, 0xFF ; 255 e682: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e686: 08 95 ret 0000e688 : menu_item++; return 0; } void menu_item_submenu_P(const char* str, menu_func_t submenu) { e688: cf 93 push r28 e68a: df 93 push r29 if (menu_item == menu_line) e68c: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e690: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e694: 32 13 cpse r19, r18 e696: 1e c0 rjmp .+60 ; 0xe6d4 e698: eb 01 movw r28, r22 e69a: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(LCD_STR_ARROW_RIGHT[0], str); e69c: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e6a0: 88 23 and r24, r24 e6a2: 19 f0 breq .+6 ; 0xe6aa e6a4: 8e e7 ldi r24, 0x7E ; 126 e6a6: 0e 94 d7 72 call 0xe5ae ; 0xe5ae if (menu_clicked && (lcd_encoder == menu_item)) e6aa: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e6ae: 88 23 and r24, r24 e6b0: 89 f0 breq .+34 ; 0xe6d4 e6b2: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e6b6: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e6ba: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e6be: 28 17 cp r18, r24 e6c0: 19 06 cpc r1, r25 e6c2: 41 f4 brne .+16 ; 0xe6d4 { menu_submenu(submenu); e6c4: 60 e0 ldi r22, 0x00 ; 0 e6c6: ce 01 movw r24, r28 e6c8: 0e 94 2e 63 call 0xc65c ; 0xc65c menu_item_ret(); return; } } menu_item++; } e6cc: df 91 pop r29 e6ce: 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(); e6d0: 0c 94 c4 62 jmp 0xc588 ; 0xc588 return; } } menu_item++; e6d4: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e6d8: 8f 5f subi r24, 0xFF ; 255 e6da: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } e6de: df 91 pop r29 e6e0: cf 91 pop r28 e6e2: 08 95 ret 0000e6e4 : menu_item++; } uint8_t menu_item_text_P(const char* str) { if (menu_item == menu_line) e6e4: 30 91 63 04 lds r19, 0x0463 ; 0x800463 e6e8: 20 91 62 04 lds r18, 0x0462 ; 0x800462 e6ec: 32 13 cpse r19, r18 e6ee: 19 c0 rjmp .+50 ; 0xe722 e6f0: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); e6f2: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e6f6: 88 23 and r24, r24 e6f8: 19 f0 breq .+6 ; 0xe700 e6fa: 80 e2 ldi r24, 0x20 ; 32 e6fc: 0e 94 d7 72 call 0xe5ae ; 0xe5ae if (menu_clicked && (lcd_encoder == menu_item)) e700: 80 91 61 04 lds r24, 0x0461 ; 0x800461 e704: 88 23 and r24, r24 e706: 69 f0 breq .+26 ; 0xe722 e708: 20 91 63 04 lds r18, 0x0463 ; 0x800463 e70c: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e710: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e714: 28 17 cp r18, r24 e716: 19 06 cpc r1, r25 e718: 21 f4 brne .+8 ; 0xe722 { menu_item_ret(); e71a: 0e 94 c4 62 call 0xc588 ; 0xc588 return 1; e71e: 81 e0 ldi r24, 0x01 ; 1 e720: 08 95 ret } } menu_item++; e722: 80 91 63 04 lds r24, 0x0463 ; 0x800463 e726: 8f 5f subi r24, 0xFF ; 255 e728: 80 93 63 04 sts 0x0463, r24 ; 0x800463 return 0; e72c: 80 e0 ldi r24, 0x00 ; 0 } e72e: 08 95 ret 0000e730 : { while (*s) lcd_write(*(s++)); } uint8_t lcd_print_pad(const char* s, uint8_t len) { e730: 0f 93 push r16 e732: 1f 93 push r17 e734: cf 93 push r28 e736: 8c 01 movw r16, r24 e738: c6 2f mov r28, r22 while (len && *s) { e73a: cc 23 and r28, r28 e73c: 49 f0 breq .+18 ; 0xe750 e73e: f8 01 movw r30, r16 e740: 81 91 ld r24, Z+ e742: 8f 01 movw r16, r30 e744: 88 23 and r24, r24 e746: 21 f0 breq .+8 ; 0xe750 lcd_write(*(s++)); e748: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 --len; e74c: c1 50 subi r28, 0x01 ; 1 e74e: f5 cf rjmp .-22 ; 0xe73a } lcd_space(len); e750: 8c 2f mov r24, r28 e752: 0e 94 79 6f call 0xdef2 ; 0xdef2 return len; } e756: 8c 2f mov r24, r28 e758: cf 91 pop r28 e75a: 1f 91 pop r17 e75c: 0f 91 pop r16 e75e: 08 95 ret 0000e760 : while (n--) lcd_putc(' '); } void lcd_print(const char* s) { e760: cf 93 push r28 e762: df 93 push r29 e764: ec 01 movw r28, r24 while (*s) lcd_write(*(s++)); e766: 89 91 ld r24, Y+ e768: 88 23 and r24, r24 e76a: 19 f0 breq .+6 ; 0xe772 e76c: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 e770: fa cf rjmp .-12 ; 0xe766 } e772: df 91 pop r29 e774: cf 91 pop r28 e776: 08 95 ret 0000e778 : lcd_command(LCD_ENTRYMODESET | lcd_displaymode); } static int lcd_putchar(char c, FILE *) { lcd_write(c); e778: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 return 0; } e77c: 90 e0 ldi r25, 0x00 ; 0 e77e: 80 e0 ldi r24, 0x00 ; 0 e780: 08 95 ret 0000e782 : extern void lcd_frame_start(); //! @brief Consume click and longpress event inline void lcd_consume_click() { lcd_click_trigger = 0; e782: 10 92 95 03 sts 0x0395, r1 ; 0x800395 lcd_longpress_trigger = 0; e786: 10 92 a7 05 sts 0x05A7, r1 ; 0x8005a7 } e78a: 08 95 ret 0000e78c : //! Generally is used in modal dialogs. //! //! @retval 0 not clicked //! @retval nonzero clicked uint8_t lcd_clicked(void) { e78c: cf 93 push r28 bool clicked = LCD_CLICKED; e78e: 80 91 95 03 lds r24, 0x0395 ; 0x800395 e792: c1 e0 ldi r28, 0x01 ; 1 e794: 81 11 cpse r24, r1 e796: 04 c0 rjmp .+8 ; 0xe7a0 e798: c0 e0 ldi r28, 0x00 ; 0 if(clicked) { lcd_consume_click(); } return clicked; } e79a: 8c 2f mov r24, r28 e79c: cf 91 pop r28 e79e: 08 95 ret uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; if(clicked) { lcd_consume_click(); e7a0: 0e 94 c1 73 call 0xe782 ; 0xe782 e7a4: fa cf rjmp .-12 ; 0xe79a 0000e7a6 <_menu_edit_P()>: } static void _menu_edit_P() { menu_data_edit_t* _md = (menu_data_edit_t*)&(menu_data[0]); if (lcd_draw_update) e7a6: 80 91 59 02 lds r24, 0x0259 ; 0x800259 e7aa: 88 23 and r24, r24 e7ac: 09 f4 brne .+2 ; 0xe7b0 <_menu_edit_P()+0xa> e7ae: 52 c0 rjmp .+164 ; 0xe854 <_menu_edit_P()+0xae> { // handle initial value jumping if (_md->minJumpValue && lcd_encoder) { e7b0: 20 91 a1 03 lds r18, 0x03A1 ; 0x8003a1 e7b4: 30 91 a2 03 lds r19, 0x03A2 ; 0x8003a2 e7b8: 80 91 9d 03 lds r24, 0x039D ; 0x80039d e7bc: 90 91 9e 03 lds r25, 0x039E ; 0x80039e e7c0: 21 15 cp r18, r1 e7c2: 31 05 cpc r19, r1 e7c4: d9 f0 breq .+54 ; 0xe7fc <_menu_edit_P()+0x56> e7c6: 40 91 1e 06 lds r20, 0x061E ; 0x80061e e7ca: 50 91 1f 06 lds r21, 0x061F ; 0x80061f e7ce: 41 15 cp r20, r1 e7d0: 51 05 cpc r21, r1 e7d2: a1 f0 breq .+40 ; 0xe7fc <_menu_edit_P()+0x56> if (lcd_encoder > 0 && _md->currentValue == _md->minEditValue) { e7d4: 7c f0 brlt .+30 ; 0xe7f4 <_menu_edit_P()+0x4e> e7d6: 40 91 9b 03 lds r20, 0x039B ; 0x80039b e7da: 50 91 9c 03 lds r21, 0x039C ; 0x80039c e7de: 48 17 cp r20, r24 e7e0: 59 07 cpc r21, r25 e7e2: 41 f4 brne .+16 ; 0xe7f4 <_menu_edit_P()+0x4e> _md->currentValue = _md->minJumpValue; e7e4: 30 93 9c 03 sts 0x039C, r19 ; 0x80039c e7e8: 20 93 9b 03 sts 0x039B, r18 ; 0x80039b lcd_encoder = 0; e7ec: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e7f0: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } // disable after first use and/or if the initial value is not minEditValue _md->minJumpValue = 0; e7f4: 10 92 a2 03 sts 0x03A2, r1 ; 0x8003a2 e7f8: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 } _md->currentValue += lcd_encoder; e7fc: 20 91 9b 03 lds r18, 0x039B ; 0x80039b e800: 30 91 9c 03 lds r19, 0x039C ; 0x80039c e804: 40 91 1e 06 lds r20, 0x061E ; 0x80061e e808: 50 91 1f 06 lds r21, 0x061F ; 0x80061f e80c: 24 0f add r18, r20 e80e: 35 1f adc r19, r21 lcd_encoder = 0; // Consume knob rotation event e810: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e814: 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); e818: 28 17 cp r18, r24 e81a: 39 07 cpc r19, r25 e81c: 44 f0 brlt .+16 ; 0xe82e <_menu_edit_P()+0x88> e81e: 80 91 9f 03 lds r24, 0x039F ; 0x80039f e822: 90 91 a0 03 lds r25, 0x03A0 ; 0x8003a0 e826: 28 17 cp r18, r24 e828: 39 07 cpc r19, r25 e82a: 0c f4 brge .+2 ; 0xe82e <_menu_edit_P()+0x88> e82c: c9 01 movw r24, r18 e82e: 90 93 9c 03 sts 0x039C, r25 ; 0x80039c e832: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b lcd_set_cursor(0, 1); e836: 61 e0 ldi r22, 0x01 ; 1 e838: 80 e0 ldi r24, 0x00 ; 0 e83a: 0e 94 ab 6f call 0xdf56 ; 0xdf56 menu_draw_P(' ', _md->editLabel, _md->currentValue); e83e: 40 91 9b 03 lds r20, 0x039B ; 0x80039b e842: 50 91 9c 03 lds r21, 0x039C ; 0x80039c e846: 60 91 96 03 lds r22, 0x0396 ; 0x800396 e84a: 70 91 97 03 lds r23, 0x0397 ; 0x800397 e84e: 80 e2 ldi r24, 0x20 ; 32 e850: 0e 94 83 6f call 0xdf06 ; 0xdf06 } if (lcd_clicked()) e854: 0e 94 c6 73 call 0xe78c ; 0xe78c e858: 88 23 and r24, r24 e85a: 41 f1 breq .+80 ; 0xe8ac <_menu_edit_P()+0x106> e85c: e0 91 99 03 lds r30, 0x0399 ; 0x800399 e860: f0 91 9a 03 lds r31, 0x039A ; 0x80039a e864: 80 91 9b 03 lds r24, 0x039B ; 0x80039b e868: 90 91 9c 03 lds r25, 0x039C ; 0x80039c { if (_md->editValueBits == 8) e86c: 20 91 98 03 lds r18, 0x0398 ; 0x800398 *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; e870: 80 83 st Z, r24 lcd_set_cursor(0, 1); menu_draw_P(' ', _md->editLabel, _md->currentValue); } if (lcd_clicked()) { if (_md->editValueBits == 8) e872: 28 30 cpi r18, 0x08 ; 8 e874: c9 f4 brne .+50 ; 0xe8a8 <_menu_edit_P()+0x102> menu_back(1); } void menu_back_no_reset(void) { if (menu_depth > 0) e876: 80 91 df 03 lds r24, 0x03DF ; 0x8003df e87a: 88 23 and r24, r24 e87c: b9 f0 breq .+46 ; 0xe8ac <_menu_edit_P()+0x106> { menu_depth--; e87e: 81 50 subi r24, 0x01 ; 1 e880: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df menu_goto(menu_stack[menu_depth].menu, menu_stack[menu_depth].position, false); e884: 90 e0 ldi r25, 0x00 ; 0 e886: fc 01 movw r30, r24 e888: ee 0f add r30, r30 e88a: ff 1f adc r31, r31 e88c: e8 0f add r30, r24 e88e: f9 1f adc r31, r25 e890: e9 5a subi r30, 0xA9 ; 169 e892: fc 4f sbci r31, 0xFC ; 252 e894: 62 81 ldd r22, Z+2 ; 0x02 e896: 06 2e mov r0, r22 e898: 00 0c add r0, r0 e89a: 77 0b sbc r23, r23 e89c: 20 e0 ldi r18, 0x00 ; 0 e89e: 40 e0 ldi r20, 0x00 ; 0 e8a0: 80 81 ld r24, Z e8a2: 91 81 ldd r25, Z+1 ; 0x01 e8a4: 0c 94 08 63 jmp 0xc610 ; 0xc610 if (lcd_clicked()) { if (_md->editValueBits == 8) *((uint8_t*)(_md->editValuePtr)) = _md->currentValue; else *((int16_t*)(_md->editValuePtr)) = _md->currentValue; e8a8: 91 83 std Z+1, r25 ; 0x01 e8aa: e5 cf rjmp .-54 ; 0xe876 <_menu_edit_P()+0xd0> menu_back_no_reset(); } } e8ac: 08 95 ret 0000e8ae : } } void menu_back_if_clicked(void) { if (lcd_clicked()) e8ae: 0e 94 c6 73 call 0xe78c ; 0xe78c e8b2: 81 11 cpse r24, r1 menu_back(); e8b4: 0c 94 6c 63 jmp 0xc6d8 ; 0xc6d8 } e8b8: 08 95 ret 0000e8ba : CRITICAL_SECTION_END; } void menu_start(void) { if (lcd_encoder < 0) e8ba: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e8be: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e8c2: 97 ff sbrs r25, 7 e8c4: 07 c0 rjmp .+14 ; 0xe8d4 { lcd_encoder = 0; e8c6: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f e8ca: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e Sound_MakeSound(e_SOUND_TYPE_BlindAlert); e8ce: 87 e0 ldi r24, 0x07 ; 7 e8d0: 0f 94 3f 23 call 0x2467e ; 0x2467e } if (lcd_encoder < menu_top) e8d4: 80 91 1e 06 lds r24, 0x061E ; 0x80061e e8d8: 90 91 1f 06 lds r25, 0x061F ; 0x80061f e8dc: 20 91 92 03 lds r18, 0x0392 ; 0x800392 e8e0: 28 17 cp r18, r24 e8e2: 19 06 cpc r1, r25 e8e4: 19 f0 breq .+6 ; 0xe8ec e8e6: 14 f0 brlt .+4 ; 0xe8ec menu_top = lcd_encoder; e8e8: 80 93 92 03 sts 0x0392, r24 ; 0x800392 menu_line = menu_top; e8ec: 80 91 92 03 lds r24, 0x0392 ; 0x800392 e8f0: 80 93 62 04 sts 0x0462, r24 ; 0x800462 menu_clicked = lcd_clicked(); // Consume click event e8f4: 0e 94 c6 73 call 0xe78c ; 0xe78c e8f8: 80 93 61 04 sts 0x0461, r24 ; 0x800461 } e8fc: 08 95 ret 0000e8fe : 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); e8fe: 8e ef ldi r24, 0xFE ; 254 e900: 9f e0 ldi r25, 0x0F ; 15 e902: 0f 94 81 a4 call 0x34902 ; 0x34902 return (lang_eeprom != LANG_ID_FORCE_SELECTION) && (lang_eeprom == lang_selected); e906: 8e 3f cpi r24, 0xFE ; 254 e908: 39 f0 breq .+14 ; 0xe918 e90a: 91 e0 ldi r25, 0x01 ; 1 e90c: 20 91 2d 03 lds r18, 0x032D ; 0x80032d e910: 28 13 cpse r18, r24 e912: 90 e0 ldi r25, 0x00 ; 0 e914: 89 2f mov r24, r25 e916: 08 95 ret e918: 80 e0 ldi r24, 0x00 ; 0 } e91a: 08 95 ret 0000e91c : return _n("??"); } void lang_reset(void) { lang_selected = 0; e91c: 10 92 2d 03 sts 0x032D, r1 ; 0x80032d eeprom_update_byte((unsigned char*)EEPROM_LANG, LANG_ID_FORCE_SELECTION); e920: 6e ef ldi r22, 0xFE ; 254 e922: 8e ef ldi r24, 0xFE ; 254 e924: 9f e0 ldi r25, 0x0F ; 15 e926: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 0000e92a : return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e92a: 85 37 cpi r24, 0x75 ; 117 e92c: 28 e6 ldi r18, 0x68 ; 104 e92e: 92 07 cpc r25, r18 e930: 09 f4 brne .+2 ; 0xe934 e932: 59 c0 rjmp .+178 ; 0xe9e6 e934: f8 f4 brcc .+62 ; 0xe974 e936: 8e 36 cpi r24, 0x6E ; 110 e938: 25 e6 ldi r18, 0x65 ; 101 e93a: 92 07 cpc r25, r18 e93c: 09 f4 brne .+2 ; 0xe940 e93e: 59 c0 rjmp .+178 ; 0xe9f2 e940: 50 f4 brcc .+20 ; 0xe956 e942: 83 37 cpi r24, 0x73 ; 115 e944: 23 e6 ldi r18, 0x63 ; 99 e946: 92 07 cpc r25, r18 e948: b1 f1 breq .+108 ; 0xe9b6 e94a: 85 36 cpi r24, 0x65 ; 101 e94c: 94 46 sbci r25, 0x64 ; 100 e94e: b1 f1 breq .+108 ; 0xe9bc //#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("??"); e950: 84 e6 ldi r24, 0x64 ; 100 e952: 94 e6 ldi r25, 0x64 ; 100 e954: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e956: 82 37 cpi r24, 0x72 ; 114 e958: 26 e6 ldi r18, 0x66 ; 102 e95a: 92 07 cpc r25, r18 e95c: 91 f1 breq .+100 ; 0xe9c2 e95e: 82 37 cpi r24, 0x72 ; 114 e960: 28 e6 ldi r18, 0x68 ; 104 e962: 92 07 cpc r25, r18 e964: 09 f4 brne .+2 ; 0xe968 e966: 42 c0 rjmp .+132 ; 0xe9ec e968: 83 37 cpi r24, 0x73 ; 115 e96a: 95 46 sbci r25, 0x65 ; 101 e96c: 89 f7 brne .-30 ; 0xe950 { 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"); e96e: 8b eb ldi r24, 0xBB ; 187 e970: 94 e6 ldi r25, 0x64 ; 100 e972: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e974: 8c 36 cpi r24, 0x6C ; 108 e976: 20 e7 ldi r18, 0x70 ; 112 e978: 92 07 cpc r25, r18 e97a: 31 f1 breq .+76 ; 0xe9c8 e97c: 70 f4 brcc .+28 ; 0xe99a e97e: 8c 36 cpi r24, 0x6C ; 108 e980: 2e e6 ldi r18, 0x6E ; 110 e982: 92 07 cpc r25, r18 e984: 21 f1 breq .+72 ; 0xe9ce e986: 8f 36 cpi r24, 0x6F ; 111 e988: 2e e6 ldi r18, 0x6E ; 110 e98a: 92 07 cpc r25, r18 e98c: 31 f1 breq .+76 ; 0xe9da e98e: 84 37 cpi r24, 0x74 ; 116 e990: 99 46 sbci r25, 0x69 ; 105 e992: f1 f6 brne .-68 ; 0xe950 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"); e994: 89 ea ldi r24, 0xA9 ; 169 e996: 94 e6 ldi r25, 0x64 ; 100 e998: 08 95 ret return LANG_CODE_XX; } const char* lang_get_name_by_code(uint16_t code) { switch (code) e99a: 8b 36 cpi r24, 0x6B ; 107 e99c: 23 e7 ldi r18, 0x73 ; 115 e99e: 92 07 cpc r25, r18 e9a0: f9 f0 breq .+62 ; 0xe9e0 e9a2: 86 37 cpi r24, 0x76 ; 118 e9a4: 23 e7 ldi r18, 0x73 ; 115 e9a6: 92 07 cpc r25, r18 e9a8: a9 f0 breq .+42 ; 0xe9d4 e9aa: 8f 36 cpi r24, 0x6F ; 111 e9ac: 92 47 sbci r25, 0x72 ; 114 e9ae: 81 f6 brne .-96 ; 0xe950 #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 e9b0: 87 e6 ldi r24, 0x67 ; 103 e9b2: 94 e6 ldi r25, 0x64 ; 100 e9b4: 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"); e9b6: 8b ec ldi r24, 0xCB ; 203 e9b8: 94 e6 ldi r25, 0x64 ; 100 e9ba: 08 95 ret case LANG_CODE_DE: return _n("Deutsch"); e9bc: 83 ec ldi r24, 0xC3 ; 195 e9be: 94 e6 ldi r25, 0x64 ; 100 e9c0: 08 95 ret case LANG_CODE_ES: return _n("Espanol"); case LANG_CODE_FR: return _n("Francais"); e9c2: 82 eb ldi r24, 0xB2 ; 178 e9c4: 94 e6 ldi r25, 0x64 ; 100 e9c6: 08 95 ret case LANG_CODE_IT: return _n("Italiano"); case LANG_CODE_PL: return _n("Polski"); e9c8: 82 ea ldi r24, 0xA2 ; 162 e9ca: 94 e6 ldi r25, 0x64 ; 100 e9cc: 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 e9ce: 87 e9 ldi r24, 0x97 ; 151 e9d0: 94 e6 ldi r25, 0x64 ; 100 e9d2: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_NL #ifdef COMMUNITY_LANG_GROUP1_SV case LANG_CODE_SV: return _n("Svenska"); //community Swedish contribution e9d4: 8f e8 ldi r24, 0x8F ; 143 e9d6: 94 e6 ldi r25, 0x64 ; 100 e9d8: 08 95 ret #endif // COMMUNITY_LANG_GROUP1_SV #ifdef COMMUNITY_LANG_GROUP1_NO case LANG_CODE_NO: return _n("Norsk"); //community Swedish contribution e9da: 89 e8 ldi r24, 0x89 ; 137 e9dc: 94 e6 ldi r25, 0x64 ; 100 e9de: 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 e9e0: 8e e7 ldi r24, 0x7E ; 126 e9e2: 94 e6 ldi r25, 0x64 ; 100 e9e4: 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 e9e6: 87 e7 ldi r24, 0x77 ; 119 e9e8: 94 e6 ldi r25, 0x64 ; 100 e9ea: 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 e9ec: 8e e6 ldi r24, 0x6E ; 110 e9ee: 94 e6 ldi r25, 0x64 ; 100 e9f0: 08 95 ret const char* lang_get_name_by_code(uint16_t code) { switch (code) { case LANG_CODE_EN: return _n("English"); e9f2: 83 ed ldi r24, 0xD3 ; 211 e9f4: 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("??"); } e9f6: 08 95 ret 0000e9f8 : return (sum == lt_sum); } uint8_t lang_get_count() { if (pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE))) == 0xffffffff) e9f8: ed e3 ldi r30, 0x3D ; 61 e9fa: f5 e7 ldi r31, 0x75 ; 117 e9fc: 85 91 lpm r24, Z+ e9fe: 95 91 lpm r25, Z+ ea00: a5 91 lpm r26, Z+ ea02: b4 91 lpm r27, Z ea04: 8f 3f cpi r24, 0xFF ; 255 ea06: 9f 4f sbci r25, 0xFF ; 255 ea08: af 4f sbci r26, 0xFF ; 255 ea0a: bf 4f sbci r27, 0xFF ; 255 ea0c: b1 f0 breq .+44 ; 0xea3a 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; ea0e: 20 e0 ldi r18, 0x00 ; 0 ea10: 31 e0 ldi r19, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) ea12: 81 e0 ldi r24, 0x01 ; 1 while (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid ea14: f9 01 movw r30, r18 ea16: 45 91 lpm r20, Z+ ea18: 55 91 lpm r21, Z+ ea1a: 65 91 lpm r22, Z+ ea1c: 74 91 lpm r23, Z ea1e: 45 3a cpi r20, 0xA5 ; 165 ea20: 5a 45 sbci r21, 0x5A ; 90 ea22: 64 4b sbci r22, 0xB4 ; 180 ea24: 7b 44 sbci r23, 0x4B ; 75 ea26: 09 f0 breq .+2 ; 0xea2a ea28: 08 95 ret { table += pgm_read_word((uint16_t*)(table + 4)); ea2a: f9 01 movw r30, r18 ea2c: 34 96 adiw r30, 0x04 ; 4 ea2e: 45 91 lpm r20, Z+ ea30: 54 91 lpm r21, Z ea32: 24 0f add r18, r20 ea34: 35 1f adc r19, r21 count++; ea36: 8f 5f subi r24, 0xFF ; 255 ea38: ed cf rjmp .-38 ; 0xea14 } 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 ea3a: 81 e0 ldi r24, 0x01 ; 1 table += pgm_read_word((uint16_t*)(table + 4)); count++; } #endif //XFLASH return count; } ea3c: 08 95 ret 0000ea3e : 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) { ea3e: 0f 93 push r16 ea40: 1f 93 push r17 if (lang == LANG_ID_PRI) //primary language ea42: 81 11 cpse r24, r1 ea44: 13 c0 rjmp .+38 ; 0xea6c { lang_table = 0; ea46: 10 92 2c 03 sts 0x032C, r1 ; 0x80032c ea4a: 10 92 2b 03 sts 0x032B, r1 ; 0x80032b lang_selected = lang; ea4e: 10 92 2d 03 sts 0x032D, r1 ; 0x80032d lang_selected = lang; // set language id } } } #endif //XFLASH if (lang_selected == lang) ea52: 90 91 2d 03 lds r25, 0x032D ; 0x80032d ea56: 98 13 cpse r25, r24 ea58: 5c c0 rjmp .+184 ; 0xeb12 ea5a: 68 2f mov r22, r24 { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); ea5c: 8e ef ldi r24, 0xFE ; 254 ea5e: 9f e0 ldi r25, 0x0F ; 15 ea60: 0f 94 a5 a4 call 0x3494a ; 0x3494a return 1; ea64: 81 e0 ldi r24, 0x01 ; 1 } return 0; } ea66: 1f 91 pop r17 ea68: 0f 91 pop r16 ea6a: 08 95 ret lang_selected = lang; // set language id } } } #else //XFLASH if (lang == LANG_ID_SEC) ea6c: 81 30 cpi r24, 0x01 ; 1 ea6e: 89 f7 brne .-30 ; 0xea52 { uint16_t table = _SEC_LANG_TABLE; if (pgm_read_dword(((uint32_t*)table)) == LANG_MAGIC) //magic valid ea70: e0 e0 ldi r30, 0x00 ; 0 ea72: f1 e0 ldi r31, 0x01 ; 1 ea74: 45 91 lpm r20, Z+ ea76: 55 91 lpm r21, Z+ ea78: 65 91 lpm r22, Z+ ea7a: 74 91 lpm r23, Z ea7c: 45 3a cpi r20, 0xA5 ; 165 ea7e: 5a 45 sbci r21, 0x5A ; 90 ea80: 64 4b sbci r22, 0xB4 ; 180 ea82: 7b 44 sbci r23, 0x4B ; 75 ea84: 31 f7 brne .-52 ; 0xea52 } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; uint16_t size = pgm_read_word((uint16_t*)(addr + 4)); ea86: e4 e0 ldi r30, 0x04 ; 4 ea88: f1 e0 ldi r31, 0x01 ; 1 ea8a: a5 91 lpm r26, Z+ ea8c: b4 91 lpm r27, Z uint16_t lt_sum = pgm_read_word((uint16_t*)(addr + 8)); ea8e: e8 e0 ldi r30, 0x08 ; 8 ea90: f1 e0 ldi r31, 0x01 ; 1 ea92: 65 91 lpm r22, Z+ ea94: 74 91 lpm r23, Z uint16_t i; for (i = 0; i < size; i++) ea96: 50 e0 ldi r21, 0x00 ; 0 ea98: 40 e0 ldi r20, 0x00 ; 0 return 0; } uint8_t lang_check(uint16_t addr) { uint16_t sum = 0; ea9a: 30 e0 ldi r19, 0x00 ; 0 ea9c: 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++) ea9e: a4 17 cp r26, r20 eaa0: b5 07 cpc r27, r21 eaa2: 29 f5 brne .+74 ; 0xeaee sum += (uint16_t)pgm_read_byte((uint8_t*)(addr + i)) << ((i & 1)?0:8); sum -= lt_sum; //subtract checksum eaa4: 26 1b sub r18, r22 eaa6: 37 0b sbc r19, r23 sum = (sum >> 8) | ((sum & 0xff) << 8); //swap bytes eaa8: 32 27 eor r19, r18 eaaa: 23 27 eor r18, r19 eaac: 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)) eaae: 62 17 cp r22, r18 eab0: 73 07 cpc r23, r19 eab2: 09 f0 breq .+2 ; 0xeab6 eab4: ce cf rjmp .-100 ; 0xea52 if (pgm_read_dword(((uint32_t*)(table + 12))) == pgm_read_dword(((uint32_t*)(_PRI_LANG_SIGNATURE)))) //signature valid eab6: ec e0 ldi r30, 0x0C ; 12 eab8: f1 e0 ldi r31, 0x01 ; 1 eaba: 05 91 lpm r16, Z+ eabc: 15 91 lpm r17, Z+ eabe: 25 91 lpm r18, Z+ eac0: 34 91 lpm r19, Z eac2: ed e3 ldi r30, 0x3D ; 61 eac4: f5 e7 ldi r31, 0x75 ; 117 eac6: 45 91 lpm r20, Z+ eac8: 55 91 lpm r21, Z+ eaca: 65 91 lpm r22, Z+ eacc: 74 91 lpm r23, Z eace: 04 17 cp r16, r20 ead0: 15 07 cpc r17, r21 ead2: 26 07 cpc r18, r22 ead4: 37 07 cpc r19, r23 ead6: 09 f0 breq .+2 ; 0xeada ead8: bc cf rjmp .-136 ; 0xea52 { lang_table = (lang_table_t*)table; // set table pointer eada: 20 e0 ldi r18, 0x00 ; 0 eadc: 31 e0 ldi r19, 0x01 ; 1 eade: 30 93 2c 03 sts 0x032C, r19 ; 0x80032c eae2: 20 93 2b 03 sts 0x032B, r18 ; 0x80032b lang_selected = lang; // set language id eae6: 91 e0 ldi r25, 0x01 ; 1 eae8: 90 93 2d 03 sts 0x032D, r25 ; 0x80032d eaec: b2 cf rjmp .-156 ; 0xea52 { 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); eaee: fa 01 movw r30, r20 eaf0: e0 50 subi r30, 0x00 ; 0 eaf2: ff 4f sbci r31, 0xFF ; 255 eaf4: e4 91 lpm r30, Z eaf6: f0 e0 ldi r31, 0x00 ; 0 eaf8: 98 e0 ldi r25, 0x08 ; 8 eafa: 40 fd sbrc r20, 0 eafc: 90 e0 ldi r25, 0x00 ; 0 eafe: 02 c0 rjmp .+4 ; 0xeb04 eb00: ee 0f add r30, r30 eb02: ff 1f adc r31, r31 eb04: 9a 95 dec r25 eb06: e2 f7 brpl .-8 ; 0xeb00 eb08: 2e 0f add r18, r30 eb0a: 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++) eb0c: 4f 5f subi r20, 0xFF ; 255 eb0e: 5f 4f sbci r21, 0xFF ; 255 eb10: c6 cf rjmp .-116 ; 0xea9e if (lang_selected == lang) { eeprom_update_byte((unsigned char*)EEPROM_LANG, lang_selected); return 1; } return 0; eb12: 80 e0 ldi r24, 0x00 ; 0 eb14: a8 cf rjmp .-176 ; 0xea66 0000eb16 : //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. eb16: 20 91 2d 03 lds r18, 0x032D ; 0x80032d eb1a: 21 11 cpse r18, r1 eb1c: 04 c0 rjmp .+8 ; 0xeb26 eb1e: fc 01 movw r30, r24 eb20: 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 } eb22: cf 01 movw r24, r30 eb24: 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. eb26: 40 91 2b 03 lds r20, 0x032B ; 0x80032b eb2a: 50 91 2c 03 lds r21, 0x032C ; 0x80032c eb2e: 41 15 cp r20, r1 eb30: 51 05 cpc r21, r1 eb32: a9 f3 breq .-22 ; 0xeb1e uint16_t ui = pgm_read_word(((uint16_t*)s)); //read string id eb34: fc 01 movw r30, r24 eb36: 25 91 lpm r18, Z+ eb38: 34 91 lpm r19, Z if (ui == 0xffff) return s + 2; //id not assigned, return orig. str. eb3a: 2f 3f cpi r18, 0xFF ; 255 eb3c: 32 07 cpc r19, r18 eb3e: 79 f3 breq .-34 ; 0xeb1e ui = pgm_read_word(((uint16_t*)(((char*)lang_table + 16 + ui*2)))); //read relative offset eb40: f9 01 movw r30, r18 eb42: 38 96 adiw r30, 0x08 ; 8 eb44: ee 0f add r30, r30 eb46: ff 1f adc r31, r31 eb48: e4 0f add r30, r20 eb4a: f5 1f adc r31, r21 eb4c: 25 91 lpm r18, Z+ eb4e: 34 91 lpm r19, Z if (pgm_read_byte(((uint8_t*)((char*)lang_table + ui))) == 0) //read first character eb50: fa 01 movw r30, r20 eb52: e2 0f add r30, r18 eb54: f3 1f adc r31, r19 eb56: 24 91 lpm r18, Z eb58: 22 23 and r18, r18 eb5a: 09 f3 breq .-62 ; 0xeb1e eb5c: e2 cf rjmp .-60 ; 0xeb22 0000eb5e : } menu_item++; } void menu_item_toggle_P(const char* str, const char* toggle, menu_func_t func, const uint8_t settings) { eb5e: 8f 92 push r8 eb60: 9f 92 push r9 eb62: af 92 push r10 eb64: bf 92 push r11 eb66: cf 92 push r12 eb68: df 92 push r13 eb6a: ef 92 push r14 eb6c: ff 92 push r15 eb6e: 0f 93 push r16 eb70: 1f 93 push r17 eb72: cf 93 push r28 eb74: df 93 push r29 if (menu_item == menu_line) eb76: e0 91 63 04 lds r30, 0x0463 ; 0x800463 eb7a: 30 91 62 04 lds r19, 0x0462 ; 0x800462 eb7e: e3 13 cpse r30, r19 eb80: 73 c0 rjmp .+230 ; 0xec68 eb82: c2 2f mov r28, r18 eb84: 6a 01 movw r12, r20 eb86: 7b 01 movw r14, r22 eb88: 5c 01 movw r10, r24 { if (lcd_draw_update) menu_draw_toggle_puts_P(str, toggle, settings | (menu_selection_mark()=='>')); eb8a: 80 91 59 02 lds r24, 0x0259 ; 0x800259 eb8e: 88 23 and r24, r24 eb90: a1 f1 breq .+104 ; 0xebfa eb92: 0e 94 b7 62 call 0xc56e ; 0xc56e eb96: 01 e0 ldi r16, 0x01 ; 1 eb98: 8e 33 cpi r24, 0x3E ; 62 eb9a: 09 f0 breq .+2 ; 0xeb9e eb9c: 00 e0 ldi r16, 0x00 ; 0 eb9e: 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; eba0: 80 2f mov r24, r16 eba2: 82 70 andi r24, 0x02 ; 2 eba4: 88 2e mov r8, r24 const char eol = (toggle == NULL) ? LCD_STR_ARROW_RIGHT[0] : ' '; eba6: e1 14 cp r14, r1 eba8: f1 04 cpc r15, r1 ebaa: 09 f4 brne .+2 ; 0xebae ebac: 6f c0 rjmp .+222 ; 0xec8c ebae: e7 01 movw r28, r14 ebb0: 90 e2 ldi r25, 0x20 ; 32 ebb2: 99 2e mov r9, r25 if (toggle == NULL) toggle = _T(MSG_NA); uint8_t len = 4 + (is_progmem ? strlen_P(toggle) : strlen(toggle)); ebb4: 88 20 and r8, r8 ebb6: 09 f4 brne .+2 ; 0xebba ebb8: 41 c0 rjmp .+130 ; 0xec3c ebba: ce 01 movw r24, r28 ebbc: 0f 94 3f a2 call 0x3447e ; 0x3447e <__strlen_P> ebc0: 14 e0 ldi r17, 0x04 ; 4 ebc2: 18 0f add r17, r24 lcd_putc_at(0, menu_row, (settings & 0x01) ? '>' : ' '); ebc4: 4e e3 ldi r20, 0x3E ; 62 ebc6: 00 ff sbrs r16, 0 ebc8: 40 e2 ldi r20, 0x20 ; 32 ebca: 60 91 60 04 lds r22, 0x0460 ; 0x800460 ebce: 80 e0 ldi r24, 0x00 ; 0 ebd0: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_print_pad_P(str, LCD_WIDTH - len); ebd4: 64 e1 ldi r22, 0x14 ; 20 ebd6: 61 1b sub r22, r17 ebd8: c5 01 movw r24, r10 ebda: 0e 94 48 72 call 0xe490 ; 0xe490 lcd_putc('['); ebde: 8b e5 ldi r24, 0x5B ; 91 ebe0: 0e 94 72 6f call 0xdee4 ; 0xdee4 if (is_progmem) { lcd_puts_P(toggle); ebe4: 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) ebe6: 88 20 and r8, r8 ebe8: 89 f1 breq .+98 ; 0xec4c { lcd_puts_P(toggle); ebea: 0e 94 6e 6f call 0xdedc ; 0xdedc } else { lcd_print(toggle); } lcd_putc(']'); ebee: 8d e5 ldi r24, 0x5D ; 93 ebf0: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_putc(eol); ebf4: 89 2d mov r24, r9 ebf6: 0e 94 72 6f call 0xdee4 ; 0xdee4 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)) ebfa: 80 91 61 04 lds r24, 0x0461 ; 0x800461 ebfe: 88 23 and r24, r24 ec00: 99 f1 breq .+102 ; 0xec68 ec02: 20 91 63 04 lds r18, 0x0463 ; 0x800463 ec06: 80 91 1e 06 lds r24, 0x061E ; 0x80061e ec0a: 90 91 1f 06 lds r25, 0x061F ; 0x80061f ec0e: 28 17 cp r18, r24 ec10: 19 06 cpc r1, r25 ec12: 51 f5 brne .+84 ; 0xec68 { if (toggle == NULL) // print N/A warning message ec14: ef 28 or r14, r15 ec16: e9 f4 brne .+58 ; 0xec52 { menu_submenu(func); ec18: 60 e0 ldi r22, 0x00 ; 0 ec1a: c6 01 movw r24, r12 ec1c: 0e 94 2e 63 call 0xc65c ; 0xc65c menu_item_ret(); return; } } menu_item++; } ec20: df 91 pop r29 ec22: cf 91 pop r28 ec24: 1f 91 pop r17 ec26: 0f 91 pop r16 ec28: ff 90 pop r15 ec2a: ef 90 pop r14 ec2c: df 90 pop r13 ec2e: cf 90 pop r12 ec30: bf 90 pop r11 ec32: af 90 pop r10 ec34: 9f 90 pop r9 ec36: 8f 90 pop r8 { lcd_update_enabled = 0; if (func) func(); lcd_update_enabled = 1; } menu_item_ret(); ec38: 0c 94 c4 62 jmp 0xc588 ; 0xc588 //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)); ec3c: fe 01 movw r30, r28 ec3e: 01 90 ld r0, Z+ ec40: 00 20 and r0, r0 ec42: e9 f7 brne .-6 ; 0xec3e ec44: ec 1b sub r30, r28 ec46: 13 e0 ldi r17, 0x03 ; 3 ec48: 1e 0f add r17, r30 ec4a: bc cf rjmp .-136 ; 0xebc4 lcd_putc('['); if (is_progmem) { lcd_puts_P(toggle); } else { lcd_print(toggle); ec4c: 0e 94 b0 73 call 0xe760 ; 0xe760 ec50: ce cf rjmp .-100 ; 0xebee { menu_submenu(func); } else // do the actual toggling { lcd_update_enabled = 0; ec52: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(); ec56: c1 14 cp r12, r1 ec58: d1 04 cpc r13, r1 ec5a: 11 f0 breq .+4 ; 0xec60 ec5c: f6 01 movw r30, r12 ec5e: 19 95 eicall lcd_update_enabled = 1; ec60: 81 e0 ldi r24, 0x01 ; 1 ec62: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a ec66: dc cf rjmp .-72 ; 0xec20 } menu_item_ret(); return; } } menu_item++; ec68: 80 91 63 04 lds r24, 0x0463 ; 0x800463 ec6c: 8f 5f subi r24, 0xFF ; 255 ec6e: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } ec72: df 91 pop r29 ec74: cf 91 pop r28 ec76: 1f 91 pop r17 ec78: 0f 91 pop r16 ec7a: ff 90 pop r15 ec7c: ef 90 pop r14 ec7e: df 90 pop r13 ec80: cf 90 pop r12 ec82: bf 90 pop r11 ec84: af 90 pop r10 ec86: 9f 90 pop r9 ec88: 8f 90 pop r8 ec8a: 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); ec8c: 8c e7 ldi r24, 0x7C ; 124 ec8e: 98 e4 ldi r25, 0x48 ; 72 ec90: 0e 94 8b 75 call 0xeb16 ; 0xeb16 ec94: 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] : ' '; ec96: 8e e7 ldi r24, 0x7E ; 126 ec98: 98 2e mov r9, r24 ec9a: 8c cf rjmp .-232 ; 0xebb4 0000ec9c : //! @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) { ec9c: 0f 93 push r16 ec9e: 1f 93 push r17 eca0: cf 93 push r28 eca2: df 93 push r29 eca4: 8c 01 movw r16, r24 eca6: eb 01 movw r28, r22 uint_least8_t index = sprintf_P(buffer.c, PSTR("%.10S "), _T(MSG_SHEET)); eca8: 87 ee ldi r24, 0xE7 ; 231 ecaa: 9e e4 ldi r25, 0x4E ; 78 ecac: 0e 94 8b 75 call 0xeb16 ; 0xeb16 ecb0: 9f 93 push r25 ecb2: 8f 93 push r24 ecb4: 8d ef ldi r24, 0xFD ; 253 ecb6: 91 e8 ldi r25, 0x81 ; 129 ecb8: 9f 93 push r25 ecba: 8f 93 push r24 ecbc: df 93 push r29 ecbe: cf 93 push r28 ecc0: 0f 94 98 a3 call 0x34730 ; 0x34730 eeprom_read_block(&(buffer.c[index]), sheet_E.name, 7); ecc4: c8 0f add r28, r24 ecc6: d1 1d adc r29, r1 ecc8: 47 e0 ldi r20, 0x07 ; 7 ecca: 50 e0 ldi r21, 0x00 ; 0 eccc: b8 01 movw r22, r16 ecce: ce 01 movw r24, r28 ecd0: 0f 94 71 a4 call 0x348e2 ; 0x348e2 //index += 7; buffer.c[index + 7] = '\0'; ecd4: 1f 82 std Y+7, r1 ; 0x07 ecd6: 0f 90 pop r0 ecd8: 0f 90 pop r0 ecda: 0f 90 pop r0 ecdc: 0f 90 pop r0 ecde: 0f 90 pop r0 ece0: 0f 90 pop r0 } ece2: df 91 pop r29 ece4: cf 91 pop r28 ece6: 1f 91 pop r17 ece8: 0f 91 pop r16 ecea: 08 95 ret 0000ecec : } menu_item++; } void menu_item_submenu_E(const Sheet &sheet, menu_func_t submenu) { ecec: 0f 93 push r16 ecee: 1f 93 push r17 ecf0: cf 93 push r28 ecf2: df 93 push r29 ecf4: cd b7 in r28, 0x3d ; 61 ecf6: de b7 in r29, 0x3e ; 62 ecf8: 63 97 sbiw r28, 0x13 ; 19 ecfa: 0f b6 in r0, 0x3f ; 63 ecfc: f8 94 cli ecfe: de bf out 0x3e, r29 ; 62 ed00: 0f be out 0x3f, r0 ; 63 ed02: cd bf out 0x3d, r28 ; 61 if (menu_item == menu_line) ed04: 30 91 63 04 lds r19, 0x0463 ; 0x800463 ed08: 20 91 62 04 lds r18, 0x0462 ; 0x800462 ed0c: 32 13 cpse r19, r18 ed0e: 38 c0 rjmp .+112 ; 0xed80 ed10: 8b 01 movw r16, r22 { if (lcd_draw_update) menu_draw_item_puts_E(LCD_STR_ARROW_RIGHT[0], sheet); ed12: 20 91 59 02 lds r18, 0x0259 ; 0x800259 ed16: 22 23 and r18, r18 ed18: a9 f0 breq .+42 ; 0xed44 static void menu_draw_item_puts_E(char type_char, const Sheet &sheet) { SheetFormatBuffer buffer; menu_format_sheet_E(sheet, buffer); ed1a: be 01 movw r22, r28 ed1c: 6f 5f subi r22, 0xFF ; 255 ed1e: 7f 4f sbci r23, 0xFF ; 255 ed20: 0e 94 4e 76 call 0xec9c ; 0xec9c lcd_putc_at(0, menu_row, menu_selection_mark()); ed24: 0e 94 b7 62 call 0xc56e ; 0xc56e ed28: 48 2f mov r20, r24 ed2a: 60 91 60 04 lds r22, 0x0460 ; 0x800460 ed2e: 80 e0 ldi r24, 0x00 ; 0 ed30: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_print_pad(buffer.c, LCD_WIDTH - 2); ed34: 62 e1 ldi r22, 0x12 ; 18 ed36: ce 01 movw r24, r28 ed38: 01 96 adiw r24, 0x01 ; 1 ed3a: 0e 94 98 73 call 0xe730 ; 0xe730 lcd_putc(type_char); ed3e: 8e e7 ldi r24, 0x7E ; 126 ed40: 0e 94 72 6f call 0xdee4 ; 0xdee4 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)) ed44: 80 91 61 04 lds r24, 0x0461 ; 0x800461 ed48: 88 23 and r24, r24 ed4a: d1 f0 breq .+52 ; 0xed80 ed4c: 20 91 63 04 lds r18, 0x0463 ; 0x800463 ed50: 80 91 1e 06 lds r24, 0x061E ; 0x80061e ed54: 90 91 1f 06 lds r25, 0x061F ; 0x80061f ed58: 28 17 cp r18, r24 ed5a: 19 06 cpc r1, r25 ed5c: 89 f4 brne .+34 ; 0xed80 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); ed5e: 60 e0 ldi r22, 0x00 ; 0 ed60: c8 01 movw r24, r16 ed62: 0e 94 2e 63 call 0xc65c ; 0xc65c menu_item_ret(); ed66: 0e 94 c4 62 call 0xc588 ; 0xc588 menu_item_ret(); return; } } menu_item++; } ed6a: 63 96 adiw r28, 0x13 ; 19 ed6c: 0f b6 in r0, 0x3f ; 63 ed6e: f8 94 cli ed70: de bf out 0x3e, r29 ; 62 ed72: 0f be out 0x3f, r0 ; 63 ed74: cd bf out 0x3d, r28 ; 61 ed76: df 91 pop r29 ed78: cf 91 pop r28 ed7a: 1f 91 pop r17 ed7c: 0f 91 pop r16 ed7e: 08 95 ret menu_submenu(submenu); menu_item_ret(); return; } } menu_item++; ed80: 80 91 63 04 lds r24, 0x0463 ; 0x800463 ed84: 8f 5f subi r24, 0xFF ; 255 ed86: 80 93 63 04 sts 0x0463, r24 ; 0x800463 ed8a: ef cf rjmp .-34 ; 0xed6a 0000ed8c : } sound_wait_for_user_reset(); } void M600_load_filament_movements(const char* filament_name) { ed8c: cf 93 push r28 ed8e: df 93 push r29 ed90: ec 01 movw r28, r24 current_position[E_AXIS]+= FILAMENTCHANGE_FIRSTFEED; ed92: 20 e0 ldi r18, 0x00 ; 0 ed94: 30 e0 ldi r19, 0x00 ; 0 ed96: 4c e8 ldi r20, 0x8C ; 140 ed98: 52 e4 ldi r21, 0x42 ; 66 ed9a: 60 91 6d 12 lds r22, 0x126D ; 0x80126d ed9e: 70 91 6e 12 lds r23, 0x126E ; 0x80126e eda2: 80 91 6f 12 lds r24, 0x126F ; 0x80126f eda6: 90 91 70 12 lds r25, 0x1270 ; 0x801270 edaa: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> edae: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d edb2: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e edb6: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f edba: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); edbe: 60 e0 ldi r22, 0x00 ; 0 edc0: 70 e0 ldi r23, 0x00 ; 0 edc2: 80 ea ldi r24, 0xA0 ; 160 edc4: 91 e4 ldi r25, 0x41 ; 65 edc6: 0f 94 0d 4a call 0x2941a ; 0x2941a load_filament_final_feed(); edca: 0e 94 3e 64 call 0xc87c ; 0xc87c } void lcd_loading_filament(const char* filament_name) { lcd_clear(); edce: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 0, _T(MSG_LOADING_FILAMENT)); edd2: 8f ea ldi r24, 0xAF ; 175 edd4: 92 e6 ldi r25, 0x62 ; 98 edd6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 edda: ac 01 movw r20, r24 eddc: 60 e0 ldi r22, 0x00 ; 0 edde: 80 e0 ldi r24, 0x00 ; 0 ede0: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 if (filament_name[0]) { ede4: 88 81 ld r24, Y ede6: 88 23 and r24, r24 ede8: 39 f0 breq .+14 ; 0xedf8 lcd_set_cursor(0, 1); edea: 61 e0 ldi r22, 0x01 ; 1 edec: 80 e0 ldi r24, 0x00 ; 0 edee: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_print(filament_name); edf2: ce 01 movw r24, r28 edf4: 0e 94 b0 73 call 0xe760 ; 0xe760 } lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); edf8: 86 eb ldi r24, 0xB6 ; 182 edfa: 99 e3 ldi r25, 0x39 ; 57 edfc: 0e 94 8b 75 call 0xeb16 ; 0xeb16 ee00: ac 01 movw r20, r24 ee02: 62 e0 ldi r22, 0x02 ; 2 ee04: 80 e0 ldi r24, 0x00 ; 0 ee06: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 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 ee0a: 83 e4 ldi r24, 0x43 ; 67 ee0c: 9b e2 ldi r25, 0x2B ; 43 ee0e: 0f 94 4b 09 call 0x21296 ; 0x21296 lcd_loading_filament(filament_name); st_synchronize(); } ee12: df 91 pop r29 ee14: 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(); ee16: 0d 94 94 18 jmp 0x23128 ; 0x23128 0000ee1a : * 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; ee1a: 0f 94 45 65 call 0x2ca8a ; 0x2ca8a ee1e: 8f 3f cpi r24, 0xFF ; 255 ee20: 11 f1 breq .+68 ; 0xee66 lcd_update_enable(false); ee22: 80 e0 ldi r24, 0x00 ; 0 ee24: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_clear(); ee28: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 1, _T(MSG_UNLOADING_FILAMENT)); ee2c: 8b e6 ldi r24, 0x6B ; 107 ee2e: 9a e5 ldi r25, 0x5A ; 90 ee30: 0e 94 8b 75 call 0xeb16 ; 0xeb16 ee34: ac 01 movw r20, r24 ee36: 61 e0 ldi r22, 0x01 ; 1 ee38: 80 e0 ldi r24, 0x00 ; 0 ee3a: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); ee3e: 80 e2 ldi r24, 0x20 ; 32 ee40: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 lcd_print(' '); lcd_print(MMU2::mmu2.get_current_tool() + 1); ee44: 0f 94 45 65 call 0x2ca8a ; 0x2ca8a ee48: 68 2f mov r22, r24 ee4a: 70 e0 ldi r23, 0x00 ; 0 ee4c: 6f 5f subi r22, 0xFF ; 255 ee4e: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); ee50: 07 2e mov r0, r23 ee52: 00 0c add r0, r0 ee54: 88 0b sbc r24, r24 ee56: 99 0b sbc r25, r25 ee58: 0e 94 2c 72 call 0xe458 ; 0xe458 // unload just current filament for multimaterial printers (used also in M702) MMU2::mmu2.unload(); ee5c: 0f 94 12 9e call 0x33c24 ; 0x33c24 lcd_update_enable(true); ee60: 81 e0 ldi r24, 0x01 ; 1 ee62: 0c 94 89 70 jmp 0xe112 ; 0xe112 } ee66: 08 95 ret 0000ee68 <__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 { ee68: 1f 92 push r1 ee6a: 0f 92 push r0 ee6c: 0f b6 in r0, 0x3f ; 63 ee6e: 0f 92 push r0 ee70: 11 24 eor r1, r1 ee72: 0b b6 in r0, 0x3b ; 59 ee74: 0f 92 push r0 ee76: 2f 93 push r18 ee78: 8f 93 push r24 ee7a: 9f 93 push r25 ee7c: ef 93 push r30 ee7e: ff 93 push r31 switch(state){ ee80: e0 91 26 03 lds r30, 0x0326 ; 0x800326 ee84: e8 30 cpi r30, 0x08 ; 8 ee86: e8 f4 brcc .+58 ; 0xeec2 <__vector_23+0x5a> ee88: f0 e0 ldi r31, 0x00 ; 0 ee8a: 88 27 eor r24, r24 ee8c: e5 5b subi r30, 0xB5 ; 181 ee8e: f8 48 sbci r31, 0x88 ; 136 ee90: 8f 4f sbci r24, 0xFF ; 255 ee92: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> ee96: 53 77 andi r21, 0x73 ; 115 ee98: 6d 77 andi r22, 0x7D ; 125 ee9a: 78 77 andi r23, 0x78 ; 120 ee9c: 86 77 andi r24, 0x76 ; 118 ee9e: 9c 77 andi r25, 0x7C ; 124 eea0: a5 77 andi r26, 0x75 ; 117 eea2: c8 77 andi r28, 0x78 ; 120 eea4: da 77 andi r29, 0x7A ; 122 case States::ZERO_START: if (bedPWMDisabled) return; // stay in the OFF state and do not change the output pin eea6: 80 91 28 06 lds r24, 0x0628 ; 0x800628 eeaa: 81 11 cpse r24, r1 eeac: 0a c0 rjmp .+20 ; 0xeec2 <__vector_23+0x5a> pwm = soft_pwm_bed << 1;// expecting soft_pwm_bed to be 7bit! eeae: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee eeb2: 88 0f add r24, r24 eeb4: 80 93 25 03 sts 0x0325, r24 ; 0x800325 if( pwm != 0 ){ eeb8: 88 23 and r24, r24 eeba: 19 f0 breq .+6 ; 0xeec2 <__vector_23+0x5a> state = States::ZERO; // do nothing, let it tick once again after the 30Hz period eebc: 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 eebe: 80 93 26 03 sts 0x0326, r24 ; 0x800326 TCNT0 = 128; OCR0B = 255; TCCR0B = (1 << CS01); // change prescaler to 8, i.e. 7.8kHz break; } } eec2: ff 91 pop r31 eec4: ef 91 pop r30 eec6: 9f 91 pop r25 eec8: 8f 91 pop r24 eeca: 2f 91 pop r18 eecc: 0f 90 pop r0 eece: 0b be out 0x3b, r0 ; 59 eed0: 0f 90 pop r0 eed2: 0f be out 0x3f, r0 ; 63 eed4: 0f 90 pop r0 eed6: 1f 90 pop r1 eed8: 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) eeda: 80 91 24 03 lds r24, 0x0324 ; 0x800324 eede: 8f 5f subi r24, 0xFF ; 255 eee0: 80 93 24 03 sts 0x0324, r24 ; 0x800324 if( slowCounter > pwm ){ eee4: 90 91 25 03 lds r25, 0x0325 ; 0x800325 eee8: 98 17 cp r25, r24 eeea: 58 f3 brcs .-42 ; 0xeec2 <__vector_23+0x5a> return; } // otherwise moving towards RISE state = States::ZERO_TO_RISE; // and finalize the change in a transitional state RISE0 eeec: 82 e0 ldi r24, 0x02 ; 2 eeee: e7 cf rjmp .-50 ; 0xeebe <__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 eef0: 83 e0 ldi r24, 0x03 ; 3 eef2: 80 93 26 03 sts 0x0326, r24 ; 0x800326 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE eef6: 8f e0 ldi r24, 0x0F ; 15 eef8: 80 93 23 03 sts 0x0323, r24 ; 0x800323 TCNT0 = 255; // force overflow on the next clock cycle eefc: 8f ef ldi r24, 0xFF ; 255 eefe: 86 bd out 0x26, r24 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz ef00: 81 e0 ldi r24, 0x01 ; 1 ef02: 85 bd out 0x25, r24 ; 37 TCCR0A &= ~(1 << COM0B0); // Clear OC0B on Compare Match, set OC0B at BOTTOM (non-inverting mode) ef04: 84 b5 in r24, 0x24 ; 36 ef06: 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 ef08: 84 bd out 0x24, r24 ; 36 ef0a: db cf rjmp .-74 ; 0xeec2 <__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; ef0c: 80 91 23 03 lds r24, 0x0323 ; 0x800323 ef10: 82 95 swap r24 ef12: 80 7f andi r24, 0xF0 ; 240 ef14: 81 95 neg r24 ef16: 88 bd out 0x28, r24 ; 40 if( fastCounter ){ ef18: 80 91 23 03 lds r24, 0x0323 ; 0x800323 ef1c: 88 23 and r24, r24 ef1e: 21 f0 breq .+8 ; 0xef28 <__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; ef20: 81 50 subi r24, 0x01 ; 1 ef22: 80 93 23 03 sts 0x0323, r24 ; 0x800323 ef26: cd cf rjmp .-102 ; 0xeec2 <__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; ef28: 84 e0 ldi r24, 0x04 ; 4 ef2a: 80 93 26 03 sts 0x0326, r24 ; 0x800326 OCR0B = 255; // full duty ef2e: 8f ef ldi r24, 0xFF ; 255 ef30: 88 bd out 0x28, r24 ; 40 TCNT0 = 254; // make the timer overflow in the next cycle ef32: 8e ef ldi r24, 0xFE ; 254 ef34: 86 bd out 0x26, r24 ; 38 ef36: c5 cf rjmp .-118 ; 0xeec2 <__vector_23+0x5a> // @@TODO these constants are still subject to investigation } break; case States::RISE_TO_ONE: state = States::ONE; ef38: 85 e0 ldi r24, 0x05 ; 5 ef3a: 80 93 26 03 sts 0x0326, r24 ; 0x800326 OCR0B = 255; // full duty ef3e: 8f ef ldi r24, 0xFF ; 255 ef40: 88 bd out 0x28, r24 ; 40 TCNT0 = 255; // make the timer overflow in the next cycle ef42: 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 ef44: 82 e0 ldi r24, 0x02 ; 2 ef46: 85 bd out 0x25, r24 ; 37 ef48: bc cf rjmp .-136 ; 0xeec2 <__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; ef4a: 2f ef ldi r18, 0xFF ; 255 ef4c: 28 bd out 0x28, r18 ; 40 if (bedPWMDisabled) return; // stay in the ON state and do not change the output pin ef4e: 80 91 28 06 lds r24, 0x0628 ; 0x800628 ef52: 81 11 cpse r24, r1 ef54: b6 cf rjmp .-148 ; 0xeec2 <__vector_23+0x5a> slowCounter += slowInc; // this does software timer_clk/256 or less ef56: 80 91 24 03 lds r24, 0x0324 ; 0x800324 ef5a: 8f 5f subi r24, 0xFF ; 255 ef5c: 80 93 24 03 sts 0x0324, r24 ; 0x800324 if( slowCounter < pwm ){ ef60: 90 91 25 03 lds r25, 0x0325 ; 0x800325 ef64: 89 17 cp r24, r25 ef66: 08 f4 brcc .+2 ; 0xef6a <__vector_23+0x102> ef68: ac cf rjmp .-168 ; 0xeec2 <__vector_23+0x5a> return; } if( (soft_pwm_bed << 1) >= (255 - slowInc - 1) ){ //@@TODO simplify & explain ef6a: 80 91 ee 05 lds r24, 0x05EE ; 0x8005ee ef6e: 90 e0 ldi r25, 0x00 ; 0 ef70: 8f 37 cpi r24, 0x7F ; 127 ef72: 91 05 cpc r25, r1 ef74: 0c f0 brlt .+2 ; 0xef78 <__vector_23+0x110> ef76: a5 cf rjmp .-182 ; 0xeec2 <__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; ef78: 86 e0 ldi r24, 0x06 ; 6 ef7a: 80 93 26 03 sts 0x0326, r24 ; 0x800326 fastCounter = fastMax - 1;// we'll do 16-1 cycles of RISE ef7e: 8f e0 ldi r24, 0x0F ; 15 ef80: 80 93 23 03 sts 0x0323, r24 ; 0x800323 TCNT0 = 255; // force overflow on the next clock cycle ef84: 26 bd out 0x26, r18 ; 38 TCCR0B = (1 << CS00); // change prescaler to 1, i.e. 62.5kHz ef86: 81 e0 ldi r24, 0x01 ; 1 ef88: 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 ef8a: 84 b5 in r24, 0x24 ; 36 ef8c: 80 61 ori r24, 0x10 ; 16 ef8e: bc cf rjmp .-136 ; 0xef08 <__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 ef90: 80 91 23 03 lds r24, 0x0323 ; 0x800323 ef94: 82 95 swap r24 ef96: 80 7f andi r24, 0xF0 ; 240 ef98: 81 95 neg r24 ef9a: 88 bd out 0x28, r24 ; 40 //TCCR0A |= (1 << COM0B0); // already set in ONE_TO_FALL if( fastCounter ){ ef9c: 80 91 23 03 lds r24, 0x0323 ; 0x800323 efa0: 81 11 cpse r24, r1 efa2: be cf rjmp .-132 ; 0xef20 <__vector_23+0xb8> --fastCounter; } else { // end of FALL cycles, changing into state ZERO state = States::FALL_TO_ZERO; efa4: 87 e0 ldi r24, 0x07 ; 7 efa6: 80 93 26 03 sts 0x0326, r24 ; 0x800326 TCNT0 = 128; //@@TODO again - need to wait long enough to propagate the timer state changes efaa: 80 e8 ldi r24, 0x80 ; 128 efac: 86 bd out 0x26, r24 ; 38 OCR0B = 255; efae: 8f ef ldi r24, 0xFF ; 255 efb0: 88 bd out 0x28, r24 ; 40 efb2: 87 cf rjmp .-242 ; 0xeec2 <__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 efb4: 10 92 26 03 sts 0x0326, r1 ; 0x800326 TCNT0 = 128; efb8: 80 e8 ldi r24, 0x80 ; 128 efba: 86 bd out 0x26, r24 ; 38 OCR0B = 255; efbc: 8f ef ldi r24, 0xFF ; 255 efbe: 88 bd out 0x28, r24 ; 40 efc0: c1 cf rjmp .-126 ; 0xef44 <__vector_23+0xdc> 0000efc2 : #else // FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { } FSensorBlockRunout::~FSensorBlockRunout() { } #endif // FILAMENT_SENSOR void Filament_sensor::setEnabled(bool enabled) { efc2: cf 93 push r28 efc4: c8 2f mov r28, r24 efc6: 68 2f mov r22, r24 efc8: 87 e6 ldi r24, 0x67 ; 103 efca: 9f e0 ldi r25, 0x0F ; 15 efcc: 0f 94 a5 a4 call 0x3494a ; 0x3494a eeprom_update_byte_notify((uint8_t *)EEPROM_FSENSOR, enabled); if (enabled) { efd0: cc 23 and r28, r28 efd2: 19 f0 breq .+6 ; 0xefda fsensor.init(); } else { fsensor.deinit(); } } efd4: 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(); efd6: 0d 94 7a 6d jmp 0x2daf4 ; 0x2daf4 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; efda: 10 92 f1 16 sts 0x16F1, r1 ; 0x8016f1 filter = 0; efde: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd if (enabled) { fsensor.init(); } else { fsensor.deinit(); } } efe2: cf 91 pop r28 efe4: 08 95 ret 0000efe6 : #endif #endif //DEBUG_DISABLE_FANCHECK } void resetFanCheck() { fan_measuring = false; efe6: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 extruder_autofan_last_check = _millis(); efea: 0f 94 89 0b call 0x21712 ; 0x21712 efee: 60 93 07 17 sts 0x1707, r22 ; 0x801707 eff2: 70 93 08 17 sts 0x1708, r23 ; 0x801708 eff6: 80 93 09 17 sts 0x1709, r24 ; 0x801709 effa: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a } effe: 08 95 ret 0000f000 : 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; f000: 80 93 22 03 sts 0x0322, r24 ; 0x800322 newFanSpeed = 0; if (fanState & 0x01) f004: 80 fd sbrc r24, 0 f006: 1c c0 rjmp .+56 ; 0xf040 { //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; f008: 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); f00c: 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) f010: 8f ef ldi r24, 0xFF ; 255 f012: 82 0f add r24, r18 f014: 8e 3f cpi r24, 0xFE ; 254 f016: e8 f0 brcs .+58 ; 0xf052 { // We use digital logic if the duty cycle is 0% or 100% TCCR4A &= ~_BV(COM4C1); f018: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> f01c: 87 7f andi r24, 0xF7 ; 247 f01e: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = 0; f022: 10 92 ad 00 sts 0x00AD, r1 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> f026: 10 92 ac 00 sts 0x00AC, r1 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> WRITE(EXTRUDER_0_AUTO_FAN_PIN, duty); f02a: 9f b7 in r25, 0x3f ; 63 f02c: 22 23 and r18, r18 f02e: 61 f0 breq .+24 ; 0xf048 f030: f8 94 cli f032: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f036: 80 62 ori r24, 0x20 ; 32 f038: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f03c: 9f bf out 0x3f, r25 ; 63 f03e: 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; f040: 8f ef ldi r24, 0xFF ; 255 f042: 80 93 3e 03 sts 0x033E, r24 ; 0x80033e f046: e2 cf rjmp .-60 ; 0xf00c f048: f8 94 cli f04a: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> f04e: 8f 7d andi r24, 0xDF ; 223 f050: f3 cf rjmp .-26 ; 0xf038 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; f052: ef b7 in r30, 0x3f ; 63 f054: f8 94 cli // Enable the PWM output on the fan pin. TCCR4A |= _BV(COM4C1); f056: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> f05a: 88 60 ori r24, 0x08 ; 8 f05c: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = (((uint16_t)duty) * ((uint16_t)((TIMSK4 & _BV(OCIE4A)) ? OCR4A : 255U))) / 255U; f060: 30 e0 ldi r19, 0x00 ; 0 f062: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> f066: 4f ef ldi r20, 0xFF ; 255 f068: 50 e0 ldi r21, 0x00 ; 0 f06a: 81 ff sbrs r24, 1 f06c: 04 c0 rjmp .+8 ; 0xf076 f06e: 40 91 a8 00 lds r20, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> f072: 50 91 a9 00 lds r21, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> f076: 24 9f mul r18, r20 f078: c0 01 movw r24, r0 f07a: 25 9f mul r18, r21 f07c: 90 0d add r25, r0 f07e: 34 9f mul r19, r20 f080: 90 0d add r25, r0 f082: 11 24 eor r1, r1 f084: 6f ef ldi r22, 0xFF ; 255 f086: 70 e0 ldi r23, 0x00 ; 0 f088: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> f08c: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> f090: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> CRITICAL_SECTION_END; f094: ef bf out 0x3f, r30 ; 63 #endif //EXTRUDER_ALTFAN_DETECT } timer4_set_fan0(newFanSpeed); } f096: 08 95 ret 0000f098 : } #endif //EXTRUDER_ALTFAN_DETECT void checkExtruderAutoFans() { f098: 1f 93 push r17 f09a: cf 93 push r28 f09c: df 93 push r29 #if defined(EXTRUDER_0_AUTO_FAN_PIN) && EXTRUDER_0_AUTO_FAN_PIN > -1 if (!(fanState & 0x02)) f09e: d0 91 22 03 lds r29, 0x0322 ; 0x800322 f0a2: d1 fd sbrc r29, 1 f0a4: 1d c0 rjmp .+58 ; 0xf0e0 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; f0a6: 10 91 cc 03 lds r17, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; f0aa: c1 e0 ldi r28, 0x01 ; 1 f0ac: 20 e0 ldi r18, 0x00 ; 0 f0ae: 30 e0 ldi r19, 0x00 ; 0 f0b0: 48 e4 ldi r20, 0x48 ; 72 f0b2: 52 e4 ldi r21, 0x42 ; 66 f0b4: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a f0b8: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b f0bc: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c f0c0: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d f0c4: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> f0c8: 18 16 cp r1, r24 f0ca: 0c f0 brlt .+2 ; 0xf0ce f0cc: 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; f0ce: de 7f andi r29, 0xFE ; 254 fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; f0d0: cd 2b or r28, r29 f0d2: 81 e0 ldi r24, 0x01 ; 1 f0d4: 11 11 cpse r17, r1 f0d6: 01 c0 rjmp .+2 ; 0xf0da f0d8: 80 e0 ldi r24, 0x00 ; 0 fanState |= get_temp_error(); f0da: c8 2b or r28, r24 f0dc: c0 93 22 03 sts 0x0322, r28 ; 0x800322 } setExtruderAutoFanState(fanState); f0e0: 80 91 22 03 lds r24, 0x0322 ; 0x800322 #endif } f0e4: df 91 pop r29 f0e6: cf 91 pop r28 f0e8: 1f 91 pop r17 { fanState &= ~1; fanState |= current_temperature[0] > EXTRUDER_AUTO_FAN_TEMPERATURE; fanState |= get_temp_error(); } setExtruderAutoFanState(fanState); f0ea: 0c 94 00 78 jmp 0xf000 ; 0xf000 0000f0ee : 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) { f0ee: ef 92 push r14 f0f0: ff 92 push r15 f0f2: 0f 93 push r16 f0f4: 1f 93 push r17 f0f6: cf 93 push r28 f0f8: df 93 push r29 f0fa: ec 01 movw r28, r24 f0fc: 8b 01 movw r16, r22 f0fe: 7a 01 movw r14, r20 if (!eeprom_is_initialized_block(__p, __n)) f100: 0e 94 65 56 call 0xacca ; 0xacca f104: 81 11 cpse r24, r1 f106: 0b c0 rjmp .+22 ; 0xf11e #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); f108: a8 01 movw r20, r16 f10a: be 01 movw r22, r28 f10c: 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); } f10e: df 91 pop r29 f110: cf 91 pop r28 f112: 1f 91 pop r17 f114: 0f 91 pop r16 f116: ff 90 pop r15 f118: 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); f11a: 0d 94 95 a4 jmp 0x3492a ; 0x3492a } 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); } f11e: df 91 pop r29 f120: cf 91 pop r28 f122: 1f 91 pop r17 f124: 0f 91 pop r16 f126: ff 90 pop r15 f128: ef 90 pop r14 f12a: 08 95 ret 0000f12c : return def; } return val; } uint16_t __attribute__((noinline)) eeprom_init_default_word(uint16_t *__p, uint16_t def) { f12c: 0f 93 push r16 f12e: 1f 93 push r17 f130: cf 93 push r28 f132: df 93 push r29 f134: 8c 01 movw r16, r24 f136: d6 2f mov r29, r22 f138: c7 2f mov r28, r23 uint16_t val = eeprom_read_word(__p); f13a: 0f 94 8f a4 call 0x3491e ; 0x3491e if (val == EEPROM_EMPTY_VALUE16) { f13e: 8f 3f cpi r24, 0xFF ; 255 f140: 98 07 cpc r25, r24 f142: 39 f4 brne .+14 ; 0xf152 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); f144: 6d 2f mov r22, r29 f146: 7c 2f mov r23, r28 f148: c8 01 movw r24, r16 f14a: 0f 94 df a4 call 0x349be ; 0x349be 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; f14e: 8d 2f mov r24, r29 f150: 9c 2f mov r25, r28 } return val; } f152: df 91 pop r29 f154: cf 91 pop r28 f156: 1f 91 pop r17 f158: 0f 91 pop r16 f15a: 08 95 ret 0000f15c : 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) { f15c: 0f 93 push r16 f15e: 1f 93 push r17 f160: cf 93 push r28 f162: 8c 01 movw r16, r24 f164: c6 2f mov r28, r22 uint8_t val = eeprom_read_byte(__p); f166: 0f 94 81 a4 call 0x34902 ; 0x34902 if (val == EEPROM_EMPTY_VALUE) { f16a: 8f 3f cpi r24, 0xFF ; 255 f16c: 29 f4 brne .+10 ; 0xf178 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); f16e: 6c 2f mov r22, r28 f170: c8 01 movw r24, r16 f172: 0f 94 c9 a4 call 0x34992 ; 0x34992 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; f176: 8c 2f mov r24, r28 } return val; } f178: cf 91 pop r28 f17a: 1f 91 pop r17 f17c: 0f 91 pop r16 f17e: 08 95 ret 0000f180 : 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) { f180: cf 93 push r28 f182: df 93 push r29 f184: ec 01 movw r28, r24 eeprom_write_word_notify(__p, eeprom_read_word(__p) + 1); f186: 0f 94 8f a4 call 0x3491e ; 0x3491e f18a: bc 01 movw r22, r24 f18c: 6f 5f subi r22, 0xFF ; 255 f18e: 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); f190: 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); } f192: df 91 pop r29 f194: 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); f196: 0d 94 df a4 jmp 0x349be ; 0x349be 0000f19a : void eeprom_toggle(uint8_t *__p) { eeprom_write_byte_notify(__p, !eeprom_read_byte(__p)); } void __attribute__((noinline)) eeprom_increment_byte(uint8_t *__p) { f19a: cf 93 push r28 f19c: df 93 push r29 f19e: ec 01 movw r28, r24 eeprom_write_byte_notify(__p, eeprom_read_byte(__p) + 1); f1a0: 0f 94 81 a4 call 0x34902 ; 0x34902 f1a4: 61 e0 ldi r22, 0x01 ; 1 f1a6: 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); f1a8: 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); } f1aa: df 91 pop r29 f1ac: 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); f1ae: 0d 94 c9 a4 jmp 0x34992 ; 0x34992 0000f1b2 : 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); f1b2: 2b e0 ldi r18, 0x0B ; 11 f1b4: 82 9f mul r24, r18 f1b6: c0 01 movw r24, r0 f1b8: 11 24 eor r1, r1 f1ba: 80 5b subi r24, 0xB0 ; 176 f1bc: 92 4f sbci r25, 0xF2 ; 242 f1be: 0f 94 8f a4 call 0x3491e ; 0x3491e f1c2: 21 e0 ldi r18, 0x01 ; 1 f1c4: 01 96 adiw r24, 0x01 ; 1 f1c6: 09 f4 brne .+2 ; 0xf1ca f1c8: 20 e0 ldi r18, 0x00 ; 0 } f1ca: 82 2f mov r24, r18 f1cc: 08 95 ret 0000f1ce : //! //! @param sheet Current sheet //! @return next initialized sheet //! @retval -1 no sheet is initialized int8_t eeprom_next_initialized_sheet(int8_t sheet) { f1ce: cf 93 push r28 f1d0: df 93 push r29 f1d2: c8 2f mov r28, r24 f1d4: d8 e0 ldi r29, 0x08 ; 8 for (int8_t i = 0; i < static_cast(sizeof(Sheets::s)/sizeof(Sheet)); ++i) { ++sheet; f1d6: cf 5f subi r28, 0xFF ; 255 if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; f1d8: c8 30 cpi r28, 0x08 ; 8 f1da: 0c f0 brlt .+2 ; 0xf1de f1dc: c0 e0 ldi r28, 0x00 ; 0 if (eeprom_is_sheet_initialized(sheet)) return sheet; f1de: 8c 2f mov r24, r28 f1e0: 0e 94 d9 78 call 0xf1b2 ; 0xf1b2 f1e4: 81 11 cpse r24, r1 f1e6: 03 c0 rjmp .+6 ; 0xf1ee f1e8: 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) f1ea: a9 f7 brne .-22 ; 0xf1d6 { ++sheet; if (sheet >= static_cast(sizeof(Sheets::s)/sizeof(Sheet))) sheet = 0; if (eeprom_is_sheet_initialized(sheet)) return sheet; } return -1; f1ec: cf ef ldi r28, 0xFF ; 255 } f1ee: 8c 2f mov r24, r28 f1f0: df 91 pop r29 f1f2: cf 91 pop r28 f1f4: 08 95 ret 0000f1f6 : #endif //DEBUG_EEPROM_CHANGES } void eeprom_switch_to_next_sheet() { int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); f1f6: 81 ea ldi r24, 0xA1 ; 161 f1f8: 9d e0 ldi r25, 0x0D ; 13 f1fa: 0f 94 81 a4 call 0x34902 ; 0x34902 sheet = eeprom_next_initialized_sheet(sheet); f1fe: 0e 94 e7 78 call 0xf1ce ; 0xf1ce if (sheet >= 0) eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), sheet); f202: 87 fd sbrc r24, 7 f204: 05 c0 rjmp .+10 ; 0xf210 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f206: 68 2f mov r22, r24 f208: 81 ea ldi r24, 0xA1 ; 161 f20a: 9d e0 ldi r25, 0x0D ; 13 f20c: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a { 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); } f210: 08 95 ret 0000f212 : //! | 7 | Custom2 | //! //! @param[in] index //! @param[out] sheetName void eeprom_default_sheet_name(uint8_t index, SheetName &sheetName) { f212: 0f 93 push r16 f214: 1f 93 push r17 f216: cf 93 push r28 f218: c8 2f mov r28, r24 f21a: 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")); f21c: 60 ef ldi r22, 0xF0 ; 240 f21e: 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) f220: 82 30 cpi r24, 0x02 ; 2 f222: 70 f0 brcs .+28 ; 0xf240 { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); f224: 69 ee ldi r22, 0xE9 ; 233 f226: 74 e7 ldi r23, 0x74 ; 116 if (index < 2) { strcpy_P(sheetName.c, PSTR("Smooth")); } else if (index < 4) f228: 84 30 cpi r24, 0x04 ; 4 f22a: 50 f0 brcs .+20 ; 0xf240 { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); f22c: 61 ee ldi r22, 0xE1 ; 225 f22e: 74 e7 ldi r23, 0x74 ; 116 } else if (index < 4) { strcpy_P(sheetName.c, PSTR("Textur")); } else if (index < 5) f230: 84 30 cpi r24, 0x04 ; 4 f232: 31 f0 breq .+12 ; 0xf240 { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) { strcpy_P(sheetName.c, PSTR("NylonPA")); f234: 69 ed ldi r22, 0xD9 ; 217 f236: 74 e7 ldi r23, 0x74 ; 116 } else if (index < 5) { strcpy_P(sheetName.c, PSTR("Satin ")); } else if (index < 6) f238: 85 30 cpi r24, 0x05 ; 5 f23a: 11 f0 breq .+4 ; 0xf240 { strcpy_P(sheetName.c, PSTR("NylonPA")); } else { strcpy_P(sheetName.c, PSTR("Custom")); f23c: 62 ed ldi r22, 0xD2 ; 210 f23e: 74 e7 ldi r23, 0x74 ; 116 f240: c8 01 movw r24, r16 f242: 0f 94 38 a2 call 0x34470 ; 0x34470 } if (index <4 || index >5) f246: 8c ef ldi r24, 0xFC ; 252 f248: 8c 0f add r24, r28 f24a: 82 30 cpi r24, 0x02 ; 2 f24c: 28 f0 brcs .+10 ; 0xf258 { sheetName.c[6] = '0' + ((index % 2)+1); f24e: c1 70 andi r28, 0x01 ; 1 f250: cf 5c subi r28, 0xCF ; 207 f252: f8 01 movw r30, r16 f254: c6 83 std Z+6, r28 ; 0x06 sheetName.c[7] = '\0'; f256: 17 82 std Z+7, r1 ; 0x07 } } f258: cf 91 pop r28 f25a: 1f 91 pop r17 f25c: 0f 91 pop r16 f25e: 08 95 ret 0000f260 : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); f260: 61 e0 ldi r22, 0x01 ; 1 f262: 80 ec ldi r24, 0xC0 ; 192 f264: 9f e0 ldi r25, 0x0F ; 15 f266: 0f 94 a5 a4 call 0x3494a ; 0x3494a f26a: 60 e0 ldi r22, 0x00 ; 0 f26c: 8f eb ldi r24, 0xBF ; 191 f26e: 9f e0 ldi r25, 0x0F ; 15 f270: 0f 94 a5 a4 call 0x3494a ; 0x3494a f274: 60 e0 ldi r22, 0x00 ; 0 f276: 8e eb ldi r24, 0xBE ; 190 f278: 9f e0 ldi r25, 0x0F ; 15 f27a: 0f 94 a5 a4 call 0x3494a ; 0x3494a f27e: 60 e0 ldi r22, 0x00 ; 0 f280: 8d eb ldi r24, 0xBD ; 189 f282: 9f e0 ldi r25, 0x0F ; 15 f284: 0f 94 a5 a4 call 0x3494a ; 0x3494a f288: 60 e0 ldi r22, 0x00 ; 0 f28a: 8c eb ldi r24, 0xBC ; 188 f28c: 9f e0 ldi r25, 0x0F ; 15 f28e: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 0000f292 : { putchar((val > 9)?(val - 10 + 'a'):(val + '0')); } void print_hex_byte(uint8_t val) { f292: cf 93 push r28 f294: c8 2f mov r28, r24 print_hex_nibble(val >> 4); f296: 82 95 swap r24 f298: 8f 70 andi r24, 0x0F ; 15 f29a: 0e 94 d3 5d call 0xbba6 ; 0xbba6 print_hex_nibble(val & 15); f29e: 8c 2f mov r24, r28 f2a0: 8f 70 andi r24, 0x0F ; 15 } f2a2: cf 91 pop r28 } void print_hex_byte(uint8_t val) { print_hex_nibble(val >> 4); print_hex_nibble(val & 15); f2a4: 0c 94 d3 5d jmp 0xbba6 ; 0xbba6 0000f2a8 : #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) f2a8: 40 91 3c 12 lds r20, 0x123C ; 0x80123c f2ac: 50 91 3d 12 lds r21, 0x123D ; 0x80123d return 0; f2b0: 90 e0 ldi r25, 0x00 ; 0 f2b2: 80 e0 ldi r24, 0x00 ; 0 #endif //SDSUPPORT } uint16_t cmdqueue_calc_sd_length() { if (buflen == 0) f2b4: 41 15 cp r20, r1 f2b6: 51 05 cpc r21, r1 f2b8: b1 f1 breq .+108 ; 0xf326 char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; for (size_t _buflen = buflen, _bufindr = bufindr;;) { f2ba: 20 91 38 12 lds r18, 0x1238 ; 0x801238 f2be: 30 91 39 12 lds r19, 0x1239 ; 0x801239 char lo; char hi; } lohi; uint16_t value; } sdlen_single; uint16_t sdlen = 0; f2c2: 90 e0 ldi r25, 0x00 ; 0 f2c4: 80 e0 ldi r24, 0x00 ; 0 for (size_t _buflen = buflen, _bufindr = bufindr;;) { if (cmdbuffer[_bufindr] == CMDBUFFER_CURRENT_TYPE_SDCARD) { f2c6: f9 01 movw r30, r18 f2c8: e5 5b subi r30, 0xB5 ; 181 f2ca: ff 4e sbci r31, 0xEF ; 239 f2cc: a0 81 ld r26, Z f2ce: a2 30 cpi r26, 0x02 ; 2 f2d0: 21 f4 brne .+8 ; 0xf2da sdlen_single.lohi.lo = cmdbuffer[_bufindr + 1]; f2d2: 61 81 ldd r22, Z+1 ; 0x01 sdlen_single.lohi.hi = cmdbuffer[_bufindr + 2]; f2d4: 72 81 ldd r23, Z+2 ; 0x02 sdlen += sdlen_single.value; f2d6: 86 0f add r24, r22 f2d8: 97 1f adc r25, r23 } if (-- _buflen == 0) f2da: 41 50 subi r20, 0x01 ; 1 f2dc: 51 09 sbc r21, r1 f2de: 19 f1 breq .+70 ; 0xf326 f2e0: f9 01 movw r30, r18 f2e2: e2 5b subi r30, 0xB2 ; 178 f2e4: 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) ; f2e6: a1 91 ld r26, Z+ f2e8: 9f 01 movw r18, r30 f2ea: 2b 54 subi r18, 0x4B ; 75 f2ec: 30 41 sbci r19, 0x10 ; 16 f2ee: a1 11 cpse r26, r1 f2f0: fa cf rjmp .-12 ; 0xf2e6 f2f2: f9 01 movw r30, r18 f2f4: e5 5b subi r30, 0xB5 ; 181 f2f6: 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) ; f2f8: 2d 3e cpi r18, 0xED ; 237 f2fa: a1 e0 ldi r26, 0x01 ; 1 f2fc: 3a 07 cpc r19, r26 f2fe: 30 f4 brcc .+12 ; 0xf30c f300: a1 91 ld r26, Z+ f302: a1 11 cpse r26, r1 f304: e0 cf rjmp .-64 ; 0xf2c6 f306: 2f 5f subi r18, 0xFF ; 255 f308: 3f 4f sbci r19, 0xFF ; 255 f30a: f6 cf rjmp .-20 ; 0xf2f8 // If the end of the buffer was empty, if (_bufindr == sizeof(cmdbuffer)) { f30c: 2d 3e cpi r18, 0xED ; 237 f30e: e1 e0 ldi r30, 0x01 ; 1 f310: 3e 07 cpc r19, r30 f312: c9 f6 brne .-78 ; 0xf2c6 f314: eb e4 ldi r30, 0x4B ; 75 f316: f0 e1 ldi r31, 0x10 ; 16 f318: 9f 01 movw r18, r30 f31a: 2b 54 subi r18, 0x4B ; 75 f31c: 30 41 sbci r19, 0x10 ; 16 // skip to the start and find the nonzero command. for (_bufindr = 0; cmdbuffer[_bufindr] == 0; ++ _bufindr) ; f31e: a1 91 ld r26, Z+ f320: aa 23 and r26, r26 f322: d1 f3 breq .-12 ; 0xf318 f324: d0 cf rjmp .-96 ; 0xf2c6 } } return sdlen; } f326: 08 95 ret 0000f328 : // 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) { f328: 80 91 3c 12 lds r24, 0x123C ; 0x80123c f32c: 90 91 3d 12 lds r25, 0x123D ; 0x80123d f330: 18 16 cp r1, r24 f332: 19 06 cpc r1, r25 f334: 0c f0 brlt .+2 ; 0xf338 f336: 43 c0 rjmp .+134 ; 0xf3be SERIAL_ECHO(serial_count); SERIAL_ECHOPGM(", bufsize "); SERIAL_ECHO(sizeof(cmdbuffer)); SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ if (-- buflen == 0) { f338: 01 97 sbiw r24, 0x01 ; 1 f33a: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d f33e: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c f342: 89 2b or r24, r25 f344: a1 f4 brne .+40 ; 0xf36e // Empty buffer. if (serial_count == 0) f346: 80 91 47 10 lds r24, 0x1047 ; 0x801047 f34a: 90 91 48 10 lds r25, 0x1048 ; 0x801048 f34e: 89 2b or r24, r25 f350: 21 f4 brne .+8 ; 0xf35a // No serial communication is pending. Reset both pointers to zero. bufindw = 0; f352: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> f356: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.511> bufindr = bufindw; f35a: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> f35e: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> f362: 90 93 39 12 sts 0x1239, r25 ; 0x801239 f366: 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; f36a: 81 e0 ldi r24, 0x01 ; 1 f36c: 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) ; f36e: 80 91 38 12 lds r24, 0x1238 ; 0x801238 f372: 90 91 39 12 lds r25, 0x1239 ; 0x801239 f376: 03 96 adiw r24, 0x03 ; 3 f378: fc 01 movw r30, r24 f37a: e5 5b subi r30, 0xB5 ; 181 f37c: ff 4e sbci r31, 0xEF ; 239 f37e: 20 81 ld r18, Z f380: 01 96 adiw r24, 0x01 ; 1 f382: 21 11 cpse r18, r1 f384: f9 cf rjmp .-14 ; 0xf378 f386: fc 01 movw r30, r24 f388: e5 5b subi r30, 0xB5 ; 181 f38a: 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) ; f38c: 8d 3e cpi r24, 0xED ; 237 f38e: 21 e0 ldi r18, 0x01 ; 1 f390: 92 07 cpc r25, r18 f392: 40 f4 brcc .+16 ; 0xf3a4 f394: 41 91 ld r20, Z+ f396: 9c 01 movw r18, r24 f398: 2f 5f subi r18, 0xFF ; 255 f39a: 3f 4f sbci r19, 0xFF ; 255 f39c: 41 11 cpse r20, r1 f39e: e1 cf rjmp .-62 ; 0xf362 f3a0: c9 01 movw r24, r18 f3a2: f4 cf rjmp .-24 ; 0xf38c // If the end of the buffer was empty, if (bufindr == sizeof(cmdbuffer)) { f3a4: eb e4 ldi r30, 0x4B ; 75 f3a6: f0 e1 ldi r31, 0x10 ; 16 f3a8: 8d 3e cpi r24, 0xED ; 237 f3aa: 21 e0 ldi r18, 0x01 ; 1 f3ac: 92 07 cpc r25, r18 f3ae: c9 f6 brne .-78 ; 0xf362 f3b0: cf 01 movw r24, r30 f3b2: 8b 54 subi r24, 0x4B ; 75 f3b4: 90 41 sbci r25, 0x10 ; 16 // skip to the start and find the nonzero command. for (bufindr = 0; cmdbuffer[bufindr] == 0; ++ bufindr) ; f3b6: 21 91 ld r18, Z+ f3b8: 22 23 and r18, r18 f3ba: d1 f3 breq .-12 ; 0xf3b0 f3bc: d2 cf rjmp .-92 ; 0xf362 SERIAL_ECHOLNPGM(""); #endif /* CMDBUFFER_DEBUG */ } return true; } return false; f3be: 80 e0 ldi r24, 0x00 ; 0 } f3c0: 08 95 ret 0000f3c2 : autostart_atmillis.start(); // reset timer } char *createFilename(char *buffer,const dir_t &p) //buffer>12characters { char *pos=buffer; f3c2: fc 01 movw r30, r24 for (uint8_t i = 0; i < 11; i++) f3c4: 20 e0 ldi r18, 0x00 ; 0 { if (p.name[i] == ' ')continue; if (i == 8) { *pos++='.'; f3c6: 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; f3c8: db 01 movw r26, r22 f3ca: 4d 91 ld r20, X+ f3cc: bd 01 movw r22, r26 f3ce: 40 32 cpi r20, 0x20 ; 32 f3d0: 49 f0 breq .+18 ; 0xf3e4 if (i == 8) f3d2: 28 30 cpi r18, 0x08 ; 8 f3d4: 11 f4 brne .+4 ; 0xf3da { *pos++='.'; f3d6: 30 83 st Z, r19 f3d8: 31 96 adiw r30, 0x01 ; 1 } *pos++=p.name[i]; f3da: db 01 movw r26, r22 f3dc: 11 97 sbiw r26, 0x01 ; 1 f3de: 4c 91 ld r20, X f3e0: 40 83 st Z, r20 f3e2: 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++) f3e4: 2f 5f subi r18, 0xFF ; 255 f3e6: 2b 30 cpi r18, 0x0B ; 11 f3e8: 79 f7 brne .-34 ; 0xf3c8 { *pos++='.'; } *pos++=p.name[i]; } *pos++=0; f3ea: 10 82 st Z, r1 return buffer; } f3ec: 08 95 ret 0000f3ee : 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);} f3ee: 40 e0 ldi r20, 0x00 ; 0 f3f0: 50 e0 ldi r21, 0x00 ; 0 f3f2: ba 01 movw r22, r20 f3f4: 0d 94 97 2a jmp 0x2552e ; 0x2552e 0000f3f8 : 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();} f3f8: fc 01 movw r30, r24 f3fa: 23 81 ldd r18, Z+3 ; 0x03 f3fc: 21 11 cpse r18, r1 f3fe: 0d 94 75 2c jmp 0x258ea ; 0x258ea f402: 08 95 ret 0000f404 : M_UDRx = c; } */ static void write(uint8_t c) { if (selectedSerialPort == 0) f404: 90 91 1c 06 lds r25, 0x061C ; 0x80061c f408: 91 11 cpse r25, r1 f40a: 07 c0 rjmp .+14 ; 0xf41a { while (!((M_UCSRxA) & (1 << M_UDREx))); f40c: 90 91 c0 00 lds r25, 0x00C0 ; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7c20c0> f410: 95 ff sbrs r25, 5 f412: fc cf rjmp .-8 ; 0xf40c M_UDRx = c; f414: 80 93 c6 00 sts 0x00C6, r24 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> f418: 08 95 ret } else if (selectedSerialPort == 1) f41a: 91 30 cpi r25, 0x01 ; 1 f41c: 31 f4 brne .+12 ; 0xf42a { while (!((UCSR1A) & (1 << UDRE1))); f41e: 90 91 c8 00 lds r25, 0x00C8 ; 0x8000c8 <__TEXT_REGION_LENGTH__+0x7c20c8> f422: 95 ff sbrs r25, 5 f424: fc cf rjmp .-8 ; 0xf41e UDR1 = c; f426: 80 93 ce 00 sts 0x00CE, r24 ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> } } f42a: 08 95 ret 0000f42c : } // Private Methods ///////////////////////////////////////////////////////////// void MarlinSerial::printNumber(unsigned long n, uint8_t base) { f42c: 8f 92 push r8 f42e: 9f 92 push r9 f430: af 92 push r10 f432: bf 92 push r11 f434: ef 92 push r14 f436: ff 92 push r15 f438: 0f 93 push r16 f43a: 1f 93 push r17 f43c: cf 93 push r28 f43e: df 93 push r29 f440: cd b7 in r28, 0x3d ; 61 f442: de b7 in r29, 0x3e ; 62 f444: a0 97 sbiw r28, 0x20 ; 32 f446: 0f b6 in r0, 0x3f ; 63 f448: f8 94 cli f44a: de bf out 0x3e, r29 ; 62 f44c: 0f be out 0x3f, r0 ; 63 f44e: cd bf out 0x3d, r28 ; 61 unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars. uint8_t i = 0; if (n == 0) { f450: 61 15 cp r22, r1 f452: 71 05 cpc r23, r1 f454: 81 05 cpc r24, r1 f456: 91 05 cpc r25, r1 f458: 99 f4 brne .+38 ; 0xf480 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f45a: 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)); } f45c: a0 96 adiw r28, 0x20 ; 32 f45e: 0f b6 in r0, 0x3f ; 63 f460: f8 94 cli f462: de bf out 0x3e, r29 ; 62 f464: 0f be out 0x3f, r0 ; 63 f466: cd bf out 0x3d, r28 ; 61 f468: df 91 pop r29 f46a: cf 91 pop r28 f46c: 1f 91 pop r17 f46e: 0f 91 pop r16 f470: ff 90 pop r15 f472: ef 90 pop r14 f474: bf 90 pop r11 f476: af 90 pop r10 f478: 9f 90 pop r9 f47a: 8f 90 pop r8 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f47c: 0c 94 02 7a jmp 0xf404 ; 0xf404 // 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; f480: 00 e0 ldi r16, 0x00 ; 0 print('0'); return; } while (n > 0) { buf[i++] = n % base; f482: 84 2e mov r8, r20 f484: 91 2c mov r9, r1 f486: b1 2c mov r11, r1 f488: a1 2c mov r10, r1 f48a: 9e 01 movw r18, r28 f48c: 2f 5f subi r18, 0xFF ; 255 f48e: 3f 4f sbci r19, 0xFF ; 255 f490: 79 01 movw r14, r18 f492: a5 01 movw r20, r10 f494: 94 01 movw r18, r8 f496: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> f49a: f7 01 movw r30, r14 f49c: e0 0f add r30, r16 f49e: f1 1d adc r31, r1 f4a0: 60 83 st Z, r22 n /= base; f4a2: b9 01 movw r22, r18 f4a4: ca 01 movw r24, r20 print('0'); return; } while (n > 0) { buf[i++] = n % base; f4a6: 0f 5f subi r16, 0xFF ; 255 if (n == 0) { print('0'); return; } while (n > 0) { f4a8: 61 15 cp r22, r1 f4aa: 71 05 cpc r23, r1 f4ac: 81 05 cpc r24, r1 f4ae: 91 05 cpc r25, r1 f4b0: 81 f7 brne .-32 ; 0xf492 f4b2: 0e 0d add r16, r14 f4b4: 1f 2d mov r17, r15 f4b6: 11 1d adc r17, r1 buf[i++] = n % base; n /= base; } for (; i > 0; i--) f4b8: e0 16 cp r14, r16 f4ba: f1 06 cpc r15, r17 f4bc: 59 f0 breq .+22 ; 0xf4d4 print((char) (buf[i - 1] < 10 ? f4be: f8 01 movw r30, r16 f4c0: 82 91 ld r24, -Z f4c2: 8f 01 movw r16, r30 f4c4: 8a 30 cpi r24, 0x0A ; 10 f4c6: 20 f4 brcc .+8 ; 0xf4d0 '0' + buf[i - 1] : f4c8: 80 5d subi r24, 0xD0 ; 208 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f4ca: 0e 94 02 7a call 0xf404 ; 0xf404 f4ce: f4 cf rjmp .-24 ; 0xf4b8 } for (; i > 0; i--) print((char) (buf[i - 1] < 10 ? '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); f4d0: 89 5c subi r24, 0xC9 ; 201 f4d2: fb cf rjmp .-10 ; 0xf4ca } f4d4: a0 96 adiw r28, 0x20 ; 32 f4d6: 0f b6 in r0, 0x3f ; 63 f4d8: f8 94 cli f4da: de bf out 0x3e, r29 ; 62 f4dc: 0f be out 0x3f, r0 ; 63 f4de: cd bf out 0x3d, r28 ; 61 f4e0: df 91 pop r29 f4e2: cf 91 pop r28 f4e4: 1f 91 pop r17 f4e6: 0f 91 pop r16 f4e8: ff 90 pop r15 f4ea: ef 90 pop r14 f4ec: bf 90 pop r11 f4ee: af 90 pop r10 f4f0: 9f 90 pop r9 f4f2: 8f 90 pop r8 f4f4: 08 95 ret 0000f4f6 : void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); } void MarlinSerial::print(long n, int base) f4f6: cf 92 push r12 f4f8: df 92 push r13 f4fa: ef 92 push r14 f4fc: ff 92 push r15 f4fe: 6b 01 movw r12, r22 f500: 7c 01 movw r14, r24 { if (base == 0) { write(n); } else if (base == 10) { if (n < 0) { f502: f7 fe sbrs r15, 7 f504: 0b c0 rjmp .+22 ; 0xf51c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f506: 8d e2 ldi r24, 0x2D ; 45 f508: 0e 94 02 7a call 0xf404 ; 0xf404 } else if (base == 10) { if (n < 0) { print('-'); n = -n; f50c: f0 94 com r15 f50e: e0 94 com r14 f510: d0 94 com r13 f512: c0 94 com r12 f514: c1 1c adc r12, r1 f516: d1 1c adc r13, r1 f518: e1 1c adc r14, r1 f51a: f1 1c adc r15, r1 } printNumber(n, 10); f51c: 4a e0 ldi r20, 0x0A ; 10 f51e: c7 01 movw r24, r14 f520: b6 01 movw r22, r12 } else { printNumber(n, base); } } f522: ff 90 pop r15 f524: ef 90 pop r14 f526: df 90 pop r13 f528: cf 90 pop r12 } else if (base == 10) { if (n < 0) { print('-'); n = -n; } printNumber(n, 10); f52a: 0c 94 16 7a jmp 0xf42c ; 0xf42c 0000f52e : '0' + buf[i - 1] : 'A' + buf[i - 1] - 10)); } void MarlinSerial::printFloat(double number, uint8_t digits) { f52e: 8f 92 push r8 f530: 9f 92 push r9 f532: af 92 push r10 f534: bf 92 push r11 f536: cf 92 push r12 f538: df 92 push r13 f53a: ef 92 push r14 f53c: ff 92 push r15 f53e: cf 93 push r28 f540: 6b 01 movw r12, r22 f542: 7c 01 movw r14, r24 f544: b4 2e mov r11, r20 // Handle negative numbers if (number < 0.0) f546: 20 e0 ldi r18, 0x00 ; 0 f548: 30 e0 ldi r19, 0x00 ; 0 f54a: a9 01 movw r20, r18 f54c: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> f550: 87 ff sbrs r24, 7 f552: 07 c0 rjmp .+14 ; 0xf562 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f554: 8d e2 ldi r24, 0x2D ; 45 f556: 0e 94 02 7a call 0xf404 ; 0xf404 { // Handle negative numbers if (number < 0.0) { print('-'); number = -number; f55a: f7 fa bst r15, 7 f55c: f0 94 com r15 f55e: f7 f8 bld r15, 7 f560: 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; f570: 20 e0 ldi r18, 0x00 ; 0 f572: 30 e0 ldi r19, 0x00 ; 0 f574: 40 e2 ldi r20, 0x20 ; 32 f576: 51 e4 ldi r21, 0x41 ; 65 f578: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__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; f580: 9b 01 movw r18, r22 f582: ac 01 movw r20, r24 f584: c7 01 movw r24, r14 f586: b6 01 movw r22, r12 f588: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> f58c: 6b 01 movw r12, r22 f58e: 7c 01 movw r14, r24 // Extract the integer part of the number and print it unsigned long int_part = (unsigned long)number; f590: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> f594: 4b 01 movw r8, r22 f596: 5c 01 movw r10, r24 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); f598: 4a e0 ldi r20, 0x0A ; 10 f59a: 0e 94 16 7a call 0xf42c ; 0xf42c 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) f59e: cc 23 and r28, r28 f5a0: 91 f1 breq .+100 ; 0xf606 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; f5a2: c5 01 movw r24, r10 f5a4: b4 01 movw r22, r8 f5a6: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> f5aa: 9b 01 movw r18, r22 f5ac: ac 01 movw r20, r24 f5ae: c7 01 movw r24, r14 f5b0: b6 01 movw r22, r12 f5b2: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> f5b6: 6b 01 movw r12, r22 f5b8: 7c 01 movw r14, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f5ba: 8e e2 ldi r24, 0x2E ; 46 f5bc: 0e 94 02 7a call 0xf404 ; 0xf404 // 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) f5c0: c1 50 subi r28, 0x01 ; 1 f5c2: 08 f1 brcs .+66 ; 0xf606 { remainder *= 10.0; f5c4: 20 e0 ldi r18, 0x00 ; 0 f5c6: 30 e0 ldi r19, 0x00 ; 0 f5c8: 40 e2 ldi r20, 0x20 ; 32 f5ca: 51 e4 ldi r21, 0x41 ; 65 f5cc: c7 01 movw r24, r14 f5ce: b6 01 movw r22, r12 f5d0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> f5d4: 4b 01 movw r8, r22 f5d6: 5c 01 movw r10, r24 int toPrint = int(remainder); f5d8: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f5dc: 6b 01 movw r12, r22 f5de: 77 0f add r23, r23 f5e0: ee 08 sbc r14, r14 f5e2: ff 08 sbc r15, r15 f5e4: c7 01 movw r24, r14 f5e6: b6 01 movw r22, r12 f5e8: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 while (digits-- > 0) { remainder *= 10.0; int toPrint = int(remainder); print(toPrint); remainder -= toPrint; f5ec: c7 01 movw r24, r14 f5ee: b6 01 movw r22, r12 f5f0: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> f5f4: 9b 01 movw r18, r22 f5f6: ac 01 movw r20, r24 f5f8: c5 01 movw r24, r10 f5fa: b4 01 movw r22, r8 f5fc: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> f600: 6b 01 movw r12, r22 f602: 7c 01 movw r14, r24 f604: dd cf rjmp .-70 ; 0xf5c0 } } f606: cf 91 pop r28 f608: ff 90 pop r15 f60a: ef 90 pop r14 f60c: df 90 pop r13 f60e: cf 90 pop r12 f610: bf 90 pop r11 f612: af 90 pop r10 f614: 9f 90 pop r9 f616: 8f 90 pop r8 f618: 08 95 ret 0000f61a : } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); f61a: 8a e0 ldi r24, 0x0A ; 10 f61c: 0c 94 02 7a jmp 0xf404 ; 0xf404 0000f620 : static FILE _uartout; #define uartout (&_uartout) int uart_putchar(char c, FILE *) { MYSERIAL.write(c); f620: 0e 94 02 7a call 0xf404 ; 0xf404 return 0; } f624: 90 e0 ldi r25, 0x00 ; 0 f626: 80 e0 ldi r24, 0x00 ; 0 f628: 08 95 ret 0000f62a : 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) { f62a: cf 93 push r28 f62c: df 93 push r29 f62e: ec 01 movw r28, r24 while(uint8_t ch = pgm_read_byte(str)) { f630: fe 01 movw r30, r28 f632: 84 91 lpm r24, Z f634: 88 23 and r24, r24 f636: 21 f0 breq .+8 ; 0xf640 MYSERIAL.write((char)ch); f638: 0e 94 02 7a call 0xf404 ; 0xf404 ++str; f63c: 21 96 adiw r28, 0x01 ; 1 f63e: f8 cf rjmp .-16 ; 0xf630 } } f640: df 91 pop r29 f642: cf 91 pop r28 f644: 08 95 ret 0000f646 : // Turn off the print fan fanSpeed = 0; } } void serialecho_temperatures() { f646: cf 92 push r12 f648: df 92 push r13 f64a: ef 92 push r14 f64c: 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]; f64e: c0 90 5a 0d lds r12, 0x0D5A ; 0x800d5a f652: d0 90 5b 0d lds r13, 0x0D5B ; 0x800d5b f656: e0 90 5c 0d lds r14, 0x0D5C ; 0x800d5c f65a: f0 90 5d 0d lds r15, 0x0D5D ; 0x800d5d float tt = degHotend(active_extruder); SERIAL_PROTOCOLPGM("T:"); f65e: 83 e4 ldi r24, 0x43 ; 67 f660: 99 e7 ldi r25, 0x79 ; 121 f662: 0e 94 15 7b call 0xf62a ; 0xf62a else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f666: 42 e0 ldi r20, 0x02 ; 2 f668: c7 01 movw r24, r14 f66a: b6 01 movw r22, r12 f66c: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL(tt); SERIAL_PROTOCOLPGM(" E:0 B:"); f670: 8b e3 ldi r24, 0x3B ; 59 f672: 99 e7 ldi r25, 0x79 ; 121 f674: 0e 94 15 7b call 0xf62a ; 0xf62a f678: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc f67c: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd f680: 80 91 be 03 lds r24, 0x03BE ; 0x8003be f684: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf f688: 41 e0 ldi r20, 0x01 ; 1 f68a: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(); } f68e: ff 90 pop r15 f690: ef 90 pop r14 f692: df 90 pop r13 f694: 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(); f696: 0c 94 0d 7b jmp 0xf61a ; 0xf61a 0000f69a : } } /// @brief Helper function to reduce code size in M861 /// by extracting common code into one function static void gcode_M861_print_pinda_cal_eeprom() { f69a: 4f 92 push r4 f69c: 5f 92 push r5 f69e: 6f 92 push r6 f6a0: 7f 92 push r7 f6a2: 8f 92 push r8 f6a4: 9f 92 push r9 f6a6: af 92 push r10 f6a8: bf 92 push r11 f6aa: cf 92 push r12 f6ac: df 92 push r13 f6ae: ef 92 push r14 f6b0: ff 92 push r15 f6b2: 0f 93 push r16 f6b4: 1f 93 push r17 f6b6: cf 93 push r28 f6b8: df 93 push r29 f6ba: cc 24 eor r12, r12 f6bc: ca 94 dec r12 f6be: dc 2c mov r13, r12 f6c0: 76 01 movw r14, r12 f6c2: 0e ea ldi r16, 0xAE ; 174 f6c4: 1f e0 ldi r17, 0x0F ; 15 f6c6: 93 e2 ldi r25, 0x23 ; 35 f6c8: 89 2e mov r8, r25 f6ca: 91 2c mov r9, r1 f6cc: a1 2c mov r10, r1 f6ce: b1 2c mov r11, r1 int16_t usteps = 0; float mm = 0; f6d0: 41 2c mov r4, r1 f6d2: 51 2c mov r5, r1 f6d4: 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; f6d6: d0 e0 ldi r29, 0x00 ; 0 f6d8: 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) { f6da: 8f ef ldi r24, 0xFF ; 255 f6dc: c8 16 cp r12, r24 f6de: 09 f4 brne .+2 ; 0xf6e2 f6e0: 5d c0 rjmp .+186 ; 0xf79c usteps = eeprom_read_word((uint16_t*) EEPROM_PROBE_TEMP_SHIFT + (i - 1)); f6e2: c8 01 movw r24, r16 f6e4: 0f 94 8f a4 call 0x3491e ; 0x3491e f6e8: ec 01 movw r28, r24 mm = ((float)usteps) / cs.axis_steps_per_mm[Z_AXIS]; f6ea: bc 01 movw r22, r24 f6ec: 99 0f add r25, r25 f6ee: 88 0b sbc r24, r24 f6f0: 99 0b sbc r25, r25 f6f2: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> f6f6: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 f6fa: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 f6fe: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 f702: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 f706: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> f70a: 2b 01 movw r4, r22 f70c: 3c 01 movw r6, r24 f70e: c7 01 movw r24, r14 f710: b6 01 movw r22, r12 f712: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOL(i - 1); } else { SERIAL_PROTOCOLRPGM(MSG_NA); } SERIAL_PROTOCOLRPGM(comma_sep); f716: 87 e9 ldi r24, 0x97 ; 151 f718: 98 e7 ldi r25, 0x78 ; 120 f71a: 0e 94 15 7b call 0xf62a ; 0xf62a f71e: c5 01 movw r24, r10 f720: b4 01 movw r22, r8 f722: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOL(35 + (i * 5)); SERIAL_PROTOCOLRPGM(comma_sep); f726: 87 e9 ldi r24, 0x97 ; 151 f728: 98 e7 ldi r25, 0x78 ; 120 f72a: 0e 94 15 7b call 0xf62a ; 0xf62a print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f72e: be 01 movw r22, r28 f730: 0d 2e mov r0, r29 f732: 00 0c add r0, r0 f734: 88 0b sbc r24, r24 f736: 99 0b sbc r25, r25 f738: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); f73c: 87 e9 ldi r24, 0x97 ; 151 f73e: 98 e7 ldi r25, 0x78 ; 120 f740: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOLLN(mm * 1000); f744: 20 e0 ldi r18, 0x00 ; 0 f746: 30 e0 ldi r19, 0x00 ; 0 f748: 4a e7 ldi r20, 0x7A ; 122 f74a: 54 e4 ldi r21, 0x44 ; 68 f74c: c3 01 movw r24, r6 f74e: b2 01 movw r22, r4 f750: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> f754: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 f758: 85 e0 ldi r24, 0x05 ; 5 f75a: 88 0e add r8, r24 f75c: 91 1c adc r9, r1 f75e: a1 1c adc r10, r1 f760: b1 1c adc r11, r1 f762: 0e 5f subi r16, 0xFE ; 254 f764: 1f 4f sbci r17, 0xFF ; 255 f766: 8f ef ldi r24, 0xFF ; 255 f768: c8 1a sub r12, r24 f76a: d8 0a sbc r13, r24 f76c: e8 0a sbc r14, r24 f76e: 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++) { f770: 0a 3b cpi r16, 0xBA ; 186 f772: 8f e0 ldi r24, 0x0F ; 15 f774: 18 07 cpc r17, r24 f776: 09 f0 breq .+2 ; 0xf77a f778: b0 cf rjmp .-160 ; 0xf6da SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOL(usteps); SERIAL_PROTOCOLRPGM(comma_sep); SERIAL_PROTOCOLLN(mm * 1000); } } f77a: df 91 pop r29 f77c: cf 91 pop r28 f77e: 1f 91 pop r17 f780: 0f 91 pop r16 f782: ff 90 pop r15 f784: ef 90 pop r14 f786: df 90 pop r13 f788: cf 90 pop r12 f78a: bf 90 pop r11 f78c: af 90 pop r10 f78e: 9f 90 pop r9 f790: 8f 90 pop r8 f792: 7f 90 pop r7 f794: 6f 90 pop r6 f796: 5f 90 pop r5 f798: 4f 90 pop r4 f79a: 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); f79c: 8c e7 ldi r24, 0x7C ; 124 f79e: 98 e4 ldi r25, 0x48 ; 72 f7a0: 0e 94 15 7b call 0xf62a ; 0xf62a f7a4: b8 cf rjmp .-144 ; 0xf716 0000f7a6 : /// @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) { f7a6: 88 23 and r24, r24 f7a8: 71 f1 breq .+92 ; 0xf806 currentMMUSlot = slot; } uint8_t SpoolJoin::nextSlot() { SERIAL_ECHOPGM("SpoolJoin: "); f7aa: 8b e8 ldi r24, 0x8B ; 139 f7ac: 98 e7 ldi r25, 0x78 ; 120 f7ae: 0e 94 15 7b call 0xf62a ; 0xf62a f7b2: 60 91 90 12 lds r22, 0x1290 ; 0x801290 f7b6: 70 e0 ldi r23, 0x00 ; 0 f7b8: 90 e0 ldi r25, 0x00 ; 0 f7ba: 80 e0 ldi r24, 0x00 ; 0 f7bc: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; f7c0: 80 91 90 12 lds r24, 0x1290 ; 0x801290 f7c4: 84 30 cpi r24, 0x04 ; 4 f7c6: d8 f0 brcs .+54 ; 0xf7fe f7c8: 10 92 90 12 sts 0x1290, r1 ; 0x801290 else currentMMUSlot++; SERIAL_ECHOPGM(" -> "); f7cc: 86 e8 ldi r24, 0x86 ; 134 f7ce: 98 e7 ldi r25, 0x78 ; 120 f7d0: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN((int)currentMMUSlot); f7d4: 80 91 90 12 lds r24, 0x1290 ; 0x801290 f7d8: 90 e0 ldi r25, 0x00 ; 0 f7da: 0f 94 5d 65 call 0x2caba ; 0x2caba return currentMMUSlot; f7de: 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; f7e2: 20 91 5b 12 lds r18, 0x125B ; 0x80125b f7e6: 30 91 5c 12 lds r19, 0x125C ; 0x80125c f7ea: 30 93 5e 12 sts 0x125E, r19 ; 0x80125e f7ee: 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); f7f2: 0e 94 d0 fb call 0x1f7a0 ; 0x1f7a0 load_filament_final_feed(); // @@TODO verify f7f6: 0e 94 3e 64 call 0xc87c ; 0xc87c st_synchronize(); f7fa: 0d 94 94 18 jmp 0x23128 ; 0x23128 { SERIAL_ECHOPGM("SpoolJoin: "); SERIAL_ECHO((int)currentMMUSlot); if (currentMMUSlot >= 4) currentMMUSlot = 0; else currentMMUSlot++; f7fe: 8f 5f subi r24, 0xFF ; 255 f800: 80 93 90 12 sts 0x1290, r24 ; 0x801290 f804: e3 cf rjmp .-58 ; 0xf7cc 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); f806: 84 e1 ldi r24, 0x14 ; 20 f808: 9d e3 ldi r25, 0x3D ; 61 f80a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 f80e: 70 e0 ldi r23, 0x00 ; 0 f810: 60 e0 ldi r22, 0x00 ; 0 f812: 0e 94 b0 cf call 0x19f60 ; 0x19f60 f816: e5 cf rjmp .-54 ; 0xf7e2 0000f818 : return final_result; } void gcode_M114() { f818: cf 93 push r28 f81a: df 93 push r29 SERIAL_PROTOCOLPGM("X:"); f81c: 83 e8 ldi r24, 0x83 ; 131 f81e: 98 e7 ldi r25, 0x78 ; 120 f820: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOL(current_position[X_AXIS]); f824: c1 e6 ldi r28, 0x61 ; 97 f826: d2 e1 ldi r29, 0x12 ; 18 else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); f828: 68 81 ld r22, Y f82a: 79 81 ldd r23, Y+1 ; 0x01 f82c: 8a 81 ldd r24, Y+2 ; 0x02 f82e: 9b 81 ldd r25, Y+3 ; 0x03 f830: 42 e0 ldi r20, 0x02 ; 2 f832: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOLPGM(" Y:"); f836: 8f e7 ldi r24, 0x7F ; 127 f838: 98 e7 ldi r25, 0x78 ; 120 f83a: 0e 94 15 7b call 0xf62a ; 0xf62a f83e: 6c 81 ldd r22, Y+4 ; 0x04 f840: 7d 81 ldd r23, Y+5 ; 0x05 f842: 8e 81 ldd r24, Y+6 ; 0x06 f844: 9f 81 ldd r25, Y+7 ; 0x07 f846: 42 e0 ldi r20, 0x02 ; 2 f848: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL(current_position[Y_AXIS]); SERIAL_PROTOCOLPGM(" Z:"); f84c: 8b e7 ldi r24, 0x7B ; 123 f84e: 98 e7 ldi r25, 0x78 ; 120 f850: 0e 94 15 7b call 0xf62a ; 0xf62a f854: 68 85 ldd r22, Y+8 ; 0x08 f856: 79 85 ldd r23, Y+9 ; 0x09 f858: 8a 85 ldd r24, Y+10 ; 0x0a f85a: 9b 85 ldd r25, Y+11 ; 0x0b f85c: 42 e0 ldi r20, 0x02 ; 2 f85e: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL(current_position[Z_AXIS]); SERIAL_PROTOCOLPGM(" E:"); f862: 87 e7 ldi r24, 0x77 ; 119 f864: 98 e7 ldi r25, 0x78 ; 120 f866: 0e 94 15 7b call 0xf62a ; 0xf62a f86a: 6c 85 ldd r22, Y+12 ; 0x0c f86c: 7d 85 ldd r23, Y+13 ; 0x0d f86e: 8e 85 ldd r24, Y+14 ; 0x0e f870: 9f 85 ldd r25, Y+15 ; 0x0f f872: 42 e0 ldi r20, 0x02 ; 2 f874: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL(current_position[E_AXIS]); SERIAL_PROTOCOLRPGM(_n(" Count X: "));////MSG_COUNT_X f878: 8b ed ldi r24, 0xDB ; 219 f87a: 94 e6 ldi r25, 0x64 ; 100 f87c: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOL(float(st_get_position(X_AXIS)) / cs.axis_steps_per_mm[X_AXIS]); f880: 80 e0 ldi r24, 0x00 ; 0 f882: 0f 94 72 18 call 0x230e4 ; 0x230e4 f886: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> f88a: c7 e6 ldi r28, 0x67 ; 103 f88c: dd e0 ldi r29, 0x0D ; 13 f88e: 2c 81 ldd r18, Y+4 ; 0x04 f890: 3d 81 ldd r19, Y+5 ; 0x05 f892: 4e 81 ldd r20, Y+6 ; 0x06 f894: 5f 81 ldd r21, Y+7 ; 0x07 f896: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> f89a: 42 e0 ldi r20, 0x02 ; 2 f89c: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOLPGM(" Y:"); f8a0: 83 e7 ldi r24, 0x73 ; 115 f8a2: 98 e7 ldi r25, 0x78 ; 120 f8a4: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOL(float(st_get_position(Y_AXIS)) / cs.axis_steps_per_mm[Y_AXIS]); f8a8: 81 e0 ldi r24, 0x01 ; 1 f8aa: 0f 94 72 18 call 0x230e4 ; 0x230e4 f8ae: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> f8b2: 28 85 ldd r18, Y+8 ; 0x08 f8b4: 39 85 ldd r19, Y+9 ; 0x09 f8b6: 4a 85 ldd r20, Y+10 ; 0x0a f8b8: 5b 85 ldd r21, Y+11 ; 0x0b f8ba: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> f8be: 42 e0 ldi r20, 0x02 ; 2 f8c0: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOLPGM(" Z:"); f8c4: 8f e6 ldi r24, 0x6F ; 111 f8c6: 98 e7 ldi r25, 0x78 ; 120 f8c8: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOL(float(st_get_position(Z_AXIS)) / cs.axis_steps_per_mm[Z_AXIS]); f8cc: 82 e0 ldi r24, 0x02 ; 2 f8ce: 0f 94 72 18 call 0x230e4 ; 0x230e4 f8d2: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> f8d6: 2c 85 ldd r18, Y+12 ; 0x0c f8d8: 3d 85 ldd r19, Y+13 ; 0x0d f8da: 4e 85 ldd r20, Y+14 ; 0x0e f8dc: 5f 85 ldd r21, Y+15 ; 0x0f f8de: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> f8e2: 42 e0 ldi r20, 0x02 ; 2 f8e4: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOLPGM(" E:"); f8e8: 8b e6 ldi r24, 0x6B ; 107 f8ea: 98 e7 ldi r25, 0x78 ; 120 f8ec: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOLLN(float(st_get_position(E_AXIS)) / cs.axis_steps_per_mm[E_AXIS]); f8f0: 83 e0 ldi r24, 0x03 ; 3 f8f2: 0f 94 72 18 call 0x230e4 ; 0x230e4 f8f6: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> f8fa: 28 89 ldd r18, Y+16 ; 0x10 f8fc: 39 89 ldd r19, Y+17 ; 0x11 f8fe: 4a 89 ldd r20, Y+18 ; 0x12 f900: 5b 89 ldd r21, Y+19 ; 0x13 f902: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> } f906: df 91 pop r29 f908: 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]); f90a: 0d 94 40 65 jmp 0x2ca80 ; 0x2ca80 0000f90e : #endif //TMC2130 void gcode_M105() { #if defined(TEMP_0_PIN) && TEMP_0_PIN > -1 SERIAL_PROTOCOLPGM("T:"); f90e: 8a e7 ldi r24, 0x7A ; 122 f910: 97 e7 ldi r25, 0x77 ; 119 f912: 0e 94 15 7b call 0xf62a ; 0xf62a f916: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a f91a: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b f91e: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c f922: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d f926: 41 e0 ldi r20, 0x01 ; 1 f928: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f92c: 87 e7 ldi r24, 0x77 ; 119 f92e: 97 e7 ldi r25, 0x77 ; 119 f930: 0e 94 15 7b call 0xf62a ; 0xf62a return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f934: 60 91 5d 12 lds r22, 0x125D ; 0x80125d f938: 70 91 5e 12 lds r23, 0x125E ; 0x80125e f93c: 07 2e mov r0, r23 f93e: 00 0c add r0, r0 f940: 88 0b sbc r24, r24 f942: 99 0b sbc r25, r25 f944: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> f948: 41 e0 ldi r20, 0x01 ; 1 f94a: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL_F(degTargetHotend(active_extruder),1); #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 SERIAL_PROTOCOLPGM(" B:"); f94e: 83 e7 ldi r24, 0x73 ; 115 f950: 97 e7 ldi r25, 0x77 ; 119 f952: 0e 94 15 7b call 0xf62a ; 0xf62a f956: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc f95a: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd f95e: 80 91 be 03 lds r24, 0x03BE ; 0x8003be f962: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf f966: 41 e0 ldi r20, 0x01 ; 1 f968: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL_F(degBed(),1); SERIAL_PROTOCOLPGM(" /"); f96c: 80 e7 ldi r24, 0x70 ; 112 f96e: 97 e7 ldi r25, 0x77 ; 119 f970: 0e 94 15 7b call 0xf62a ; 0xf62a }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; f974: 60 91 59 12 lds r22, 0x1259 ; 0x801259 f978: 70 91 5a 12 lds r23, 0x125A ; 0x80125a f97c: 07 2e mov r0, r23 f97e: 00 0c add r0, r0 f980: 88 0b sbc r24, r24 f982: 99 0b sbc r25, r25 f984: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> f988: 41 e0 ldi r20, 0x01 ; 1 f98a: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL_F(degTargetBed(),1); #endif //TEMP_BED_PIN SERIAL_PROTOCOLPGM(" T0:"); f98e: 8b e6 ldi r24, 0x6B ; 107 f990: 97 e7 ldi r25, 0x77 ; 119 f992: 0e 94 15 7b call 0xf62a ; 0xf62a f996: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a f99a: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b f99e: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c f9a2: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d f9a6: 41 e0 ldi r20, 0x01 ; 1 f9a8: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL_F(degHotend(active_extruder),1); SERIAL_PROTOCOLPGM(" /"); f9ac: 88 e6 ldi r24, 0x68 ; 104 f9ae: 97 e7 ldi r25, 0x77 ; 119 f9b0: 0e 94 15 7b call 0xf62a ; 0xf62a return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; f9b4: 60 91 5d 12 lds r22, 0x125D ; 0x80125d f9b8: 70 91 5e 12 lds r23, 0x125E ; 0x80125e f9bc: 07 2e mov r0, r23 f9be: 00 0c add r0, r0 f9c0: 88 0b sbc r24, r24 f9c2: 99 0b sbc r25, r25 f9c4: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> f9c8: 41 e0 ldi r20, 0x01 ; 1 f9ca: 0e 94 97 7a call 0xf52e ; 0xf52e #else SERIAL_ERROR_START; SERIAL_ERRORLNRPGM(_n("No thermistors - no temperature"));////MSG_ERR_NO_THERMISTORS #endif SERIAL_PROTOCOLPGM(" @:"); f9ce: 84 e6 ldi r24, 0x64 ; 100 f9d0: 97 e7 ldi r25, 0x77 ; 119 f9d2: 0e 94 15 7b call 0xf62a ; 0xf62a print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); f9d6: 60 91 f5 05 lds r22, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.501> f9da: 70 e0 ldi r23, 0x00 ; 0 f9dc: 90 e0 ldi r25, 0x00 ; 0 f9de: 80 e0 ldi r24, 0x00 ; 0 f9e0: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOLPGM("W"); #else SERIAL_PROTOCOL(getHeaterPower(active_extruder)); #endif SERIAL_PROTOCOLPGM(" B@:"); f9e4: 8f e5 ldi r24, 0x5F ; 95 f9e6: 97 e7 ldi r25, 0x77 ; 119 f9e8: 0e 94 15 7b call 0xf62a ; 0xf62a f9ec: 60 91 ee 05 lds r22, 0x05EE ; 0x8005ee f9f0: 70 e0 ldi r23, 0x00 ; 0 f9f2: 90 e0 ldi r25, 0x00 ; 0 f9f4: 80 e0 ldi r24, 0x00 ; 0 f9f6: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 #else SERIAL_PROTOCOL(getHeaterPower(-1)); #endif #ifdef PINDA_THERMISTOR SERIAL_PROTOCOLPGM(" P:"); f9fa: 8b e5 ldi r24, 0x5B ; 91 f9fc: 97 e7 ldi r25, 0x77 ; 119 f9fe: 0e 94 15 7b call 0xf62a ; 0xf62a else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); fa02: 60 91 85 03 lds r22, 0x0385 ; 0x800385 fa06: 70 91 86 03 lds r23, 0x0386 ; 0x800386 fa0a: 80 91 87 03 lds r24, 0x0387 ; 0x800387 fa0e: 90 91 88 03 lds r25, 0x0388 ; 0x800388 fa12: 41 e0 ldi r20, 0x01 ; 1 fa14: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL_F(100 * (1 + (PtA * (raw/OVERSAMPLENR)) + (PtB * sq((raw/OVERSAMPLENR)))), 5); SERIAL_PROTOCOLPGM(" Rx0->"); SERIAL_PROTOCOL_F(raw, 5); } #endif SERIAL_PROTOCOLLN(); fa18: 0c 94 0d 7b jmp 0xf61a ; 0xf61a 0000fa1c : ++str; } } void serialprintlnPGM(const char *str) { serialprintPGM(str); fa1c: 0e 94 15 7b call 0xf62a ; 0xf62a MYSERIAL.println(); fa20: 0c 94 0d 7b jmp 0xf61a ; 0xf61a 0000fa24 : /** * Output a "busy" message at regular intervals * while the machine is not accepting commands. */ void host_keepalive() { fa24: 8f 92 push r8 fa26: 9f 92 push r9 fa28: af 92 push r10 fa2a: bf 92 push r11 fa2c: cf 92 push r12 fa2e: df 92 push r13 fa30: ef 92 push r14 fa32: ff 92 push r15 #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; long ms = _millis(); fa34: 0f 94 89 0b call 0x21712 ; 0x21712 fa38: 6b 01 movw r12, r22 fa3a: 7c 01 movw r14, r24 if (host_keepalive_interval && busy_state != NOT_BUSY) { fa3c: 20 91 32 02 lds r18, 0x0232 ; 0x800232 fa40: 22 23 and r18, r18 fa42: 09 f1 breq .+66 ; 0xfa86 fa44: 40 91 78 02 lds r20, 0x0278 ; 0x800278 fa48: 41 30 cpi r20, 0x01 ; 1 fa4a: e9 f0 breq .+58 ; 0xfa86 if ((ms - prev_busy_signal_ms) < (long)(1000L * host_keepalive_interval)) return; fa4c: 80 91 14 02 lds r24, 0x0214 ; 0x800214 fa50: 90 91 15 02 lds r25, 0x0215 ; 0x800215 fa54: a0 91 16 02 lds r26, 0x0216 ; 0x800216 fa58: b0 91 17 02 lds r27, 0x0217 ; 0x800217 fa5c: 46 01 movw r8, r12 fa5e: 57 01 movw r10, r14 fa60: 88 1a sub r8, r24 fa62: 99 0a sbc r9, r25 fa64: aa 0a sbc r10, r26 fa66: bb 0a sbc r11, r27 fa68: 30 e0 ldi r19, 0x00 ; 0 fa6a: a8 ee ldi r26, 0xE8 ; 232 fa6c: b3 e0 ldi r27, 0x03 ; 3 fa6e: 0f 94 21 a5 call 0x34a42 ; 0x34a42 <__umulhisi3> fa72: 86 16 cp r8, r22 fa74: 97 06 cpc r9, r23 fa76: a8 06 cpc r10, r24 fa78: b9 06 cpc r11, r25 fa7a: 6c f0 brlt .+26 ; 0xfa96 switch (busy_state) { fa7c: 44 30 cpi r20, 0x04 ; 4 fa7e: 31 f1 breq .+76 ; 0xfacc fa80: 9c f4 brge .+38 ; 0xfaa8 fa82: 42 30 cpi r20, 0x02 ; 2 fa84: d4 f4 brge .+52 ; 0xfaba break; default: break; } } prev_busy_signal_ms = ms; fa86: c0 92 14 02 sts 0x0214, r12 ; 0x800214 fa8a: d0 92 15 02 sts 0x0215, r13 ; 0x800215 fa8e: e0 92 16 02 sts 0x0216, r14 ; 0x800216 fa92: f0 92 17 02 sts 0x0217, r15 ; 0x800217 } fa96: ff 90 pop r15 fa98: ef 90 pop r14 fa9a: df 90 pop r13 fa9c: cf 90 pop r12 fa9e: bf 90 pop r11 faa0: af 90 pop r10 faa2: 9f 90 pop r9 faa4: 8f 90 pop r8 faa6: 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) { faa8: 45 30 cpi r20, 0x05 ; 5 faaa: 69 f7 brne .-38 ; 0xfa86 case PAUSED_FOR_USER: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: paused for user"); break; case PAUSED_FOR_INPUT: SERIAL_ECHO_START; faac: 84 ee ldi r24, 0xE4 ; 228 faae: 92 ea ldi r25, 0xA2 ; 162 fab0: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNPGM("busy: paused for input"); fab4: 86 e4 ldi r24, 0x46 ; 70 fab6: 99 e7 ldi r25, 0x79 ; 121 fab8: 06 c0 rjmp .+12 ; 0xfac6 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; faba: 84 ee ldi r24, 0xE4 ; 228 fabc: 92 ea ldi r25, 0xA2 ; 162 fabe: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNPGM("busy: processing"); fac2: 83 e7 ldi r24, 0x73 ; 115 fac4: 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"); fac6: 0e 94 0e 7d call 0xfa1c ; 0xfa1c faca: dd cf rjmp .-70 ; 0xfa86 case IN_PROCESS: SERIAL_ECHO_START; SERIAL_ECHOLNPGM("busy: processing"); break; case PAUSED_FOR_USER: SERIAL_ECHO_START; facc: 84 ee ldi r24, 0xE4 ; 228 face: 92 ea ldi r25, 0xA2 ; 162 fad0: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNPGM("busy: paused for user"); fad4: 8d e5 ldi r24, 0x5D ; 93 fad6: 99 e7 ldi r25, 0x79 ; 121 fad8: f6 cf rjmp .-20 ; 0xfac6 0000fada : #endif //TEMP_RESIDENCY_TIME } } void check_babystep() { fada: 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))); fadc: 81 ea ldi r24, 0xA1 ; 161 fade: 9d e0 ldi r25, 0x0D ; 13 fae0: 0f 94 81 a4 call 0x34902 ; 0x34902 } } void check_babystep() { int babystep_z = eeprom_read_word(reinterpret_cast(&(EEPROM_Sheets_base-> fae4: cb e0 ldi r28, 0x0B ; 11 fae6: 8c 9f mul r24, r28 fae8: c0 01 movw r24, r0 faea: 11 24 eor r1, r1 faec: 80 5b subi r24, 0xB0 ; 176 faee: 92 4f sbci r25, 0xF2 ; 242 faf0: 0f 94 8f a4 call 0x3491e ; 0x3491e s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset))); if ((babystep_z < Z_BABYSTEP_MIN) || (babystep_z > Z_BABYSTEP_MAX)) { faf4: 81 56 subi r24, 0x61 ; 97 faf6: 90 4f sbci r25, 0xF0 ; 240 faf8: 80 3a cpi r24, 0xA0 ; 160 fafa: 9f 40 sbci r25, 0x0F ; 15 fafc: c8 f0 brcs .+50 ; 0xfb30 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"); fafe: 82 e1 ldi r24, 0x12 ; 18 fb00: 99 e7 ldi r25, 0x79 ; 121 fb02: 0e 94 0e 7d call 0xfa1c ; 0xfa1c eeprom_write_word_notify(reinterpret_cast(&(EEPROM_Sheets_base-> s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)), fb06: 81 ea ldi r24, 0xA1 ; 161 fb08: 9d e0 ldi r25, 0x0D ; 13 fb0a: 0f 94 81 a4 call 0x34902 ; 0x34902 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-> fb0e: 8c 9f mul r24, r28 fb10: c0 01 movw r24, r0 fb12: 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); fb14: 70 e0 ldi r23, 0x00 ; 0 fb16: 60 e0 ldi r22, 0x00 ; 0 fb18: 80 5b subi r24, 0xB0 ; 176 fb1a: 92 4f sbci r25, 0xF2 ; 242 fb1c: 0f 94 df a4 call 0x349be ; 0x349be 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.")); fb20: 85 ed ldi r24, 0xD5 ; 213 fb22: 98 e7 ldi r25, 0x78 ; 120 fb24: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa lcd_update_enable(true); fb28: 81 e0 ldi r24, 0x01 ; 1 } } fb2a: 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); fb2c: 0c 94 89 70 jmp 0xe112 ; 0xe112 } } fb30: cf 91 pop r28 fb32: 08 95 ret 0000fb34 : } // G80 - Automatic mesh bed leveling static void gcode_G80() { fb34: 2f 92 push r2 fb36: 3f 92 push r3 fb38: 4f 92 push r4 fb3a: 5f 92 push r5 fb3c: 6f 92 push r6 fb3e: 7f 92 push r7 fb40: 8f 92 push r8 fb42: 9f 92 push r9 fb44: af 92 push r10 fb46: bf 92 push r11 fb48: cf 92 push r12 fb4a: df 92 push r13 fb4c: ef 92 push r14 fb4e: ff 92 push r15 fb50: 0f 93 push r16 fb52: 1f 93 push r17 fb54: cf 93 push r28 fb56: df 93 push r29 fb58: cd b7 in r28, 0x3d ; 61 fb5a: de b7 in r29, 0x3e ; 62 fb5c: a4 97 sbiw r28, 0x24 ; 36 fb5e: 0f b6 in r0, 0x3f ; 63 fb60: f8 94 cli fb62: de bf out 0x3e, r29 ; 62 fb64: 0f be out 0x3f, r0 ; 63 fb66: 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(); fb68: 0f 94 94 18 call 0x23128 ; 0x23128 if (planner_aborted) fb6c: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 fb70: 81 11 cpse r24, r1 fb72: 17 c0 rjmp .+46 ; 0xfba2 return; mesh_bed_leveling_flag = true; fb74: 81 e0 ldi r24, 0x01 ; 1 fb76: 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])) { fb7a: 80 91 39 06 lds r24, 0x0639 ; 0x800639 fb7e: 88 23 and r24, r24 fb80: 49 f0 breq .+18 ; 0xfb94 fb82: 80 91 3a 06 lds r24, 0x063A ; 0x80063a fb86: 88 23 and r24, r24 fb88: 29 f0 breq .+10 ; 0xfb94 fb8a: 20 91 3b 06 lds r18, 0x063B ; 0x80063b fb8e: 2f 83 std Y+7, r18 ; 0x07 fb90: 21 11 cpse r18, r1 fb92: 20 c0 rjmp .+64 ; 0xfbd4 // 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; fb94: 81 e0 ldi r24, 0x01 ; 1 fb96: 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); fb9a: 81 e7 ldi r24, 0x71 ; 113 fb9c: 99 e6 ldi r25, 0x69 ; 105 fb9e: 0f 94 16 67 call 0x2ce2c ; 0x2ce2c custom_message_state = custom_message_state_old; lcd_update(2); st_synchronize(); mesh_bed_leveling_flag = false; } fba2: a4 96 adiw r28, 0x24 ; 36 fba4: 0f b6 in r0, 0x3f ; 63 fba6: f8 94 cli fba8: de bf out 0x3e, r29 ; 62 fbaa: 0f be out 0x3f, r0 ; 63 fbac: cd bf out 0x3d, r28 ; 61 fbae: df 91 pop r29 fbb0: cf 91 pop r28 fbb2: 1f 91 pop r17 fbb4: 0f 91 pop r16 fbb6: ff 90 pop r15 fbb8: ef 90 pop r14 fbba: df 90 pop r13 fbbc: cf 90 pop r12 fbbe: bf 90 pop r11 fbc0: af 90 pop r10 fbc2: 9f 90 pop r9 fbc4: 8f 90 pop r8 fbc6: 7f 90 pop r7 fbc8: 6f 90 pop r6 fbca: 5f 90 pop r5 fbcc: 4f 90 pop r4 fbce: 3f 90 pop r3 fbd0: 2f 90 pop r2 fbd2: 08 95 ret return; } run = false; #endif //PINDA_THERMISTOR uint8_t nMeasPoints = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); fbd4: 8b ea ldi r24, 0xAB ; 171 fbd6: 9d e0 ldi r25, 0x0D ; 13 fbd8: 0f 94 81 a4 call 0x34902 ; 0x34902 fbdc: 18 2f mov r17, r24 if (uint8_t codeSeen = code_seen('N'), value = code_value_uint8(); codeSeen && (value == 7 || value == 3)) fbde: 8e e4 ldi r24, 0x4E ; 78 fbe0: 0e 94 80 56 call 0xad00 ; 0xad00 fbe4: 08 2f mov r16, r24 fbe6: 0e 94 95 56 call 0xad2a ; 0xad2a fbea: 8e 83 std Y+6, r24 ; 0x06 fbec: 00 23 and r16, r16 fbee: 29 f0 breq .+10 ; 0xfbfa fbf0: 87 30 cpi r24, 0x07 ; 7 fbf2: 09 f4 brne .+2 ; 0xfbf6 fbf4: c9 c0 rjmp .+402 ; 0xfd88 fbf6: 83 30 cpi r24, 0x03 ; 3 fbf8: 29 f0 breq .+10 ; 0xfc04 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; fbfa: 13 30 cpi r17, 0x03 ; 3 fbfc: 09 f0 breq .+2 ; 0xfc00 fbfe: c3 c0 rjmp .+390 ; 0xfd86 fc00: 63 e0 ldi r22, 0x03 ; 3 fc02: 6e 83 std Y+6, r22 ; 0x06 fc04: 80 e0 ldi r24, 0x00 ; 0 fc06: 90 e0 ldi r25, 0x00 ; 0 fc08: a0 e8 ldi r26, 0x80 ; 128 fc0a: bf e3 ldi r27, 0x3F ; 63 fc0c: 8a 83 std Y+2, r24 ; 0x02 fc0e: 9b 83 std Y+3, r25 ; 0x03 fc10: ac 83 std Y+4, r26 ; 0x04 fc12: bd 83 std Y+5, r27 ; 0x05 uint8_t nProbeRetryCount = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); fc14: 8a ea ldi r24, 0xAA ; 170 fc16: 9d e0 ldi r25, 0x0D ; 13 fc18: 0f 94 81 a4 call 0x34902 ; 0x34902 fc1c: 88 8f std Y+24, r24 ; 0x18 if (uint8_t codeSeen = code_seen('C'), value = code_value_uint8(); codeSeen && value >= 1 && value <= 10) fc1e: 83 e4 ldi r24, 0x43 ; 67 fc20: 0e 94 80 56 call 0xad00 ; 0xad00 fc24: 18 2f mov r17, r24 fc26: 0e 94 95 56 call 0xad2a ; 0xad2a fc2a: 11 23 and r17, r17 fc2c: 29 f0 breq .+10 ; 0xfc38 fc2e: 88 23 and r24, r24 fc30: 19 f0 breq .+6 ; 0xfc38 fc32: 8b 30 cpi r24, 0x0B ; 11 fc34: 08 f4 brcc .+2 ; 0xfc38 fc36: 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; fc38: 88 e5 ldi r24, 0x58 ; 88 fc3a: 0e 94 80 56 call 0xad00 ; 0xad00 fc3e: 88 23 and r24, r24 fc40: 09 f4 brne .+2 ; 0xfc44 fc42: ab c0 rjmp .+342 ; 0xfd9a fc44: 0e 94 10 5b call 0xb620 ; 0xb620 fc48: 20 e0 ldi r18, 0x00 ; 0 fc4a: 30 e0 ldi r19, 0x00 ; 0 fc4c: 48 e0 ldi r20, 0x08 ; 8 fc4e: 52 e4 ldi r21, 0x42 ; 66 fc50: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> fc54: 20 e0 ldi r18, 0x00 ; 0 fc56: 30 e0 ldi r19, 0x00 ; 0 fc58: 48 eb ldi r20, 0xB8 ; 184 fc5a: 51 e4 ldi r21, 0x41 ; 65 fc5c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> fc60: 6a 87 std Y+10, r22 ; 0x0a fc62: 7b 87 std Y+11, r23 ; 0x0b fc64: 8c 87 std Y+12, r24 ; 0x0c fc66: 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; fc68: 89 e5 ldi r24, 0x59 ; 89 fc6a: 0e 94 80 56 call 0xad00 ; 0xad00 fc6e: 88 23 and r24, r24 fc70: 09 f4 brne .+2 ; 0xfc74 fc72: 9c c0 rjmp .+312 ; 0xfdac fc74: 0e 94 10 5b call 0xb620 ; 0xb620 fc78: 20 e0 ldi r18, 0x00 ; 0 fc7a: 30 e0 ldi r19, 0x00 ; 0 fc7c: 48 e0 ldi r20, 0x08 ; 8 fc7e: 52 e4 ldi r21, 0x42 ; 66 fc80: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> fc84: 20 e0 ldi r18, 0x00 ; 0 fc86: 30 e0 ldi r19, 0x00 ; 0 fc88: 40 ea ldi r20, 0xA0 ; 160 fc8a: 50 e4 ldi r21, 0x40 ; 64 fc8c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> fc90: 6c 8b std Y+20, r22 ; 0x14 fc92: 7d 8b std Y+21, r23 ; 0x15 fc94: 8e 8b std Y+22, r24 ; 0x16 fc96: 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; fc98: 87 e5 ldi r24, 0x57 ; 87 fc9a: 0e 94 80 56 call 0xad00 ; 0xad00 fc9e: 88 23 and r24, r24 fca0: 09 f4 brne .+2 ; 0xfca4 fca2: 89 c0 rjmp .+274 ; 0xfdb6 fca4: 0e 94 10 5b call 0xb620 ; 0xb620 fca8: 2a 85 ldd r18, Y+10 ; 0x0a fcaa: 3b 85 ldd r19, Y+11 ; 0x0b fcac: 4c 85 ldd r20, Y+12 ; 0x0c fcae: 5d 85 ldd r21, Y+13 ; 0x0d fcb0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> fcb4: 20 e0 ldi r18, 0x00 ; 0 fcb6: 30 e0 ldi r19, 0x00 ; 0 fcb8: 48 e8 ldi r20, 0x88 ; 136 fcba: 52 e4 ldi r21, 0x42 ; 66 fcbc: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> fcc0: 69 8f std Y+25, r22 ; 0x19 fcc2: 7a 8f std Y+26, r23 ; 0x1a fcc4: 8b 8f std Y+27, r24 ; 0x1b fcc6: 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; fcc8: 88 e4 ldi r24, 0x48 ; 72 fcca: 0e 94 80 56 call 0xad00 ; 0xad00 fcce: 88 23 and r24, r24 fcd0: 09 f4 brne .+2 ; 0xfcd4 fcd2: 7a c0 rjmp .+244 ; 0xfdc8 fcd4: 0e 94 10 5b call 0xb620 ; 0xb620 fcd8: 2c 89 ldd r18, Y+20 ; 0x14 fcda: 3d 89 ldd r19, Y+21 ; 0x15 fcdc: 4e 89 ldd r20, Y+22 ; 0x16 fcde: 5f 89 ldd r21, Y+23 ; 0x17 fce0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> fce4: 20 e0 ldi r18, 0x00 ; 0 fce6: 30 e0 ldi r19, 0x00 ; 0 fce8: 48 e8 ldi r20, 0x88 ; 136 fcea: 52 e4 ldi r21, 0x42 ; 66 fcec: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> fcf0: 6d 8f std Y+29, r22 ; 0x1d fcf2: 7e 8f std Y+30, r23 ; 0x1e fcf4: 8f 8f std Y+31, r24 ; 0x1f fcf6: 98 a3 std Y+32, r25 ; 0x20 mbl.reset(); //reset mesh bed leveling fcf8: 0f 94 84 7c call 0x2f908 ; 0x2f908 mbl.z_values[0][0] = min_pos[Z_AXIS]; fcfc: 80 91 2c 02 lds r24, 0x022C ; 0x80022c fd00: 90 91 2d 02 lds r25, 0x022D ; 0x80022d fd04: a0 91 2e 02 lds r26, 0x022E ; 0x80022e fd08: b0 91 2f 02 lds r27, 0x022F ; 0x80022f fd0c: 80 93 0a 13 sts 0x130A, r24 ; 0x80130a fd10: 90 93 0b 13 sts 0x130B, r25 ; 0x80130b fd14: a0 93 0c 13 sts 0x130C, r26 ; 0x80130c fd18: b0 93 0d 13 sts 0x130D, r27 ; 0x80130d // Reset baby stepping to zero, if the babystepping has already been loaded before. babystep_undo(); fd1c: 0f 94 70 52 call 0x2a4e0 ; 0x2a4e0 fd20: 05 ec ldi r16, 0xC5 ; 197 fd22: 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) fd24: c8 01 movw r24, r16 fd26: 0f 94 8f a4 call 0x3491e ; 0x3491e fd2a: 01 96 adiw r24, 0x01 ; 1 fd2c: 09 f0 breq .+2 ; 0xfd30 fd2e: 51 c0 rjmp .+162 ; 0xfdd2 fd30: 0e 5f subi r16, 0xFE ; 254 fd32: 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) { fd34: 05 3d cpi r16, 0xD5 ; 213 fd36: 8f e0 ldi r24, 0x0F ; 15 fd38: 18 07 cpc r17, r24 fd3a: a1 f7 brne .-24 ; 0xfd24 if (eeprom_read_word((uint16_t*)(EEPROM_BED_CALIBRATION_Z_JITTER + i * 2)) != 0x0FFFF) return true; } return false; fd3c: 21 2c mov r2, r1 fd3e: a9 e0 ldi r26, 0x09 ; 9 fd40: b3 e1 ldi r27, 0x13 ; 19 fd42: ba a3 std Y+34, r27 ; 0x22 fd44: 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; fd46: b9 87 std Y+9, r27 ; 0x09 fd48: a8 87 std Y+8, r26 ; 0x08 fd4a: 51 2c mov r5, r1 fd4c: 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; fd4e: 31 2c mov r3, r1 fd50: 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)); fd52: 84 2d mov r24, r4 fd54: 63 e0 ldi r22, 0x03 ; 3 fd56: 0f 94 30 a5 call 0x34a60 ; 0x34a60 <__udivmodqi4> fd5a: 98 8b std Y+16, r25 ; 0x10 fd5c: 68 84 ldd r6, Y+8 ; 0x08 fd5e: 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++) { fd60: 10 e0 ldi r17, 0x00 ; 0 bool isOn3x3Mesh = ((row % 3 == 0) && (col % 3 == 0)); fd62: f8 89 ldd r31, Y+16 ; 0x10 fd64: f1 11 cpse r31, r1 fd66: 37 c0 rjmp .+110 ; 0xfdd6 fd68: 81 2f mov r24, r17 fd6a: 63 e0 ldi r22, 0x03 ; 3 fd6c: 0f 94 30 a5 call 0x34a60 ; 0x34a60 <__udivmodqi4> fd70: 91 11 cpse r25, r1 fd72: 31 c0 rjmp .+98 ; 0xfdd6 if (isOn3x3Mesh) { if (has_z && (row || col)) { fd74: 21 10 cpse r2, r1 fd76: 3f c1 rjmp .+638 ; 0xfff6 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { fd78: 7e 81 ldd r23, Y+6 ; 0x06 fd7a: 73 30 cpi r23, 0x03 ; 3 fd7c: 09 f4 brne .+2 ; 0xfd80 fd7e: 70 c0 rjmp .+224 ; 0xfe60 fd80: 8f 81 ldd r24, Y+7 ; 0x07 fd82: 8e 87 std Y+14, r24 ; 0x0e fd84: 37 c0 rjmp .+110 ; 0xfdf4 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; fd86: 1e 83 std Y+6, r17 ; 0x06 fd88: 6a e9 ldi r22, 0x9A ; 154 fd8a: 79 e9 ldi r23, 0x99 ; 153 fd8c: 89 e1 ldi r24, 0x19 ; 25 fd8e: 9f e3 ldi r25, 0x3F ; 63 fd90: 6a 83 std Y+2, r22 ; 0x02 fd92: 7b 83 std Y+3, r23 ; 0x03 fd94: 8c 83 std Y+4, r24 ; 0x04 fd96: 9d 83 std Y+5, r25 ; 0x05 fd98: 3d cf rjmp .-390 ; 0xfc14 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; fd9a: 80 e0 ldi r24, 0x00 ; 0 fd9c: 90 e0 ldi r25, 0x00 ; 0 fd9e: a0 e8 ldi r26, 0x80 ; 128 fda0: bf ef ldi r27, 0xFF ; 255 fda2: 8a 87 std Y+10, r24 ; 0x0a fda4: 9b 87 std Y+11, r25 ; 0x0b fda6: ac 87 std Y+12, r26 ; 0x0c fda8: bd 87 std Y+13, r27 ; 0x0d fdaa: 5e cf rjmp .-324 ; 0xfc68 const float area_min_y = code_seen('Y') ? code_value() - y_mesh_density - Y_PROBE_OFFSET_FROM_EXTRUDER : -INFINITY; fdac: 60 e0 ldi r22, 0x00 ; 0 fdae: 70 e0 ldi r23, 0x00 ; 0 fdb0: 80 e8 ldi r24, 0x80 ; 128 fdb2: 9f ef ldi r25, 0xFF ; 255 fdb4: 6d cf rjmp .-294 ; 0xfc90 const float area_max_x = code_seen('W') ? area_min_x + code_value() + 2 * x_mesh_density : INFINITY; fdb6: 80 e0 ldi r24, 0x00 ; 0 fdb8: 90 e0 ldi r25, 0x00 ; 0 fdba: a0 e8 ldi r26, 0x80 ; 128 fdbc: bf e7 ldi r27, 0x7F ; 127 fdbe: 89 8f std Y+25, r24 ; 0x19 fdc0: 9a 8f std Y+26, r25 ; 0x1a fdc2: ab 8f std Y+27, r26 ; 0x1b fdc4: bc 8f std Y+28, r27 ; 0x1c fdc6: 80 cf rjmp .-256 ; 0xfcc8 const float area_max_y = code_seen('H') ? area_min_y + code_value() + 2 * y_mesh_density : INFINITY; fdc8: 60 e0 ldi r22, 0x00 ; 0 fdca: 70 e0 ldi r23, 0x00 ; 0 fdcc: 80 e8 ldi r24, 0x80 ; 128 fdce: 9f e7 ldi r25, 0x7F ; 127 fdd0: 8f cf rjmp .-226 ; 0xfcf0 fdd2: 2f 80 ldd r2, Y+7 ; 0x07 fdd4: b4 cf rjmp .-152 ; 0xfd3e 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; } fdd6: 60 e0 ldi r22, 0x00 ; 0 fdd8: 70 e0 ldi r23, 0x00 ; 0 fdda: 80 ec ldi r24, 0xC0 ; 192 fddc: 9f e7 ldi r25, 0x7F ; 127 fdde: d3 01 movw r26, r6 fde0: 11 96 adiw r26, 0x01 ; 1 fde2: 6d 93 st X+, r22 fde4: 7d 93 st X+, r23 fde6: 8d 93 st X+, r24 fde8: 9c 93 st X, r25 fdea: 14 97 sbiw r26, 0x04 ; 4 } else { mbl.set_z(col, row, NAN); } // check for points that are skipped if (nMeasPoints == 3) { fdec: be 81 ldd r27, Y+6 ; 0x06 fdee: b3 30 cpi r27, 0x03 ; 3 fdf0: c1 f1 breq .+112 ; 0xfe62 fdf2: 1e 86 std Y+14, r1 ; 0x0e if (!isOn3x3Mesh) continue; } else { const float x_pos = BED_X(col); fdf4: 81 2f mov r24, r17 fdf6: 0e 94 31 5f call 0xbe62 ; 0xbe62 fdfa: 4b 01 movw r8, r22 fdfc: 5c 01 movw r10, r24 const float y_pos = BED_Y(row); fdfe: 80 2f mov r24, r16 fe00: 0e 94 31 5f call 0xbe62 ; 0xbe62 fe04: 6b 01 movw r12, r22 fe06: 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)) { fe08: a5 01 movw r20, r10 fe0a: 94 01 movw r18, r8 fe0c: 6a 85 ldd r22, Y+10 ; 0x0a fe0e: 7b 85 ldd r23, Y+11 ; 0x0b fe10: 8c 85 ldd r24, Y+12 ; 0x0c fe12: 9d 85 ldd r25, Y+13 ; 0x0d fe14: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> fe18: 18 16 cp r1, r24 fe1a: 0c f4 brge .+2 ; 0xfe1e fe1c: 1c c1 rjmp .+568 ; 0x10056 fe1e: 29 8d ldd r18, Y+25 ; 0x19 fe20: 3a 8d ldd r19, Y+26 ; 0x1a fe22: 4b 8d ldd r20, Y+27 ; 0x1b fe24: 5c 8d ldd r21, Y+28 ; 0x1c fe26: c5 01 movw r24, r10 fe28: b4 01 movw r22, r8 fe2a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> fe2e: 18 16 cp r1, r24 fe30: 0c f4 brge .+2 ; 0xfe34 fe32: 11 c1 rjmp .+546 ; 0x10056 fe34: a7 01 movw r20, r14 fe36: 96 01 movw r18, r12 fe38: 6c 89 ldd r22, Y+20 ; 0x14 fe3a: 7d 89 ldd r23, Y+21 ; 0x15 fe3c: 8e 89 ldd r24, Y+22 ; 0x16 fe3e: 9f 89 ldd r25, Y+23 ; 0x17 fe40: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> fe44: 18 16 cp r1, r24 fe46: 0c f4 brge .+2 ; 0xfe4a fe48: 06 c1 rjmp .+524 ; 0x10056 fe4a: 2d 8d ldd r18, Y+29 ; 0x1d fe4c: 3e 8d ldd r19, Y+30 ; 0x1e fe4e: 4f 8d ldd r20, Y+31 ; 0x1f fe50: 58 a1 ldd r21, Y+32 ; 0x20 fe52: c7 01 movw r24, r14 fe54: b6 01 movw r22, r12 fe56: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> fe5a: 18 16 cp r1, r24 fe5c: 0c f4 brge .+2 ; 0xfe60 fe5e: fb c0 rjmp .+502 ; 0x10056 continue; } } // increment the total point counter if the points are not skipped meshPointsToProbe++; fe60: 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++) { fe62: 1f 5f subi r17, 0xFF ; 255 fe64: 24 e0 ldi r18, 0x04 ; 4 fe66: 62 0e add r6, r18 fe68: 71 1c adc r7, r1 fe6a: 17 30 cpi r17, 0x07 ; 7 fe6c: 09 f0 breq .+2 ; 0xfe70 fe6e: 79 cf rjmp .-270 ; 0xfd62 fe70: 6f ef ldi r22, 0xFF ; 255 fe72: 46 1a sub r4, r22 fe74: 56 0a sbc r5, r22 fe76: 88 85 ldd r24, Y+8 ; 0x08 fe78: 99 85 ldd r25, Y+9 ; 0x09 fe7a: 4c 96 adiw r24, 0x1c ; 28 fe7c: 99 87 std Y+9, r25 ; 0x09 fe7e: 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++) { fe80: 97 e0 ldi r25, 0x07 ; 7 fe82: 49 16 cp r4, r25 fe84: 51 04 cpc r5, r1 fe86: 09 f0 breq .+2 ; 0xfe8a fe88: 63 cf rjmp .-314 ; 0xfd50 // increment the total point counter if the points are not skipped meshPointsToProbe++; } } mbl.upsample_3x3(); //upsample the default mesh fe8a: 0f 94 5e 93 call 0x326bc ; 0x326bc // Save custom message state, set a new custom message state to display: Calibrating point 9. CustomMsg custom_message_type_old = custom_message_type; fe8e: a0 91 5d 06 lds r26, 0x065D ; 0x80065d fe92: af 83 std Y+7, r26 ; 0x07 uint8_t custom_message_state_old = custom_message_state; fe94: b0 91 de 03 lds r27, 0x03DE ; 0x8003de fe98: b8 87 std Y+8, r27 ; 0x08 custom_message_type = CustomMsg::MeshBedLeveling; fe9a: 81 e0 ldi r24, 0x01 ; 1 fe9c: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d custom_message_state = meshPointsToProbe + 10; fea0: 8a e0 ldi r24, 0x0A ; 10 fea2: 83 0d add r24, r3 fea4: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_update(1); fea8: 81 e0 ldi r24, 0x01 ; 1 feaa: 0e 94 4a 6f call 0xde94 ; 0xde94 // Lift Z to a safe position before probing the first point current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; feae: 80 e0 ldi r24, 0x00 ; 0 feb0: 90 e0 ldi r25, 0x00 ; 0 feb2: a0 ea ldi r26, 0xA0 ; 160 feb4: b0 e4 ldi r27, 0x40 ; 64 feb6: 80 93 69 12 sts 0x1269, r24 ; 0x801269 feba: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a febe: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b fec2: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); fec6: 65 e5 ldi r22, 0x55 ; 85 fec8: 75 e5 ldi r23, 0x55 ; 85 feca: 85 e5 ldi r24, 0x55 ; 85 fecc: 91 e4 ldi r25, 0x41 ; 65 fece: 0f 94 0d 4a call 0x2941a ; 0x2941a // Cycle through all points and probe them int l_feedmultiply = setup_for_endstop_move(false); //save feedrate and feedmultiply, sets feedmultiply to 100 fed2: 80 e0 ldi r24, 0x00 ; 0 fed4: 0e 94 b7 65 call 0xcb6e ; 0xcb6e fed8: 9c a3 std Y+36, r25 ; 0x24 feda: 8b a3 std Y+35, r24 ; 0x23 fedc: 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 fede: 83 2d mov r24, r3 fee0: 67 e0 ldi r22, 0x07 ; 7 fee2: 0f 94 30 a5 call 0x34a60 ; 0x34a60 <__udivmodqi4> fee6: f8 2e mov r15, r24 fee8: 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 feea: 68 2f mov r22, r24 feec: 70 e0 ldi r23, 0x00 ; 0 feee: 7f 87 std Y+15, r23 ; 0x0f fef0: 6e 87 std Y+14, r22 ; 0x0e fef2: 80 ff sbrs r24, 0 fef4: 03 c0 rjmp .+6 ; 0xfefc fef6: 76 e0 ldi r23, 0x06 ; 6 fef8: 79 1b sub r23, r25 fefa: 07 2f mov r16, r23 bool isOn3x3Mesh = ((ix % 3 == 0) && (iy % 3 == 0)); fefc: 80 2f mov r24, r16 fefe: 63 e0 ldi r22, 0x03 ; 3 ff00: 0f 94 30 a5 call 0x34a60 ; 0x34a60 <__udivmodqi4> ff04: 91 11 cpse r25, r1 ff06: 05 c0 rjmp .+10 ; 0xff12 ff08: 8f 2d mov r24, r15 ff0a: 0f 94 30 a5 call 0x34a60 ; 0x34a60 <__udivmodqi4> ff0e: 11 e0 ldi r17, 0x01 ; 1 ff10: 91 11 cpse r25, r1 ff12: 10 e0 ldi r17, 0x00 ; 0 float x_pos = BED_X(ix); ff14: 80 2f mov r24, r16 ff16: 0e 94 31 5f call 0xbe62 ; 0xbe62 ff1a: 68 8b std Y+16, r22 ; 0x10 ff1c: 79 8b std Y+17, r23 ; 0x11 ff1e: 8a 8b std Y+18, r24 ; 0x12 ff20: 9b 8b std Y+19, r25 ; 0x13 float y_pos = BED_Y(iy); ff22: 8f 2d mov r24, r15 ff24: 0e 94 31 5f call 0xbe62 ; 0xbe62 ff28: 4b 01 movw r8, r22 ff2a: 5c 01 movw r10, r24 if (nMeasPoints == 3) { ff2c: 8e 81 ldd r24, Y+6 ; 0x06 ff2e: 83 30 cpi r24, 0x03 ; 3 ff30: 09 f0 breq .+2 ; 0xff34 ff32: 99 c0 rjmp .+306 ; 0x10066 if (!isOn3x3Mesh) { ff34: 11 11 cpse r17, r1 ff36: c8 c0 rjmp .+400 ; 0x100c8 ff38: 27 e0 ldi r18, 0x07 ; 7 ff3a: ae 85 ldd r26, Y+14 ; 0x0e ff3c: bf 85 ldd r27, Y+15 ; 0x0f ff3e: 2a 9f mul r18, r26 ff40: f0 01 movw r30, r0 ff42: 2b 9f mul r18, r27 ff44: f0 0d add r31, r0 ff46: 11 24 eor r1, r1 ff48: e0 0f add r30, r16 ff4a: f1 1d adc r31, r1 ff4c: ee 0f add r30, r30 ff4e: ff 1f adc r31, r31 ff50: ee 0f add r30, r30 ff52: ff 1f adc r31, r31 ff54: e7 5f subi r30, 0xF7 ; 247 ff56: fc 4e sbci r31, 0xEC ; 236 ff58: 60 e0 ldi r22, 0x00 ; 0 ff5a: 70 e0 ldi r23, 0x00 ; 0 ff5c: 80 ec ldi r24, 0xC0 ; 192 ff5e: 9f e7 ldi r25, 0x7F ; 127 ff60: 61 83 std Z+1, r22 ; 0x01 ff62: 72 83 std Z+2, r23 ; 0x02 ff64: 83 83 std Z+3, r24 ; 0x03 ff66: 94 83 std Z+4, r25 ; 0x04 ff68: 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) { ff6a: e1 e3 ldi r30, 0x31 ; 49 ff6c: 3e 12 cpse r3, r30 ff6e: b7 cf rjmp .-146 ; 0xfede custom_message_state--; mesh_point++; lcd_update(1); } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; ff70: 80 e0 ldi r24, 0x00 ; 0 ff72: 90 e0 ldi r25, 0x00 ; 0 ff74: a0 ea ldi r26, 0xA0 ; 160 ff76: b0 e4 ldi r27, 0x40 ; 64 ff78: 80 93 69 12 sts 0x1269, r24 ; 0x801269 ff7c: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a ff80: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b ff84: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); ff88: 65 e5 ldi r22, 0x55 ; 85 ff8a: 75 e5 ldi r23, 0x55 ; 85 ff8c: 85 e5 ldi r24, 0x55 ; 85 ff8e: 91 e4 ldi r25, 0x41 ; 65 ff90: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); ff94: 0f 94 94 18 call 0x23128 ; 0x23128 static uint8_t g80_fail_cnt = 0; if (mesh_point != MESH_NUM_X_POINTS * MESH_NUM_Y_POINTS) { ff98: b1 e3 ldi r27, 0x31 ; 49 ff9a: 3b 16 cp r3, r27 ff9c: 09 f4 brne .+2 ; 0xffa0 ff9e: 3c c2 rjmp .+1144 ; 0x10418 if (g80_fail_cnt++ >= 1) { ffa0: 80 91 3d 03 lds r24, 0x033D ; 0x80033d ffa4: 91 e0 ldi r25, 0x01 ; 1 ffa6: 98 0f add r25, r24 ffa8: 90 93 3d 03 sts 0x033D, r25 ; 0x80033d ffac: 88 23 and r24, r24 ffae: 09 f4 brne .+2 ; 0xffb2 ffb0: d3 c1 rjmp .+934 ; 0x10358 print_stop(); ffb2: 60 e0 ldi r22, 0x00 ; 0 ffb4: 80 e0 ldi r24, 0x00 ; 0 ffb6: 0e 94 e1 dc call 0x1b9c2 ; 0x1b9c2 lcd_show_fullscreen_message_and_wait_P(_T(MSG_MBL_FAILED)); ffba: 84 e3 ldi r24, 0x34 ; 52 ffbc: 96 e3 ldi r25, 0x36 ; 54 ffbe: 0e 94 8b 75 call 0xeb16 ; 0xeb16 ffc2: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa lcd_z_calibration_prompt(false); ffc6: 80 e0 ldi r24, 0x00 ; 0 ffc8: 0e 94 b3 e7 call 0x1cf66 ; 0x1cf66 current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } #endif // !PINDA_THERMISTOR exit: KEEPALIVE_STATE(NOT_BUSY); ffcc: 81 e0 ldi r24, 0x01 ; 1 ffce: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // Restore custom message state lcd_setstatuspgm(MSG_WELCOME); ffd2: 8a e8 ldi r24, 0x8A ; 138 ffd4: 9c e6 ldi r25, 0x6C ; 108 ffd6: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 custom_message_type = custom_message_type_old; ffda: 2f 81 ldd r18, Y+7 ; 0x07 ffdc: 20 93 5d 06 sts 0x065D, r18 ; 0x80065d custom_message_state = custom_message_state_old; ffe0: 68 85 ldd r22, Y+8 ; 0x08 ffe2: 60 93 de 03 sts 0x03DE, r22 ; 0x8003de lcd_update(2); ffe6: 82 e0 ldi r24, 0x02 ; 2 ffe8: 0e 94 4a 6f call 0xde94 ; 0xde94 st_synchronize(); ffec: 0f 94 94 18 call 0x23128 ; 0x23128 mesh_bed_leveling_flag = false; fff0: 10 92 72 12 sts 0x1272, r1 ; 0x801272 fff4: d6 cd rjmp .-1108 ; 0xfba2 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)) { fff6: 01 11 cpse r16, r1 fff8: 03 c0 rjmp .+6 ; 0x10000 fffa: 11 23 and r17, r17 fffc: 09 f4 brne .+2 ; 0x10000 fffe: bc ce rjmp .-648 ; 0xfd78 // 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))); 10000: 81 2f mov r24, r17 10002: 63 e0 ldi r22, 0x03 ; 3 10004: 0f 94 3c a5 call 0x34a78 ; 0x34a78 <__divmodqi4> 10008: 84 0d add r24, r4 1000a: 95 2d mov r25, r5 1000c: 91 1d adc r25, r1 1000e: 88 0f add r24, r24 10010: 99 1f adc r25, r25 10012: 8d 53 subi r24, 0x3D ; 61 10014: 90 4f sbci r25, 0xF0 ; 240 10016: 0f 94 8f a4 call 0x3491e ; 0x3491e const float z0 = mbl.z_values[0][0] + *reinterpret_cast(&z_offset_u) * 0.01; 1001a: bc 01 movw r22, r24 1001c: 99 0f add r25, r25 1001e: 88 0b sbc r24, r24 10020: 99 0b sbc r25, r25 10022: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 10026: 2a e0 ldi r18, 0x0A ; 10 10028: 37 ed ldi r19, 0xD7 ; 215 1002a: 43 e2 ldi r20, 0x23 ; 35 1002c: 5c e3 ldi r21, 0x3C ; 60 1002e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 10032: 9b 01 movw r18, r22 10034: ac 01 movw r20, r24 10036: 60 91 0a 13 lds r22, 0x130A ; 0x80130a 1003a: 70 91 0b 13 lds r23, 0x130B ; 0x80130b 1003e: 80 91 0c 13 lds r24, 0x130C ; 0x80130c 10042: 90 91 0d 13 lds r25, 0x130D ; 0x80130d 10046: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1004a: f3 01 movw r30, r6 1004c: 61 83 std Z+1, r22 ; 0x01 1004e: 72 83 std Z+2, r23 ; 0x02 10050: 83 83 std Z+3, r24 ; 0x03 10052: 94 83 std Z+4, r25 ; 0x04 10054: 91 ce rjmp .-734 ; 0xfd78 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)) { 10056: fe 85 ldd r31, Y+14 ; 0x0e 10058: ff 23 and r31, r31 1005a: 09 f4 brne .+2 ; 0x1005e 1005c: 02 cf rjmp .-508 ; 0xfe62 1005e: 22 20 and r2, r2 10060: 09 f4 brne .+2 ; 0x10064 10062: fe ce rjmp .-516 ; 0xfe60 10064: fe ce rjmp .-516 ; 0xfe62 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)) { 10066: 28 89 ldd r18, Y+16 ; 0x10 10068: 39 89 ldd r19, Y+17 ; 0x11 1006a: 4a 89 ldd r20, Y+18 ; 0x12 1006c: 5b 89 ldd r21, Y+19 ; 0x13 1006e: 6a 85 ldd r22, Y+10 ; 0x0a 10070: 7b 85 ldd r23, Y+11 ; 0x0b 10072: 8c 85 ldd r24, Y+12 ; 0x0c 10074: 9d 85 ldd r25, Y+13 ; 0x0d 10076: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1007a: 18 16 cp r1, r24 1007c: 04 f1 brlt .+64 ; 0x100be 1007e: 28 89 ldd r18, Y+16 ; 0x10 10080: 39 89 ldd r19, Y+17 ; 0x11 10082: 4a 89 ldd r20, Y+18 ; 0x12 10084: 5b 89 ldd r21, Y+19 ; 0x13 10086: 69 8d ldd r22, Y+25 ; 0x19 10088: 7a 8d ldd r23, Y+26 ; 0x1a 1008a: 8b 8d ldd r24, Y+27 ; 0x1b 1008c: 9c 8d ldd r25, Y+28 ; 0x1c 1008e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 10092: 87 fd sbrc r24, 7 10094: 14 c0 rjmp .+40 ; 0x100be 10096: a5 01 movw r20, r10 10098: 94 01 movw r18, r8 1009a: 6c 89 ldd r22, Y+20 ; 0x14 1009c: 7d 89 ldd r23, Y+21 ; 0x15 1009e: 8e 89 ldd r24, Y+22 ; 0x16 100a0: 9f 89 ldd r25, Y+23 ; 0x17 100a2: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 100a6: 18 16 cp r1, r24 100a8: 54 f0 brlt .+20 ; 0x100be 100aa: a5 01 movw r20, r10 100ac: 94 01 movw r18, r8 100ae: 6d 8d ldd r22, Y+29 ; 0x1d 100b0: 7e 8d ldd r23, Y+30 ; 0x1e 100b2: 8f 8d ldd r24, Y+31 ; 0x1f 100b4: 98 a1 ldd r25, Y+32 ; 0x20 100b6: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 100ba: 87 ff sbrs r24, 7 100bc: 05 c0 rjmp .+10 ; 0x100c8 100be: 11 23 and r17, r17 100c0: 09 f4 brne .+2 ; 0x100c4 100c2: 52 cf rjmp .-348 ; 0xff68 100c4: 21 10 cpse r2, r1 100c6: 50 cf rjmp .-352 ; 0xff68 mesh_point++; continue; //skip } // Move Z up to the probe height of the current Z point. const float z0 = mbl.z_values[iy][ix]; 100c8: 10 e0 ldi r17, 0x00 ; 0 100ca: a7 e0 ldi r26, 0x07 ; 7 100cc: 8e 85 ldd r24, Y+14 ; 0x0e 100ce: 9f 85 ldd r25, Y+15 ; 0x0f 100d0: a8 9f mul r26, r24 100d2: f0 01 movw r30, r0 100d4: a9 9f mul r26, r25 100d6: f0 0d add r31, r0 100d8: 11 24 eor r1, r1 100da: e0 0f add r30, r16 100dc: f1 1f adc r31, r17 100de: ee 0f add r30, r30 100e0: ff 1f adc r31, r31 100e2: ee 0f add r30, r30 100e4: ff 1f adc r31, r31 100e6: e7 5f subi r30, 0xF7 ; 247 100e8: fc 4e sbci r31, 0xEC ; 236 100ea: 41 80 ldd r4, Z+1 ; 0x01 100ec: 52 80 ldd r5, Z+2 ; 0x02 100ee: 63 80 ldd r6, Z+3 ; 0x03 100f0: 74 80 ldd r7, Z+4 ; 0x04 const float init_z_bckp = !has_z ? MESH_HOME_Z_SEARCH : z0 + MESH_HOME_Z_SEARCH_FAST; 100f2: c1 2c mov r12, r1 100f4: d1 2c mov r13, r1 100f6: e0 ea ldi r30, 0xA0 ; 160 100f8: ee 2e mov r14, r30 100fa: e0 e4 ldi r30, 0x40 ; 64 100fc: fe 2e mov r15, r30 100fe: 22 20 and r2, r2 10100: 51 f0 breq .+20 ; 0x10116 10102: 23 e3 ldi r18, 0x33 ; 51 10104: 33 e3 ldi r19, 0x33 ; 51 10106: 43 eb ldi r20, 0xB3 ; 179 10108: 5e e3 ldi r21, 0x3E ; 62 1010a: c3 01 movw r24, r6 1010c: b2 01 movw r22, r4 1010e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 10112: 6b 01 movw r12, r22 10114: 7c 01 movw r14, r24 if (init_z_bckp > current_position[Z_AXIS]) { 10116: a7 01 movw r20, r14 10118: 96 01 movw r18, r12 1011a: 60 91 69 12 lds r22, 0x1269 ; 0x801269 1011e: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 10122: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 10126: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 1012a: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1012e: 87 ff sbrs r24, 7 10130: 10 c0 rjmp .+32 ; 0x10152 current_position[Z_AXIS] = init_z_bckp; 10132: c0 92 69 12 sts 0x1269, r12 ; 0x801269 10136: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 1013a: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 1013e: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10142: 65 e5 ldi r22, 0x55 ; 85 10144: 75 e5 ldi r23, 0x55 ; 85 10146: 85 e5 ldi r24, 0x55 ; 85 10148: 91 e4 ldi r25, 0x41 ; 65 1014a: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1014e: 0f 94 94 18 call 0x23128 ; 0x23128 } // Move to XY position of the sensor point. current_position[X_AXIS] = x_pos; 10152: 68 89 ldd r22, Y+16 ; 0x10 10154: 79 89 ldd r23, Y+17 ; 0x11 10156: 8a 89 ldd r24, Y+18 ; 0x12 10158: 9b 89 ldd r25, Y+19 ; 0x13 1015a: 60 93 61 12 sts 0x1261, r22 ; 0x801261 1015e: 70 93 62 12 sts 0x1262, r23 ; 0x801262 10162: 80 93 63 12 sts 0x1263, r24 ; 0x801263 10166: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = y_pos; 1016a: 80 92 65 12 sts 0x1265, r8 ; 0x801265 1016e: 90 92 66 12 sts 0x1266, r9 ; 0x801266 10172: a0 92 67 12 sts 0x1267, r10 ; 0x801267 10176: b0 92 68 12 sts 0x1268, r11 ; 0x801268 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 1017a: 65 e6 ldi r22, 0x65 ; 101 1017c: 72 e1 ldi r23, 0x12 ; 18 1017e: 81 e6 ldi r24, 0x61 ; 97 10180: 92 e1 ldi r25, 0x12 ; 18 10182: 0e 94 6f 69 call 0xd2de ; 0xd2de plan_buffer_line_curposXYZE(XY_AXIS_FEEDRATE); 10186: 60 e0 ldi r22, 0x00 ; 0 10188: 70 e0 ldi r23, 0x00 ; 0 1018a: 86 e1 ldi r24, 0x16 ; 22 1018c: 93 e4 ldi r25, 0x43 ; 67 1018e: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 10192: 0f 94 94 18 call 0x23128 ; 0x23128 if (planner_aborted) 10196: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1019a: 88 23 and r24, r24 1019c: 39 f0 breq .+14 ; 0x101ac { custom_message_type = custom_message_type_old; 1019e: 7f 81 ldd r23, Y+7 ; 0x07 101a0: 70 93 5d 06 sts 0x065D, r23 ; 0x80065d custom_message_state = custom_message_state_old; 101a4: 88 85 ldd r24, Y+8 ; 0x08 101a6: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de 101aa: fb cc rjmp .-1546 ; 0xfba2 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 101ac: 81 2c mov r8, r1 101ae: 91 2c mov r9, r1 101b0: 70 e2 ldi r23, 0x20 ; 32 101b2: a7 2e mov r10, r23 101b4: 71 ec ldi r23, 0xC1 ; 193 101b6: b7 2e mov r11, r23 101b8: 22 20 and r2, r2 101ba: 51 f0 breq .+20 ; 0x101d0 101bc: 2a 81 ldd r18, Y+2 ; 0x02 101be: 3b 81 ldd r19, Y+3 ; 0x03 101c0: 4c 81 ldd r20, Y+4 ; 0x04 101c2: 5d 81 ldd r21, Y+5 ; 0x05 101c4: c3 01 movw r24, r6 101c6: b2 01 movw r22, r4 101c8: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 101cc: 4b 01 movw r8, r22 101ce: 5c 01 movw r10, r24 101d0: 48 8d ldd r20, Y+24 ; 0x18 101d2: c5 01 movw r24, r10 101d4: b4 01 movw r22, r8 101d6: 0f 94 8e 7c call 0x2f91c ; 0x2f91c 101da: 81 11 cpse r24, r1 101dc: 0b c0 rjmp .+22 ; 0x101f4 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)); 101de: 82 e6 ldi r24, 0x62 ; 98 101e0: 96 e5 ldi r25, 0x56 ; 86 101e2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 101e6: 9f 93 push r25 101e8: 8f 93 push r24 101ea: 0f 94 43 a3 call 0x34686 ; 0x34686 101ee: 0f 90 pop r0 101f0: 0f 90 pop r0 101f2: be ce rjmp .-644 ; 0xff70 // 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. 101f4: 20 91 69 12 lds r18, 0x1269 ; 0x801269 101f8: 30 91 6a 12 lds r19, 0x126A ; 0x80126a 101fc: 40 91 6b 12 lds r20, 0x126B ; 0x80126b 10200: 50 91 6c 12 lds r21, 0x126C ; 0x80126c 10204: c7 01 movw r24, r14 10206: b6 01 movw r22, r12 10208: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1020c: 20 e0 ldi r18, 0x00 ; 0 1020e: 30 e0 ldi r19, 0x00 ; 0 10210: a9 01 movw r20, r18 10212: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 10216: 87 ff sbrs r24, 7 10218: 36 c0 rjmp .+108 ; 0x10286 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1021a: 60 e0 ldi r22, 0x00 ; 0 1021c: 70 e0 ldi r23, 0x00 ; 0 1021e: 80 ea ldi r24, 0xA0 ; 160 10220: 90 e4 ldi r25, 0x40 ; 64 10222: 60 93 69 12 sts 0x1269, r22 ; 0x801269 10226: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1022a: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1022e: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 10232: 65 e5 ldi r22, 0x55 ; 85 10234: 75 e5 ldi r23, 0x55 ; 85 10236: 85 e5 ldi r24, 0x55 ; 85 10238: 91 e4 ldi r25, 0x41 ; 65 1023a: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1023e: 0f 94 94 18 call 0x23128 ; 0x23128 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 10242: 48 8d ldd r20, Y+24 ; 0x18 10244: c5 01 movw r24, r10 10246: b4 01 movw r22, r8 10248: 0f 94 8e 7c call 0x2f91c ; 0x2f91c 1024c: 88 23 and r24, r24 1024e: 39 f2 breq .-114 ; 0x101de printf_P(_T(MSG_BED_LEVELING_FAILED_POINT_LOW)); break; } if (MESH_HOME_Z_SEARCH - current_position[Z_AXIS] < 0.1f) { 10250: 20 91 69 12 lds r18, 0x1269 ; 0x801269 10254: 30 91 6a 12 lds r19, 0x126A ; 0x80126a 10258: 40 91 6b 12 lds r20, 0x126B ; 0x80126b 1025c: 50 91 6c 12 lds r21, 0x126C ; 0x80126c 10260: 60 e0 ldi r22, 0x00 ; 0 10262: 70 e0 ldi r23, 0x00 ; 0 10264: 80 ea ldi r24, 0xA0 ; 160 10266: 90 e4 ldi r25, 0x40 ; 64 10268: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1026c: 2d ec ldi r18, 0xCD ; 205 1026e: 3c ec ldi r19, 0xCC ; 204 10270: 4c ec ldi r20, 0xCC ; 204 10272: 5d e3 ldi r21, 0x3D ; 61 10274: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 10278: 87 ff sbrs r24, 7 1027a: 05 c0 rjmp .+10 ; 0x10286 puts_P(PSTR("Bed leveling failed. Sensor triggered too soon")); 1027c: 87 ee ldi r24, 0xE7 ; 231 1027e: 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")); 10280: 0f 94 6a a3 call 0x346d4 ; 0x346d4 10284: 75 ce rjmp .-790 ; 0xff70 10286: c0 90 69 12 lds r12, 0x1269 ; 0x801269 1028a: d0 90 6a 12 lds r13, 0x126A ; 0x80126a 1028e: e0 90 6b 12 lds r14, 0x126B ; 0x80126b 10292: 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 10296: 22 20 and r2, r2 10298: a1 f0 breq .+40 ; 0x102c2 1029a: a7 01 movw r20, r14 1029c: 96 01 movw r18, r12 1029e: c3 01 movw r24, r6 102a0: b2 01 movw r22, r4 102a2: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 102a6: 9b 01 movw r18, r22 102a8: ac 01 movw r20, r24 102aa: 5f 77 andi r21, 0x7F ; 127 102ac: 6a 81 ldd r22, Y+2 ; 0x02 102ae: 7b 81 ldd r23, Y+3 ; 0x03 102b0: 8c 81 ldd r24, Y+4 ; 0x04 102b2: 9d 81 ldd r25, Y+5 ; 0x05 102b4: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 102b8: 87 ff sbrs r24, 7 102ba: 03 c0 rjmp .+6 ; 0x102c2 puts_P(PSTR("Bed leveling failed. Too much variation from eeprom mesh")); 102bc: 8e ea ldi r24, 0xAE ; 174 102be: 97 e7 ldi r25, 0x77 ; 119 102c0: df cf rjmp .-66 ; 0x10280 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 102c2: 8f ea ldi r24, 0xAF ; 175 102c4: 9f e0 ldi r25, 0x0F ; 15 102c6: 0f 94 81 a4 call 0x34902 ; 0x34902 102ca: 88 23 and r24, r24 102cc: 09 f4 brne .+2 ; 0x102d0 102ce: 40 c0 rjmp .+128 ; 0x10350 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); } 102d0: 86 ea ldi r24, 0xA6 ; 166 102d2: 9f e0 ldi r25, 0x0F ; 15 102d4: 0f 94 81 a4 call 0x34902 ; 0x34902 if (!calibration_status_pinda()) return 0; 102d8: 88 23 and r24, r24 102da: d1 f1 breq .+116 ; 0x10350 return temp_comp_interpolation(temperature_pinda) / cs.axis_steps_per_mm[Z_AXIS]; 102dc: 60 91 85 03 lds r22, 0x0385 ; 0x800385 102e0: 70 91 86 03 lds r23, 0x0386 ; 0x800386 102e4: 80 91 87 03 lds r24, 0x0387 ; 0x800387 102e8: 90 91 88 03 lds r25, 0x0388 ; 0x800388 102ec: 0e 94 11 57 call 0xae22 ; 0xae22 102f0: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 102f4: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 102f8: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 102fc: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 10300: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 10304: 9b 01 movw r18, r22 10306: ac 01 movw r20, r24 10308: e7 e0 ldi r30, 0x07 ; 7 1030a: ae 85 ldd r26, Y+14 ; 0x0e 1030c: bf 85 ldd r27, Y+15 ; 0x0f 1030e: ea 9f mul r30, r26 10310: c0 01 movw r24, r0 10312: eb 9f mul r30, r27 10314: 90 0d add r25, r0 10316: 11 24 eor r1, r1 10318: 08 0f add r16, r24 1031a: 19 1f adc r17, r25 1031c: 00 0f add r16, r16 1031e: 11 1f adc r17, r17 10320: 00 0f add r16, r16 10322: 11 1f adc r17, r17 10324: 07 5f subi r16, 0xF7 ; 247 10326: 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; 10328: c7 01 movw r24, r14 1032a: b6 01 movw r22, r12 1032c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 10330: d8 01 movw r26, r16 10332: 11 96 adiw r26, 0x01 ; 1 10334: 6d 93 st X+, r22 10336: 7d 93 st X+, r23 10338: 8d 93 st X+, r24 1033a: 9c 93 st X, r25 1033c: 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--; 1033e: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 10342: 81 50 subi r24, 0x01 ; 1 10344: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de mesh_point++; lcd_update(1); 10348: 81 e0 ldi r24, 0x01 ; 1 1034a: 0e 94 4a 6f call 0xde94 ; 0xde94 1034e: 0c ce rjmp .-1000 ; 0xff68 } #ifdef PINDA_THERMISTOR float temp_compensation_pinda_thermistor_offset(float temperature_pinda) { if (!eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE)) return 0; 10350: 20 e0 ldi r18, 0x00 ; 0 10352: 30 e0 ldi r19, 0x00 ; 0 10354: a9 01 movw r20, r18 10356: d8 cf rjmp .-80 ; 0x10308 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); 10358: 85 e0 ldi r24, 0x05 ; 5 1035a: 0f 94 3f 23 call 0x2467e ; 0x2467e 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; 1035e: c1 2c mov r12, r1 10360: d1 2c mov r13, r1 10362: 90 ea ldi r25, 0xA0 ; 160 10364: e9 2e mov r14, r25 10366: 90 e4 ldi r25, 0x40 ; 64 10368: 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)); 1036a: 80 e0 ldi r24, 0x00 ; 0 1036c: 96 e3 ldi r25, 0x36 ; 54 1036e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 10372: 0e 94 91 de call 0x1bd22 ; 0x1bd22 #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 10376: 90 e0 ldi r25, 0x00 ; 0 10378: 80 e0 ldi r24, 0x00 ; 0 1037a: 0e 94 aa dd call 0x1bb54 ; 0x1bb54 lcd_calibrate_z_end_stop_manual(true); // Z-leveling (X-assembly stay up!!!) 1037e: 81 e0 ldi r24, 0x01 ; 1 10380: 0e 94 aa f9 call 0x1f354 ; 0x1f354 #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); 10384: 80 e0 ldi r24, 0x00 ; 0 10386: 0f 94 1a 23 call 0x24634 ; 0x24634 1038a: 18 2f mov r17, r24 raise_z(-1); 1038c: 60 e0 ldi r22, 0x00 ; 0 1038e: 70 e0 ldi r23, 0x00 ; 0 10390: 80 e8 ldi r24, 0x80 ; 128 10392: 9f eb ldi r25, 0xBF ; 191 10394: 0e 94 e5 6c call 0xd9ca ; 0xd9ca enable_z_endstop(true); 10398: 81 e0 ldi r24, 0x01 ; 1 1039a: 0f 94 1a 23 call 0x24634 ; 0x24634 #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif // TMC2130 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 1039e: c0 92 69 12 sts 0x1269, r12 ; 0x801269 103a2: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 103a6: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 103aa: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c plan_buffer_line_curposXYZE(Z_LIFT_FEEDRATE); 103ae: 65 e5 ldi r22, 0x55 ; 85 103b0: 75 e5 ldi r23, 0x55 ; 85 103b2: 85 e5 ldi r24, 0x55 ; 85 103b4: 91 e4 ldi r25, 0x41 ; 65 103b6: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 103ba: 0f 94 94 18 call 0x23128 ; 0x23128 #ifdef TMC2130 tmc2130_home_exit(); #endif // TMC2130 enable_z_endstop(bState); 103be: 81 2f mov r24, r17 103c0: 0f 94 1a 23 call 0x24634 ; 0x24634 } while (st_get_position_mm(Z_AXIS) > MESH_HOME_Z_SEARCH); // i.e. Z-leveling not o.k. 103c4: 82 e0 ldi r24, 0x02 ; 2 103c6: 0f 94 80 18 call 0x23100 ; 0x23100 103ca: 20 e0 ldi r18, 0x00 ; 0 103cc: 30 e0 ldi r19, 0x00 ; 0 103ce: 40 ea ldi r20, 0xA0 ; 160 103d0: 50 e4 ldi r21, 0x40 ; 64 103d2: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 103d6: 18 16 cp r1, r24 103d8: 44 f2 brlt .-112 ; 0x1036a custom_message_type = custom_message_type_old; 103da: ef 81 ldd r30, Y+7 ; 0x07 103dc: e0 93 5d 06 sts 0x065D, r30 ; 0x80065d custom_message_state = custom_message_state_old; 103e0: f8 85 ldd r31, Y+8 ; 0x08 103e2: f0 93 de 03 sts 0x03DE, r31 ; 0x8003de lcd_update_enable(true); // display / status-line recovery 103e6: 81 e0 ldi r24, 0x01 ; 1 103e8: 0e 94 89 70 call 0xe112 ; 0xe112 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); 103ec: dd 24 eor r13, r13 103ee: d3 94 inc r13 103f0: df 92 push r13 103f2: 81 2c mov r8, r1 103f4: 91 2c mov r9, r1 103f6: 54 01 movw r10, r8 103f8: cc 24 eor r12, r12 103fa: c3 94 inc r12 103fc: e1 2c mov r14, r1 103fe: f1 2c mov r15, r1 10400: 87 01 movw r16, r14 10402: 21 e0 ldi r18, 0x01 ; 1 10404: 40 e0 ldi r20, 0x00 ; 0 10406: 50 e0 ldi r21, 0x00 ; 0 10408: ba 01 movw r22, r20 1040a: 81 e0 ldi r24, 0x01 ; 1 1040c: 0e 94 7b 6d call 0xdaf6 ; 0xdaf6 10410: d0 92 53 12 sts 0x1253, r13 ; 0x801253 10414: 0f 90 pop r0 10416: c5 cb rjmp .-2166 ; 0xfba2 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. 10418: 10 92 3d 03 sts 0x033D, r1 ; 0x80033d clean_up_after_endstop_move(l_feedmultiply); 1041c: 8b a1 ldd r24, Y+35 ; 0x23 1041e: 9c a1 ldd r25, Y+36 ; 0x24 10420: 0e 94 9d 65 call 0xcb3a ; 0xcb3a // Number of baby steps applied static int babystepLoadZ = 0; void babystep_load() { babystepLoadZ = 0; 10424: 10 92 27 06 sts 0x0627, r1 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.450+0x1> 10428: 10 92 26 06 sts 0x0626, r1 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.450> // Apply Z height correction aka baby stepping before mesh bed leveling gets activated. if (calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 1042c: 80 e1 ldi r24, 0x10 ; 16 1042e: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 10432: 88 23 and r24, r24 10434: 91 f0 breq .+36 ; 0x1045a { check_babystep(); //checking if babystep is in allowed range, otherwise setting babystep to 0 10436: 0e 94 6d 7d call 0xfada ; 0xfada // 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))); 1043a: 81 ea ldi r24, 0xA1 ; 161 1043c: 9d e0 ldi r25, 0x0D ; 13 1043e: 0f 94 81 a4 call 0x34902 ; 0x34902 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-> 10442: 2b e0 ldi r18, 0x0B ; 11 10444: 82 9f mul r24, r18 10446: c0 01 movw r24, r0 10448: 11 24 eor r1, r1 1044a: 80 5b subi r24, 0xB0 ; 176 1044c: 92 4f sbci r25, 0xF2 ; 242 1044e: 0f 94 8f a4 call 0x3491e ; 0x3491e 10452: 90 93 27 06 sts 0x0627, r25 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.450+0x1> 10456: 80 93 26 06 sts 0x0626, r24 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.450> } void babystep_apply() { babystep_load(); shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_mm[Z_AXIS])); 1045a: 60 91 26 06 lds r22, 0x0626 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.450> 1045e: 70 91 27 06 lds r23, 0x0627 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.450+0x1> 10462: 07 2e mov r0, r23 10464: 00 0c add r0, r0 10466: 88 0b sbc r24, r24 10468: 99 0b sbc r25, r25 1046a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1046e: 90 58 subi r25, 0x80 ; 128 10470: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 10474: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 10478: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1047c: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 10480: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 10484: 0f 94 36 52 call 0x2a46c ; 0x2a46c 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; 10488: 80 ec ldi r24, 0xC0 ; 192 1048a: 9f e0 ldi r25, 0x0F ; 15 1048c: 0f 94 81 a4 call 0x34902 ; 0x34902 10490: 91 e0 ldi r25, 0x01 ; 1 10492: 81 30 cpi r24, 0x01 ; 1 10494: 09 f0 breq .+2 ; 0x10498 10496: 90 e0 ldi r25, 0x00 ; 0 } } else if (eeprom_bed_correction_valid) { return (int8_t)eeprom_read_byte(eep_address); } return 0; }; 10498: 99 83 std Y+1, r25 ; 0x01 const int8_t correction[4] = { bedCorrectHelper('L', (uint8_t*)EEPROM_BED_CORRECTION_LEFT), 1049a: 4f eb ldi r20, 0xBF ; 191 1049c: 5f e0 ldi r21, 0x0F ; 15 1049e: 6c e4 ldi r22, 0x4C ; 76 104a0: ce 01 movw r24, r28 104a2: 01 96 adiw r24, 0x01 ; 1 104a4: 0e 94 af 56 call 0xad5e ; 0xad5e 104a8: f8 2e mov r15, r24 bedCorrectHelper('R', (uint8_t*)EEPROM_BED_CORRECTION_RIGHT), 104aa: 4e eb ldi r20, 0xBE ; 190 104ac: 5f e0 ldi r21, 0x0F ; 15 104ae: 62 e5 ldi r22, 0x52 ; 82 104b0: ce 01 movw r24, r28 104b2: 01 96 adiw r24, 0x01 ; 1 104b4: 0e 94 af 56 call 0xad5e ; 0xad5e 104b8: 08 2f mov r16, r24 bedCorrectHelper('F', (uint8_t*)EEPROM_BED_CORRECTION_FRONT), 104ba: 4d eb ldi r20, 0xBD ; 189 104bc: 5f e0 ldi r21, 0x0F ; 15 104be: 66 e4 ldi r22, 0x46 ; 70 104c0: ce 01 movw r24, r28 104c2: 01 96 adiw r24, 0x01 ; 1 104c4: 0e 94 af 56 call 0xad5e ; 0xad5e 104c8: 18 2f mov r17, r24 bedCorrectHelper('B', (uint8_t*)EEPROM_BED_CORRECTION_REAR), 104ca: 4c eb ldi r20, 0xBC ; 188 104cc: 5f e0 ldi r21, 0x0F ; 15 104ce: 62 e4 ldi r22, 0x42 ; 66 104d0: ce 01 movw r24, r28 104d2: 01 96 adiw r24, 0x01 ; 1 104d4: 0e 94 af 56 call 0xad5e ; 0xad5e 104d8: 21 2f mov r18, r17 104da: 11 0f add r17, r17 104dc: 33 0b sbc r19, r19 104de: 08 2e mov r0, r24 104e0: 00 0c add r0, r0 104e2: 99 0b sbc r25, r25 104e4: 5c 01 movw r10, r24 104e6: a2 1a sub r10, r18 104e8: b3 0a sbc r11, r19 104ea: 8f 2d mov r24, r15 104ec: ff 0c add r15, r15 104ee: 99 0b sbc r25, r25 104f0: 28 0f add r18, r24 104f2: 39 1f adc r19, r25 104f4: 46 e0 ldi r20, 0x06 ; 6 104f6: 42 9f mul r20, r18 104f8: 60 01 movw r12, r0 104fa: 43 9f mul r20, r19 104fc: d0 0c add r13, r0 104fe: 11 24 eor r1, r1 10500: f1 2c mov r15, r1 10502: e1 2c mov r14, r1 10504: 00 2e mov r0, r16 10506: 00 0c add r0, r0 10508: 11 0b sbc r17, r17 1050a: 08 1b sub r16, r24 1050c: 19 0b sbc r17, r25 1050e: b7 01 movw r22, r14 10510: 66 5f subi r22, 0xF6 ; 246 10512: 7c 4e sbci r23, 0xEC ; 236 10514: 3b 01 movw r6, r22 10516: 46 01 movw r8, r12 10518: 77 e0 ldi r23, 0x07 ; 7 1051a: 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 * ( 1051c: d3 01 movw r26, r6 1051e: 2d 90 ld r2, X+ 10520: 3d 90 ld r3, X+ 10522: 4d 90 ld r4, X+ 10524: 5d 90 ld r5, X+ 10526: 3d 01 movw r6, r26 10528: fd 01 movw r30, r26 1052a: 34 97 sbiw r30, 0x04 ; 4 1052c: fb 87 std Y+11, r31 ; 0x0b 1052e: ea 87 std Y+10, r30 ; 0x0a 10530: b4 01 movw r22, r8 10532: 09 2c mov r0, r9 10534: 00 0c add r0, r0 10536: 88 0b sbc r24, r24 10538: 99 0b sbc r25, r25 1053a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1053e: 2f e3 ldi r18, 0x3F ; 63 10540: 33 ec ldi r19, 0xC3 ; 195 10542: 4e e2 ldi r20, 0x2E ; 46 10544: 59 e3 ldi r21, 0x39 ; 57 10546: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1054a: a2 01 movw r20, r4 1054c: 91 01 movw r18, r2 1054e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 10552: aa 85 ldd r26, Y+10 ; 0x0a 10554: bb 85 ldd r27, Y+11 ; 0x0b 10556: 6d 93 st X+, r22 10558: 7d 93 st X+, r23 1055a: 8d 93 st X+, r24 1055c: 9c 93 st X, r25 1055e: 13 97 sbiw r26, 0x03 ; 3 10560: ba 81 ldd r27, Y+2 ; 0x02 10562: b1 50 subi r27, 0x01 ; 1 10564: ba 83 std Y+2, r27 ; 0x02 10566: 80 0e add r8, r16 10568: 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++) { 1056a: b1 11 cpse r27, r1 1056c: d7 cf rjmp .-82 ; 0x1051c 1056e: ca 0c add r12, r10 10570: db 1c adc r13, r11 10572: ec e1 ldi r30, 0x1C ; 28 10574: ee 0e add r14, r30 10576: 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++) { 10578: f4 ec ldi r31, 0xC4 ; 196 1057a: ef 16 cp r14, r31 1057c: f1 04 cpc r15, r1 1057e: 39 f6 brne .-114 ; 0x1050e + 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) 10580: 0f 94 5e 93 call 0x326bc ; 0x326bc { // apply magnet compensation uint8_t useMagnetCompensation = code_seen('M') ? code_value_uint8() : eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION); 10584: 8d e4 ldi r24, 0x4D ; 77 10586: 0e 94 80 56 call 0xad00 ; 0xad00 1058a: 88 23 and r24, r24 1058c: 09 f4 brne .+2 ; 0x10590 1058e: 84 c0 rjmp .+264 ; 0x10698 10590: 0e 94 95 56 call 0xad2a ; 0xad2a if (nMeasPoints == 7 && useMagnetCompensation) { 10594: 2e 81 ldd r18, Y+6 ; 0x06 10596: 27 30 cpi r18, 0x07 ; 7 10598: 09 f0 breq .+2 ; 0x1059c 1059a: 94 c0 rjmp .+296 ; 0x106c4 1059c: 88 23 and r24, r24 1059e: 09 f4 brne .+2 ; 0x105a2 105a0: 91 c0 rjmp .+290 ; 0x106c4 105a2: bb 24 eor r11, r11 105a4: b3 94 inc r11 105a6: aa 24 eor r10, r10 105a8: aa 94 dec r10 105aa: ab 0c add r10, r11 105ac: 09 a1 ldd r16, Y+33 ; 0x21 105ae: 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++) { 105b0: 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++; } 105b2: 8e ef ldi r24, 0xFE ; 254 105b4: 88 2e mov r8, r24 105b6: 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)) { 105b8: 6a 2d mov r22, r10 105ba: 86 2d mov r24, r6 105bc: 0f 94 01 52 call 0x2a402 ; 0x2a402 105c0: 99 24 eor r9, r9 105c2: 93 94 inc r9 105c4: 96 0c add r9, r6 105c6: 81 11 cpse r24, r1 105c8: 6e c0 rjmp .+220 ; 0x106a6 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++; } 105ca: 6b 2d mov r22, r11 105cc: 86 2d mov r24, r6 105ce: 0f 94 01 52 call 0x2a402 ; 0x2a402 } 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; 105d2: c1 2c mov r12, r1 105d4: d1 2c mov r13, r1 105d6: 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; 105d8: 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++; } 105da: 88 23 and r24, r24 105dc: 81 f0 breq .+32 ; 0x105fe 105de: 20 e0 ldi r18, 0x00 ; 0 105e0: 30 e0 ldi r19, 0x00 ; 0 105e2: a9 01 movw r20, r18 105e4: d8 01 movw r26, r16 105e6: 5d 96 adiw r26, 0x1d ; 29 105e8: 6d 91 ld r22, X+ 105ea: 7d 91 ld r23, X+ 105ec: 8d 91 ld r24, X+ 105ee: 9c 91 ld r25, X 105f0: 90 97 sbiw r26, 0x20 ; 32 105f2: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 105f6: 6b 01 movw r12, r22 105f8: 7c 01 movw r14, r24 105fa: 77 24 eor r7, r7 105fc: 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++; } 105fe: 68 2d mov r22, r8 10600: 86 2d mov r24, r6 10602: 0f 94 01 52 call 0x2a402 ; 0x2a402 10606: 88 23 and r24, r24 10608: 69 f0 breq .+26 ; 0x10624 1060a: f8 01 movw r30, r16 1060c: 7b 97 sbiw r30, 0x1b ; 27 1060e: 20 81 ld r18, Z 10610: 31 81 ldd r19, Z+1 ; 0x01 10612: 42 81 ldd r20, Z+2 ; 0x02 10614: 53 81 ldd r21, Z+3 ; 0x03 10616: c7 01 movw r24, r14 10618: b6 01 movw r22, r12 1061a: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1061e: 6b 01 movw r12, r22 10620: 7c 01 movw r14, r24 10622: 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++; } 10624: 6a 2d mov r22, r10 10626: 89 2d mov r24, r9 10628: 0f 94 01 52 call 0x2a402 ; 0x2a402 1062c: 88 23 and r24, r24 1062e: 61 f0 breq .+24 ; 0x10648 10630: f8 01 movw r30, r16 10632: 25 81 ldd r18, Z+5 ; 0x05 10634: 36 81 ldd r19, Z+6 ; 0x06 10636: 47 81 ldd r20, Z+7 ; 0x07 10638: 50 85 ldd r21, Z+8 ; 0x08 1063a: c7 01 movw r24, r14 1063c: b6 01 movw r22, r12 1063e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 10642: 6b 01 movw r12, r22 10644: 7c 01 movw r14, r24 10646: 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++; } 10648: 6a 2d mov r22, r10 1064a: 8f ef ldi r24, 0xFF ; 255 1064c: 86 0d add r24, r6 1064e: 0f 94 01 52 call 0x2a402 ; 0x2a402 10652: 88 23 and r24, r24 10654: 31 f1 breq .+76 ; 0x106a2 10656: f8 01 movw r30, r16 10658: 33 97 sbiw r30, 0x03 ; 3 1065a: 20 81 ld r18, Z 1065c: 31 81 ldd r19, Z+1 ; 0x01 1065e: 42 81 ldd r20, Z+2 ; 0x02 10660: 53 81 ldd r21, Z+3 ; 0x03 10662: c7 01 movw r24, r14 10664: b6 01 movw r22, r12 10666: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1066a: 6b 01 movw r12, r22 1066c: 7c 01 movw r14, r24 1066e: 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 10670: 67 2d mov r22, r7 10672: 70 e0 ldi r23, 0x00 ; 0 10674: 90 e0 ldi r25, 0x00 ; 0 10676: 80 e0 ldi r24, 0x00 ; 0 10678: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1067c: 9b 01 movw r18, r22 1067e: ac 01 movw r20, r24 10680: c7 01 movw r24, r14 10682: b6 01 movw r22, r12 10684: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 10688: d8 01 movw r26, r16 1068a: 11 96 adiw r26, 0x01 ; 1 1068c: 6d 93 st X+, r22 1068e: 7d 93 st X+, r23 10690: 8d 93 st X+, r24 10692: 9c 93 st X, r25 10694: 14 97 sbiw r26, 0x04 ; 4 10696: 07 c0 rjmp .+14 ; 0x106a6 } 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); 10698: 8c ea ldi r24, 0xAC ; 172 1069a: 9d e0 ldi r25, 0x0D ; 13 1069c: 0f 94 81 a4 call 0x34902 ; 0x34902 106a0: 79 cf rjmp .-270 ; 0x10594 106a2: 71 10 cpse r7, r1 106a4: e5 cf rjmp .-54 ; 0x10670 //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++) { 106a6: 69 2c mov r6, r9 106a8: 0c 5f subi r16, 0xFC ; 252 106aa: 1f 4f sbci r17, 0xFF ; 255 106ac: b7 e0 ldi r27, 0x07 ; 7 106ae: 9b 12 cpse r9, r27 106b0: 83 cf rjmp .-250 ; 0x105b8 106b2: b3 94 inc r11 106b4: e9 a1 ldd r30, Y+33 ; 0x21 106b6: fa a1 ldd r31, Y+34 ; 0x22 106b8: 7c 96 adiw r30, 0x1c ; 28 106ba: fa a3 std Y+34, r31 ; 0x22 106bc: 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++) { 106be: f8 e0 ldi r31, 0x08 ; 8 106c0: bf 12 cpse r11, r31 106c2: 71 cf rjmp .-286 ; 0x105a6 if (nMeasPoints == 7 && useMagnetCompensation) { mbl_magnet_elimination(); } } mbl.active = 1; //activate mesh bed leveling 106c4: 81 e0 ldi r24, 0x01 ; 1 106c6: 80 93 09 13 sts 0x1309, r24 ; 0x801309 if (code_seen('O') && !code_value_uint8()) { 106ca: 8f e4 ldi r24, 0x4F ; 79 106cc: 0e 94 80 56 call 0xad00 ; 0xad00 106d0: 81 11 cpse r24, r1 106d2: 03 c0 rjmp .+6 ; 0x106da // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); } else { go_home_with_z_lift(); 106d4: 0e 94 8e 6a call 0xd51c ; 0xd51c 106d8: 79 cc rjmp .-1806 ; 0xffcc } } mbl.active = 1; //activate mesh bed leveling if (code_seen('O') && !code_value_uint8()) { 106da: 0e 94 95 56 call 0xad2a ; 0xad2a 106de: 81 11 cpse r24, r1 106e0: f9 cf rjmp .-14 ; 0x106d4 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 106e2: 0e 94 92 65 call 0xcb24 ; 0xcb24 106e6: 72 cc rjmp .-1820 ; 0xffcc 000106e8 : #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } void kill(const char *full_screen_message) { 106e8: ec 01 movw r28, r24 cli(); // Stop interrupts 106ea: f8 94 cli disable_heater(); 106ec: 0f 94 9e 0e call 0x21d3c ; 0x21d3c disable_x(); 106f0: 17 9a sbi 0x02, 7 ; 2 106f2: 10 92 39 06 sts 0x0639, r1 ; 0x800639 disable_y(); 106f6: 16 9a sbi 0x02, 6 ; 2 106f8: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a poweroff_z(); disable_e0(); 106fc: 14 9a sbi 0x02, 4 ; 2 SERIAL_ERROR_START; 106fe: 87 ec ldi r24, 0xC7 ; 199 10700: 92 ea ldi r25, 0xA2 ; 162 10702: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); 10706: 86 eb ldi r24, 0xB6 ; 182 10708: 98 e7 ldi r25, 0x78 ; 120 1070a: 0e 94 0e 7d call 0xfa1c ; 0xfa1c if (full_screen_message != NULL) { 1070e: 20 97 sbiw r28, 0x00 ; 0 10710: 79 f0 breq .+30 ; 0x10730 SERIAL_ERRORLNRPGM(full_screen_message); 10712: ce 01 movw r24, r28 10714: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 10718: be 01 movw r22, r28 1071a: 85 e9 ldi r24, 0x95 ; 149 1071c: 9c e0 ldi r25, 0x0C ; 12 1071e: 0f 94 df a4 call 0x349be ; 0x349be 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); 10722: 62 e4 ldi r22, 0x42 ; 66 10724: 84 e9 ldi r24, 0x94 ; 148 10726: 9c e0 ldi r25, 0x0C ; 12 10728: 0f 94 c9 a4 call 0x34992 ; 0x34992 // 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(); 1072c: 0e 94 70 66 call 0xcce0 ; 0xcce0 SERIAL_ERRORLNRPGM(PSTR("Printer halted. kill() called!")); if (full_screen_message != NULL) { SERIAL_ERRORLNRPGM(full_screen_message); } else { full_screen_message = PSTR("KILLED."); 10730: ce ea ldi r28, 0xAE ; 174 10732: d8 e7 ldi r29, 0x78 ; 120 10734: f1 cf rjmp .-30 ; 0x10718 00010736 : // 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(); 10736: 88 e4 ldi r24, 0x48 ; 72 10738: 93 e0 ldi r25, 0x03 ; 3 1073a: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> if (buflen && ((CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB) || (CMDBUFFER_CURRENT_TYPE == CMDBUFFER_CURRENT_TYPE_USB_WITH_LINENR))) 1073e: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 10742: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 10746: 89 2b or r24, r25 10748: 79 f0 breq .+30 ; 0x10768 1074a: e0 91 38 12 lds r30, 0x1238 ; 0x801238 1074e: f0 91 39 12 lds r31, 0x1239 ; 0x801239 10752: e5 5b subi r30, 0xB5 ; 181 10754: ff 4e sbci r31, 0xEF ; 239 10756: 80 81 ld r24, Z 10758: 81 30 cpi r24, 0x01 ; 1 1075a: 11 f0 breq .+4 ; 0x10760 1075c: 86 30 cpi r24, 0x06 ; 6 1075e: 21 f4 brne .+8 ; 0x10768 SERIAL_PROTOCOLLNRPGM(MSG_OK); 10760: 80 e9 ldi r24, 0x90 ; 144 10762: 9a e6 ldi r25, 0x6A ; 106 10764: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c } 10768: 08 95 ret 0001076a : return false; } void cmdqueue_reset() { while (buflen) 1076a: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1076e: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 10772: 89 2b or r24, r25 10774: 29 f0 breq .+10 ; 0x10780 { // printf_P(PSTR("dumping: \"%s\" of type %u\n"), cmdbuffer+bufindr+CMDHDRSIZE, CMDBUFFER_CURRENT_TYPE); ClearToSend(); 10776: 0e 94 9b 83 call 0x10736 ; 0x10736 cmdqueue_pop_front(); 1077a: 0e 94 94 79 call 0xf328 ; 0xf328 1077e: f5 cf rjmp .-22 ; 0x1076a } bufindr = 0; 10780: 10 92 39 12 sts 0x1239, r1 ; 0x801239 10784: 10 92 38 12 sts 0x1238, r1 ; 0x801238 bufindw = 0; 10788: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 1078c: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.511> //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; 10790: 81 e0 ldi r24, 0x01 ; 1 10792: 80 93 53 12 sts 0x1253, r24 ; 0x801253 } 10796: 08 95 ret 00010798 : } // G81_M420 Mesh bed leveling status static void gcode_G81_M420() { 10798: ef 92 push r14 1079a: ff 92 push r15 1079c: 0f 93 push r16 1079e: 1f 93 push r17 107a0: cf 93 push r28 107a2: df 93 push r29 if (mbl.active) { 107a4: 80 91 09 13 lds r24, 0x1309 ; 0x801309 107a8: 88 23 and r24, r24 107aa: 89 f1 breq .+98 ; 0x1080e } } } void mesh_bed_leveling::print() { SERIAL_PROTOCOLLNPGM("Num X,Y: " STRINGIFY(MESH_NUM_X_POINTS) "," STRINGIFY(MESH_NUM_Y_POINTS)); 107ac: 80 e4 ldi r24, 0x40 ; 64 107ae: 98 e7 ldi r25, 0x78 ; 120 107b0: 0e 94 0e 7d call 0xfa1c ; 0xfa1c SERIAL_PROTOCOLLNPGM("Z search height: " STRINGIFY(MESH_HOME_Z_SEARCH)); 107b4: 8a e2 ldi r24, 0x2A ; 42 107b6: 98 e7 ldi r25, 0x78 ; 120 107b8: 0e 94 0e 7d call 0xfa1c ; 0xfa1c SERIAL_PROTOCOLLNPGM("Measured points:"); 107bc: 89 e1 ldi r24, 0x19 ; 25 107be: 98 e7 ldi r25, 0x78 ; 120 107c0: 0e 94 0e 7d call 0xfa1c ; 0xfa1c for (uint8_t y = MESH_NUM_Y_POINTS; y-- > 0;) { 107c4: c7 e0 ldi r28, 0x07 ; 7 107c6: dc e1 ldi r29, 0x1C ; 28 107c8: c1 50 subi r28, 0x01 ; 1 107ca: 58 f1 brcs .+86 ; 0x10822 107cc: cd 9f mul r28, r29 107ce: 70 01 movw r14, r0 107d0: 11 24 eor r1, r1 107d2: 01 e0 ldi r16, 0x01 ; 1 107d4: 10 e0 ldi r17, 0x00 ; 0 for (uint8_t x = 0; x < MESH_NUM_X_POINTS; x++) { SERIAL_PROTOCOLPGM(" "); 107d6: 86 e1 ldi r24, 0x16 ; 22 107d8: 98 e7 ldi r25, 0x78 ; 120 107da: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOL_F(z_values[y][x], 5); 107de: f8 01 movw r30, r16 107e0: ee 0f add r30, r30 107e2: ff 1f adc r31, r31 107e4: ee 0f add r30, r30 107e6: ff 1f adc r31, r31 107e8: ee 0d add r30, r14 107ea: ff 1d adc r31, r15 107ec: ea 5f subi r30, 0xFA ; 250 107ee: fc 4e sbci r31, 0xEC ; 236 107f0: 60 81 ld r22, Z 107f2: 71 81 ldd r23, Z+1 ; 0x01 107f4: 82 81 ldd r24, Z+2 ; 0x02 107f6: 93 81 ldd r25, Z+3 ; 0x03 107f8: 45 e0 ldi r20, 0x05 ; 5 107fa: 0e 94 97 7a call 0xf52e ; 0xf52e 107fe: 0f 5f subi r16, 0xFF ; 255 10800: 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++) { 10802: 08 30 cpi r16, 0x08 ; 8 10804: 11 05 cpc r17, r1 10806: 39 f7 brne .-50 ; 0x107d6 SERIAL_PROTOCOLPGM(" "); SERIAL_PROTOCOL_F(z_values[y][x], 5); } SERIAL_PROTOCOLLN(); 10808: 0e 94 0d 7b call 0xf61a ; 0xf61a 1080c: dd cf rjmp .-70 ; 0x107c8 mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 1080e: 8d e4 ldi r24, 0x4D ; 77 10810: 98 e7 ldi r25, 0x78 ; 120 return; } 10812: df 91 pop r29 10814: cf 91 pop r28 10816: 1f 91 pop r17 10818: 0f 91 pop r16 1081a: ff 90 pop r15 1081c: ef 90 pop r14 static void gcode_G81_M420() { if (mbl.active) { mbl.print(); } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); 1081e: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c return; } 10822: df 91 pop r29 10824: cf 91 pop r28 10826: 1f 91 pop r17 10828: 0f 91 pop r16 1082a: ff 90 pop r15 1082c: ef 90 pop r14 1082e: 08 95 ret 00010830 : return (k >= 0? la10c_convert(k): -1); } float la10c_jerk(float j) { 10830: cf 92 push r12 10832: df 92 push r13 10834: ef 92 push r14 10836: ff 92 push r15 10838: 6b 01 movw r12, r22 1083a: 7c 01 movw r14, r24 la10c_orig_jerk = j; 1083c: c0 92 27 03 sts 0x0327, r12 ; 0x800327 10840: d0 92 28 03 sts 0x0328, r13 ; 0x800328 10844: e0 92 29 03 sts 0x0329, r14 ; 0x800329 10848: f0 92 2a 03 sts 0x032A, r15 ; 0x80032a if(la10c_mode != LA10C_LA10) 1084c: 80 91 43 03 lds r24, 0x0343 ; 0x800343 10850: 82 30 cpi r24, 0x02 ; 2 10852: b1 f4 brne .+44 ; 0x10880 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) 10854: 20 e0 ldi r18, 0x00 ; 0 10856: 30 e0 ldi r19, 0x00 ; 0 10858: 40 e9 ldi r20, 0x90 ; 144 1085a: 50 e4 ldi r21, 0x40 ; 64 1085c: c7 01 movw r24, r14 1085e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 10862: 87 ff sbrs r24, 7 10864: 14 c0 rjmp .+40 ; 0x1088e 10866: 80 91 97 0d lds r24, 0x0D97 ; 0x800d97 1086a: 90 91 98 0d lds r25, 0x0D98 ; 0x800d98 1086e: a0 91 99 0d lds r26, 0x0D99 ; 0x800d99 10872: b0 91 9a 0d lds r27, 0x0D9A ; 0x800d9a 10876: 80 3d cpi r24, 0xD0 ; 208 10878: 97 40 sbci r25, 0x07 ; 7 1087a: a1 05 cpc r26, r1 1087c: b1 05 cpc r27, r1 1087e: 20 f5 brcc .+72 ; 0x108c8 j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); SERIAL_ECHOLN(j); return j; } 10880: c7 01 movw r24, r14 10882: b6 01 movw r22, r12 10884: ff 90 pop r15 10886: ef 90 pop r14 10888: df 90 pop r13 1088a: cf 90 pop r12 1088c: 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: 1088e: 2a e9 ldi r18, 0x9A ; 154 10890: 39 e9 ldi r19, 0x99 ; 153 10892: 49 e9 ldi r20, 0x99 ; 153 10894: 5e e3 ldi r21, 0x3E ; 62 10896: c7 01 movw r24, r14 10898: b6 01 movw r22, r12 1089a: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1089e: 87 ff sbrs r24, 7 108a0: 0a c0 rjmp .+20 ; 0x108b6 108a2: 20 e0 ldi r18, 0x00 ; 0 108a4: 30 e0 ldi r19, 0x00 ; 0 108a6: 48 e3 ldi r20, 0x38 ; 56 108a8: 51 e4 ldi r21, 0x41 ; 65 108aa: c7 01 movw r24, r14 108ac: b6 01 movw r22, r12 108ae: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 108b2: 6b 01 movw r12, r22 108b4: 7c 01 movw r14, r24 j < 4.5? j * 0.25 + 3.375: j; SERIAL_ECHOPGM("LA10C: Adjusted E-Jerk: "); 108b6: 84 e2 ldi r24, 0x24 ; 36 108b8: 95 e7 ldi r25, 0x75 ; 117 108ba: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN(j); 108be: c7 01 movw r24, r14 108c0: b6 01 movw r22, r12 108c2: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 108c6: dc cf rjmp .-72 ; 0x10880 // 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: 108c8: 2a e9 ldi r18, 0x9A ; 154 108ca: 39 e9 ldi r19, 0x99 ; 153 108cc: 49 e9 ldi r20, 0x99 ; 153 108ce: 5e e3 ldi r21, 0x3E ; 62 108d0: c7 01 movw r24, r14 108d2: b6 01 movw r22, r12 108d4: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 108d8: 87 fd sbrc r24, 7 108da: e3 cf rjmp .-58 ; 0x108a2 j < 4.5? j * 0.25 + 3.375: 108dc: 20 e0 ldi r18, 0x00 ; 0 108de: 30 e0 ldi r19, 0x00 ; 0 108e0: 40 e8 ldi r20, 0x80 ; 128 108e2: 5e e3 ldi r21, 0x3E ; 62 108e4: c7 01 movw r24, r14 108e6: b6 01 movw r22, r12 108e8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__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: 108ec: 20 e0 ldi r18, 0x00 ; 0 108ee: 30 e0 ldi r19, 0x00 ; 0 108f0: 48 e5 ldi r20, 0x58 ; 88 108f2: 50 e4 ldi r21, 0x40 ; 64 108f4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 108f8: dc cf rjmp .-72 ; 0x108b2 000108fa : return la10c_mode; } void la10c_mode_change(LA10C_MODE mode) { 108fa: cf 92 push r12 108fc: df 92 push r13 108fe: ef 92 push r14 10900: ff 92 push r15 10902: cf 93 push r28 if(mode == la10c_mode) return; 10904: 90 91 43 03 lds r25, 0x0343 ; 0x800343 10908: 98 17 cp r25, r24 1090a: b9 f1 breq .+110 ; 0x1097a 1090c: c8 2f mov r28, r24 // always restore to the last unadjusted E-jerk value if(la10c_orig_jerk) 1090e: c0 90 27 03 lds r12, 0x0327 ; 0x800327 10912: d0 90 28 03 lds r13, 0x0328 ; 0x800328 10916: e0 90 29 03 lds r14, 0x0329 ; 0x800329 1091a: f0 90 2a 03 lds r15, 0x032A ; 0x80032a 1091e: 20 e0 ldi r18, 0x00 ; 0 10920: 30 e0 ldi r19, 0x00 ; 0 10922: a9 01 movw r20, r18 10924: c7 01 movw r24, r14 10926: b6 01 movw r22, r12 10928: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1092c: 88 23 and r24, r24 1092e: 41 f0 breq .+16 ; 0x10940 cs.max_jerk[E_AXIS] = la10c_orig_jerk; 10930: c0 92 bb 0d sts 0x0DBB, r12 ; 0x800dbb 10934: d0 92 bc 0d sts 0x0DBC, r13 ; 0x800dbc 10938: e0 92 bd 0d sts 0x0DBD, r14 ; 0x800dbd 1093c: f0 92 be 0d sts 0x0DBE, r15 ; 0x800dbe SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); 10940: 87 e0 ldi r24, 0x07 ; 7 10942: 95 e7 ldi r25, 0x75 ; 117 10944: 0e 94 15 7b call 0xf62a ; 0xf62a switch(mode) 10948: c1 30 cpi r28, 0x01 ; 1 1094a: 11 f1 breq .+68 ; 0x10990 1094c: e0 f0 brcs .+56 ; 0x10986 1094e: c2 30 cpi r28, 0x02 ; 2 10950: 11 f1 breq .+68 ; 0x10996 { 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; 10952: 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]); 10956: 60 91 bb 0d lds r22, 0x0DBB ; 0x800dbb 1095a: 70 91 bc 0d lds r23, 0x0DBC ; 0x800dbc 1095e: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 10962: 90 91 be 0d lds r25, 0x0DBE ; 0x800dbe 10966: 0e 94 18 84 call 0x10830 ; 0x10830 1096a: 60 93 bb 0d sts 0x0DBB, r22 ; 0x800dbb 1096e: 70 93 bc 0d sts 0x0DBC, r23 ; 0x800dbc 10972: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd 10976: 90 93 be 0d sts 0x0DBE, r25 ; 0x800dbe } 1097a: cf 91 pop r28 1097c: ff 90 pop r15 1097e: ef 90 pop r14 10980: df 90 pop r13 10982: cf 90 pop r12 10984: 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; 10986: 8f ef ldi r24, 0xFF ; 255 10988: 94 e7 ldi r25, 0x74 ; 116 case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 1098a: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 1098e: e1 cf rjmp .-62 ; 0x10952 SERIAL_ECHOPGM("LA10C: Linear Advance mode: "); switch(mode) { case LA10C_UNKNOWN: SERIAL_ECHOLNPGM("UNKNOWN"); break; case LA10C_LA15: SERIAL_ECHOLNPGM("1.5"); break; 10990: 8b ef ldi r24, 0xFB ; 251 10992: 94 e7 ldi r25, 0x74 ; 116 10994: fa cf rjmp .-12 ; 0x1098a case LA10C_LA10: SERIAL_ECHOLNPGM("1.0"); break; 10996: 87 ef ldi r24, 0xF7 ; 247 10998: 94 e7 ldi r25, 0x74 ; 116 1099a: f7 cf rjmp .-18 ; 0x1098a 0001099c : bool IsStopped() { return Stopped; }; void finishAndDisableSteppers() { st_synchronize(); 1099c: 0f 94 94 18 call 0x23128 ; 0x23128 disable_x(); 109a0: 17 9a sbi 0x02, 7 ; 2 109a2: e9 e3 ldi r30, 0x39 ; 57 109a4: f6 e0 ldi r31, 0x06 ; 6 109a6: 10 82 st Z, r1 disable_y(); 109a8: 16 9a sbi 0x02, 6 ; 2 109aa: 11 82 std Z+1, r1 ; 0x01 disable_z(); disable_e0(); 109ac: 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); } 109ae: 80 e0 ldi r24, 0x00 ; 0 109b0: 0e 94 7d 84 call 0x108fa ; 0x108fa return percent_done; } static void print_time_remaining_init() { print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; 109b4: 8f ef ldi r24, 0xFF ; 255 109b6: 9f ef ldi r25, 0xFF ; 255 109b8: 90 93 73 02 sts 0x0273, r25 ; 0x800273 109bc: 80 93 72 02 sts 0x0272, r24 ; 0x800272 print_percent_done_normal = PRINT_PERCENT_DONE_INIT; 109c0: 2f ef ldi r18, 0xFF ; 255 109c2: 20 93 6f 02 sts 0x026F, r18 ; 0x80026f print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; 109c6: 90 93 3e 02 sts 0x023E, r25 ; 0x80023e 109ca: 80 93 3d 02 sts 0x023D, r24 ; 0x80023d print_percent_done_silent = PRINT_PERCENT_DONE_INIT; 109ce: 20 93 3f 02 sts 0x023F, r18 ; 0x80023f print_time_to_change_normal = PRINT_TIME_REMAINING_INIT; 109d2: 90 93 71 02 sts 0x0271, r25 ; 0x800271 109d6: 80 93 70 02 sts 0x0270, r24 ; 0x800270 print_time_to_change_silent = PRINT_TIME_REMAINING_INIT; 109da: 90 93 3c 02 sts 0x023C, r25 ; 0x80023c 109de: 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(); } 109e2: 08 95 ret 000109e4 : SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); } } void __attribute__((noinline)) serial_dump_and_reset(dump_crash_reason reason) { 109e4: 18 2f mov r17, r24 uint16_t sp; uint32_t pc; // we're being called from a live state, so shut off interrupts ... cli(); 109e6: f8 94 cli // sample SP/PC sp = SP; 109e8: cd b7 in r28, 0x3d ; 61 109ea: de b7 in r29, 0x3e ; 62 "rcall .\n" "pop %A0\n" "pop %B0\n" "pop %C0\n" : "=&r" (ret) ); 109ec: 00 d0 rcall .+0 ; 0x109ee 109ee: cf 90 pop r12 109f0: df 90 pop r13 109f2: ef 90 pop r14 109f4: 88 e1 ldi r24, 0x18 ; 24 109f6: 99 e2 ldi r25, 0x29 ; 41 109f8: 0f b6 in r0, 0x3f ; 63 109fa: f8 94 cli 109fc: a8 95 wdr 109fe: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 10a02: 0f be out 0x3f, r0 ; 63 10a04: 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); 10a08: 9f b7 in r25, 0x3f ; 63 10a0a: f8 94 cli 10a0c: e2 e0 ldi r30, 0x02 ; 2 10a0e: f1 e0 ldi r31, 0x01 ; 1 10a10: 80 81 ld r24, Z 10a12: 88 60 ori r24, 0x08 ; 8 10a14: 80 83 st Z, r24 10a16: 9f bf out 0x3f, r25 ; 63 disable_heater(); 10a18: 0f 94 9e 0e call 0x21d3c ; 0x21d3c // 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"); 10a1c: 86 eb ldi r24, 0xB6 ; 182 10a1e: 94 e7 ldi r25, 0x74 ; 116 10a20: 0e 94 0e 7d call 0xfa1c ; 0xfa1c SERIAL_ECHOPGM("error: "); 10a24: 8e ea ldi r24, 0xAE ; 174 10a26: 94 e7 ldi r25, 0x74 ; 116 10a28: 0e 94 15 7b call 0xf62a ; 0xf62a print((long) c, base); } void MarlinSerial::print(unsigned char b, int base) { print((unsigned long) b, base); 10a2c: 61 2f mov r22, r17 10a2e: 70 e0 ldi r23, 0x00 ; 0 10a30: 90 e0 ldi r25, 0x00 ; 0 10a32: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 10a34: 4a e0 ldi r20, 0x0A ; 10 10a36: 0e 94 16 7a call 0xf42c ; 0xf42c MYSERIAL.print((uint8_t)reason, DEC); SERIAL_ECHOPGM(" 0x"); 10a3a: 8a ea ldi r24, 0xAA ; 170 10a3c: 94 e7 ldi r25, 0x74 ; 116 10a3e: 0e 94 15 7b call 0xf62a ; 0xf62a // we're being called from a live state, so shut off interrupts ... cli(); // sample SP/PC sp = SP; pc = GETPC(); 10a42: 8e 2d mov r24, r14 10a44: b6 01 movw r22, r12 10a46: 90 e0 ldi r25, 0x00 ; 0 10a48: 40 e1 ldi r20, 0x10 ; 16 10a4a: 0e 94 16 7a call 0xf42c ; 0xf42c 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"); 10a4e: 86 ea ldi r24, 0xA6 ; 166 10a50: 94 e7 ldi r25, 0x74 ; 116 10a52: 0e 94 15 7b call 0xf62a ; 0xf62a print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 10a56: be 01 movw r22, r28 10a58: 90 e0 ldi r25, 0x00 ; 0 10a5a: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 10a5c: 40 e1 ldi r20, 0x10 ; 16 10a5e: 0e 94 16 7a call 0xf42c ; 0xf42c } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 10a62: 0e 94 0d 7b call 0xf61a ; 0xf61a MYSERIAL.println(sp, HEX); print_mem(0, RAMEND+1, dcode_mem_t::sram); 10a66: 40 e0 ldi r20, 0x00 ; 0 10a68: 60 e0 ldi r22, 0x00 ; 0 10a6a: 72 e2 ldi r23, 0x22 ; 34 10a6c: 90 e0 ldi r25, 0x00 ; 0 10a6e: 80 e0 ldi r24, 0x00 ; 0 10a70: 0f 94 70 78 call 0x2f0e0 ; 0x2f0e0 SERIAL_ECHOLNRPGM(MSG_OK); 10a74: 80 e9 ldi r24, 0x90 ; 144 10a76: 9a e6 ldi r25, 0x6A ; 106 10a78: 0e 94 0e 7d call 0xfa1c ; 0xfa1c // reset soon softReset(); 10a7c: 0e 94 70 66 call 0xcce0 ; 0xcce0 00010a80 : #endif //EMERGENCY_HANDLERS #endif //WATCHDOG } static inline void crash_and_burn(dump_crash_reason reason) { 10a80: c8 2f mov r28, r24 WRITE(BEEPER, HIGH); 10a82: 9f b7 in r25, 0x3f ; 63 10a84: f8 94 cli 10a86: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 10a8a: 84 60 ori r24, 0x04 ; 4 10a8c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 10a90: 9f bf out 0x3f, r25 ; 63 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 10a92: 6c 2f mov r22, r28 10a94: 83 e0 ldi r24, 0x03 ; 3 10a96: 9d e0 ldi r25, 0x0D ; 13 10a98: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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) 10a9c: 80 91 0f 06 lds r24, 0x060F ; 0x80060f 10aa0: 88 23 and r24, r24 10aa2: 19 f0 breq .+6 ; 0x10aaa serial_dump_and_reset(reason); 10aa4: 8c 2f mov r24, r28 10aa6: 0e 94 f2 84 call 0x109e4 ; 0x109e4 #endif softReset(); 10aaa: 0e 94 70 66 call 0xcce0 ; 0xcce0 00010aae <__vector_default>: crash_and_burn(dump_crash_reason::watchdog); } #endif ISR(BADISR_vect) { 10aae: 1f 92 push r1 10ab0: 0f 92 push r0 10ab2: 0f b6 in r0, 0x3f ; 63 10ab4: 0f 92 push r0 10ab6: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::bad_isr); 10ab8: 83 e0 ldi r24, 0x03 ; 3 10aba: 0e 94 40 85 call 0x10a80 ; 0x10a80 00010abe <__vector_12>: } #ifdef EMERGENCY_HANDLERS #ifdef WATCHDOG ISR(WDT_vect) { 10abe: 1f 92 push r1 10ac0: 0f 92 push r0 10ac2: 0f b6 in r0, 0x3f ; 63 10ac4: 0f 92 push r0 10ac6: 11 24 eor r1, r1 crash_and_burn(dump_crash_reason::watchdog); 10ac8: 82 e0 ldi r24, 0x02 ; 2 10aca: 0e 94 40 85 call 0x10a80 ; 0x10a80 00010ace : } #endif void Config_ResetDefault() { memcpy_P(&cs,&default_conf, sizeof(cs)); 10ace: 41 ed ldi r20, 0xD1 ; 209 10ad0: 50 e0 ldi r21, 0x00 ; 0 10ad2: 65 ed ldi r22, 0xD5 ; 213 10ad4: 73 e7 ldi r23, 0x73 ; 115 10ad6: 87 e6 ldi r24, 0x67 ; 103 10ad8: 9d e0 ldi r25, 0x0D ; 13 10ada: 0f 94 1b a2 call 0x34436 ; 0x34436 // steps per sq second need to be updated to agree with the units per sq second reset_acceleration_rates(); 10ade: 0f 94 32 3a call 0x27464 ; 0x27464 #ifdef PIDTEMP updatePID(); 10ae2: 0f 94 d9 14 call 0x229b2 ; 0x229b2 #endif//PIDTEMP #ifdef THERMAL_MODEL thermal_model_reset_settings(); #endif calculate_extruder_multipliers(); 10ae6: 0e 94 9b 64 call 0xc936 ; 0xc936 SERIAL_ECHO_START; 10aea: 84 ee ldi r24, 0xE4 ; 228 10aec: 92 ea ldi r25, 0xA2 ; 162 10aee: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); 10af2: 83 eb ldi r24, 0xB3 ; 179 10af4: 93 e7 ldi r25, 0x73 ; 115 10af6: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c 00010afa : //! @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)); 10afa: 44 e0 ldi r20, 0x04 ; 4 10afc: 50 e0 ldi r21, 0x00 ; 0 10afe: 64 e1 ldi r22, 0x14 ; 20 10b00: 70 e0 ldi r23, 0x00 ; 0 10b02: 87 e6 ldi r24, 0x67 ; 103 10b04: 9d e0 ldi r25, 0x0D ; 13 10b06: 0f 94 71 a4 call 0x348e2 ; 0x348e2 // SERIAL_ECHOLN("Version: [" << ver << "] Stored version: [" << cs.version << "]"); if (strncmp_P(cs.version, default_conf.version, sizeof(EEPROM_VERSION)) == 0) // version number match 10b0a: 43 e0 ldi r20, 0x03 ; 3 10b0c: 50 e0 ldi r21, 0x00 ; 0 10b0e: 65 ed ldi r22, 0xD5 ; 213 10b10: 73 e7 ldi r23, 0x73 ; 115 10b12: 87 e6 ldi r24, 0x67 ; 103 10b14: 9d e0 ldi r25, 0x0D ; 13 10b16: 0f 94 60 a2 call 0x344c0 ; 0x344c0 10b1a: 89 2b or r24, r25 10b1c: 09 f0 breq .+2 ; 0x10b20 10b1e: 5d c0 rjmp .+186 ; 0x10bda { // 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)); 10b20: e9 e9 ldi r30, 0x99 ; 153 10b22: f4 e7 ldi r31, 0x74 ; 116 10b24: 45 91 lpm r20, Z+ 10b26: 55 91 lpm r21, Z+ 10b28: 65 91 lpm r22, Z+ 10b2a: 74 91 lpm r23, Z 10b2c: 88 ed ldi r24, 0xD8 ; 216 10b2e: 90 e0 ldi r25, 0x00 ; 0 10b30: 0e 94 25 5e call 0xbc4a ; 0xbc4a eeprom_init_default_float(&EEPROM_M500_base->min_mm_per_arc_segment, pgm_read_float(&default_conf.min_mm_per_arc_segment)); 10b34: ed e9 ldi r30, 0x9D ; 157 10b36: f4 e7 ldi r31, 0x74 ; 116 10b38: 45 91 lpm r20, Z+ 10b3a: 55 91 lpm r21, Z+ 10b3c: 65 91 lpm r22, Z+ 10b3e: 74 91 lpm r23, Z 10b40: 8c ed ldi r24, 0xDC ; 220 10b42: 90 e0 ldi r25, 0x00 ; 0 10b44: 0e 94 25 5e call 0xbc4a ; 0xbc4a eeprom_init_default_byte(&EEPROM_M500_base->n_arc_correction, pgm_read_byte(&default_conf.n_arc_correction)); 10b48: e1 ea ldi r30, 0xA1 ; 161 10b4a: f4 e7 ldi r31, 0x74 ; 116 10b4c: 64 91 lpm r22, Z 10b4e: 80 ee ldi r24, 0xE0 ; 224 10b50: 90 e0 ldi r25, 0x00 ; 0 10b52: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_word(&EEPROM_M500_base->min_arc_segments, pgm_read_word(&default_conf.min_arc_segments)); 10b56: e2 ea ldi r30, 0xA2 ; 162 10b58: f4 e7 ldi r31, 0x74 ; 116 10b5a: 65 91 lpm r22, Z+ 10b5c: 74 91 lpm r23, Z 10b5e: 81 ee ldi r24, 0xE1 ; 225 10b60: 90 e0 ldi r25, 0x00 ; 0 10b62: 0e 94 96 78 call 0xf12c ; 0xf12c eeprom_init_default_word(&EEPROM_M500_base->arc_segments_per_sec, pgm_read_word(&default_conf.arc_segments_per_sec)); 10b66: e4 ea ldi r30, 0xA4 ; 164 10b68: f4 e7 ldi r31, 0x74 ; 116 10b6a: 65 91 lpm r22, Z+ 10b6c: 74 91 lpm r23, Z 10b6e: 83 ee ldi r24, 0xE3 ; 227 10b70: 90 e0 ldi r25, 0x00 ; 0 10b72: 0e 94 96 78 call 0xf12c ; 0xf12c // 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)); 10b76: e5 e9 ldi r30, 0x95 ; 149 10b78: f4 e7 ldi r31, 0x74 ; 116 10b7a: 45 91 lpm r20, Z+ 10b7c: 55 91 lpm r21, Z+ 10b7e: 65 91 lpm r22, Z+ 10b80: 74 91 lpm r23, Z 10b82: 84 ed ldi r24, 0xD4 ; 212 10b84: 90 e0 ldi r25, 0x00 ; 0 10b86: 0e 94 25 5e call 0xbc4a ; 0xbc4a // 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); 10b8a: 41 e7 ldi r20, 0x71 ; 113 10b8c: 54 e7 ldi r21, 0x74 ; 116 10b8e: 60 e1 ldi r22, 0x10 ; 16 10b90: 70 e0 ldi r23, 0x00 ; 0 10b92: 80 eb ldi r24, 0xB0 ; 176 10b94: 90 e0 ldi r25, 0x00 ; 0 10b96: 0e 94 77 78 call 0xf0ee ; 0xf0ee 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); 10b9a: 41 e8 ldi r20, 0x81 ; 129 10b9c: 54 e7 ldi r21, 0x74 ; 116 10b9e: 60 e1 ldi r22, 0x10 ; 16 10ba0: 70 e0 ldi r23, 0x00 ; 0 10ba2: 80 ec ldi r24, 0xC0 ; 192 10ba4: 90 e0 ldi r25, 0x00 ; 0 10ba6: 0e 94 77 78 call 0xf0ee ; 0xf0ee #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)); 10baa: 41 ed ldi r20, 0xD1 ; 209 10bac: 50 e0 ldi r21, 0x00 ; 0 10bae: 64 e1 ldi r22, 0x14 ; 20 10bb0: 70 e0 ldi r23, 0x00 ; 0 10bb2: 87 e6 ldi r24, 0x67 ; 103 10bb4: 9d e0 ldi r25, 0x0D ; 13 10bb6: 0f 94 71 a4 call 0x348e2 ; 0x348e2 calculate_extruder_multipliers(); 10bba: 0e 94 9b 64 call 0xc936 ; 0xc936 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(); 10bbe: 0f 94 32 3a call 0x27464 ; 0x27464 // Call updatePID (similar to when we have processed M301) updatePID(); 10bc2: 0f 94 d9 14 call 0x229b2 ; 0x229b2 #ifdef THERMAL_MODEL thermal_model_load_settings(); #endif SERIAL_ECHO_START; 10bc6: 84 ee ldi r24, 0xE4 ; 228 10bc8: 92 ea ldi r25, 0xA2 ; 162 10bca: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNPGM("Stored settings retrieved"); 10bce: 89 e9 ldi r24, 0x99 ; 153 10bd0: 93 e7 ldi r25, 0x73 ; 115 10bd2: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 10bd6: 81 e0 ldi r24, 0x01 ; 1 10bd8: 08 95 ret } else { Config_ResetDefault(); 10bda: 0e 94 67 85 call 0x10ace ; 0x10ace //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))) { 10bde: 64 e0 ldi r22, 0x04 ; 4 10be0: 70 e0 ldi r23, 0x00 ; 0 10be2: 84 e1 ldi r24, 0x14 ; 20 10be4: 90 e0 ldi r25, 0x00 ; 0 10be6: 0e 94 65 56 call 0xacca ; 0xacca 10bea: 91 e0 ldi r25, 0x01 ; 1 10bec: 89 27 eor r24, r25 return false; } } return true; } 10bee: 08 95 ret 00010bf0 : }; void Config_StoreSettings() { strcpy_P(cs.version, default_conf.version); 10bf0: 65 ed ldi r22, 0xD5 ; 213 10bf2: 73 e7 ldi r23, 0x73 ; 115 10bf4: 87 e6 ldi r24, 0x67 ; 103 10bf6: 9d e0 ldi r25, 0x0D ; 13 10bf8: 0f 94 38 a2 call 0x34470 ; 0x34470 #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); 10bfc: 41 ed ldi r20, 0xD1 ; 209 10bfe: 50 e0 ldi r21, 0x00 ; 0 10c00: 64 e1 ldi r22, 0x14 ; 20 10c02: 70 e0 ldi r23, 0x00 ; 0 10c04: 87 e6 ldi r24, 0x67 ; 103 10c06: 9d e0 ldi r25, 0x0D ; 13 10c08: 0f 94 95 a4 call 0x3492a ; 0x3492a 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; 10c0c: 84 ee ldi r24, 0xE4 ; 228 10c0e: 92 ea ldi r25, 0xA2 ; 162 10c10: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNPGM("Settings Stored"); 10c14: 89 e8 ldi r24, 0x89 ; 137 10c16: 93 e7 ldi r25, 0x73 ; 115 10c18: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c 00010c1c : static void printFloat(double, uint8_t); public: static /*FORCE_INLINE*/ void write(const char *str) 10c1c: cf 93 push r28 10c1e: df 93 push r29 10c20: ec 01 movw r28, r24 { while (*str) 10c22: 89 91 ld r24, Y+ 10c24: 88 23 and r24, r24 10c26: 19 f0 breq .+6 ; 0x10c2e write(*str++); 10c28: 0e 94 02 7a call 0xf404 ; 0xf404 10c2c: fa cf rjmp .-12 ; 0x10c22 } 10c2e: df 91 pop r29 10c30: cf 91 pop r28 10c32: 08 95 ret 00010c34 : } }*/ static FORCE_INLINE void print(const char *str) { write(str); 10c34: 0e 94 0e 86 call 0x10c1c ; 0x10c1c }*/ void MarlinSerial::println(const char c[]) { print(c); println(); 10c38: 0c 94 0d 7b jmp 0xf61a ; 0xf61a 00010c3c : { cmdbuffer_front_already_processed = true; } void get_command() { 10c3c: 2f 92 push r2 10c3e: 3f 92 push r3 10c40: 4f 92 push r4 10c42: 5f 92 push r5 10c44: 6f 92 push r6 10c46: 7f 92 push r7 10c48: 8f 92 push r8 10c4a: 9f 92 push r9 10c4c: af 92 push r10 10c4e: bf 92 push r11 10c50: cf 92 push r12 10c52: df 92 push r13 10c54: ef 92 push r14 10c56: ff 92 push r15 10c58: 0f 93 push r16 10c5a: 1f 93 push r17 10c5c: cf 93 push r28 10c5e: df 93 push r29 10c60: cd b7 in r28, 0x3d ; 61 10c62: de b7 in r29, 0x3e ; 62 10c64: a0 97 sbiw r28, 0x20 ; 32 10c66: 0f b6 in r0, 0x3f ; 63 10c68: f8 94 cli 10c6a: de bf out 0x3e, r29 ; 62 10c6c: 0f be out 0x3f, r0 ; 63 10c6e: cd bf out 0x3d, r28 ; 61 // Test and reserve space for the new command string. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE - 1)) 10c70: 8f e5 ldi r24, 0x5F ; 95 10c72: 90 e0 ldi r25, 0x00 ; 0 10c74: 0e 94 ef 55 call 0xabde ; 0xabde 10c78: 88 23 and r24, r24 10c7a: 09 f4 brne .+2 ; 0x10c7e 10c7c: a1 c0 rjmp .+322 ; 0x10dc0 return; if (MYSERIAL.available() == RX_BUFFER_SIZE - 1) { //compare number of chars buffered in rx buffer with rx buffer size 10c7e: 0e 94 87 55 call 0xab0e ; 0xab0e 10c82: 8f 37 cpi r24, 0x7F ; 127 10c84: 91 05 cpc r25, r1 10c86: 61 f4 brne .+24 ; 0x10ca0 // 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; 10c88: 80 91 44 05 lds r24, 0x0544 ; 0x800544 10c8c: 90 91 45 05 lds r25, 0x0545 ; 0x800545 10c90: 90 93 43 05 sts 0x0543, r25 ; 0x800543 10c94: 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 10c98: 8a e7 ldi r24, 0x7A ; 122 10c9a: 93 e7 ldi r25, 0x73 ; 115 10c9c: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 10ca0: 6e 01 movw r12, r28 10ca2: 4f e1 ldi r20, 0x1F ; 31 10ca4: c4 0e add r12, r20 10ca6: 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; 10ca8: 99 24 eor r9, r9 10caa: 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 10cac: 0e 94 87 55 call 0xab0e ; 0xab0e 10cb0: 18 16 cp r1, r24 10cb2: 19 06 cpc r1, r25 10cb4: 0c f0 brlt .+2 ; 0x10cb8 10cb6: 78 c0 rjmp .+240 ; 0x10da8 10cb8: 80 91 73 12 lds r24, 0x1273 ; 0x801273 10cbc: 88 23 and r24, r24 10cbe: 29 f0 breq .+10 ; 0x10cca 10cc0: 0e 94 86 66 call 0xcd0c ; 0xcd0c 10cc4: 88 23 and r24, r24 10cc6: 09 f4 brne .+2 ; 0x10cca 10cc8: 6f c0 rjmp .+222 ; 0x10da8 10cca: 80 91 93 03 lds r24, 0x0393 ; 0x800393 10cce: 81 11 cpse r24, r1 10cd0: 6b c0 rjmp .+214 ; 0x10da8 } 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) { 10cd2: 20 91 44 05 lds r18, 0x0544 ; 0x800544 10cd6: 30 91 45 05 lds r19, 0x0545 ; 0x800545 10cda: 80 91 42 05 lds r24, 0x0542 ; 0x800542 10cde: 90 91 43 05 lds r25, 0x0543 ; 0x800543 10ce2: 82 17 cp r24, r18 10ce4: 93 07 cpc r25, r19 10ce6: 11 f3 breq .-60 ; 0x10cac return -1; } else { unsigned char c = rx_buffer.buffer[rx_buffer.tail]; 10ce8: f9 01 movw r30, r18 10cea: ee 53 subi r30, 0x3E ; 62 10cec: fb 4f sbci r31, 0xFB ; 251 10cee: 80 81 ld r24, Z rx_buffer.tail = (unsigned int)(rx_buffer.tail + 1) % RX_BUFFER_SIZE; 10cf0: 2f 5f subi r18, 0xFF ; 255 10cf2: 3f 4f sbci r19, 0xFF ; 255 10cf4: 2f 77 andi r18, 0x7F ; 127 10cf6: 33 27 eor r19, r19 10cf8: 30 93 45 05 sts 0x0545, r19 ; 0x800545 10cfc: 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)) { 10d00: 8f 3f cpi r24, 0xFF ; 255 10d02: 09 f0 breq .+2 ; 0x10d06 10d04: 79 c0 rjmp .+242 ; 0x10df8 if (mp_cmd_count > 0) { 10d06: 80 91 19 03 lds r24, 0x0319 ; 0x800319 10d0a: 88 23 and r24, r24 10d0c: 09 f4 brne .+2 ; 0x10d10 10d0e: 71 c0 rjmp .+226 ; 0x10df2 mp_cmd_active = 1; 10d10: 90 92 18 03 sts 0x0318, r9 ; 0x800318 mp_cmd_count = 0; 10d14: 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}; 10d18: 1f 8e std Y+31, r1 ; 0x1f 10d1a: 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) { 10d1c: 80 90 1c 03 lds r8, 0x031C ; 0x80031c 10d20: 88 20 and r8, r8 10d22: 21 f2 breq .-120 ; 0x10cac 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]; 10d24: 80 91 1a 03 lds r24, 0x031A ; 0x80031a 10d28: 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) 10d2a: f1 e0 ldi r31, 0x01 ; 1 10d2c: f8 15 cp r31, r8 10d2e: 18 f4 brcc .+6 ; 0x10d36 out[i] = (char)mp_char_out_buf[i]; 10d30: 80 91 1b 03 lds r24, 0x031B ; 0x80031b 10d34: 88 a3 std Y+32, r24 ; 0x20 mp_char_out_count = 0; 10d36: 10 92 1c 03 sts 0x031C, r1 ; 0x80031c 10d3a: 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]; 10d3c: 82 2d mov r24, r2 10d3e: 8c 19 sub r24, r12 10d40: 88 15 cp r24, r8 10d42: 08 f0 brcs .+2 ; 0x10d46 10d44: b3 cf rjmp .-154 ; 0x10cac 10d46: f1 01 movw r30, r2 10d48: 11 91 ld r17, Z+ 10d4a: 1f 01 movw r2, r30 #else char serial_char = MYSERIAL.read(); #endif serialTimeoutTimer.start(); 10d4c: 8f e1 ldi r24, 0x1F ; 31 10d4e: 93 e0 ldi r25, 0x03 ; 3 10d50: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> if (serial_char < 0) 10d54: 17 fd sbrc r17, 7 10d56: f2 cf rjmp .-28 ; 0x10d3c 10d58: 80 91 47 10 lds r24, 0x1047 ; 0x801047 10d5c: 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' || 10d60: 1a 30 cpi r17, 0x0A ; 10 10d62: 09 f4 brne .+2 ; 0x10d66 10d64: 4b c1 rjmp .+662 ; 0x10ffc 10d66: 1d 30 cpi r17, 0x0D ; 13 10d68: 09 f4 brne .+2 ; 0x10d6c 10d6a: 48 c1 rjmp .+656 ; 0x10ffc serial_char == '\r' || 10d6c: 8f 35 cpi r24, 0x5F ; 95 10d6e: 91 05 cpc r25, r1 10d70: 0c f0 brlt .+2 ; 0x10d74 10d72: 49 c1 rjmp .+658 ; 0x11006 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; 10d74: 1b 33 cpi r17, 0x3B ; 59 10d76: 11 f4 brne .+4 ; 0x10d7c 10d78: 90 92 1e 03 sts 0x031E, r9 ; 0x80031e if(!comment_mode) cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 10d7c: 20 91 1e 03 lds r18, 0x031E ; 0x80031e 10d80: 21 11 cpse r18, r1 10d82: dc cf rjmp .-72 ; 0x10d3c 10d84: 9c 01 movw r18, r24 10d86: 2f 5f subi r18, 0xFF ; 255 10d88: 3f 4f sbci r19, 0xFF ; 255 10d8a: 30 93 48 10 sts 0x1048, r19 ; 0x801048 10d8e: 20 93 47 10 sts 0x1047, r18 ; 0x801047 10d92: 20 91 49 10 lds r18, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> 10d96: 30 91 4a 10 lds r19, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 10d9a: 25 5b subi r18, 0xB5 ; 181 10d9c: 3f 4e sbci r19, 0xEF ; 239 10d9e: 82 0f add r24, r18 10da0: 93 1f adc r25, r19 10da2: fc 01 movw r30, r24 10da4: 13 83 std Z+3, r17 ; 0x03 10da6: ca cf rjmp .-108 ; 0x10d3c #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 10da8: 80 91 47 10 lds r24, 0x1047 ; 0x801047 10dac: 90 91 48 10 lds r25, 0x1048 ; 0x801048 10db0: 18 16 cp r1, r24 10db2: 19 06 cpc r1, r25 10db4: 0c f4 brge .+2 ; 0x10db8 10db6: 51 c2 rjmp .+1186 ; 0x1125a SERIAL_ECHOLNPGM("RX timeout"); return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 10db8: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 10dbc: 81 11 cpse r24, r1 10dbe: 67 c2 rjmp .+1230 ; 0x1128e prusa_statistics(6); } } #endif //SDSUPPORT } 10dc0: a0 96 adiw r28, 0x20 ; 32 10dc2: 0f b6 in r0, 0x3f ; 63 10dc4: f8 94 cli 10dc6: de bf out 0x3e, r29 ; 62 10dc8: 0f be out 0x3f, r0 ; 63 10dca: cd bf out 0x3d, r28 ; 61 10dcc: df 91 pop r29 10dce: cf 91 pop r28 10dd0: 1f 91 pop r17 10dd2: 0f 91 pop r16 10dd4: ff 90 pop r15 10dd6: ef 90 pop r14 10dd8: df 90 pop r13 10dda: cf 90 pop r12 10ddc: bf 90 pop r11 10dde: af 90 pop r10 10de0: 9f 90 pop r9 10de2: 8f 90 pop r8 10de4: 7f 90 pop r7 10de6: 6f 90 pop r6 10de8: 5f 90 pop r5 10dea: 4f 90 pop r4 10dec: 3f 90 pop r3 10dee: 2f 90 pop r2 10df0: 08 95 ret if (mp_cmd_count > 0) { mp_cmd_active = 1; mp_cmd_count = 0; } else ++mp_cmd_count; 10df2: 90 92 19 03 sts 0x0319, r9 ; 0x800319 10df6: 90 cf rjmp .-224 ; 0x10d18 return; } if (mp_cmd_active > 0) { 10df8: 90 91 18 03 lds r25, 0x0318 ; 0x800318 10dfc: 99 23 and r25, r25 10dfe: 09 f4 brne .+2 ; 0x10e02 10e00: 58 c0 rjmp .+176 ; 0x10eb2 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10e02: 89 3f cpi r24, 0xF9 ; 249 10e04: e9 f1 breq .+122 ; 0x10e80 10e06: 70 f5 brcc .+92 ; 0x10e64 10e08: 86 3f cpi r24, 0xF6 ; 246 10e0a: 09 f4 brne .+2 ; 0x10e0e 10e0c: 4a c0 rjmp .+148 ; 0x10ea2 10e0e: 87 3f cpi r24, 0xF7 ; 247 10e10: 09 f4 brne .+2 ; 0x10e14 10e12: 43 c0 rjmp .+134 ; 0x10e9a 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. 10e14: 85 e4 ldi r24, 0x45 ; 69 10e16: 93 e7 ldi r25, 0x73 ; 115 10e18: 0e 94 15 7b call 0xf62a ; 0xf62a // 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); 10e1c: 80 e4 ldi r24, 0x40 ; 64 10e1e: 93 e7 ldi r25, 0x73 ; 115 10e20: 0e 94 15 7b call 0xf62a ; 0xf62a // Echo current state if (mp_config & MPConfig_Active) 10e24: 10 91 17 03 lds r17, 0x0317 ; 0x800317 SERIAL_ECHOPGM(" ON"); 10e28: 8c e3 ldi r24, 0x3C ; 60 10e2a: 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) 10e2c: 10 fd sbrc r17, 0 10e2e: 02 c0 rjmp .+4 ; 0x10e34 SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); 10e30: 87 e3 ldi r24, 0x37 ; 55 10e32: 93 e7 ldi r25, 0x73 ; 115 10e34: 0e 94 15 7b call 0xf62a ; 0xf62a if (mp_config & MPConfig_NoSpaces) 10e38: 01 2f mov r16, r17 10e3a: 02 70 andi r16, 0x02 ; 2 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces 10e3c: 82 e3 ldi r24, 0x32 ; 50 10e3e: 93 e7 ldi r25, 0x73 ; 115 if (mp_config & MPConfig_Active) SERIAL_ECHOPGM(" ON"); else SERIAL_ECHOPGM(" OFF"); if (mp_config & MPConfig_NoSpaces) 10e40: 11 fd sbrc r17, 1 10e42: 02 c0 rjmp .+4 ; 0x10e48 SERIAL_ECHOPGM(" NSP"); // [N]o [SP]aces else SERIAL_ECHOPGM(" ESP"); // [E]nabled [SP]aces 10e44: 8d e2 ldi r24, 0x2D ; 45 10e46: 93 e7 ldi r25, 0x73 ; 115 10e48: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNPGM(""); 10e4c: 8c e2 ldi r24, 0x2C ; 44 10e4e: 93 e7 ldi r25, 0x73 ; 115 10e50: 0e 94 0e 7d call 0xfa1c ; 0xfa1c // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) 10e54: 00 23 and r16, r16 10e56: 49 f1 breq .+82 ; 0x10eaa MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); 10e58: 85 e4 ldi r24, 0x45 ; 69 10e5a: 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; 10e5e: 10 92 18 03 sts 0x0318, r1 ; 0x800318 10e62: 5a cf rjmp .-332 ; 0x10d18 } //========================================================================== void FORCE_INLINE mp_handle_cmd(const MeatPack_Command c) { switch (c) { 10e64: 8a 3f cpi r24, 0xFA ; 250 10e66: 41 f0 breq .+16 ; 0x10e78 10e68: 8b 3f cpi r24, 0xFB ; 251 10e6a: a1 f6 brne .-88 ; 0x10e14 case MPCommand_EnablePacking: { mp_config |= MPConfig_Active; 10e6c: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10e70: 81 60 ori r24, 0x01 ; 1 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10e72: 80 93 17 03 sts 0x0317, r24 ; 0x800317 10e76: ce cf rjmp .-100 ; 0x10e14 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL REC"); #endif } break; case MPCommand_DisablePacking: { mp_config &= ~(MPConfig_Active); 10e78: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10e7c: 8e 7f andi r24, 0xFE ; 254 10e7e: f9 cf rjmp .-14 ; 0x10e72 return out; } //============================================================================== void FORCE_INLINE mp_reset_state() { mp_char_out_count = 0; 10e80: 10 92 1c 03 sts 0x031C, r1 ; 0x80031c mp_cmd_active = MPCommand_None; 10e84: 10 92 18 03 sts 0x0318, r1 ; 0x800318 mp_config = MPConfig_None; 10e88: 10 92 17 03 sts 0x0317, r1 ; 0x800317 mp_char_buf = 0; 10e8c: 10 92 16 03 sts 0x0316, r1 ; 0x800316 mp_cmd_count = 0; 10e90: 10 92 19 03 sts 0x0319, r1 ; 0x800319 mp_cmd_active = 0; mp_full_char_queue = 0; 10e94: 10 92 15 03 sts 0x0315, r1 ; 0x800315 10e98: bd cf rjmp .-134 ; 0x10e14 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] RESET REC"); #endif } break; case MPCommand_EnableNoSpaces: { mp_config |= MPConfig_NoSpaces; 10e9a: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10e9e: 82 60 ori r24, 0x02 ; 2 10ea0: e8 cf rjmp .-48 ; 0x10e72 #ifdef MP_DEBUG SERIAL_ECHOLNPGM("[MPDBG] ENABL NSP"); #endif } break; case MPCommand_DisableNoSpaces: { mp_config &= ~(MPConfig_NoSpaces); 10ea2: 80 91 17 03 lds r24, 0x0317 ; 0x800317 10ea6: 8d 7f andi r24, 0xFD ; 253 10ea8: e4 cf rjmp .-56 ; 0x10e72 // Validate config vars #ifdef USE_LOOKUP_TABLE if (mp_config & MPConfig_NoSpaces) MeatPackLookupTbl[MeatPack_SpaceCharIdx] = (uint8_t)(MeatPack_SpaceCharReplace); else MeatPackLookupTbl[MeatPack_SpaceCharIdx] = ' '; 10eaa: 90 e2 ldi r25, 0x20 ; 32 10eac: 90 93 0b 02 sts 0x020B, r25 ; 0x80020b <__DATA_REGION_ORIGIN__+0xb> 10eb0: d6 cf rjmp .-84 ; 0x10e5e mp_handle_cmd((MeatPack_Command)c); mp_cmd_active = 0; return; } if (mp_cmd_count > 0) { 10eb2: 90 91 19 03 lds r25, 0x0319 ; 0x800319 10eb6: 30 91 17 03 lds r19, 0x0317 ; 0x800317 10eba: 99 23 and r25, r25 10ebc: 31 f1 breq .+76 ; 0x10f0a 10ebe: 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) { 10ec2: 30 ff sbrs r19, 0 10ec4: 49 c0 rjmp .+146 ; 0x10f58 if (mp_full_char_queue > 0) { 10ec6: 20 91 15 03 lds r18, 0x0315 ; 0x800315 10eca: 22 23 and r18, r18 10ecc: 09 f4 brne .+2 ; 0x10ed0 10ece: 40 c0 rjmp .+128 ; 0x10f50 #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; 10ed0: 91 e0 ldi r25, 0x01 ; 1 10ed2: 9e 0f add r25, r30 10ed4: 90 93 1c 03 sts 0x031C, r25 ; 0x80031c 10ed8: ae 2f mov r26, r30 10eda: b0 e0 ldi r27, 0x00 ; 0 10edc: a6 5e subi r26, 0xE6 ; 230 10ede: bc 4f sbci r27, 0xFC ; 252 10ee0: ff ef ldi r31, 0xFF ; 255 10ee2: 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) { 10ee4: 40 91 16 03 lds r20, 0x0316 ; 0x800316 10ee8: 44 23 and r20, r20 10eea: 51 f0 breq .+20 ; 0x10f00 #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; 10eec: ee 5f subi r30, 0xFE ; 254 10eee: e0 93 1c 03 sts 0x031C, r30 ; 0x80031c 10ef2: e9 2f mov r30, r25 10ef4: f0 e0 ldi r31, 0x00 ; 0 10ef6: e6 5e subi r30, 0xE6 ; 230 10ef8: fc 4f sbci r31, 0xFC ; 252 10efa: 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; 10efc: 10 92 16 03 sts 0x0316, r1 ; 0x800316 } --mp_full_char_queue; 10f00: 21 50 subi r18, 0x01 ; 1 10f02: 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; 10f06: 10 92 19 03 sts 0x0319, r1 ; 0x800319 10f0a: 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) { 10f0e: 30 ff sbrs r19, 0 10f10: 6c c0 rjmp .+216 ; 0x10fea if (mp_full_char_queue > 0) { 10f12: 90 91 15 03 lds r25, 0x0315 ; 0x800315 10f16: 99 23 and r25, r25 10f18: 49 f1 breq .+82 ; 0x10f6c #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; 10f1a: 21 e0 ldi r18, 0x01 ; 1 10f1c: 2e 0f add r18, r30 10f1e: 20 93 1c 03 sts 0x031C, r18 ; 0x80031c 10f22: ae 2f mov r26, r30 10f24: b0 e0 ldi r27, 0x00 ; 0 10f26: a6 5e subi r26, 0xE6 ; 230 10f28: bc 4f sbci r27, 0xFC ; 252 10f2a: 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) { 10f2c: 80 91 16 03 lds r24, 0x0316 ; 0x800316 10f30: 88 23 and r24, r24 10f32: 51 f0 breq .+20 ; 0x10f48 #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; 10f34: ee 5f subi r30, 0xFE ; 254 10f36: e0 93 1c 03 sts 0x031C, r30 ; 0x80031c 10f3a: e2 2f mov r30, r18 10f3c: f0 e0 ldi r31, 0x00 ; 0 10f3e: e6 5e subi r30, 0xE6 ; 230 10f40: fc 4f sbci r31, 0xFC ; 252 10f42: 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; 10f44: 10 92 16 03 sts 0x0316, r1 ; 0x800316 } --mp_full_char_queue; 10f48: 91 50 subi r25, 0x01 ; 1 10f4a: 90 93 15 03 sts 0x0315, r25 ; 0x800315 10f4e: e4 ce rjmp .-568 ; 0x10d18 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; 10f50: 42 e0 ldi r20, 0x02 ; 2 10f52: 40 93 15 03 sts 0x0315, r20 ; 0x800315 10f56: d7 cf rjmp .-82 ; 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; 10f58: 91 e0 ldi r25, 0x01 ; 1 10f5a: 9e 0f add r25, r30 10f5c: 90 93 1c 03 sts 0x031C, r25 ; 0x80031c 10f60: f0 e0 ldi r31, 0x00 ; 0 10f62: e6 5e subi r30, 0xE6 ; 230 10f64: fc 4f sbci r31, 0xFC ; 252 10f66: 9f ef ldi r25, 0xFF ; 255 10f68: 90 83 st Z, r25 10f6a: cd cf rjmp .-102 ; 0x10f06 10f6c: a8 2f mov r26, r24 10f6e: af 70 andi r26, 0x0F ; 15 mp_char_buf = 0; } --mp_full_char_queue; } else { uint8_t buf[2] = { 0,0 }; 10f70: 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; 10f72: 21 e0 ldi r18, 0x01 ; 1 10f74: af 30 cpi r26, 0x0F ; 15 10f76: 29 f0 breq .+10 ; 0x10f82 10f78: b0 e0 ldi r27, 0x00 ; 0 else chars_out[0] = MeatPackLookupTbl[(pk & 0xF)]; // Assign lower char 10f7a: a0 50 subi r26, 0x00 ; 0 10f7c: be 4f sbci r27, 0xFE ; 254 10f7e: 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; 10f80: 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; 10f82: 48 2f mov r20, r24 10f84: 40 7f andi r20, 0xF0 ; 240 10f86: 40 3f cpi r20, 0xF0 ; 240 10f88: 59 f4 brne .+22 ; 0x10fa0 10f8a: 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) { 10f8c: 20 ff sbrs r18, 0 10f8e: 13 c0 rjmp .+38 ; 0x10fb6 ++mp_full_char_queue; 10f90: 90 92 15 03 sts 0x0315, r9 ; 0x800315 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10f94: 21 ff sbrs r18, 1 10f96: 0c c0 rjmp .+24 ; 0x10fb0 10f98: e2 e0 ldi r30, 0x02 ; 2 10f9a: e0 93 15 03 sts 0x0315, r30 ; 0x800315 10f9e: bc ce rjmp .-648 ; 0x10d18 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 10fa0: 82 95 swap r24 10fa2: 8f 70 andi r24, 0x0F ; 15 10fa4: a8 2f mov r26, r24 10fa6: b0 e0 ldi r27, 0x00 ; 0 10fa8: a0 50 subi r26, 0x00 ; 0 10faa: be 4f sbci r27, 0xFE ; 254 10fac: 9c 91 ld r25, X 10fae: ee cf rjmp .-36 ; 0x10f8c 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]; 10fb0: 90 93 16 03 sts 0x0316, r25 ; 0x800316 10fb4: b1 ce rjmp .-670 ; 0x10d18 #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; 10fb6: 81 e0 ldi r24, 0x01 ; 1 10fb8: 8e 0f add r24, r30 10fba: 80 93 1c 03 sts 0x031C, r24 ; 0x80031c 10fbe: ae 2f mov r26, r30 10fc0: b0 e0 ldi r27, 0x00 ; 0 10fc2: a6 5e subi r26, 0xE6 ; 230 10fc4: bc 4f sbci r27, 0xFC ; 252 10fc6: 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') { 10fc8: 3a 30 cpi r19, 0x0A ; 10 10fca: 09 f4 brne .+2 ; 0x10fce 10fcc: a5 ce rjmp .-694 ; 0x10d18 if (res & MeatPack_NextPackedSecond) ++mp_full_char_queue; 10fce: 21 ff sbrs r18, 1 10fd0: 03 c0 rjmp .+6 ; 0x10fd8 10fd2: 90 92 15 03 sts 0x0315, r9 ; 0x800315 10fd6: a0 ce rjmp .-704 ; 0x10d18 #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; 10fd8: ee 5f subi r30, 0xFE ; 254 10fda: e0 93 1c 03 sts 0x031C, r30 ; 0x80031c 10fde: e8 2f mov r30, r24 10fe0: f0 e0 ldi r31, 0x00 ; 0 10fe2: e6 5e subi r30, 0xE6 ; 230 10fe4: fc 4f sbci r31, 0xFC ; 252 10fe6: 90 83 st Z, r25 10fe8: 97 ce rjmp .-722 ; 0x10d18 10fea: 91 e0 ldi r25, 0x01 ; 1 10fec: 9e 0f add r25, r30 10fee: 90 93 1c 03 sts 0x031C, r25 ; 0x80031c 10ff2: f0 e0 ldi r31, 0x00 ; 0 10ff4: e6 5e subi r30, 0xE6 ; 230 10ff6: fc 4f sbci r31, 0xFC ; 252 10ff8: 80 83 st Z, r24 10ffa: 8e ce rjmp .-740 ; 0x10d18 continue; if(serial_char == '\n' || serial_char == '\r' || serial_count >= (MAX_CMD_SIZE - 1) ) { if(!serial_count) { //if empty line 10ffc: 00 97 sbiw r24, 0x00 ; 0 10ffe: 19 f4 brne .+6 ; 0x11006 comment_mode = false; //for new command 11000: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e 11004: dd ce rjmp .-582 ; 0x10dc0 11006: 00 91 49 10 lds r16, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> 1100a: 10 91 4a 10 lds r17, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> return; } cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; // terminate string 1100e: 02 5b subi r16, 0xB2 ; 178 11010: 1f 4e sbci r17, 0xEF ; 239 11012: 80 0f add r24, r16 11014: 91 1f adc r25, r17 11016: fc 01 movw r30, r24 11018: 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) 1101a: 1a 83 std Y+2, r17 ; 0x02 1101c: 09 83 std Y+1, r16 ; 0x01 if(!comment_mode){ 1101e: 80 91 1e 03 lds r24, 0x031E ; 0x80031e 11022: 81 11 cpse r24, r1 11024: fd c0 rjmp .+506 ; 0x11220 long gcode_N = -1; // seen line number // Line numbers must be first in buffer if (*cmd_head == 'N') { 11026: f8 01 movw r30, r16 11028: 80 81 ld r24, Z 1102a: 8e 34 cpi r24, 0x4E ; 78 1102c: 09 f0 breq .+2 ; 0x11030 1102e: 84 c0 rjmp .+264 ; 0x11138 // Line number met: decode the number, then move cmd_start past all spaces. gcode_N = (strtol(cmd_head+1, &cmd_start, 10)); 11030: 4a e0 ldi r20, 0x0A ; 10 11032: 50 e0 ldi r21, 0x00 ; 0 11034: be 01 movw r22, r28 11036: 6f 5f subi r22, 0xFF ; 255 11038: 7f 4f sbci r23, 0xFF ; 255 1103a: c8 01 movw r24, r16 1103c: 01 96 adiw r24, 0x01 ; 1 1103e: 0f 94 0c a0 call 0x34018 ; 0x34018 11042: 2b 01 movw r4, r22 11044: 3c 01 movw r6, r24 while (*cmd_start == ' ') ++cmd_start; 11046: e9 80 ldd r14, Y+1 ; 0x01 11048: fa 80 ldd r15, Y+2 ; 0x02 1104a: f7 01 movw r30, r14 1104c: 80 81 ld r24, Z 1104e: 80 32 cpi r24, 0x20 ; 32 11050: 31 f4 brne .+12 ; 0x1105e 11052: ff ef ldi r31, 0xFF ; 255 11054: ef 1a sub r14, r31 11056: ff 0a sbc r15, r31 11058: fa 82 std Y+2, r15 ; 0x02 1105a: e9 82 std Y+1, r14 ; 0x01 1105c: f4 cf rjmp .-24 ; 0x11046 // 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)) { 1105e: 80 91 3e 12 lds r24, 0x123E ; 0x80123e 11062: 90 91 3f 12 lds r25, 0x123F ; 0x80123f 11066: a0 91 40 12 lds r26, 0x1240 ; 0x801240 1106a: b0 91 41 12 lds r27, 0x1241 ; 0x801241 1106e: 01 96 adiw r24, 0x01 ; 1 11070: a1 1d adc r26, r1 11072: b1 1d adc r27, r1 11074: 84 15 cp r24, r4 11076: 95 05 cpc r25, r5 11078: a6 05 cpc r26, r6 1107a: b7 05 cpc r27, r7 1107c: 49 f0 breq .+18 ; 0x11090 1107e: 44 e0 ldi r20, 0x04 ; 4 11080: 50 e0 ldi r21, 0x00 ; 0 11082: 65 e7 ldi r22, 0x75 ; 117 11084: 73 e7 ldi r23, 0x73 ; 115 11086: c7 01 movw r24, r14 11088: 0f 94 60 a2 call 0x344c0 ; 0x344c0 1108c: 89 2b or r24, r25 1108e: a1 f4 brne .+40 ; 0x110b8 FlushSerialRequestResend(); serial_count = 0; return; } if((strchr_pointer = strchr(cmd_start, '*')) != NULL) 11090: 6a e2 ldi r22, 0x2A ; 42 11092: 70 e0 ldi r23, 0x00 ; 0 11094: c7 01 movw r24, r14 11096: 0f 94 d8 aa call 0x355b0 ; 0x355b0 1109a: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 1109e: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb 110a2: 00 97 sbiw r24, 0x00 ; 0 110a4: 09 f4 brne .+2 ; 0x110a8 110a6: 41 c0 rjmp .+130 ; 0x1112a 110a8: f8 01 movw r30, r16 { byte checksum = 0; 110aa: f1 2c mov r15, r1 char *p = cmd_head; while (p != strchr_pointer) 110ac: 8e 17 cp r24, r30 110ae: 9f 07 cpc r25, r31 110b0: f1 f0 breq .+60 ; 0x110ee checksum = checksum^(*p++); 110b2: 21 91 ld r18, Z+ 110b4: f2 26 eor r15, r18 110b6: fa cf rjmp .-12 ; 0x110ac 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; 110b8: 87 ec ldi r24, 0xC7 ; 199 110ba: 92 ea ldi r25, 0xA2 ; 162 110bc: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORRPGM(_n("Line Number is not Last Line Number+1, Last Line: "));////MSG_ERR_LINE_NO 110c0: 82 ef ldi r24, 0xF2 ; 242 110c2: 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 110c4: 0e 94 15 7b call 0xf62a ; 0xf62a 110c8: 60 91 3e 12 lds r22, 0x123E ; 0x80123e 110cc: 70 91 3f 12 lds r23, 0x123F ; 0x80123f 110d0: 80 91 40 12 lds r24, 0x1240 ; 0x801240 110d4: 90 91 41 12 lds r25, 0x1241 ; 0x801241 110d8: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 } void MarlinSerial::println(long n, int base) { print(n, base); println(); 110dc: 0e 94 0d 7b call 0xf61a ; 0xf61a SERIAL_ERRORLN(gcode_LastN); FlushSerialRequestResend(); 110e0: 0e 94 37 56 call 0xac6e ; 0xac6e serial_count = 0; 110e4: 10 92 48 10 sts 0x1048, r1 ; 0x801048 110e8: 10 92 47 10 sts 0x1047, r1 ; 0x801047 110ec: 69 ce rjmp .-814 ; 0x10dc0 { byte checksum = 0; char *p = cmd_head; while (p != strchr_pointer) checksum = checksum^(*p++); if (code_value_short() != (int16_t)checksum) { 110ee: 0e 94 a2 56 call 0xad44 ; 0xad44 110f2: f8 16 cp r15, r24 110f4: 19 06 cpc r1, r25 110f6: 39 f0 breq .+14 ; 0x11106 SERIAL_ERROR_START; 110f8: 87 ec ldi r24, 0xC7 ; 199 110fa: 92 ea ldi r25, 0xA2 ; 162 110fc: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORRPGM(_n("checksum mismatch, Last Line: "));////MSG_ERR_CHECKSUM_MISMATCH 11100: 83 ed ldi r24, 0xD3 ; 211 11102: 93 e6 ldi r25, 0x63 ; 99 11104: df cf rjmp .-66 ; 0x110c4 FlushSerialRequestResend(); serial_count = 0; return; } // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; 11106: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 1110a: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 1110e: 10 82 st Z, r1 return; } } // Handle KILL early, even when Stopped if(strcmp_P(cmd_start, PSTR("M112")) == 0) 11110: e9 80 ldd r14, Y+1 ; 0x01 11112: fa 80 ldd r15, Y+2 ; 0x02 11114: 60 e7 ldi r22, 0x70 ; 112 11116: 73 e7 ldi r23, 0x73 ; 115 11118: c7 01 movw r24, r14 1111a: 0f 94 2f a2 call 0x3445e ; 0x3445e 1111e: 89 2b or r24, r25 11120: 39 f5 brne .+78 ; 0x11170 kill(MSG_M112_KILL); 11122: 89 e3 ldi r24, 0x39 ; 57 11124: 96 e6 ldi r25, 0x66 ; 102 11126: 0e 94 74 83 call 0x106e8 ; 0x106e8 // If no errors, remove the checksum and continue parsing. *strchr_pointer = 0; } else { SERIAL_ERROR_START; 1112a: 87 ec ldi r24, 0xC7 ; 199 1112c: 92 ea ldi r25, 0xA2 ; 162 1112e: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORRPGM(_n("No Checksum with line number, Last Line: "));////MSG_ERR_NO_CHECKSUM 11132: 89 ea ldi r24, 0xA9 ; 169 11134: 93 e6 ldi r25, 0x63 ; 99 11136: c6 cf rjmp .-116 ; 0x110c4 } } else { // move cmd_start past all spaces while (*cmd_start == ' ') ++cmd_start; 11138: 89 81 ldd r24, Y+1 ; 0x01 1113a: 9a 81 ldd r25, Y+2 ; 0x02 1113c: fc 01 movw r30, r24 1113e: 20 81 ld r18, Z 11140: 20 32 cpi r18, 0x20 ; 32 11142: 21 f4 brne .+8 ; 0x1114c 11144: 01 96 adiw r24, 0x01 ; 1 11146: 9a 83 std Y+2, r25 ; 0x02 11148: 89 83 std Y+1, r24 ; 0x01 1114a: f6 cf rjmp .-20 ; 0x11138 // if we didn't receive 'N' but still see '*' if (strchr(cmd_start, '*') != NULL) 1114c: 6a e2 ldi r22, 0x2A ; 42 1114e: 70 e0 ldi r23, 0x00 ; 0 11150: 0f 94 d8 aa call 0x355b0 ; 0x355b0 11154: 89 2b or r24, r25 11156: 39 f0 breq .+14 ; 0x11166 { SERIAL_ERROR_START; 11158: 87 ec ldi r24, 0xC7 ; 199 1115a: 92 ea ldi r25, 0xA2 ; 162 1115c: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORRPGM(_n("No Line Number with checksum, Last Line: "));////MSG_ERR_NO_LINENUMBER_WITH_CHECKSUM 11160: 8f e7 ldi r24, 0x7F ; 127 11162: 93 e6 ldi r25, 0x63 ; 99 11164: af cf rjmp .-162 ; 0x110c4 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 11166: 44 24 eor r4, r4 11168: 4a 94 dec r4 1116a: 54 2c mov r5, r4 1116c: 32 01 movw r6, r4 1116e: d0 cf rjmp .-96 ; 0x11110 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) 11170: 44 e0 ldi r20, 0x04 ; 4 11172: 50 e0 ldi r21, 0x00 ; 0 11174: 6b e6 ldi r22, 0x6B ; 107 11176: 73 e7 ldi r23, 0x73 ; 115 11178: c7 01 movw r24, r14 1117a: 0f 94 60 a2 call 0x344c0 ; 0x344c0 1117e: 5c 01 movw r10, r24 allow_when_stopped = true; // Handle the USB timer if ((*cmd_start == 'G') && (GetPrinterState() != PrinterState::IsSDPrinting)) { 11180: f7 01 movw r30, r14 11182: 80 81 ld r24, Z 11184: 87 34 cpi r24, 0x47 ; 71 11186: 81 f4 brne .+32 ; 0x111a8 11188: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.384> 1118c: 85 30 cpi r24, 0x05 ; 5 1118e: 61 f0 breq .+24 ; 0x111a8 usb_timer.start(); 11190: 82 e4 ldi r24, 0x42 ; 66 11192: 92 e1 ldi r25, 0x12 ; 18 11194: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> PrinterState GetPrinterState() { return printer_state; } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 11198: f6 e0 ldi r31, 0x06 ; 6 1119a: f0 93 61 0d sts 0x0D61, r31 ; 0x800d61 <_ZL13printer_state.lto_priv.384> if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1119e: 60 e0 ldi r22, 0x00 ; 0 111a0: 85 ea ldi r24, 0xA5 ; 165 111a2: 9f e0 ldi r25, 0x0F ; 15 111a4: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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) { 111a8: ab 28 or r10, r11 111aa: 21 f0 breq .+8 ; 0x111b4 111ac: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 111b0: 81 11 cpse r24, r1 111b2: 98 cf rjmp .-208 ; 0x110e4 } // 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; 111b4: 26 e0 ldi r18, 0x06 ; 6 111b6: 77 fc sbrc r7, 7 111b8: 21 e0 ldi r18, 0x01 ; 1 111ba: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> 111be: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 111c2: fc 01 movw r30, r24 111c4: e5 5b subi r30, 0xB5 ; 181 111c6: ff 4e sbci r31, 0xEF ; 239 111c8: 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) 111ca: 49 81 ldd r20, Y+1 ; 0x01 111cc: 5a 81 ldd r21, Y+2 ; 0x02 cmd_len = strlen(cmd_start) + 1; 111ce: 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) 111d0: da 01 movw r26, r20 111d2: 40 17 cp r20, r16 111d4: 51 07 cpc r21, r17 111d6: a1 f5 brne .+104 ; 0x11240 cmd_len = strlen(cmd_start) + 1; 111d8: 01 90 ld r0, Z+ 111da: 00 20 and r0, r0 111dc: e9 f7 brne .-6 ; 0x111d8 111de: 9f 01 movw r18, r30 111e0: 20 1b sub r18, r16 111e2: 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; 111e4: 03 96 adiw r24, 0x03 ; 3 111e6: 28 0f add r18, r24 111e8: 39 1f adc r19, r25 if (bufindw == sizeof(cmdbuffer)) 111ea: 2d 3e cpi r18, 0xED ; 237 111ec: f1 e0 ldi r31, 0x01 ; 1 111ee: 3f 07 cpc r19, r31 111f0: 79 f1 breq .+94 ; 0x11250 // 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; 111f2: 30 93 4a 10 sts 0x104A, r19 ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 111f6: 20 93 49 10 sts 0x1049, r18 ; 0x801049 <_ZL7bufindw.lto_priv.511> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 111fa: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 111fe: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 11202: 01 96 adiw r24, 0x01 ; 1 11204: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 11208: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c // Update the processed gcode line if (gcode_N >= 0) 1120c: 77 fc sbrc r7, 7 1120e: 08 c0 rjmp .+16 ; 0x11220 gcode_LastN = gcode_N; 11210: 40 92 3e 12 sts 0x123E, r4 ; 0x80123e 11214: 50 92 3f 12 sts 0x123F, r5 ; 0x80123f 11218: 60 92 40 12 sts 0x1240, r6 ; 0x801240 1121c: 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 11220: 10 92 48 10 sts 0x1048, r1 ; 0x801048 11224: 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)) 11228: 0e 94 87 55 call 0xab0e ; 0xab0e 1122c: 89 2b or r24, r25 1122e: 09 f4 brne .+2 ; 0x11232 11230: c7 cd rjmp .-1138 ; 0x10dc0 11232: 8f e5 ldi r24, 0x5F ; 95 11234: 90 e0 ldi r25, 0x00 ; 0 11236: 0e 94 ef 55 call 0xabde ; 0xabde 1123a: 81 11 cpse r24, r1 1123c: 7f cd rjmp .-1282 ; 0x10d3c 1123e: c0 cd rjmp .-1152 ; 0x10dc0 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]; } 11240: 6d 91 ld r22, X+ 11242: 61 93 st Z+, r22 11244: 9d 01 movw r18, r26 11246: 24 1b sub r18, r20 11248: 35 0b sbc r19, r21 while (cmd_head[cmd_len++]); 1124a: 61 11 cpse r22, r1 1124c: f9 cf rjmp .-14 ; 0x11240 1124e: ca cf rjmp .-108 ; 0x111e4 } bufindw += cmd_len + CMDHDRSIZE; if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11250: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 11254: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.511> 11258: d0 cf rjmp .-96 ; 0x111fa #ifdef ENABLE_MEATPACK } #endif } // end of serial line processing loop if (serial_count > 0 && serialTimeoutTimer.expired(farm_mode ? 800 : 2000)) { 1125a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1125e: 60 e2 ldi r22, 0x20 ; 32 11260: 73 e0 ldi r23, 0x03 ; 3 11262: 81 11 cpse r24, r1 11264: 02 c0 rjmp .+4 ; 0x1126a 11266: 60 ed ldi r22, 0xD0 ; 208 11268: 77 e0 ldi r23, 0x07 ; 7 1126a: 8f e1 ldi r24, 0x1F ; 31 1126c: 93 e0 ldi r25, 0x03 ; 3 1126e: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 11272: 88 23 and r24, r24 11274: 09 f4 brne .+2 ; 0x11278 11276: a0 cd rjmp .-1216 ; 0x10db8 comment_mode = false; 11278: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e serial_count = 0; 1127c: 10 92 48 10 sts 0x1048, r1 ; 0x801048 11280: 10 92 47 10 sts 0x1047, r1 ; 0x801047 SERIAL_ECHOLNPGM("RX timeout"); 11284: 80 e6 ldi r24, 0x60 ; 96 11286: 93 e7 ldi r25, 0x73 ; 115 11288: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 1128c: 99 cd rjmp .-1230 ; 0x10dc0 return; } #ifdef SDSUPPORT if(!card.sdprinting || !card.isFileOpen() || serial_count!=0){ 1128e: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 11292: 88 23 and r24, r24 11294: 09 f4 brne .+2 ; 0x11298 11296: 94 cd rjmp .-1240 ; 0x10dc0 11298: 80 91 47 10 lds r24, 0x1047 ; 0x801047 1129c: 90 91 48 10 lds r25, 0x1048 ; 0x801048 112a0: 89 2b or r24, r25 112a2: 09 f0 breq .+2 ; 0x112a6 112a4: 8d cd rjmp .-1254 ; 0x10dc0 //'#' 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; 112a6: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 112aa: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 112ae: 89 2b or r24, r25 112b0: 11 f4 brne .+4 ; 0x112b6 112b2: 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; 112b6: 12 e0 ldi r17, 0x02 ; 2 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 112b8: 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) { 112ba: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 112be: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 112c2: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 112c6: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 112ca: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 112ce: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 112d2: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 112d6: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 112da: 48 17 cp r20, r24 112dc: 59 07 cpc r21, r25 112de: 6a 07 cpc r22, r26 112e0: 7b 07 cpc r23, r27 112e2: 08 f0 brcs .+2 ; 0x112e6 112e4: c1 c0 rjmp .+386 ; 0x11468 112e6: 80 91 1d 03 lds r24, 0x031D ; 0x80031d 112ea: 81 11 cpse r24, r1 112ec: bd c0 rjmp .+378 ; 0x11468 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); 112ee: 0f 94 8d 6c call 0x2d91a ; 0x2d91a 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_;} 112f2: 40 91 6f 16 lds r20, 0x166F ; 0x80166f 112f6: 50 91 70 16 lds r21, 0x1670 ; 0x801670 112fa: 60 91 71 16 lds r22, 0x1671 ; 0x801671 112fe: 70 91 72 16 lds r23, 0x1672 ; 0x801672 sdpos = file.curPosition(); 11302: 40 93 eb 16 sts 0x16EB, r20 ; 0x8016eb 11306: 50 93 ec 16 sts 0x16EC, r21 ; 0x8016ec 1130a: 60 93 ed 16 sts 0x16ED, r22 ; 0x8016ed 1130e: 70 93 ee 16 sts 0x16EE, r23 ; 0x8016ee 11312: 20 91 47 10 lds r18, 0x1047 ; 0x801047 11316: 30 91 48 10 lds r19, 0x1048 ; 0x801048 int16_t n=card.getFilteredGcodeChar(); char serial_char = (char)n; if( serial_char == '\n' 1131a: 8a 30 cpi r24, 0x0A ; 10 1131c: 61 f0 breq .+24 ; 0x11336 || serial_char == '\r' 1131e: 8d 30 cpi r24, 0x0D ; 13 11320: 51 f0 breq .+20 ; 0x11336 || serial_char == '#' 11322: 83 32 cpi r24, 0x23 ; 35 11324: 09 f4 brne .+2 ; 0x11328 11326: 87 c0 rjmp .+270 ; 0x11436 || serial_count >= (MAX_CMD_SIZE - 1) 11328: 2f 35 cpi r18, 0x5F ; 95 1132a: 31 05 cpc r19, r1 1132c: 24 f4 brge .+8 ; 0x11336 || n==-1 1132e: 8f 3f cpi r24, 0xFF ; 255 11330: 98 07 cpc r25, r24 11332: 09 f0 breq .+2 ; 0x11336 11334: 87 c0 rjmp .+270 ; 0x11444 ){ if(serial_char=='#') stop_buffering=true; if(!serial_count) 11336: 21 15 cp r18, r1 11338: 31 05 cpc r19, r1 1133a: 09 f4 brne .+2 ; 0x1133e 1133c: 41 cd rjmp .-1406 ; 0x10dc0 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); }; 1133e: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 11342: 81 11 cpse r24, r1 11344: 03 c0 rjmp .+6 ; 0x1134c 11346: 40 e0 ldi r20, 0x00 ; 0 11348: 50 e0 ldi r21, 0x00 ; 0 1134a: 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; 1134c: 80 91 49 12 lds r24, 0x1249 ; 0x801249 11350: 90 91 4a 12 lds r25, 0x124A ; 0x80124a 11354: 48 1b sub r20, r24 11356: 59 0b sbc r21, r25 cmdbuffer[bufindw] = CMDBUFFER_CURRENT_TYPE_SDCARD; 11358: a0 91 49 10 lds r26, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> 1135c: b0 91 4a 10 lds r27, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 11360: fd 01 movw r30, r26 11362: e5 5b subi r30, 0xB5 ; 181 11364: ff 4e sbci r31, 0xEF ; 239 11366: 10 83 st Z, r17 cmdbuffer[bufindw+1] = sd_count.lohi.lo; 11368: 41 83 std Z+1, r20 ; 0x01 cmdbuffer[bufindw+2] = sd_count.lohi.hi; 1136a: 52 83 std Z+2, r21 ; 0x02 1136c: 13 96 adiw r26, 0x03 ; 3 cmdbuffer[bufindw+serial_count+CMDHDRSIZE] = 0; //terminate string 1136e: 25 5b subi r18, 0xB5 ; 181 11370: 3f 4e sbci r19, 0xEF ; 239 11372: f9 01 movw r30, r18 11374: ea 0f add r30, r26 11376: fb 1f adc r31, r27 11378: 10 82 st Z, r1 // Calculate the length before disabling the interrupts. uint8_t len = strlen(cmdbuffer+bufindw+CMDHDRSIZE) + (1 + CMDHDRSIZE); 1137a: a5 5b subi r26, 0xB5 ; 181 1137c: bf 4e sbci r27, 0xEF ; 239 1137e: fd 01 movw r30, r26 11380: 01 90 ld r0, Z+ 11382: 00 20 and r0, r0 11384: e9 f7 brne .-6 ; 0x11380 11386: 31 97 sbiw r30, 0x01 ; 1 11388: ea 1b sub r30, r26 1138a: fb 0b sbc r31, r27 // MYSERIAL.print(cmdbuffer); // SERIAL_ECHOPGM("buflen:"); // MYSERIAL.print(buflen+1); sd_count.value = 0; cli(); 1138c: 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; 1138e: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 11392: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 11396: 01 96 adiw r24, 0x01 ; 1 11398: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 1139c: 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); 113a0: 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; 113a2: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> 113a6: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 113aa: e8 0f add r30, r24 113ac: f9 2f mov r31, r25 113ae: f1 1d adc r31, r1 113b0: f0 93 4a 10 sts 0x104A, r31 ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 113b4: e0 93 49 10 sts 0x1049, r30 ; 0x801049 <_ZL7bufindw.lto_priv.511> 113b8: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 113bc: 88 23 and r24, r24 113be: 09 f4 brne .+2 ; 0x113c2 113c0: 3d c0 rjmp .+122 ; 0x1143c 113c2: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 113c6: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 113ca: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 113ce: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee sdpos_atomic = card.get_sdpos(); 113d2: 80 93 49 12 sts 0x1249, r24 ; 0x801249 113d6: 90 93 4a 12 sts 0x124A, r25 ; 0x80124a 113da: a0 93 4b 12 sts 0x124B, r26 ; 0x80124b 113de: b0 93 4c 12 sts 0x124C, r27 ; 0x80124c if (bufindw == sizeof(cmdbuffer)) 113e2: ed 3e cpi r30, 0xED ; 237 113e4: f1 40 sbci r31, 0x01 ; 1 113e6: 21 f4 brne .+8 ; 0x113f0 bufindw = 0; 113e8: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 113ec: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.511> sei(); 113f0: 78 94 sei comment_mode = false; //for new command 113f2: 10 92 1e 03 sts 0x031E, r1 ; 0x80031e serial_count = 0; //clear buffer 113f6: 10 92 48 10 sts 0x1048, r1 ; 0x801048 113fa: 10 92 47 10 sts 0x1047, r1 ; 0x801047 if(card.eof()) break; 113fe: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 11402: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 11406: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 1140a: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 1140e: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 11412: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 11416: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 1141a: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 1141e: 48 17 cp r20, r24 11420: 59 07 cpc r21, r25 11422: 6a 07 cpc r22, r26 11424: 7b 07 cpc r23, r27 11426: 00 f5 brcc .+64 ; 0x11468 // The following line will reserve buffer space if available. if (! cmdqueue_could_enqueue_back(MAX_CMD_SIZE-1)) 11428: 8f e5 ldi r24, 0x5F ; 95 1142a: 90 e0 ldi r25, 0x00 ; 0 1142c: 0e 94 ef 55 call 0xabde ; 0xabde 11430: 81 11 cpse r24, r1 11432: 43 cf rjmp .-378 ; 0x112ba 11434: c5 cc rjmp .-1654 ; 0x10dc0 || serial_char == '#' || serial_count >= (MAX_CMD_SIZE - 1) || n==-1 ){ if(serial_char=='#') stop_buffering=true; 11436: 00 93 1d 03 sts 0x031D, r16 ; 0x80031d 1143a: 7d cf rjmp .-262 ; 0x11336 1143c: 80 e0 ldi r24, 0x00 ; 0 1143e: 90 e0 ldi r25, 0x00 ; 0 11440: dc 01 movw r26, r24 11442: c7 cf rjmp .-114 ; 0x113d2 return; } else { // there are no comments coming from the filtered file cmdbuffer[bufindw+CMDHDRSIZE+serial_count++] = serial_char; 11444: a9 01 movw r20, r18 11446: 4f 5f subi r20, 0xFF ; 255 11448: 5f 4f sbci r21, 0xFF ; 255 1144a: 50 93 48 10 sts 0x1048, r21 ; 0x801048 1144e: 40 93 47 10 sts 0x1047, r20 ; 0x801047 11452: 40 91 49 10 lds r20, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> 11456: 50 91 4a 10 lds r21, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 1145a: 45 5b subi r20, 0xB5 ; 181 1145c: 5f 4e sbci r21, 0xEF ; 239 1145e: 24 0f add r18, r20 11460: 35 1f adc r19, r21 11462: f9 01 movw r30, r18 11464: 83 83 std Z+3, r24 ; 0x03 11466: 29 cf rjmp .-430 ; 0x112ba } } if(card.eof()) 11468: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 1146c: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 11470: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 11474: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 11478: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 1147c: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 11480: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 11484: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 11488: 48 17 cp r20, r24 1148a: 59 07 cpc r21, r25 1148c: 6a 07 cpc r22, r26 1148e: 7b 07 cpc r23, r27 11490: 08 f4 brcc .+2 ; 0x11494 11492: 96 cc rjmp .-1748 ; 0x10dc0 { // 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()) 11494: 0e 94 54 79 call 0xf2a8 ; 0xf2a8 11498: 89 2b or r24, r25 1149a: 09 f0 breq .+2 ; 0x1149e 1149c: 91 cc rjmp .-1758 ; 0x10dc0 { // queue is complete, but before we process EOF commands prevent // re-entry by disabling SD processing from any st_synchronize call card.closefile(); 1149e: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e SERIAL_PROTOCOLLNRPGM(_n("Done printing file"));////MSG_FILE_PRINTED 114a2: 8c e6 ldi r24, 0x6C ; 108 114a4: 93 e6 ldi r25, 0x63 ; 99 114a6: 0e 94 0e 7d call 0xfa1c ; 0xfa1c char time[30]; uint32_t t = print_job_timer.duration() / 60; 114aa: 0f 94 06 15 call 0x22a0c ; 0x22a0c 114ae: 6b 01 movw r12, r22 114b0: 7c 01 movw r14, r24 int hours, minutes; minutes = t % 60; hours = t / 60; save_statistics(); 114b2: 0e 94 01 65 call 0xca02 ; 0xca02 // 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; 114b6: 8c e3 ldi r24, 0x3C ; 60 114b8: 88 2e mov r8, r24 114ba: 91 2c mov r9, r1 114bc: a1 2c mov r10, r1 114be: b1 2c mov r11, r1 114c0: c7 01 movw r24, r14 114c2: b6 01 movw r22, r12 114c4: a5 01 movw r20, r10 114c6: 94 01 movw r18, r8 114c8: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> int hours, minutes; minutes = t % 60; 114cc: ca 01 movw r24, r20 114ce: b9 01 movw r22, r18 114d0: a5 01 movw r20, r10 114d2: 94 01 movw r18, r8 114d4: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> hours = t / 60; save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 114d8: 7f 93 push r23 114da: 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; 114dc: c7 01 movw r24, r14 114de: b6 01 movw r22, r12 114e0: 20 e1 ldi r18, 0x10 ; 16 114e2: 3e e0 ldi r19, 0x0E ; 14 114e4: 40 e0 ldi r20, 0x00 ; 0 114e6: 50 e0 ldi r21, 0x00 ; 0 114e8: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> save_statistics(); sprintf_P(time, PSTR("%i hours %i minutes"),hours, minutes); 114ec: 3f 93 push r19 114ee: 2f 93 push r18 114f0: 8c e4 ldi r24, 0x4C ; 76 114f2: 93 e7 ldi r25, 0x73 ; 115 114f4: 9f 93 push r25 114f6: 8f 93 push r24 114f8: 8e 01 movw r16, r28 114fa: 0f 5f subi r16, 0xFF ; 255 114fc: 1f 4f sbci r17, 0xFF ; 255 114fe: 1f 93 push r17 11500: 0f 93 push r16 11502: 0f 94 98 a3 call 0x34730 ; 0x34730 SERIAL_ECHO_START; 11506: 84 ee ldi r24, 0xE4 ; 228 11508: 92 ea ldi r25, 0xA2 ; 162 1150a: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN(time); 1150e: c8 01 movw r24, r16 11510: 0e 94 1a 86 call 0x10c34 ; 0x10c34 lcd_setstatus(time); 11514: c8 01 movw r24, r16 11516: 0e 94 d0 dc call 0x1b9a0 ; 0x1b9a0 card.printingHasFinished(); 1151a: 0f 94 c9 72 call 0x2e592 ; 0x2e592 if(!autostart_stilltocheck) return; if(autostart_atmillis.expired(5000)) return; } autostart_stilltocheck = false; 1151e: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.512> if(!mounted) 11522: 0f b6 in r0, 0x3f ; 63 11524: f8 94 cli 11526: de bf out 0x3e, r29 ; 62 11528: 0f be out 0x3f, r0 ; 63 1152a: cd bf out 0x3d, r28 ; 61 1152c: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 11530: 88 23 and r24, r24 11532: 59 f0 breq .+22 ; 0x1154a 11534: 0f 94 d0 67 call 0x2cfa0 ; 0x2cfa0 card.checkautostart(true); if (farm_mode) 11538: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1153c: 88 23 and r24, r24 1153e: 09 f4 brne .+2 ; 0x11542 11540: 3f cc rjmp .-1922 ; 0x10dc0 prusa_statistics(6); 11542: 86 e0 ldi r24, 0x06 ; 6 11544: 0f 94 05 30 call 0x2600a ; 0x2600a 11548: 3b cc rjmp .-1930 ; 0x10dc0 { mount(); 1154a: 81 e0 ldi r24, 0x01 ; 1 1154c: 0f 94 08 73 call 0x2e610 ; 0x2e610 if(!mounted) //fail 11550: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 11554: 81 11 cpse r24, r1 11556: ee cf rjmp .-36 ; 0x11534 11558: ef cf rjmp .-34 ; 0x11538 0001155a : } } #endif //SAFETYTIMER void manage_inactivity(bool ignore_stepper_queue/*=false*/) //default argument set in Marlin.h { 1155a: 0f 93 push r16 1155c: 1f 93 push r17 1155e: cf 93 push r28 11560: df 93 push r29 11562: c8 2f mov r28, r24 state = State::disabled; filter = 0; } bool PAT9125_sensor::update() { switch (state) { 11564: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 11568: 81 30 cpi r24, 0x01 ; 1 1156a: 09 f4 brne .+2 ; 0x1156e 1156c: 49 c0 rjmp .+146 ; 0x11600 1156e: 82 30 cpi r24, 0x02 ; 2 11570: 09 f4 brne .+2 ; 0x11574 11572: 5f c0 rjmp .+190 ; 0x11632 * * 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) 11574: 0e 94 e2 66 call 0xcdc4 ; 0xcdc4 11578: 81 11 cpse r24, r1 1157a: ff c0 rjmp .+510 ; 0x1177a 1157c: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 11580: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 11584: 00 97 sbiw r24, 0x00 ; 0 11586: 39 f4 brne .+14 ; 0x11596 11588: 20 91 59 12 lds r18, 0x1259 ; 0x801259 1158c: 30 91 5a 12 lds r19, 0x125A ; 0x80125a 11590: 23 2b or r18, r19 11592: 09 f4 brne .+2 ; 0x11596 11594: f2 c0 rjmp .+484 ; 0x1177a 11596: 40 91 33 02 lds r20, 0x0233 ; 0x800233 1159a: 50 91 34 02 lds r21, 0x0234 ; 0x800234 1159e: 60 91 35 02 lds r22, 0x0235 ; 0x800235 115a2: 70 91 36 02 lds r23, 0x0236 ; 0x800236 115a6: 41 15 cp r20, r1 115a8: 51 05 cpc r21, r1 115aa: 61 05 cpc r22, r1 115ac: 71 05 cpc r23, r1 115ae: 09 f4 brne .+2 ; 0x115b2 115b0: e4 c0 rjmp .+456 ; 0x1177a { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) 115b2: 89 2b or r24, r25 115b4: 31 f4 brne .+12 ; 0x115c2 115b6: 80 91 59 12 lds r24, 0x1259 ; 0x801259 115ba: 90 91 5a 12 lds r25, 0x125A ; 0x80125a 115be: 89 2b or r24, r25 115c0: 29 f0 breq .+10 ; 0x115cc 115c2: 80 91 ad 05 lds r24, 0x05AD ; 0x8005ad 115c6: 88 23 and r24, r24 115c8: 09 f4 brne .+2 ; 0x115cc 115ca: 3f c1 rjmp .+638 ; 0x1184a { safetyTimer.start(); } else if (safetyTimer.expired(farm_mode?FARM_DEFAULT_SAFETYTIMER_TIME_ms:safetytimer_inactive_time)) 115cc: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 115d0: 88 23 and r24, r24 115d2: 21 f0 breq .+8 ; 0x115dc 115d4: 40 ee ldi r20, 0xE0 ; 224 115d6: 52 e3 ldi r21, 0x32 ; 50 115d8: 69 e2 ldi r22, 0x29 ; 41 115da: 70 e0 ldi r23, 0x00 ; 0 115dc: 8d ea ldi r24, 0xAD ; 173 115de: 95 e0 ldi r25, 0x05 ; 5 115e0: 0f 94 21 0c call 0x21842 ; 0x21842 ::expired(unsigned long)> 115e4: 88 23 and r24, r24 115e6: 09 f4 brne .+2 ; 0x115ea 115e8: ca c0 rjmp .+404 ; 0x1177e { disable_heater(); 115ea: 0f 94 9e 0e call 0x21d3c ; 0x21d3c lcd_show_fullscreen_message_and_wait_P(_T(MSG_BED_HEATING_SAFETY_DISABLED)); 115ee: 80 e6 ldi r24, 0x60 ; 96 115f0: 96 e3 ldi r25, 0x36 ; 54 115f2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 115f6: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa lcd_return_to_status(); 115fa: 0f 94 6e 05 call 0x20adc ; 0x20adc 115fe: bf c0 rjmp .+382 ; 0x1177e case State::initializing: if (!updatePAT9125()) { 11600: 0f 94 28 6e call 0x2dc50 ; 0x2dc50 11604: 88 23 and r24, r24 11606: 09 f4 brne .+2 ; 0x1160a 11608: b5 cf rjmp .-150 ; 0x11574 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 1160a: 81 e0 ldi r24, 0x01 ; 1 1160c: 90 91 fe 16 lds r25, 0x16FE ; 0x8016fe 11610: 91 11 cpse r25, r1 11612: 01 c0 rjmp .+2 ; 0x11616 11614: 80 e0 ldi r24, 0x00 ; 0 break; // still not stable. Stay in the initialization state. } oldFilamentPresent = 11616: 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; 1161a: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 1161e: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 11622: 90 93 01 17 sts 0x1701, r25 ; 0x801701 11626: 80 93 00 17 sts 0x1700, r24 ; 0x801700 state = State::ready; 1162a: 82 e0 ldi r24, 0x02 ; 2 1162c: 80 93 f1 16 sts 0x16F1, r24 ; 0x8016f1 11630: a1 cf rjmp .-190 ; 0x11574 break; case State::ready: { updatePAT9125(); 11632: 0f 94 28 6e call 0x2dc50 ; 0x2dc50 postponedLoadEvent = false; 11636: 10 92 f5 16 sts 0x16F5, r1 ; 0x8016f5 sensorActionOnError = SensorActionOnError::_Continue; } } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) 1163a: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1163e: 82 30 cpi r24, 0x02 ; 2 11640: 09 f0 breq .+2 ; 0x11644 11642: 98 cf rjmp .-208 ; 0x11574 return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 11644: 80 91 f6 16 lds r24, 0x16F6 ; 0x8016f6 11648: 81 11 cpse r24, r1 1164a: 40 c0 rjmp .+128 ; 0x116cc 1164c: d0 91 fe 16 lds r29, 0x16FE ; 0x8016fe 11650: 81 e0 ldi r24, 0x01 ; 1 11652: d1 11 cpse r29, r1 11654: 01 c0 rjmp .+2 ; 0x11658 11656: 80 e0 ldi r24, 0x00 ; 0 return false; } bool newFilamentPresent = fsensor.getFilamentPresent(); if (oldFilamentPresent != newFilamentPresent) { 11658: 90 91 f4 16 lds r25, 0x16F4 ; 0x8016f4 1165c: 89 17 cp r24, r25 1165e: 09 f4 brne .+2 ; 0x11662 11660: 89 cf rjmp .-238 ; 0x11574 oldFilamentPresent = newFilamentPresent; 11662: 80 93 f4 16 sts 0x16F4, r24 ; 0x8016f4 eventBlankingTimer.start(); 11666: 86 ef ldi r24, 0xF6 ; 246 11668: 96 e1 ldi r25, 0x16 ; 22 1166a: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> if (newFilamentPresent) { // filament insertion 1166e: dd 23 and r29, r29 11670: b1 f1 breq .+108 ; 0x116de } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 11672: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 11676: 88 23 and r24, r24 11678: 11 f1 breq .+68 ; 0x116be return false; } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) 1167a: 80 91 94 03 lds r24, 0x0394 ; 0x800394 1167e: 81 11 cpse r24, r1 11680: 1e c0 rjmp .+60 ; 0x116be && !( 11682: 80 91 01 13 lds r24, 0x1301 ; 0x801301 11686: 81 30 cpi r24, 0x01 ; 1 11688: d1 f0 breq .+52 ; 0x116be 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); 1168a: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 1168e: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 11692: 89 1b sub r24, r25 11694: 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 11696: 99 f4 brne .+38 ; 0x116be || printJobOngoing() 11698: 0e 94 91 66 call 0xcd22 ; 0xcd22 1169c: 81 11 cpse r24, r1 1169e: 0f c0 rjmp .+30 ; 0x116be || (lcd_commands_type == LcdCommands::Layer1Cal) 116a0: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 116a4: 84 30 cpi r24, 0x04 ; 4 116a6: 59 f0 breq .+22 ; 0x116be || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 116a8: 8f e5 ldi r24, 0x5F ; 95 116aa: 9f e0 ldi r25, 0x0F ; 15 116ac: 0f 94 81 a4 call 0x34902 ; 0x34902 } void Filament_sensor::triggerFilamentInserted() { if (autoLoadEnabled && (eFilamentAction == FilamentAction::None) && !( 116b0: 81 11 cpse r24, r1 116b2: 05 c0 rjmp .+10 ; 0x116be || printJobOngoing() || (lcd_commands_type == LcdCommands::Layer1Cal) || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) ) ) { menu_submenu(lcd_AutoLoadFilament, true); 116b4: 61 e0 ldi r22, 0x01 ; 1 116b6: 8c e5 ldi r24, 0x5C ; 92 116b8: 98 e3 ldi r25, 0x38 ; 56 116ba: 0e 94 2e 63 call 0xc65c ; 0xc65c oldFilamentPresent = newFilamentPresent; eventBlankingTimer.start(); if (newFilamentPresent) { // filament insertion // puts_P(PSTR("filament inserted")); triggerFilamentInserted(); postponedLoadEvent = true; 116be: 81 e0 ldi r24, 0x01 ; 1 116c0: 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. 116c4: 81 e0 ldi r24, 0x01 ; 1 116c6: 80 93 59 02 sts 0x0259, r24 ; 0x800259 116ca: 54 cf rjmp .-344 ; 0x11574 } bool Filament_sensor::checkFilamentEvents() { if (state != State::ready) return false; if (eventBlankingTimer.running() && !eventBlankingTimer.expired(100)) { // event blanking for 100ms 116cc: 64 e6 ldi r22, 0x64 ; 100 116ce: 70 e0 ldi r23, 0x00 ; 0 116d0: 86 ef ldi r24, 0xF6 ; 246 116d2: 96 e1 ldi r25, 0x16 ; 22 116d4: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 116d8: 81 11 cpse r24, r1 116da: b8 cf rjmp .-144 ; 0x1164c 116dc: 4b cf rjmp .-362 ; 0x11574 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 116de: 80 91 f3 16 lds r24, 0x16F3 ; 0x8016f3 116e2: 88 23 and r24, r24 116e4: 79 f3 breq .-34 ; 0x116c4 } void Filament_sensor::triggerFilamentRemoved() { // SERIAL_ECHOLNPGM("triggerFilamentRemoved"); if (runoutEnabled && (eFilamentAction == FilamentAction::None) 116e6: 80 91 94 03 lds r24, 0x0394 ; 0x800394 116ea: 81 11 cpse r24, r1 116ec: eb cf rjmp .-42 ; 0x116c4 116ee: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 116f2: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 116f6: 89 1b sub r24, r25 116f8: 8f 70 andi r24, 0x0F ; 15 && ( 116fa: 21 f4 brne .+8 ; 0x11704 moves_planned() != 0 || printJobOngoing() 116fc: 0e 94 91 66 call 0xcd22 ; 0xcd22 11700: 88 23 and r24, r24 11702: 01 f3 breq .-64 ; 0x116c4 ) && !( 11704: 80 91 73 12 lds r24, 0x1273 ; 0x801273 11708: 81 11 cpse r24, r1 1170a: dc cf rjmp .-72 ; 0x116c4 saved_printing || MMU2::mmu2.Enabled() // quick and dirty hack to prevent spurious runouts just before the toolchange 1170c: 80 91 01 13 lds r24, 0x1301 ; 0x801301 11710: 81 30 cpi r24, 0x01 ; 1 11712: c1 f2 breq .-80 ; 0x116c4 || (lcd_commands_type == LcdCommands::Layer1Cal) 11714: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 11718: 84 30 cpi r24, 0x04 ; 4 1171a: a1 f2 breq .-88 ; 0x116c4 || eeprom_read_byte((uint8_t *)EEPROM_WIZARD_ACTIVE) 1171c: 8f e5 ldi r24, 0x5F ; 95 1171e: 9f e0 ldi r25, 0x0F ; 15 11720: 0f 94 81 a4 call 0x34902 ; 0x34902 && (eFilamentAction == FilamentAction::None) && ( moves_planned() != 0 || printJobOngoing() ) && !( 11724: 81 11 cpse r24, r1 11726: ce cf rjmp .-100 ; 0x116c4 } //! @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); 11728: 8a e3 ldi r24, 0x3A ; 58 1172a: 95 e6 ldi r25, 0x65 ; 101 1172c: 9f 93 push r25 1172e: 8f 93 push r24 11730: 80 e2 ldi r24, 0x20 ; 32 11732: 95 e6 ldi r25, 0x65 ; 101 11734: 9f 93 push r25 11736: 8f 93 push r24 11738: 0f 94 43 a3 call 0x34686 ; 0x34686 void Filament_sensor::filRunout() { // SERIAL_ECHOLNPGM("filRunout"); sendHostNotification_P(MSG_FILAMENT_RUNOUT_DETECTED); runoutEnabled = false; 1173c: 10 92 f3 16 sts 0x16F3, r1 ; 0x8016f3 autoLoadEnabled = false; 11740: 10 92 f2 16 sts 0x16F2, r1 ; 0x8016f2 stop_and_save_print_to_ram(0, 0); 11744: 60 e0 ldi r22, 0x00 ; 0 11746: 70 e0 ldi r23, 0x00 ; 0 11748: cb 01 movw r24, r22 1174a: 0f 94 a4 65 call 0x2cb48 ; 0x2cb48 restore_print_from_ram_and_continue(0); 1174e: 60 e0 ldi r22, 0x00 ; 0 11750: 70 e0 ldi r23, 0x00 ; 0 11752: cb 01 movw r24, r22 11754: 0e 94 09 67 call 0xce12 ; 0xce12 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 11758: 85 e6 ldi r24, 0x65 ; 101 1175a: 9f e0 ldi r25, 0x0F ; 15 1175c: 0e 94 cd 78 call 0xf19a ; 0xf19a eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 11760: 81 e0 ldi r24, 0x01 ; 1 11762: 9f e0 ldi r25, 0x0F ; 15 11764: 0e 94 c0 78 call 0xf180 ; 0xf180 enquecommand_front_P(MSG_M600); 11768: 82 e0 ldi r24, 0x02 ; 2 1176a: 9d e6 ldi r25, 0x6D ; 109 1176c: 0f 94 16 67 call 0x2ce2c ; 0x2ce2c 11770: 0f 90 pop r0 11772: 0f 90 pop r0 11774: 0f 90 pop r0 11776: 0f 90 pop r0 11778: a5 cf rjmp .-182 ; 0x116c4 inline constexpr Timer() : m_isRunning(false) , m_started(0) {}; void start(); void stop(){m_isRunning = false;} 1177a: 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)){ 1177e: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 11782: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 11786: 03 97 sbiw r24, 0x03 ; 3 11788: 14 f4 brge .+4 ; 0x1178e get_command(); 1178a: 0e 94 1e 86 call 0x10c3c ; 0x10c3c 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); 1178e: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 11792: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f } if (blocks_queued() && GetPrinterState() == PrinterState::IsHostPrinting && usb_timer.expired((USB_TIMER_TIMEOUT) / 2)) 11796: 98 17 cp r25, r24 11798: 81 f0 breq .+32 ; 0x117ba 1179a: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.384> 1179e: 86 30 cpi r24, 0x06 ; 6 117a0: 61 f4 brne .+24 ; 0x117ba 117a2: 68 e8 ldi r22, 0x88 ; 136 117a4: 73 e1 ldi r23, 0x13 ; 19 117a6: 82 e4 ldi r24, 0x42 ; 66 117a8: 92 e1 ldi r25, 0x12 ; 18 117aa: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 117ae: 88 23 and r24, r24 117b0: 21 f0 breq .+8 ; 0x117ba { // 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(); 117b2: 82 e4 ldi r24, 0x42 ; 66 117b4: 92 e1 ldi r25, 0x12 ; 18 117b6: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> } if(max_inactive_time && previous_millis_cmd.expired(max_inactive_time)) 117ba: 40 91 44 03 lds r20, 0x0344 ; 0x800344 117be: 50 91 45 03 lds r21, 0x0345 ; 0x800345 117c2: 60 91 46 03 lds r22, 0x0346 ; 0x800346 117c6: 70 91 47 03 lds r23, 0x0347 ; 0x800347 117ca: 41 15 cp r20, r1 117cc: 51 05 cpc r21, r1 117ce: 61 05 cpc r22, r1 117d0: 71 05 cpc r23, r1 117d2: 09 f0 breq .+2 ; 0x117d6 117d4: 3f c0 rjmp .+126 ; 0x11854 kill(PSTR("Inactivity Shutdown")); if(stepper_inactive_time && previous_millis_cmd.expired(stepper_inactive_time)) { 117d6: 40 91 37 02 lds r20, 0x0237 ; 0x800237 117da: 50 91 38 02 lds r21, 0x0238 ; 0x800238 117de: 60 91 39 02 lds r22, 0x0239 ; 0x800239 117e2: 70 91 3a 02 lds r23, 0x023A ; 0x80023a 117e6: 41 15 cp r20, r1 117e8: 51 05 cpc r21, r1 117ea: 61 05 cpc r22, r1 117ec: 71 05 cpc r23, r1 117ee: a9 f0 breq .+42 ; 0x1181a 117f0: 88 e4 ldi r24, 0x48 ; 72 117f2: 93 e0 ldi r25, 0x03 ; 3 117f4: 0f 94 21 0c call 0x21842 ; 0x21842 ::expired(unsigned long)> 117f8: 88 23 and r24, r24 117fa: 79 f0 breq .+30 ; 0x1181a 117fc: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 11800: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f if(blocks_queued() == false && ignore_stepper_queue == false) { 11804: 98 13 cpse r25, r24 11806: 09 c0 rjmp .+18 ; 0x1181a 11808: c1 11 cpse r28, r1 1180a: 07 c0 rjmp .+14 ; 0x1181a disable_x(); 1180c: 17 9a sbi 0x02, 7 ; 2 1180e: 10 92 39 06 sts 0x0639, r1 ; 0x800639 disable_y(); 11812: 16 9a sbi 0x02, 6 ; 2 11814: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a disable_z(); disable_e0(); 11818: 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; 1181a: c0 91 55 12 lds r28, 0x1255 ; 0x801255 block_t *block; if(block_buffer_tail != block_buffer_head) 1181e: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 11822: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 11826: 98 17 cp r25, r24 11828: 01 f1 breq .+64 ; 0x1186a { uint8_t block_index = block_buffer_tail; 1182a: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f tail_fan_speed = block_buffer[block_index].fan_speed; 1182e: 9e e6 ldi r25, 0x6E ; 110 11830: 89 9f mul r24, r25 11832: f0 01 movw r30, r0 11834: 11 24 eor r1, r1 11836: ec 55 subi r30, 0x5C ; 92 11838: f9 4f sbci r31, 0xF9 ; 249 1183a: c0 81 ld r28, Z while(block_index != block_buffer_head) 1183c: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 11840: 98 17 cp r25, r24 11842: 99 f0 breq .+38 ; 0x1186a 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); 11844: 8f 5f subi r24, 0xFF ; 255 11846: 8f 70 andi r24, 0x0F ; 15 11848: f9 cf rjmp .-14 ; 0x1183c { safetyTimer.stop(); } else if ((CHECK_ALL_HEATERS) && !safetyTimer.running()) { safetyTimer.start(); 1184a: 8d ea ldi r24, 0xAD ; 173 1184c: 95 e0 ldi r25, 0x05 ; 5 1184e: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> 11852: 95 cf rjmp .-214 ; 0x1177e // 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)) 11854: 88 e4 ldi r24, 0x48 ; 72 11856: 93 e0 ldi r25, 0x03 ; 3 11858: 0f 94 21 0c call 0x21842 ; 0x21842 ::expired(unsigned long)> 1185c: 88 23 and r24, r24 1185e: 09 f4 brne .+2 ; 0x11862 11860: ba cf rjmp .-140 ; 0x117d6 kill(PSTR("Inactivity Shutdown")); 11862: 8a e9 ldi r24, 0x9A ; 154 11864: 98 e7 ldi r25, 0x78 ; 120 11866: 0e 94 74 83 call 0x106e8 ; 0x106e8 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) { 1186a: cc 23 and r28, r28 1186c: 09 f4 brne .+2 ; 0x11870 1186e: be c0 rjmp .+380 ; 0x119ec if (fan_kick_end == 0) { 11870: 80 91 3f 03 lds r24, 0x033F ; 0x80033f 11874: 90 91 40 03 lds r25, 0x0340 ; 0x800340 11878: a0 91 41 03 lds r26, 0x0341 ; 0x800341 1187c: b0 91 42 03 lds r27, 0x0342 ; 0x800342 11880: 89 2b or r24, r25 11882: 8a 2b or r24, r26 11884: 8b 2b or r24, r27 11886: 81 f4 brne .+32 ; 0x118a8 // Just starting up fan - run at full power. fan_kick_end = _millis() + FAN_KICKSTART_TIME; 11888: 0f 94 89 0b call 0x21712 ; 0x21712 1188c: 60 5e subi r22, 0xE0 ; 224 1188e: 7c 4f sbci r23, 0xFC ; 252 11890: 8f 4f sbci r24, 0xFF ; 255 11892: 9f 4f sbci r25, 0xFF ; 255 11894: 60 93 3f 03 sts 0x033F, r22 ; 0x80033f 11898: 70 93 40 03 sts 0x0340, r23 ; 0x800340 1189c: 80 93 41 03 sts 0x0341, r24 ; 0x800341 118a0: 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; 118a4: cf ef ldi r28, 0xFF ; 255 118a6: 0f c0 rjmp .+30 ; 0x118c6 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()) 118a8: 0f 94 89 0b call 0x21712 ; 0x21712 118ac: 00 91 3f 03 lds r16, 0x033F ; 0x80033f 118b0: 10 91 40 03 lds r17, 0x0340 ; 0x800340 118b4: 20 91 41 03 lds r18, 0x0341 ; 0x800341 118b8: 30 91 42 03 lds r19, 0x0342 ; 0x800342 118bc: 60 17 cp r22, r16 118be: 71 07 cpc r23, r17 118c0: 82 07 cpc r24, r18 118c2: 93 07 cpc r25, r19 118c4: 78 f3 brcs .-34 ; 0x118a4 } 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 118c6: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 118ca: 88 23 and r24, r24 118cc: 09 f4 brne .+2 ; 0x118d0 118ce: 97 c0 rjmp .+302 ; 0x119fe fanSpeedBckp = tail_fan_speed; 118d0: 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) { 118d4: 80 91 5f 04 lds r24, 0x045F ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.500> 118d8: 81 11 cpse r24, r1 118da: 07 c0 rjmp .+14 ; 0x118ea return; } avoidRecursion = true; 118dc: 81 e0 ldi r24, 0x01 ; 1 118de: 80 93 5f 04 sts 0x045F, r24 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.500> mmu_loop_inner(true); 118e2: 0f 94 d9 97 call 0x32fb2 ; 0x32fb2 avoidRecursion = false; 118e6: 10 92 5f 04 sts 0x045F, r1 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.500> lcd_draw_update = 2; lcd_beeper_quick_feedback(); } void lcd_knob_update() { if (lcd_backlight_wake_trigger) { 118ea: 80 91 a6 05 lds r24, 0x05A6 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.498> 118ee: 88 23 and r24, r24 118f0: c9 f1 breq .+114 ; 0x11964 lcd_backlight_wake_trigger = false; 118f2: 10 92 a6 05 sts 0x05A6, r1 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.498> backlight_wake(); bool did_rotate = false; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 118f6: 4f b7 in r20, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 118f8: f8 94 cli if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 118fa: 80 91 a4 05 lds r24, 0x05A4 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.499> 118fe: 28 2f mov r18, r24 11900: 08 2e mov r0, r24 11902: 00 0c add r0, r0 11904: 33 0b sbc r19, r19 11906: 37 ff sbrs r19, 7 11908: 03 c0 rjmp .+6 ; 0x11910 1190a: 31 95 neg r19 1190c: 21 95 neg r18 1190e: 31 09 sbc r19, r1 11910: 24 30 cpi r18, 0x04 ; 4 11912: 31 05 cpc r19, r1 11914: 0c f4 brge .+2 ; 0x11918 11916: 76 c0 rjmp .+236 ; 0x11a04 lcd_encoder += lcd_encoder_diff / ENCODER_PULSES_PER_STEP; 11918: 98 2f mov r25, r24 1191a: 87 ff sbrs r24, 7 1191c: 02 c0 rjmp .+4 ; 0x11922 1191e: 93 e0 ldi r25, 0x03 ; 3 11920: 98 0f add r25, r24 11922: 95 95 asr r25 11924: 95 95 asr r25 11926: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1192a: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1192e: 29 0f add r18, r25 11930: 31 1d adc r19, r1 11932: 97 fd sbrc r25, 7 11934: 3a 95 dec r19 11936: 30 93 1f 06 sts 0x061F, r19 ; 0x80061f 1193a: 20 93 1e 06 sts 0x061E, r18 ; 0x80061e lcd_encoder_diff %= ENCODER_PULSES_PER_STEP; 1193e: 83 78 andi r24, 0x83 ; 131 11940: 87 ff sbrs r24, 7 11942: 03 c0 rjmp .+6 ; 0x1194a 11944: 81 50 subi r24, 0x01 ; 1 11946: 8c 6f ori r24, 0xFC ; 252 11948: 8f 5f subi r24, 0xFF ; 255 1194a: 80 93 a4 05 sts 0x05A4, r24 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.499> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1194e: 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); 11950: 86 e0 ldi r24, 0x06 ; 6 11952: 0f 94 3f 23 call 0x2467e ; 0x2467e if (lcd_draw_update == 0) { 11956: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1195a: 81 11 cpse r24, r1 1195c: 03 c0 rjmp .+6 ; 0x11964 // Update LCD rendering at minimum lcd_draw_update = 1; 1195e: 81 e0 ldi r24, 0x01 ; 1 11960: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_knob_update(); backlight_update(); // handle longpress if(lcd_longpress_trigger) 11964: 80 91 a7 05 lds r24, 0x05A7 ; 0x8005a7 11968: 88 23 and r24, r24 1196a: 61 f0 breq .+24 ; 0x11984 { lcd_consume_click(); // Reset trigger to prevent recursion 1196c: 0e 94 c1 73 call 0xe782 ; 0xe782 // long press is not possible in modal mode, wait until ready if (lcd_longpress_func && lcd_update_enabled) 11970: e0 91 06 04 lds r30, 0x0406 ; 0x800406 11974: f0 91 07 04 lds r31, 0x0407 ; 0x800407 11978: 30 97 sbiw r30, 0x00 ; 0 1197a: 21 f0 breq .+8 ; 0x11984 1197c: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 11980: 81 11 cpse r24, r1 { lcd_longpress_func(); 11982: 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); } 11984: 20 91 cf 13 lds r18, 0x13CF ; 0x8013cf 11988: 30 e0 ldi r19, 0x00 ; 0 1198a: a8 ee ldi r26, 0xE8 ; 232 1198c: b3 e0 ldi r27, 0x03 ; 3 1198e: 0f 94 21 a5 call 0x34a42 ; 0x34a42 <__umulhisi3> 11992: ab 01 movw r20, r22 11994: bc 01 movw r22, r24 11996: 80 ed ldi r24, 0xD0 ; 208 11998: 93 e1 ldi r25, 0x13 ; 19 1199a: 0f 94 21 0c call 0x21842 ; 0x21842 ::expired(unsigned long)> * Output autoreport values according to features requested in M155 */ #if defined(AUTO_REPORT) void host_autoreport() { if (autoReportFeatures.TimerExpired()) 1199e: 88 23 and r24, r24 119a0: 99 f0 breq .+38 ; 0x119c8 119a2: 80 91 ce 13 lds r24, 0x13CE ; 0x8013ce { if(autoReportFeatures.Temp()){ 119a6: 80 fd sbrc r24, 0 gcode_M105(); 119a8: 0e 94 87 7c call 0xf90e ; 0xf90e 119ac: 80 91 ce 13 lds r24, 0x13CE ; 0x8013ce } if(autoReportFeatures.Pos()){ 119b0: 82 fd sbrc r24, 2 gcode_M114(); 119b2: 0e 94 0c 7c call 0xf818 ; 0xf818 119b6: 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()){ 119ba: 81 fd sbrc r24, 1 gcode_M123(); 119bc: 0e 94 66 65 call 0xcacc ; 0xcacc } else{ auto_report_timer.stop(); } } inline void TimerStart() { auto_report_timer.start(); } 119c0: 80 ed ldi r24, 0xD0 ; 208 119c2: 93 e1 ldi r25, 0x13 ; 19 119c4: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; 119c8: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 119cc: 81 11 cpse r24, r1 119ce: 02 c0 rjmp .+4 ; 0x119d4 119d0: 0e 94 12 7d call 0xfa24 ; 0xfa24 bool M79_timer_get_status() { return M79_timer.running(); } void M79_timer_update_status() { M79_timer.expired(M79_TIMEOUT); 119d4: 40 e3 ldi r20, 0x30 ; 48 119d6: 55 e7 ldi r21, 0x75 ; 117 119d8: 60 e0 ldi r22, 0x00 ; 0 119da: 70 e0 ldi r23, 0x00 ; 0 119dc: 8c e8 ldi r24, 0x8C ; 140 119de: 93 e0 ldi r25, 0x03 ; 3 #if defined(AUTO_REPORT) host_autoreport(); #endif //AUTO_REPORT host_keepalive(); M79_timer_update_status(); } 119e0: df 91 pop r29 119e2: cf 91 pop r28 119e4: 1f 91 pop r17 119e6: 0f 91 pop r16 119e8: 0d 94 21 0c jmp 0x21842 ; 0x21842 ::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; 119ec: 10 92 3f 03 sts 0x033F, r1 ; 0x80033f 119f0: 10 92 40 03 sts 0x0340, r1 ; 0x800340 119f4: 10 92 41 03 sts 0x0341, r1 ; 0x800341 119f8: 10 92 42 03 sts 0x0342, r1 ; 0x800342 119fc: 64 cf rjmp .-312 ; 0x118c6 #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; 119fe: c0 93 1d 06 sts 0x061D, r28 ; 0x80061d 11a02: 68 cf rjmp .-304 ; 0x118d4 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; 11a04: 10 92 a4 05 sts 0x05A4, r1 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.499> 11a08: 4f bf out 0x3f, r20 ; 63 } } Sound_MakeSound(did_rotate ? e_SOUND_TYPE_EncoderMove : e_SOUND_TYPE_ButtonEcho); 11a0a: 80 e0 ldi r24, 0x00 ; 0 11a0c: a2 cf rjmp .-188 ; 0x11952 00011a0e : #endif #endif } void delay_keep_alive(unsigned int ms) { 11a0e: cf 93 push r28 11a10: df 93 push r29 11a12: ec 01 movw r28, r24 for (;;) { manage_heater(); 11a14: 0f 94 a8 37 call 0x26f50 ; 0x26f50 // Manage inactivity, but don't disable steppers on timeout. manage_inactivity(true); 11a18: 81 e0 ldi r24, 0x01 ; 1 11a1a: 0e 94 ad 8a call 0x1155a ; 0x1155a lcd_update(0); 11a1e: 80 e0 ldi r24, 0x00 ; 0 11a20: 0e 94 4a 6f call 0xde94 ; 0xde94 if (ms == 0) 11a24: 20 97 sbiw r28, 0x00 ; 0 11a26: 99 f0 breq .+38 ; 0x11a4e break; else if (ms >= 50) { 11a28: c2 33 cpi r28, 0x32 ; 50 11a2a: d1 05 cpc r29, r1 11a2c: 40 f0 brcs .+16 ; 0x11a3e _delay(50); 11a2e: 62 e3 ldi r22, 0x32 ; 50 11a30: 70 e0 ldi r23, 0x00 ; 0 11a32: 80 e0 ldi r24, 0x00 ; 0 11a34: 90 e0 ldi r25, 0x00 ; 0 11a36: 0f 94 56 0b call 0x216ac ; 0x216ac ms -= 50; 11a3a: e2 97 sbiw r28, 0x32 ; 50 11a3c: eb cf rjmp .-42 ; 0x11a14 } else { _delay(ms); 11a3e: be 01 movw r22, r28 11a40: 90 e0 ldi r25, 0x00 ; 0 11a42: 80 e0 ldi r24, 0x00 ; 0 11a44: 0f 94 56 0b call 0x216ac ; 0x216ac ms = 0; 11a48: d0 e0 ldi r29, 0x00 ; 0 11a4a: c0 e0 ldi r28, 0x00 ; 0 11a4c: e3 cf rjmp .-58 ; 0x11a14 } } } 11a4e: df 91 pop r29 11a50: cf 91 pop r28 11a52: 08 95 ret 00011a54 : /// @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) { 11a54: cf 93 push r28 11a56: df 93 push r29 11a58: c8 2f mov r28, r24 inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11a5a: df ef ldi r29, 0xFF ; 255 MMU2::Buttons btn; for(;;) { manage_heater(); 11a5c: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 11a60: 81 e0 ldi r24, 0x01 ; 1 11a62: 0e 94 ad 8a call 0x1155a ; 0x1155a 11a66: 80 91 ff 12 lds r24, 0x12FF ; 0x8012ff btn = MMU2::mmu2.GetPrinterButtonOperation(); if (btn != MMU2::Buttons::NoButton) 11a6a: 8f 3f cpi r24, 0xFF ; 255 11a6c: d9 f4 brne .+54 ; 0x11aa4 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 11a6e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 11a72: 84 30 cpi r24, 0x04 ; 4 11a74: 21 f4 brne .+8 ; 0x11a7e }; 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 11a76: 80 91 97 12 lds r24, 0x1297 ; 0x801297 11a7a: 81 11 cpse r24, r1 11a7c: ef cf rjmp .-34 ; 0x11a5c 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 11a7e: 80 91 d2 12 lds r24, 0x12D2 ; 0x8012d2 11a82: 90 91 d3 12 lds r25, 0x12D3 ; 0x8012d3 11a86: 01 97 sbiw r24, 0x01 ; 1 11a88: 49 f7 brne .-46 ; 0x11a5c && lastErrorCode != ec) // The error code is not a duplicate 11a8a: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 11a8e: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 11a92: 89 32 cpi r24, 0x29 ; 41 11a94: 90 48 sbci r25, 0x80 ; 128 11a96: 11 f3 breq .-60 ; 0x11a5c { ReportError(ec, ErrorSource::ErrorSourcePrinter); 11a98: 60 e0 ldi r22, 0x00 ; 0 11a9a: 89 e2 ldi r24, 0x29 ; 41 11a9c: 90 e8 ldi r25, 0x80 ; 128 11a9e: 0f 94 35 75 call 0x2ea6a ; 0x2ea6a 11aa2: dc cf rjmp .-72 ; 0x11a5c inline Buttons GetPrinterButtonOperation() { return printerButtonOperation; } inline void ClearPrinterButtonOperation() { printerButtonOperation = Buttons::NoButton; 11aa4: d0 93 ff 12 sts 0x12FF, r29 ; 0x8012ff { MMU2::mmu2.ClearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { 11aa8: 85 30 cpi r24, 0x05 ; 5 11aaa: 39 f4 brne .+14 ; 0x11aba if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { 11aac: cf 3f cpi r28, 0xFF ; 255 11aae: f9 f2 breq .-66 ; 0x11a6e MMU2::mmu2.eject_filament(eject_slot, true); 11ab0: 61 e0 ldi r22, 0x01 ; 1 11ab2: 8c 2f mov r24, r28 11ab4: 0f 94 6d 9e call 0x33cda ; 0x33cda 11ab8: d1 cf rjmp .-94 ; 0x11a5c // the operation is done. We must be careful to not raise FILAMENT_CHANGE // screen too quickly continue; } } else if (btn == MMU2::Buttons::Load) 11aba: 84 30 cpi r24, 0x04 ; 4 11abc: c1 f6 brne .-80 ; 0x11a6e } } MMU2::mmu2.InvokeErrorScreen(ErrorCode::FILAMENT_CHANGE); } } 11abe: df 91 pop r29 11ac0: cf 91 pop r28 11ac2: 08 95 ret 00011ac4 : //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) { 11ac4: ff 92 push r15 11ac6: 0f 93 push r16 11ac8: 1f 93 push r17 11aca: cf 93 push r28 11acc: df 93 push r29 11ace: ec 01 movw r28, r24 11ad0: f6 2e mov r15, r22 size_t len = from_progmem ? strlen_P(cmd) : strlen(cmd); 11ad2: 66 23 and r22, r22 11ad4: 09 f4 brne .+2 ; 0x11ad8 11ad6: 4b c0 rjmp .+150 ; 0x11b6e 11ad8: 0f 94 3f a2 call 0x3447e ; 0x3447e <__strlen_P> 11adc: 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)) { 11ade: c8 01 movw r24, r16 11ae0: 0e 94 ef 55 call 0xabde ; 0xabde 11ae4: 88 23 and r24, r24 11ae6: 09 f4 brne .+2 ; 0x11aea 11ae8: 53 c0 rjmp .+166 ; 0x11b90 // 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; 11aea: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> 11aee: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 11af2: fc 01 movw r30, r24 11af4: e5 5b subi r30, 0xB5 ; 181 11af6: ff 4e sbci r31, 0xEF ; 239 11af8: 23 e0 ldi r18, 0x03 ; 3 11afa: 20 83 st Z, r18 11afc: 82 5b subi r24, 0xB2 ; 178 11afe: 9f 4e sbci r25, 0xEF ; 239 if (from_progmem) strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 11b00: 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) 11b02: ff 20 and r15, r15 11b04: e9 f1 breq .+122 ; 0x11b80 strcpy_P(cmdbuffer + bufindw + CMDHDRSIZE, cmd); 11b06: 0f 94 38 a2 call 0x34470 ; 0x34470 else strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; 11b0a: 84 ee ldi r24, 0xE4 ; 228 11b0c: 92 ea ldi r25, 0xA2 ; 162 11b0e: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(MSG_Enqueing); 11b12: 81 e6 ldi r24, 0x61 ; 97 11b14: 93 e6 ldi r25, 0x63 ; 99 11b16: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); 11b1a: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> 11b1e: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 11b22: 82 5b subi r24, 0xB2 ; 178 11b24: 9f 4e sbci r25, 0xEF ; 239 11b26: 0e 94 0e 86 call 0x10c1c ; 0x10c1c SERIAL_ECHOLNPGM("\""); 11b2a: 8a e2 ldi r24, 0x2A ; 42 11b2c: 93 e7 ldi r25, 0x73 ; 115 11b2e: 0e 94 0e 7d call 0xfa1c ; 0xfa1c bufindw += len + (CMDHDRSIZE + 1); 11b32: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> 11b36: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 11b3a: 04 96 adiw r24, 0x04 ; 4 11b3c: 08 0f add r16, r24 11b3e: 19 1f adc r17, r25 if (bufindw == sizeof(cmdbuffer)) 11b40: 0d 3e cpi r16, 0xED ; 237 11b42: 81 e0 ldi r24, 0x01 ; 1 11b44: 18 07 cpc r17, r24 11b46: f9 f0 breq .+62 ; 0x11b86 strcpy(cmdbuffer + bufindw + CMDHDRSIZE, cmd); SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); 11b48: 10 93 4a 10 sts 0x104A, r17 ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 11b4c: 00 93 49 10 sts 0x1049, r16 ; 0x801049 <_ZL7bufindw.lto_priv.511> if (bufindw == sizeof(cmdbuffer)) bufindw = 0; ++ buflen; 11b50: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 11b54: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 11b58: 01 96 adiw r24, 0x01 ; 1 11b5a: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 11b5e: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11b62: df 91 pop r29 11b64: cf 91 pop r28 11b66: 1f 91 pop r17 11b68: 0f 91 pop r16 11b6a: ff 90 pop r15 11b6c: 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); 11b6e: fc 01 movw r30, r24 11b70: 01 90 ld r0, Z+ 11b72: 00 20 and r0, r0 11b74: e9 f7 brne .-6 ; 0x11b70 11b76: 31 97 sbiw r30, 0x01 ; 1 11b78: 8f 01 movw r16, r30 11b7a: 08 1b sub r16, r24 11b7c: 19 0b sbc r17, r25 11b7e: af cf rjmp .-162 ; 0x11ade // 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); 11b80: 0f 94 ec aa call 0x355d8 ; 0x355d8 11b84: c2 cf rjmp .-124 ; 0x11b0a SERIAL_ECHORPGM(MSG_Enqueing); SERIAL_ECHO(cmdbuffer + bufindw + CMDHDRSIZE); SERIAL_ECHOLNPGM("\""); bufindw += len + (CMDHDRSIZE + 1); if (bufindw == sizeof(cmdbuffer)) bufindw = 0; 11b86: 10 92 4a 10 sts 0x104A, r1 ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 11b8a: 10 92 49 10 sts 0x1049, r1 ; 0x801049 <_ZL7bufindw.lto_priv.511> 11b8e: e0 cf rjmp .-64 ; 0x11b50 ++ buflen; #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 11b90: 87 ec ldi r24, 0xC7 ; 199 11b92: 92 ea ldi r25, 0xA2 ; 162 11b94: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(MSG_Enqueing); 11b98: 81 e6 ldi r24, 0x61 ; 97 11b9a: 93 e6 ldi r25, 0x63 ; 99 11b9c: 0e 94 15 7b call 0xf62a ; 0xf62a if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 11ba0: ce 01 movw r24, r28 cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) 11ba2: ff 20 and r15, r15 11ba4: 59 f0 breq .+22 ; 0x11bbc SERIAL_PROTOCOLRPGM(cmd); 11ba6: 0e 94 15 7b call 0xf62a ; 0xf62a else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11baa: 85 e9 ldi r24, 0x95 ; 149 11bac: 92 ea ldi r25, 0xA2 ; 162 #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 11bae: df 91 pop r29 11bb0: cf 91 pop r28 11bb2: 1f 91 pop r17 11bb4: 0f 91 pop r16 11bb6: ff 90 pop r15 SERIAL_ECHORPGM(MSG_Enqueing); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 11bb8: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c 11bbc: 0e 94 0e 86 call 0x10c1c ; 0x10c1c 11bc0: f4 cf rjmp .-24 ; 0x11baa 00011bc2 : } menu_item++; } void menu_item_gcode_P(const char* str, const char* str_gcode) { 11bc2: cf 93 push r28 11bc4: df 93 push r29 if (menu_item == menu_line) 11bc6: 30 91 63 04 lds r19, 0x0463 ; 0x800463 11bca: 20 91 62 04 lds r18, 0x0462 ; 0x800462 11bce: 32 13 cpse r19, r18 11bd0: 20 c0 rjmp .+64 ; 0x11c12 11bd2: eb 01 movw r28, r22 11bd4: bc 01 movw r22, r24 { if (lcd_draw_update) menu_draw_item_puts_P(' ', str); 11bd6: 80 91 59 02 lds r24, 0x0259 ; 0x800259 11bda: 88 23 and r24, r24 11bdc: 19 f0 breq .+6 ; 0x11be4 11bde: 80 e2 ldi r24, 0x20 ; 32 11be0: 0e 94 d7 72 call 0xe5ae ; 0xe5ae if (menu_clicked && (lcd_encoder == menu_item)) 11be4: 80 91 61 04 lds r24, 0x0461 ; 0x800461 11be8: 88 23 and r24, r24 11bea: 99 f0 breq .+38 ; 0x11c12 11bec: 20 91 63 04 lds r18, 0x0463 ; 0x800463 11bf0: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 11bf4: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 11bf8: 28 17 cp r18, r24 11bfa: 19 06 cpc r1, r25 11bfc: 51 f4 brne .+20 ; 0x11c12 { if (str_gcode) enquecommand_P(str_gcode); 11bfe: 20 97 sbiw r28, 0x00 ; 0 11c00: 21 f0 breq .+8 ; 0x11c0a 11c02: 61 e0 ldi r22, 0x01 ; 1 11c04: ce 01 movw r24, r28 11c06: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 menu_item_ret(); return; } } menu_item++; } 11c0a: df 91 pop r29 11c0c: 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(); 11c0e: 0c 94 c4 62 jmp 0xc588 ; 0xc588 return; } } menu_item++; 11c12: 80 91 63 04 lds r24, 0x0463 ; 0x800463 11c16: 8f 5f subi r24, 0xFF ; 255 11c18: 80 93 63 04 sts 0x0463, r24 ; 0x800463 } 11c1c: df 91 pop r29 11c1e: cf 91 pop r28 11c20: 08 95 ret 00011c22 : { 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) { 11c22: 0f 93 push r16 11c24: 1f 93 push r17 11c26: cf 93 push r28 11c28: df 93 push r29 11c2a: d6 2f mov r29, r22 11c2c: 8c 01 movw r16, r24 for (uint8_t i = 0; i < steps; ++i) 11c2e: c0 e0 ldi r28, 0x00 ; 0 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); 11c30: f8 01 movw r30, r16 11c32: 85 91 lpm r24, Z+ 11c34: 94 91 lpm r25, Z 11c36: 61 e0 ldi r22, 0x01 ; 1 11c38: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 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) 11c3c: cf 5f subi r28, 0xFF ; 255 11c3e: 0e 5f subi r16, 0xFE ; 254 11c40: 1f 4f sbci r17, 0xFF ; 255 11c42: dc 13 cpse r29, r28 11c44: f5 cf rjmp .-22 ; 0x11c30 { enquecommand_P(static_cast(pgm_read_ptr(cmd_sequence + i))); } } 11c46: df 91 pop r29 11c48: cf 91 pop r28 11c4a: 1f 91 pop r17 11c4c: 0f 91 pop r16 11c4e: 08 95 ret 00011c50 : static const char bufferFull[] PROGMEM = "\" failed: Buffer full!"; static const char enqueingFront[] PROGMEM = "Enqueing to the front: \""; void enquecommandf_P(const char *fmt, ...) { 11c50: cf 93 push r28 11c52: df 93 push r29 11c54: cd b7 in r28, 0x3d ; 61 11c56: de b7 in r29, 0x3e ; 62 11c58: 6e 97 sbiw r28, 0x1e ; 30 11c5a: 0f b6 in r0, 0x3f ; 63 11c5c: f8 94 cli 11c5e: de bf out 0x3e, r29 ; 62 11c60: 0f be out 0x3f, r0 ; 63 11c62: cd bf out 0x3d, r28 ; 61 11c64: 9e 01 movw r18, r28 11c66: 2c 5d subi r18, 0xDC ; 220 11c68: 3f 4f sbci r19, 0xFF ; 255 11c6a: f9 01 movw r30, r18 11c6c: 41 91 ld r20, Z+ 11c6e: 51 91 ld r21, Z+ 11c70: 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); 11c72: 6e e1 ldi r22, 0x1E ; 30 11c74: 70 e0 ldi r23, 0x00 ; 0 11c76: ce 01 movw r24, r28 11c78: 01 96 adiw r24, 0x01 ; 1 11c7a: 0f 94 d7 a3 call 0x347ae ; 0x347ae va_end(ap); enquecommand(cmd_buffer, false); 11c7e: 60 e0 ldi r22, 0x00 ; 0 11c80: ce 01 movw r24, r28 11c82: 01 96 adiw r24, 0x01 ; 1 11c84: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 } 11c88: 6e 96 adiw r28, 0x1e ; 30 11c8a: 0f b6 in r0, 0x3f ; 63 11c8c: f8 94 cli 11c8e: de bf out 0x3e, r29 ; 62 11c90: 0f be out 0x3f, r0 ; 63 11c92: cd bf out 0x3d, r28 ; 61 11c94: df 91 pop r29 11c96: cf 91 pop r28 11c98: 08 95 ret 00011c9a : 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() 11c9a: 2f 92 push r2 11c9c: 3f 92 push r3 11c9e: 4f 92 push r4 11ca0: 5f 92 push r5 11ca2: 6f 92 push r6 11ca4: 7f 92 push r7 11ca6: 8f 92 push r8 11ca8: 9f 92 push r9 11caa: af 92 push r10 11cac: bf 92 push r11 11cae: cf 92 push r12 11cb0: df 92 push r13 11cb2: ef 92 push r14 11cb4: ff 92 push r15 11cb6: 0f 93 push r16 11cb8: 1f 93 push r17 11cba: cf 93 push r28 11cbc: df 93 push r29 11cbe: cd b7 in r28, 0x3d ; 61 11cc0: de b7 in r29, 0x3e ; 62 11cc2: c3 56 subi r28, 0x63 ; 99 11cc4: d1 09 sbc r29, r1 11cc6: 0f b6 in r0, 0x3f ; 63 11cc8: f8 94 cli 11cca: de bf out 0x3e, r29 ; 62 11ccc: 0f be out 0x3f, r0 ; 63 11cce: cd bf out 0x3d, r28 ; 61 #endif /* CMDBUFFER_DEBUG */ unsigned long codenum; //throw away variable // PRUSA GCODES KEEPALIVE_STATE(IN_HANDLER); 11cd0: 82 e0 ldi r24, 0x02 ; 2 11cd2: 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) { 11cd6: 00 91 38 12 lds r16, 0x1238 ; 0x801238 11cda: 10 91 39 12 lds r17, 0x1239 ; 0x801239 11cde: 02 5b subi r16, 0xB2 ; 178 11ce0: 1f 4e sbci r17, 0xEF ; 239 11ce2: 45 e0 ldi r20, 0x05 ; 5 11ce4: 50 e0 ldi r21, 0x00 ; 0 11ce6: 67 ef ldi r22, 0xF7 ; 247 11ce8: 71 e8 ldi r23, 0x81 ; 129 11cea: c8 01 movw r24, r16 11cec: 0f 94 60 a2 call 0x344c0 ; 0x344c0 11cf0: 89 2b or r24, r25 11cf2: 09 f0 breq .+2 ; 0x11cf6 11cf4: 9b c1 rjmp .+822 ; 0x1202c eeprom_update_byte_notify((uint8_t*)EEPROM_FAN_CHECK_ENABLED, true); } } bool farm_prusa_code_seen() { if (!farm_mode) 11cf6: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 11cfa: 88 23 and r24, r24 11cfc: 09 f4 brne .+2 ; 0x11d00 11cfe: 4d c0 rjmp .+154 ; 0x11d9a return false; if (code_seen_P(PSTR("PRN"))) { // PRUSA PRN 11d00: 84 ef ldi r24, 0xF4 ; 244 11d02: 9e e7 ldi r25, 0x7E ; 126 11d04: 0f 94 ee 39 call 0x273dc ; 0x273dc 11d08: 88 23 and r24, r24 11d0a: 79 f0 breq .+30 ; 0x11d2a printf_P(_N("%u"), status_number); 11d0c: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.489> 11d10: 1f 92 push r1 11d12: 8f 93 push r24 11d14: 84 ec ldi r24, 0xC4 ; 196 11d16: 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); 11d18: 9f 93 push r25 11d1a: 8f 93 push r24 11d1c: 0f 94 43 a3 call 0x34686 ; 0x34686 11d20: 0f 90 pop r0 11d22: 0f 90 pop r0 11d24: 0f 90 pop r0 11d26: 0f 90 pop r0 11d28: 08 c0 rjmp .+16 ; 0x11d3a } else if (code_seen_P(PSTR("thx"))) { // PRUSA thx 11d2a: 80 ef ldi r24, 0xF0 ; 240 11d2c: 9e e7 ldi r25, 0x7E ; 126 11d2e: 0f 94 ee 39 call 0x273dc ; 0x273dc 11d32: 88 23 and r24, r24 11d34: 41 f0 breq .+16 ; 0x11d46 no_response = false; 11d36: 10 92 08 04 sts 0x0408, r1 ; 0x800408 <_ZL11no_response.lto_priv.490> SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); 11d3a: 81 e0 ldi r24, 0x01 ; 1 11d3c: 80 93 78 02 sts 0x0278, r24 ; 0x800278 ClearToSend(); 11d40: 0e 94 9b 83 call 0x10736 ; 0x10736 11d44: 3a c2 rjmp .+1140 ; 0x121ba trace(); prusa_sd_card_upload = true; card.openFileWrite(strchr_pointer+4); } #endif //PRUSA_M28 else if (code_seen_P(PSTR("fv"))) { // PRUSA fv 11d46: 8d ee ldi r24, 0xED ; 237 11d48: 9e e7 ldi r25, 0x7E ; 126 11d4a: 0f 94 ee 39 call 0x273dc ; 0x273dc 11d4e: 88 23 and r24, r24 11d50: 21 f1 breq .+72 ; 0x11d9a // get file version #ifdef SDSUPPORT card.openFileReadFilteredGcode(strchr_pointer + 3, true); 11d52: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 11d56: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 11d5a: 61 e0 ldi r22, 0x01 ; 1 11d5c: 03 96 adiw r24, 0x03 ; 3 11d5e: 0f 94 91 71 call 0x2e322 ; 0x2e322 FORCE_INLINE bool isFileOpen() { return file.isOpen(); } bool eof() { return sdpos>=filesize; } FORCE_INLINE int16_t getFilteredGcodeChar() { int16_t c = (int16_t)file.readFilteredGcode(); 11d62: 0f 94 8d 6c call 0x2d91a ; 0x2d91a 11d66: 8c 01 movw r16, r24 sdpos = file.curPosition(); 11d68: 80 91 6f 16 lds r24, 0x166F ; 0x80166f 11d6c: 90 91 70 16 lds r25, 0x1670 ; 0x801670 11d70: a0 91 71 16 lds r26, 0x1671 ; 0x801671 11d74: b0 91 72 16 lds r27, 0x1672 ; 0x801672 11d78: 80 93 eb 16 sts 0x16EB, r24 ; 0x8016eb 11d7c: 90 93 ec 16 sts 0x16EC, r25 ; 0x8016ec 11d80: a0 93 ed 16 sts 0x16ED, r26 ; 0x8016ed 11d84: b0 93 ee 16 sts 0x16EE, r27 ; 0x8016ee while (true) { uint16_t readByte = card.getFilteredGcodeChar(); MYSERIAL.write(readByte); 11d88: 80 2f mov r24, r16 11d8a: 0e 94 02 7a call 0xf404 ; 0xf404 if (readByte == '\n') { 11d8e: 0a 30 cpi r16, 0x0A ; 10 11d90: 11 05 cpc r17, r1 11d92: 39 f7 brne .-50 ; 0x11d62 break; } } card.closefile(); 11d94: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e 11d98: d0 cf rjmp .-96 ; 0x11d3a - `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"))) { 11d9a: 8d ee ldi r24, 0xED ; 237 11d9c: 91 e8 ldi r25, 0x81 ; 129 11d9e: 0f 94 ee 39 call 0x273dc ; 0x273dc 11da2: 81 11 cpse r24, r1 11da4: ca cf rjmp .-108 ; 0x11d3a gcode_PRUSA_BadRAMBoFanTest(); } else if (code_seen_P(PSTR("FAN"))) { // PRUSA FAN 11da6: 89 ee ldi r24, 0xE9 ; 233 11da8: 91 e8 ldi r25, 0x81 ; 129 11daa: 0f 94 ee 39 call 0x273dc ; 0x273dc 11dae: 88 23 and r24, r24 11db0: 21 f1 breq .+72 ; 0x11dfa printf_P(_N("E0:%d RPM\nPRN0:%d RPM\n"), 60*fan_speed[0], 60*fan_speed[1]); 11db2: 40 91 b9 03 lds r20, 0x03B9 ; 0x8003b9 11db6: 50 91 ba 03 lds r21, 0x03BA ; 0x8003ba 11dba: 2c e3 ldi r18, 0x3C ; 60 11dbc: 24 9f mul r18, r20 11dbe: c0 01 movw r24, r0 11dc0: 25 9f mul r18, r21 11dc2: 90 0d add r25, r0 11dc4: 11 24 eor r1, r1 11dc6: 9f 93 push r25 11dc8: 8f 93 push r24 11dca: 40 91 b7 03 lds r20, 0x03B7 ; 0x8003b7 11dce: 50 91 b8 03 lds r21, 0x03B8 ; 0x8003b8 11dd2: 24 9f mul r18, r20 11dd4: c0 01 movw r24, r0 11dd6: 25 9f mul r18, r21 11dd8: 90 0d add r25, r0 11dda: 11 24 eor r1, r1 11ddc: 9f 93 push r25 11dde: 8f 93 push r24 11de0: 82 ee ldi r24, 0xE2 ; 226 11de2: 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); 11de4: 9f 93 push r25 11de6: 8f 93 push r24 11de8: 0f 94 43 a3 call 0x34686 ; 0x34686 11dec: 0f 90 pop r0 11dee: 0f 90 pop r0 11df0: 0f 90 pop r0 11df2: 0f 90 pop r0 11df4: 0f 90 pop r0 11df6: 0f 90 pop r0 11df8: a0 cf rjmp .-192 ; 0x11d3a 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 11dfa: 84 ee ldi r24, 0xE4 ; 228 11dfc: 91 e8 ldi r25, 0x81 ; 129 11dfe: 0f 94 ee 39 call 0x273dc ; 0x273dc 11e02: 88 23 and r24, r24 11e04: 11 f1 breq .+68 ; 0x11e4a if (eeprom_read_byte((uint8_t*)EEPROM_UVLO_PRINT_TYPE) == PowerPanic::PRINT_TYPE_SD) { 11e06: 8c e8 ldi r24, 0x8C ; 140 11e08: 9f e0 ldi r25, 0x0F ; 15 11e0a: 0f 94 81 a4 call 0x34902 ; 0x34902 11e0e: 81 11 cpse r24, r1 11e10: 10 c0 rjmp .+32 ; 0x11e32 // M24 - Start SD print enquecommand_P(MSG_M24); 11e12: 61 e0 ldi r22, 0x01 ; 1 11e14: 87 e0 ldi r24, 0x07 ; 7 11e16: 9d e6 ldi r25, 0x6D ; 109 11e18: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 11e1c: 60 e0 ldi r22, 0x00 ; 0 11e1e: 85 ea ldi r24, 0xA5 ; 165 11e20: 9f e0 ldi r25, 0x0F ; 15 11e22: 0f 94 a5 a4 call 0x3494a ; 0x3494a 11e26: 60 e0 ldi r22, 0x00 ; 0 11e28: 8f e7 ldi r24, 0x7F ; 127 11e2a: 9c e0 ldi r25, 0x0C ; 12 11e2c: 0f 94 a5 a4 call 0x3494a ; 0x3494a 11e30: 84 cf rjmp .-248 ; 0x11d3a // 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) { 11e32: 81 30 cpi r24, 0x01 ; 1 11e34: 09 f0 breq .+2 ; 0x11e38 11e36: 81 cf rjmp .-254 ; 0x11d3a // 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(); 11e38: 0f 94 be 16 call 0x22d7c ; 0x22d7c usb_timer.start(); 11e3c: 82 e4 ldi r24, 0x42 ; 66 11e3e: 92 e1 ldi r25, 0x12 ; 18 11e40: 0f 94 e7 0b call 0x217ce ; 0x217ce ::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(); 11e44: 0f 94 95 0b call 0x2172a ; 0x2172a 11e48: 78 cf rjmp .-272 ; 0x11d3a } } else if (code_seen_P(PSTR("MMURES"))) { // PRUSA MMURES 11e4a: 8d ed ldi r24, 0xDD ; 221 11e4c: 91 e8 ldi r25, 0x81 ; 129 11e4e: 0f 94 ee 39 call 0x273dc ; 0x273dc 11e52: 88 23 and r24, r24 11e54: 21 f0 breq .+8 ; 0x11e5e break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 11e56: 80 e0 ldi r24, 0x00 ; 0 11e58: 0f 94 e4 95 call 0x32bc8 ; 0x32bc8 11e5c: 6e cf rjmp .-292 ; 0x11d3a MMU2::mmu2.Reset(MMU2::MMU2::Software); } else if (code_seen_P(PSTR("RESET"))) { // PRUSA RESET 11e5e: 87 ed ldi r24, 0xD7 ; 215 11e60: 91 e8 ldi r25, 0x81 ; 129 11e62: 0f 94 ee 39 call 0x273dc ; 0x273dc 11e66: 81 11 cpse r24, r1 #if defined(XFLASH) && defined(BOOTAPP) boot_app_magic = 0; #endif //defined(XFLASH) && defined(BOOTAPP) softReset(); 11e68: 0e 94 70 66 call 0xcce0 ; 0xcce0 } else if (code_seen_P(PSTR("SN"))) { // PRUSA SN 11e6c: 84 ed ldi r24, 0xD4 ; 212 11e6e: 91 e8 ldi r25, 0x81 ; 129 11e70: 0f 94 ee 39 call 0x273dc ; 0x273dc 11e74: 88 23 and r24, r24 11e76: a9 f0 breq .+42 ; 0x11ea2 char SN[20]; eeprom_read_block(SN, (uint8_t*)EEPROM_PRUSA_SN, 20); 11e78: 44 e1 ldi r20, 0x14 ; 20 11e7a: 50 e0 ldi r21, 0x00 ; 0 11e7c: 65 e1 ldi r22, 0x15 ; 21 11e7e: 7d e0 ldi r23, 0x0D ; 13 11e80: ce 01 movw r24, r28 11e82: 01 96 adiw r24, 0x01 ; 1 11e84: 0f 94 71 a4 call 0x348e2 ; 0x348e2 if (SN[19]) 11e88: 8c 89 ldd r24, Y+20 ; 0x14 11e8a: 88 23 and r24, r24 11e8c: 29 f0 breq .+10 ; 0x11e98 puts_P(PSTR("SN invalid")); 11e8e: 89 ec ldi r24, 0xC9 ; 201 11e90: 91 e8 ldi r25, 0x81 ; 129 11e92: 0f 94 6a a3 call 0x346d4 ; 0x346d4 11e96: 51 cf rjmp .-350 ; 0x11d3a else puts(SN); 11e98: ce 01 movw r24, r28 11e9a: 01 96 adiw r24, 0x01 ; 1 11e9c: 0f 94 10 ab call 0x35620 ; 0x35620 11ea0: 4c cf rjmp .-360 ; 0x11d3a } else if(code_seen_P(PSTR("Fir"))){ // PRUSA Fir 11ea2: 85 ec ldi r24, 0xC5 ; 197 11ea4: 91 e8 ldi r25, 0x81 ; 129 11ea6: 0f 94 ee 39 call 0x273dc ; 0x273dc 11eaa: 88 23 and r24, r24 11eac: 29 f0 breq .+10 ; 0x11eb8 SERIAL_PROTOCOLLNPGM(FW_VERSION_FULL); 11eae: 89 eb ldi r24, 0xB9 ; 185 11eb0: 91 e8 ldi r25, 0x81 ; 129 else { SERIAL_ECHO_START; SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); 11eb2: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 11eb6: 41 cf rjmp .-382 ; 0x11d3a 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 11eb8: 85 eb ldi r24, 0xB5 ; 181 11eba: 91 e8 ldi r25, 0x81 ; 129 11ebc: 0f 94 ee 39 call 0x273dc ; 0x273dc 11ec0: 88 23 and r24, r24 11ec2: 19 f0 breq .+6 ; 0x11eca SERIAL_PROTOCOLLNPGM(FILAMENT_SIZE "-" ELECTRONICS "-" NOZZLE_TYPE ); 11ec4: 86 e9 ldi r24, 0x96 ; 150 11ec6: 91 e8 ldi r25, 0x81 ; 129 11ec8: f4 cf rjmp .-24 ; 0x11eb2 } else if(code_seen_P(PSTR("Lang"))) { // PRUSA Lang 11eca: 81 e9 ldi r24, 0x91 ; 145 11ecc: 91 e8 ldi r25, 0x81 ; 129 11ece: 0f 94 ee 39 call 0x273dc ; 0x273dc 11ed2: 88 23 and r24, r24 11ed4: 19 f0 breq .+6 ; 0x11edc lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 11ed6: 0e 94 8e 74 call 0xe91c ; 0xe91c 11eda: 2f cf rjmp .-418 ; 0x11d3a 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 11edc: 8e e8 ldi r24, 0x8E ; 142 11ede: 91 e8 ldi r25, 0x81 ; 129 11ee0: 0f 94 ee 39 call 0x273dc ; 0x273dc 11ee4: 88 23 and r24, r24 11ee6: 79 f0 breq .+30 ; 0x11f06 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 11ee8: 81 ea ldi r24, 0xA1 ; 161 11eea: 9d e0 ldi r25, 0x0D ; 13 11eec: 0f 94 81 a4 call 0x34902 ; 0x34902 11ef0: 2b e0 ldi r18, 0x0B ; 11 11ef2: 82 9f mul r24, r18 11ef4: c0 01 movw r24, r0 11ef6: 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); 11ef8: 70 e0 ldi r23, 0x00 ; 0 11efa: 60 e0 ldi r22, 0x00 ; 0 11efc: 80 5b subi r24, 0xB0 ; 176 11efe: 92 4f sbci r25, 0xF2 ; 242 11f00: 0f 94 c3 a4 call 0x34986 ; 0x34986 11f04: 1a cf rjmp .-460 ; 0x11d3a } else if(code_seen_P(PSTR("FR"))) { // PRUSA FR 11f06: 8b e8 ldi r24, 0x8B ; 139 11f08: 91 e8 ldi r25, 0x81 ; 129 11f0a: 0f 94 ee 39 call 0x273dc ; 0x273dc 11f0e: 88 23 and r24, r24 11f10: 51 f0 breq .+20 ; 0x11f26 // 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(); 11f12: 0e 94 77 70 call 0xe0ee ; 0xe0ee Sound_MakeCustom(100,0,false); 11f16: 40 e0 ldi r20, 0x00 ; 0 11f18: 70 e0 ldi r23, 0x00 ; 0 11f1a: 60 e0 ldi r22, 0x00 ; 0 11f1c: 84 e6 ldi r24, 0x64 ; 100 11f1e: 90 e0 ldi r25, 0x00 ; 0 11f20: 0f 94 4a 25 call 0x24a94 ; 0x24a94 11f24: d8 cf rjmp .-80 ; 0x11ed6 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 11f26: 87 e8 ldi r24, 0x87 ; 135 11f28: 91 e8 ldi r25, 0x81 ; 129 11f2a: 0f 94 ee 39 call 0x273dc ; 0x273dc 11f2e: 88 23 and r24, r24 11f30: e1 f0 breq .+56 ; 0x11f6a // Change the MBL status without changing the logical Z position. if(code_seen('V')) { 11f32: 86 e5 ldi r24, 0x56 ; 86 11f34: 0e 94 80 56 call 0xad00 ; 0xad00 11f38: 88 23 and r24, r24 11f3a: 09 f4 brne .+2 ; 0x11f3e 11f3c: fe ce rjmp .-516 ; 0x11d3a bool value = code_value_short(); 11f3e: 0e 94 a2 56 call 0xad44 ; 0xad44 11f42: 11 e0 ldi r17, 0x01 ; 1 11f44: 89 2b or r24, r25 11f46: 09 f4 brne .+2 ; 0x11f4a 11f48: 10 e0 ldi r17, 0x00 ; 0 st_synchronize(); 11f4a: 0f 94 94 18 call 0x23128 ; 0x23128 if(value != mbl.active) { 11f4e: 80 91 09 13 lds r24, 0x1309 ; 0x801309 11f52: 90 e0 ldi r25, 0x00 ; 0 11f54: 18 17 cp r17, r24 11f56: 19 06 cpc r1, r25 11f58: 09 f4 brne .+2 ; 0x11f5c 11f5a: ef ce rjmp .-546 ; 0x11d3a mbl.active = value; 11f5c: 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]); 11f60: 89 e6 ldi r24, 0x69 ; 105 11f62: 92 e1 ldi r25, 0x12 ; 18 11f64: 0f 94 98 3a call 0x27530 ; 0x27530 11f68: e8 ce rjmp .-560 ; 0x11d3a } } } else if (code_seen_P(PSTR("nozzle"))) { // PRUSA nozzle 11f6a: 80 e8 ldi r24, 0x80 ; 128 11f6c: 91 e8 ldi r25, 0x81 ; 129 11f6e: 0f 94 ee 39 call 0x273dc ; 0x273dc 11f72: 88 23 and r24, r24 11f74: 09 f4 brne .+2 ; 0x11f78 11f76: e1 ce rjmp .-574 ; 0x11d3a uint16_t nDiameter; if(code_seen('D')) { 11f78: 84 e4 ldi r24, 0x44 ; 68 11f7a: 0e 94 80 56 call 0xad00 ; 0xad00 11f7e: 88 23 and r24, r24 11f80: a1 f0 breq .+40 ; 0x11faa nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 11f82: 0e 94 10 5b call 0xb620 ; 0xb620 11f86: 20 e0 ldi r18, 0x00 ; 0 11f88: 30 e0 ldi r19, 0x00 ; 0 11f8a: 4a e7 ldi r20, 0x7A ; 122 11f8c: 54 e4 ldi r21, 0x44 ; 68 11f8e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 11f92: 20 e0 ldi r18, 0x00 ; 0 11f94: 30 e0 ldi r19, 0x00 ; 0 11f96: 40 e0 ldi r20, 0x00 ; 0 11f98: 5f e3 ldi r21, 0x3F ; 63 11f9a: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 11f9e: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> nozzle_diameter_check(nDiameter); 11fa2: cb 01 movw r24, r22 11fa4: 0e 94 df e8 call 0x1d1be ; 0x1d1be 11fa8: c8 ce rjmp .-624 ; 0x11d3a } else if(code_seen_P(PSTR("set")) && farm_mode) { 11faa: 8c e7 ldi r24, 0x7C ; 124 11fac: 91 e8 ldi r25, 0x81 ; 129 11fae: 0f 94 ee 39 call 0x273dc ; 0x273dc 11fb2: 88 23 and r24, r24 11fb4: 49 f1 breq .+82 ; 0x12008 11fb6: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 11fba: 88 23 and r24, r24 11fbc: 29 f1 breq .+74 ; 0x12008 strchr_pointer++; // skip 1st char (~ 's') strchr_pointer++; // skip 2nd char (~ 'e') 11fbe: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 11fc2: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 11fc6: 02 96 adiw r24, 0x02 ; 2 11fc8: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 11fcc: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 11fd0: 0e 94 10 5b call 0xb620 ; 0xb620 11fd4: 6b 01 movw r12, r22 11fd6: 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); 11fd8: 6f ef ldi r22, 0xFF ; 255 11fda: 87 ea ldi r24, 0xA7 ; 167 11fdc: 9d e0 ldi r25, 0x0D ; 13 11fde: 0f 94 a5 a4 call 0x3494a ; 0x3494a 11fe2: 20 e0 ldi r18, 0x00 ; 0 11fe4: 30 e0 ldi r19, 0x00 ; 0 11fe6: 4a e7 ldi r20, 0x7A ; 122 11fe8: 54 e4 ldi r21, 0x44 ; 68 11fea: c7 01 movw r24, r14 11fec: b6 01 movw r22, r12 11fee: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 11ff2: 20 e0 ldi r18, 0x00 ; 0 11ff4: 30 e0 ldi r19, 0x00 ; 0 11ff6: 40 e0 ldi r20, 0x00 ; 0 11ff8: 5f e3 ldi r21, 0x3F ; 63 11ffa: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 11ffe: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 12002: 85 ea ldi r24, 0xA5 ; 165 12004: 9d e0 ldi r25, 0x0D ; 13 12006: 7c cf rjmp .-264 ; 0x11f00 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); 12008: 85 ea ldi r24, 0xA5 ; 165 1200a: 9d e0 ldi r25, 0x0D ; 13 1200c: 0f 94 8f a4 call 0x3491e ; 0x3491e 12010: bc 01 movw r22, r24 12012: 90 e0 ldi r25, 0x00 ; 0 12014: 80 e0 ldi r24, 0x00 ; 0 12016: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 1201a: 20 e0 ldi r18, 0x00 ; 0 1201c: 30 e0 ldi r19, 0x00 ; 0 1201e: 4a e7 ldi r20, 0x7A ; 122 12020: 54 e4 ldi r21, 0x44 ; 68 12022: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 12026: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 1202a: 87 ce rjmp .-754 ; 0x11d3a } } else if(*CMDBUFFER_CURRENT_STRING == 'G') 1202c: d8 01 movw r26, r16 1202e: 8c 91 ld r24, X 12030: 87 34 cpi r24, 0x47 ; 71 12032: 11 f0 breq .+4 ; 0x12038 12034: 0c 94 41 9b jmp 0x13682 ; 0x13682 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 12038: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 1203c: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb gcode_in_progress = code_value_short(); 12040: 0e 94 a2 56 call 0xad44 ; 0xad44 12044: 90 93 56 03 sts 0x0356, r25 ; 0x800356 12048: 80 93 55 03 sts 0x0355, r24 ; 0x800355 // printf_P(_N("BEGIN G-CODE=%u\n"), gcode_in_progress); switch (gcode_in_progress) 1204c: 8b 34 cpi r24, 0x4B ; 75 1204e: 91 05 cpc r25, r1 12050: 09 f4 brne .+2 ; 0x12054 12052: 45 c6 rjmp .+3210 ; 0x12cde 12054: 0c f0 brlt .+2 ; 0x12058 12056: 4b c1 rjmp .+662 ; 0x122ee 12058: 84 30 cpi r24, 0x04 ; 4 1205a: 91 05 cpc r25, r1 1205c: 09 f4 brne .+2 ; 0x12060 1205e: aa c5 rjmp .+2900 ; 0x12bb4 12060: 0c f0 brlt .+2 ; 0x12064 12062: c5 c0 rjmp .+394 ; 0x121ee 12064: 97 fd sbrc r25, 7 12066: cf c0 rjmp .+414 ; 0x12206 12068: 02 97 sbiw r24, 0x02 ; 2 1206a: 0c f0 brlt .+2 ; 0x1206e 1206c: a2 c1 rjmp .+836 ; 0x123b2 */ case 0: // G0 -> G1 case 1: // G1 { uint16_t start_segment_idx = restore_interrupted_gcode(); 1206e: 0e 94 3c 55 call 0xaa78 ; 0xaa78 12072: 8c 01 movw r16, r24 get_coordinates(); // For X Y Z E F 12074: 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 12078: 60 91 17 06 lds r22, 0x0617 ; 0x800617 1207c: 70 91 18 06 lds r23, 0x0618 ; 0x800618 12080: 80 91 19 06 lds r24, 0x0619 ; 0x800619 12084: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 12088: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 1208c: 6b 01 movw r12, r22 1208e: 7c 01 movw r14, r24 12090: 40 90 6d 12 lds r4, 0x126D ; 0x80126d 12094: 50 90 6e 12 lds r5, 0x126E ; 0x80126e 12098: 60 90 6f 12 lds r6, 0x126F ; 0x80126f 1209c: 70 90 70 12 lds r7, 0x1270 ; 0x801270 120a0: 80 90 35 06 lds r8, 0x0635 ; 0x800635 120a4: 90 90 36 06 lds r9, 0x0636 ; 0x800636 120a8: a0 90 37 06 lds r10, 0x0637 ; 0x800637 120ac: b0 90 38 06 lds r11, 0x0638 ; 0x800638 120b0: a5 01 movw r20, r10 120b2: 94 01 movw r18, r8 120b4: c3 01 movw r24, r6 120b6: b2 01 movw r22, r4 120b8: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 120bc: 20 e0 ldi r18, 0x00 ; 0 120be: 30 e0 ldi r19, 0x00 ; 0 120c0: 48 ec ldi r20, 0xC8 ; 200 120c2: 52 e4 ldi r21, 0x42 ; 66 120c4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 120c8: 9b 01 movw r18, r22 120ca: ac 01 movw r20, r24 120cc: c7 01 movw r24, r14 120ce: b6 01 movw r22, r12 120d0: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 120d4: 18 16 cp r1, r24 120d6: d4 f4 brge .+52 ; 0x1210c total_filament_used = total_filament_used + ((destination[E_AXIS] - current_position[E_AXIS]) * 100); 120d8: a3 01 movw r20, r6 120da: 92 01 movw r18, r4 120dc: c5 01 movw r24, r10 120de: b4 01 movw r22, r8 120e0: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 120e4: 20 e0 ldi r18, 0x00 ; 0 120e6: 30 e0 ldi r19, 0x00 ; 0 120e8: 48 ec ldi r20, 0xC8 ; 200 120ea: 52 e4 ldi r21, 0x42 ; 66 120ec: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 120f0: a7 01 movw r20, r14 120f2: 96 01 movw r18, r12 120f4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 120f8: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 120fc: 60 93 17 06 sts 0x0617, r22 ; 0x800617 12100: 70 93 18 06 sts 0x0618, r23 ; 0x800618 12104: 80 93 19 06 sts 0x0619, r24 ; 0x800619 12108: 90 93 1a 06 sts 0x061A, r25 ; 0x80061a } #ifdef FWRETRACT if(cs.autoretract_enabled) { 1210c: 80 91 e9 0d lds r24, 0x0DE9 ; 0x800de9 12110: 88 23 and r24, r24 12112: 09 f4 brne .+2 ; 0x12116 12114: 46 c1 rjmp .+652 ; 0x123a2 if( !(code_seen('X') || code_seen('Y') || code_seen('Z')) && code_seen('E')) { 12116: 88 e5 ldi r24, 0x58 ; 88 12118: 0e 94 80 56 call 0xad00 ; 0xad00 1211c: 81 11 cpse r24, r1 1211e: 41 c1 rjmp .+642 ; 0x123a2 12120: 89 e5 ldi r24, 0x59 ; 89 12122: 0e 94 80 56 call 0xad00 ; 0xad00 12126: 81 11 cpse r24, r1 12128: 3c c1 rjmp .+632 ; 0x123a2 1212a: 8a e5 ldi r24, 0x5A ; 90 1212c: 0e 94 80 56 call 0xad00 ; 0xad00 12130: 81 11 cpse r24, r1 12132: 37 c1 rjmp .+622 ; 0x123a2 12134: 85 e4 ldi r24, 0x45 ; 69 12136: 0e 94 80 56 call 0xad00 ; 0xad00 1213a: 88 23 and r24, r24 1213c: 09 f4 brne .+2 ; 0x12140 1213e: 31 c1 rjmp .+610 ; 0x123a2 float echange=destination[E_AXIS]-current_position[E_AXIS]; 12140: 20 91 6d 12 lds r18, 0x126D ; 0x80126d 12144: 30 91 6e 12 lds r19, 0x126E ; 0x80126e 12148: 40 91 6f 12 lds r20, 0x126F ; 0x80126f 1214c: 50 91 70 12 lds r21, 0x1270 ; 0x801270 12150: 60 91 35 06 lds r22, 0x0635 ; 0x800635 12154: 70 91 36 06 lds r23, 0x0636 ; 0x800636 12158: 80 91 37 06 lds r24, 0x0637 ; 0x800637 1215c: 90 91 38 06 lds r25, 0x0638 ; 0x800638 12160: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 12164: 6b 01 movw r12, r22 12166: 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 12168: 2d ec ldi r18, 0xCD ; 205 1216a: 3c ec ldi r19, 0xCC ; 204 1216c: 4c ec ldi r20, 0xCC ; 204 1216e: 5d eb ldi r21, 0xBD ; 189 12170: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 12174: 87 ff sbrs r24, 7 12176: 07 c1 rjmp .+526 ; 0x12386 12178: 80 91 1b 06 lds r24, 0x061B ; 0x80061b 1217c: 81 11 cpse r24, r1 1217e: 0c 94 f6 b9 jmp 0x173ec ; 0x173ec st_synchronize(); 12182: 0f 94 94 18 call 0x23128 ; 0x23128 current_position[E_AXIS] = destination[E_AXIS]; //hide the slicer-generated retract/recover from calculations 12186: 80 91 35 06 lds r24, 0x0635 ; 0x800635 1218a: 90 91 36 06 lds r25, 0x0636 ; 0x800636 1218e: a0 91 37 06 lds r26, 0x0637 ; 0x800637 12192: b0 91 38 06 lds r27, 0x0638 ; 0x800638 12196: 80 93 6d 12 sts 0x126D, r24 ; 0x80126d 1219a: 90 93 6e 12 sts 0x126E, r25 ; 0x80126e 1219e: a0 93 6f 12 sts 0x126F, r26 ; 0x80126f 121a2: b0 93 70 12 sts 0x1270, r27 ; 0x801270 plan_set_e_position(current_position[E_AXIS]); //AND from the planner 121a6: 8d e6 ldi r24, 0x6D ; 109 121a8: 92 e1 ldi r25, 0x12 ; 18 121aa: 0f 94 65 3a call 0x274ca ; 0x274ca retract(!retracted[active_extruder]); 121ae: 90 91 1b 06 lds r25, 0x061B ; 0x80061b 121b2: 81 e0 ldi r24, 0x01 ; 1 121b4: 89 27 eor r24, r25 121b6: 0f 94 cd 90 call 0x3219a ; 0x3219a SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); SERIAL_ECHOLNPGM("\"(2)"); } KEEPALIVE_STATE(NOT_BUSY); ClearToSend(); } 121ba: cd 59 subi r28, 0x9D ; 157 121bc: df 4f sbci r29, 0xFF ; 255 121be: 0f b6 in r0, 0x3f ; 63 121c0: f8 94 cli 121c2: de bf out 0x3e, r29 ; 62 121c4: 0f be out 0x3f, r0 ; 63 121c6: cd bf out 0x3d, r28 ; 61 121c8: df 91 pop r29 121ca: cf 91 pop r28 121cc: 1f 91 pop r17 121ce: 0f 91 pop r16 121d0: ff 90 pop r15 121d2: ef 90 pop r14 121d4: df 90 pop r13 121d6: cf 90 pop r12 121d8: bf 90 pop r11 121da: af 90 pop r10 121dc: 9f 90 pop r9 121de: 8f 90 pop r8 121e0: 7f 90 pop r7 121e2: 6f 90 pop r6 121e4: 5f 90 pop r5 121e6: 4f 90 pop r4 121e8: 3f 90 pop r3 121ea: 2f 90 pop r2 121ec: 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) 121ee: 85 31 cpi r24, 0x15 ; 21 121f0: 91 05 cpc r25, r1 121f2: 09 f4 brne .+2 ; 0x121f6 121f4: d9 c0 rjmp .+434 ; 0x123a8 121f6: fc f4 brge .+62 ; 0x12236 121f8: 8a 30 cpi r24, 0x0A ; 10 121fa: 91 05 cpc r25, r1 121fc: 09 f4 brne .+2 ; 0x12200 121fe: 23 c5 rjmp .+2630 ; 0x12c46 12200: 0b 97 sbiw r24, 0x0b ; 11 12202: 09 f4 brne .+2 ; 0x12206 12204: 24 c5 rjmp .+2632 ; 0x12c4e case 99: farm_gcode_g99(); break; #endif //PRUSA_FARM default: printf_P(MSG_UNKNOWN_CODE, 'G', cmdbuffer + bufindr + CMDHDRSIZE); 12206: 80 91 38 12 lds r24, 0x1238 ; 0x801238 1220a: 90 91 39 12 lds r25, 0x1239 ; 0x801239 1220e: 82 5b subi r24, 0xB2 ; 178 12210: 9f 4e sbci r25, 0xEF ; 239 12212: 9f 93 push r25 12214: 8f 93 push r24 12216: 1f 92 push r1 12218: 87 e4 ldi r24, 0x47 ; 71 1221a: 8f 93 push r24 1221c: 84 e0 ldi r24, 0x04 ; 4 1221e: 97 e6 ldi r25, 0x67 ; 103 12220: 9f 93 push r25 12222: 8f 93 push r24 12224: 0f 94 43 a3 call 0x34686 ; 0x34686 12228: 0f 90 pop r0 1222a: 0f 90 pop r0 1222c: 0f 90 pop r0 1222e: 0f 90 pop r0 12230: 0f 90 pop r0 12232: 0f 90 pop r0 12234: b9 c0 rjmp .+370 ; 0x123a8 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) 12236: 8c 31 cpi r24, 0x1C ; 28 12238: 91 05 cpc r25, r1 1223a: 09 f4 brne .+2 ; 0x1223e 1223c: 0a c5 rjmp .+2580 ; 0x12c52 1223e: 4e 97 sbiw r24, 0x1e ; 30 12240: 11 f7 brne .-60 ; 0x12206 Sensor must be over the bed. The maximum travel distance before an error is triggered is 10mm. */ case 30: { st_synchronize(); 12242: 0f 94 94 18 call 0x23128 ; 0x23128 homing_flag = true; 12246: 81 e0 ldi r24, 0x01 ; 1 12248: 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(); 1224c: 0e 94 b7 65 call 0xcb6e ; 0xcb6e 12250: 8c 01 movw r16, r24 feedrate = homing_feedrate[Z_AXIS]; 12252: 80 e0 ldi r24, 0x00 ; 0 12254: 90 e0 ldi r25, 0x00 ; 0 12256: a8 e4 ldi r26, 0x48 ; 72 12258: b4 e4 ldi r27, 0x44 ; 68 1225a: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 1225e: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 12262: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 12266: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d find_bed_induction_sensor_point_z(-10.f, 3); 1226a: 43 e0 ldi r20, 0x03 ; 3 1226c: 60 e0 ldi r22, 0x00 ; 0 1226e: 70 e0 ldi r23, 0x00 ; 0 12270: 80 e2 ldi r24, 0x20 ; 32 12272: 91 ec ldi r25, 0xC1 ; 193 12274: 0f 94 8e 7c call 0x2f91c ; 0x2f91c printf_P(_N("%S X: %.5f Y: %.5f Z: %.5f\n"), _T(MSG_BED), _x, _y, _z); 12278: 70 90 69 12 lds r7, 0x1269 ; 0x801269 1227c: 60 90 6a 12 lds r6, 0x126A ; 0x80126a 12280: 50 90 6b 12 lds r5, 0x126B ; 0x80126b 12284: 40 90 6c 12 lds r4, 0x126C ; 0x80126c 12288: b0 90 65 12 lds r11, 0x1265 ; 0x801265 1228c: a0 90 66 12 lds r10, 0x1266 ; 0x801266 12290: 90 90 67 12 lds r9, 0x1267 ; 0x801267 12294: 80 90 68 12 lds r8, 0x1268 ; 0x801268 12298: f0 90 61 12 lds r15, 0x1261 ; 0x801261 1229c: e0 90 62 12 lds r14, 0x1262 ; 0x801262 122a0: d0 90 63 12 lds r13, 0x1263 ; 0x801263 122a4: c0 90 64 12 lds r12, 0x1264 ; 0x801264 122a8: 8a ec ldi r24, 0xCA ; 202 122aa: 94 e4 ldi r25, 0x44 ; 68 122ac: 0e 94 8b 75 call 0xeb16 ; 0xeb16 122b0: 4f 92 push r4 122b2: 5f 92 push r5 122b4: 6f 92 push r6 122b6: 7f 92 push r7 122b8: 8f 92 push r8 122ba: 9f 92 push r9 122bc: af 92 push r10 122be: bf 92 push r11 122c0: cf 92 push r12 122c2: df 92 push r13 122c4: ef 92 push r14 122c6: ff 92 push r15 122c8: 9f 93 push r25 122ca: 8f 93 push r24 122cc: 8d eb ldi r24, 0xBD ; 189 122ce: 97 e6 ldi r25, 0x67 ; 103 122d0: 9f 93 push r25 122d2: 8f 93 push r24 122d4: 0f 94 43 a3 call 0x34686 ; 0x34686 clean_up_after_endstop_move(l_feedmultiply); 122d8: c8 01 movw r24, r16 122da: 0e 94 9d 65 call 0xcb3a ; 0xcb3a homing_flag = false; 122de: 10 92 71 12 sts 0x1271, r1 ; 0x801271 122e2: 0f b6 in r0, 0x3f ; 63 122e4: f8 94 cli 122e6: de bf out 0x3e, r29 ; 62 122e8: 0f be out 0x3f, r0 ; 63 122ea: cd bf out 0x3d, r28 ; 61 122ec: 5d c0 rjmp .+186 ; 0x123a8 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) 122ee: 88 35 cpi r24, 0x58 ; 88 122f0: 91 05 cpc r25, r1 122f2: 09 f4 brne .+2 ; 0x122f6 122f4: 59 c0 rjmp .+178 ; 0x123a8 122f6: f4 f4 brge .+60 ; 0x12334 122f8: 81 35 cpi r24, 0x51 ; 81 122fa: 91 05 cpc r25, r1 122fc: 11 f4 brne .+4 ; 0x12302 122fe: 0c 94 87 9a jmp 0x1350e ; 0x1350e 12302: 5c f4 brge .+22 ; 0x1231a 12304: 8c 34 cpi r24, 0x4C ; 76 12306: 91 05 cpc r25, r1 12308: 09 f4 brne .+2 ; 0x1230c 1230a: 0c c5 rjmp .+2584 ; 0x12d24 1230c: 80 35 cpi r24, 0x50 ; 80 1230e: 91 05 cpc r25, r1 12310: 09 f0 breq .+2 ; 0x12314 12312: 79 cf rjmp .-270 ; 0x12206 - `W` - area width (on X axis) - `H` - area height (on Y axis) */ case 80: { gcode_G80(); 12314: 0e 94 9a 7d call 0xfb34 ; 0xfb34 12318: 47 c0 rjmp .+142 ; 0x123a8 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) 1231a: 86 35 cpi r24, 0x56 ; 86 1231c: 91 05 cpc r25, r1 1231e: 11 f4 brne .+4 ; 0x12324 12320: 0c 94 8b 9a jmp 0x13516 ; 0x13516 12324: 87 35 cpi r24, 0x57 ; 87 12326: 91 05 cpc r25, r1 12328: 09 f0 breq .+2 ; 0x1232c 1232a: 6d cf rjmp .-294 ; 0x12206 This G-code will be performed at the end of a calibration script. (Prusa3D specific) */ case 87: calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 1232c: 80 e1 ldi r24, 0x10 ; 16 1232e: 0e 94 36 d5 call 0x1aa6c ; 0x1aa6c 12332: 3a c0 rjmp .+116 ; 0x123a8 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) 12334: 8c 35 cpi r24, 0x5C ; 92 12336: 91 05 cpc r25, r1 12338: 11 f4 brne .+4 ; 0x1233e 1233a: 0c 94 97 9a jmp 0x1352e ; 0x1352e 1233e: 74 f4 brge .+28 ; 0x1235c 12340: 8a 35 cpi r24, 0x5A ; 90 12342: 91 05 cpc r25, r1 12344: 11 f4 brne .+4 ; 0x1234a 12346: 0c 94 90 9a jmp 0x13520 ; 0x13520 1234a: 8b 35 cpi r24, 0x5B ; 91 1234c: 91 05 cpc r25, r1 1234e: 09 f0 breq .+2 ; 0x12352 12350: 5a cf rjmp .-332 ; 0x12206 /*! ### 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; 12352: 80 91 57 12 lds r24, 0x1257 ; 0x801257 12356: 87 60 ori r24, 0x07 ; 7 12358: 0c 94 93 9a jmp 0x13526 ; 0x13526 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) 1235c: 82 36 cpi r24, 0x62 ; 98 1235e: 91 05 cpc r25, r1 12360: 11 f4 brne .+4 ; 0x12366 12362: 0c 94 2e 9b jmp 0x1365c ; 0x1365c 12366: 83 36 cpi r24, 0x63 ; 99 12368: 91 05 cpc r25, r1 1236a: 09 f0 breq .+2 ; 0x1236e 1236c: 4c cf rjmp .-360 ; 0x12206 lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 1236e: 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); 12372: 60 e0 ldi r22, 0x00 ; 0 12374: 84 ec ldi r24, 0xC4 ; 196 12376: 9f e0 ldi r25, 0x0F ; 15 12378: 0f 94 a5 a4 call 0x3494a ; 0x3494a fCheckModeInit(); // alternatively invoke printer reset } void farm_gcode_g99() { farm_disable(); lcd_update(2); 1237c: 82 e0 ldi r24, 0x02 ; 2 1237e: 0e 94 4a 6f call 0xde94 ; 0xde94 12382: 0c 94 3d 9b jmp 0x1367a ; 0x1367a #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 12386: 2d ec ldi r18, 0xCD ; 205 12388: 3c ec ldi r19, 0xCC ; 204 1238a: 4c ec ldi r20, 0xCC ; 204 1238c: 5d e3 ldi r21, 0x3D ; 61 1238e: c7 01 movw r24, r14 12390: b6 01 movw r22, r12 12392: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 12396: 18 16 cp r1, r24 12398: 24 f4 brge .+8 ; 0x123a2 1239a: 80 91 1b 06 lds r24, 0x061B ; 0x80061b 1239e: 81 11 cpse r24, r1 123a0: f0 ce rjmp .-544 ; 0x12182 } } } #endif //FWRETRACT prepare_move(start_segment_idx); 123a2: c8 01 movw r24, r16 123a4: 0e 94 0c 6b call 0xd618 ; 0xd618 #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; 123a8: 10 92 56 03 sts 0x0356, r1 ; 0x800356 123ac: 10 92 55 03 sts 0x0355, r1 ; 0x800355 123b0: c4 cc rjmp .-1656 ; 0x11d3a */ case 2: case 3: { uint16_t start_segment_idx = restore_interrupted_gcode(); 123b2: 0e 94 3c 55 call 0xaa78 ; 0xaa78 123b6: 2e 96 adiw r28, 0x0e ; 14 123b8: 9f af std Y+63, r25 ; 0x3f 123ba: 8e af std Y+62, r24 ; 0x3e 123bc: 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 123be: 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; 123c2: 89 e4 ldi r24, 0x49 ; 73 123c4: 0e 94 80 56 call 0xad00 ; 0xad00 123c8: 88 23 and r24, r24 123ca: 09 f4 brne .+2 ; 0x123ce 123cc: a0 c3 rjmp .+1856 ; 0x12b0e 123ce: 0e 94 10 5b call 0xb620 ; 0xb620 123d2: 60 93 4d 03 sts 0x034D, r22 ; 0x80034d 123d6: 70 93 4e 03 sts 0x034E, r23 ; 0x80034e 123da: 80 93 4f 03 sts 0x034F, r24 ; 0x80034f 123de: 90 93 50 03 sts 0x0350, r25 ; 0x800350 offset[1] = code_seen('J') ? code_value() : 0.f; 123e2: 8a e4 ldi r24, 0x4A ; 74 123e4: 0e 94 80 56 call 0xad00 ; 0xad00 123e8: c1 2c mov r12, r1 123ea: d1 2c mov r13, r1 123ec: 76 01 movw r14, r12 123ee: 88 23 and r24, r24 123f0: 21 f0 breq .+8 ; 0x123fa 123f2: 0e 94 10 5b call 0xb620 ; 0xb620 123f6: 6b 01 movw r12, r22 123f8: 7c 01 movw r14, r24 123fa: c0 92 51 03 sts 0x0351, r12 ; 0x800351 123fe: d0 92 52 03 sts 0x0352, r13 ; 0x800352 12402: e0 92 53 03 sts 0x0353, r14 ; 0x800353 12406: f0 92 54 03 sts 0x0354, r15 ; 0x800354 prepare_arc_move((gcode_in_progress == 2), start_segment_idx); 1240a: e0 91 55 03 lds r30, 0x0355 ; 0x800355 1240e: f0 91 56 03 lds r31, 0x0356 ; 0x800356 12412: a4 96 adiw r28, 0x24 ; 36 12414: ff af std Y+63, r31 ; 0x3f 12416: ee af std Y+62, r30 ; 0x3e 12418: 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 1241a: 80 90 4d 03 lds r8, 0x034D ; 0x80034d 1241e: 90 90 4e 03 lds r9, 0x034E ; 0x80034e 12422: a0 90 4f 03 lds r10, 0x034F ; 0x80034f 12426: b0 90 50 03 lds r11, 0x0350 ; 0x800350 1242a: a7 01 movw r20, r14 1242c: 96 01 movw r18, r12 1242e: c5 01 movw r24, r10 12430: b4 01 movw r22, r8 12432: 0f 94 45 a8 call 0x3508a ; 0x3508a 12436: 24 96 adiw r28, 0x04 ; 4 12438: 6c af std Y+60, r22 ; 0x3c 1243a: 7d af std Y+61, r23 ; 0x3d 1243c: 8e af std Y+62, r24 ; 0x3e 1243e: 9f af std Y+63, r25 ; 0x3f 12440: 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); 12442: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 12446: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 1244a: 07 2e mov r0, r23 1244c: 00 0c add r0, r0 1244e: 88 0b sbc r24, r24 12450: 99 0b sbc r25, r25 12452: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 12456: 20 91 7a 02 lds r18, 0x027A ; 0x80027a 1245a: 30 91 7b 02 lds r19, 0x027B ; 0x80027b 1245e: 40 91 7c 02 lds r20, 0x027C ; 0x80027c 12462: 50 91 7d 02 lds r21, 0x027D ; 0x80027d 12466: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1246a: 2e e3 ldi r18, 0x3E ; 62 1246c: 33 ec ldi r19, 0xC3 ; 195 1246e: 4e e2 ldi r20, 0x2E ; 46 12470: 59 e3 ldi r21, 0x39 ; 57 12472: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 12476: 68 af std Y+56, r22 ; 0x38 12478: 79 af std Y+57, r23 ; 0x39 1247a: 8a af std Y+58, r24 ; 0x3a 1247c: 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)); 1247e: 80 e1 ldi r24, 0x10 ; 16 12480: e1 e6 ldi r30, 0x61 ; 97 12482: f2 e1 ldi r31, 0x12 ; 18 12484: de 01 movw r26, r28 12486: 11 96 adiw r26, 0x01 ; 1 12488: 01 90 ld r0, Z+ 1248a: 0d 92 st X+, r0 1248c: 8a 95 dec r24 1248e: e1 f7 brne .-8 ; 0x12488 float r_axis_x = -offset[X_AXIS]; // Radius vector from center to current location 12490: a5 01 movw r20, r10 12492: 94 01 movw r18, r8 12494: 50 58 subi r21, 0x80 ; 128 12496: 28 a7 std Y+40, r18 ; 0x28 12498: 39 a7 std Y+41, r19 ; 0x29 1249a: 4a a7 std Y+42, r20 ; 0x2a 1249c: 5b a7 std Y+43, r21 ; 0x2b float r_axis_y = -offset[Y_AXIS]; 1249e: d7 01 movw r26, r14 124a0: c6 01 movw r24, r12 124a2: b0 58 subi r27, 0x80 ; 128 124a4: 8c a7 std Y+44, r24 ; 0x2c 124a6: 9d a7 std Y+45, r25 ; 0x2d 124a8: ae a7 std Y+46, r26 ; 0x2e 124aa: bf a7 std Y+47, r27 ; 0x2f float center_axis_x = start_position[X_AXIS] - r_axis_x; 124ac: 29 81 ldd r18, Y+1 ; 0x01 124ae: 3a 81 ldd r19, Y+2 ; 0x02 124b0: 4b 81 ldd r20, Y+3 ; 0x03 124b2: 5c 81 ldd r21, Y+4 ; 0x04 124b4: 28 96 adiw r28, 0x08 ; 8 124b6: 2c af std Y+60, r18 ; 0x3c 124b8: 3d af std Y+61, r19 ; 0x3d 124ba: 4e af std Y+62, r20 ; 0x3e 124bc: 5f af std Y+63, r21 ; 0x3f 124be: 28 97 sbiw r28, 0x08 ; 8 124c0: c5 01 movw r24, r10 124c2: b4 01 movw r22, r8 124c4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 124c8: 62 96 adiw r28, 0x12 ; 18 124ca: 6c af std Y+60, r22 ; 0x3c 124cc: 7d af std Y+61, r23 ; 0x3d 124ce: 8e af std Y+62, r24 ; 0x3e 124d0: 9f af std Y+63, r25 ; 0x3f 124d2: 62 97 sbiw r28, 0x12 ; 18 float center_axis_y = start_position[Y_AXIS] - r_axis_y; 124d4: 8d 81 ldd r24, Y+5 ; 0x05 124d6: 9e 81 ldd r25, Y+6 ; 0x06 124d8: af 81 ldd r26, Y+7 ; 0x07 124da: b8 85 ldd r27, Y+8 ; 0x08 124dc: 2c 96 adiw r28, 0x0c ; 12 124de: 8c af std Y+60, r24 ; 0x3c 124e0: 9d af std Y+61, r25 ; 0x3d 124e2: ae af std Y+62, r26 ; 0x3e 124e4: bf af std Y+63, r27 ; 0x3f 124e6: 2c 97 sbiw r28, 0x0c ; 12 124e8: 9c 01 movw r18, r24 124ea: ad 01 movw r20, r26 124ec: c7 01 movw r24, r14 124ee: b6 01 movw r22, r12 124f0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 124f4: 66 96 adiw r28, 0x16 ; 22 124f6: 6c af std Y+60, r22 ; 0x3c 124f8: 7d af std Y+61, r23 ; 0x3d 124fa: 8e af std Y+62, r24 ; 0x3e 124fc: 9f af std Y+63, r25 ; 0x3f 124fe: 66 97 sbiw r28, 0x16 ; 22 float travel_z = target[Z_AXIS] - start_position[Z_AXIS]; 12500: 29 85 ldd r18, Y+9 ; 0x09 12502: 3a 85 ldd r19, Y+10 ; 0x0a 12504: 4b 85 ldd r20, Y+11 ; 0x0b 12506: 5c 85 ldd r21, Y+12 ; 0x0c 12508: 60 91 31 06 lds r22, 0x0631 ; 0x800631 1250c: 70 91 32 06 lds r23, 0x0632 ; 0x800632 12510: 80 91 33 06 lds r24, 0x0633 ; 0x800633 12514: 90 91 34 06 lds r25, 0x0634 ; 0x800634 12518: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1251c: 6a 96 adiw r28, 0x1a ; 26 1251e: 6c af std Y+60, r22 ; 0x3c 12520: 7d af std Y+61, r23 ; 0x3d 12522: 8e af std Y+62, r24 ; 0x3e 12524: 9f af std Y+63, r25 ; 0x3f 12526: 6a 97 sbiw r28, 0x1a ; 26 float rt_x = target[X_AXIS] - center_axis_x; 12528: 20 91 29 06 lds r18, 0x0629 ; 0x800629 1252c: 30 91 2a 06 lds r19, 0x062A ; 0x80062a 12530: 40 91 2b 06 lds r20, 0x062B ; 0x80062b 12534: 50 91 2c 06 lds r21, 0x062C ; 0x80062c 12538: 6e 96 adiw r28, 0x1e ; 30 1253a: 2c af std Y+60, r18 ; 0x3c 1253c: 3d af std Y+61, r19 ; 0x3d 1253e: 4e af std Y+62, r20 ; 0x3e 12540: 5f af std Y+63, r21 ; 0x3f 12542: 6e 97 sbiw r28, 0x1e ; 30 12544: 62 96 adiw r28, 0x12 ; 18 12546: 2c ad ldd r18, Y+60 ; 0x3c 12548: 3d ad ldd r19, Y+61 ; 0x3d 1254a: 4e ad ldd r20, Y+62 ; 0x3e 1254c: 5f ad ldd r21, Y+63 ; 0x3f 1254e: 62 97 sbiw r28, 0x12 ; 18 12550: 6e 96 adiw r28, 0x1e ; 30 12552: 6c ad ldd r22, Y+60 ; 0x3c 12554: 7d ad ldd r23, Y+61 ; 0x3d 12556: 8e ad ldd r24, Y+62 ; 0x3e 12558: 9f ad ldd r25, Y+63 ; 0x3f 1255a: 6e 97 sbiw r28, 0x1e ; 30 1255c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 12560: 6b 01 movw r12, r22 12562: 7c 01 movw r14, r24 float rt_y = target[Y_AXIS] - center_axis_y; 12564: 80 91 2d 06 lds r24, 0x062D ; 0x80062d 12568: 90 91 2e 06 lds r25, 0x062E ; 0x80062e 1256c: a0 91 2f 06 lds r26, 0x062F ; 0x80062f 12570: b0 91 30 06 lds r27, 0x0630 ; 0x800630 12574: a2 96 adiw r28, 0x22 ; 34 12576: 8c af std Y+60, r24 ; 0x3c 12578: 9d af std Y+61, r25 ; 0x3d 1257a: ae af std Y+62, r26 ; 0x3e 1257c: bf af std Y+63, r27 ; 0x3f 1257e: a2 97 sbiw r28, 0x22 ; 34 12580: 66 96 adiw r28, 0x16 ; 22 12582: 2c ad ldd r18, Y+60 ; 0x3c 12584: 3d ad ldd r19, Y+61 ; 0x3d 12586: 4e ad ldd r20, Y+62 ; 0x3e 12588: 5f ad ldd r21, Y+63 ; 0x3f 1258a: 66 97 sbiw r28, 0x16 ; 22 1258c: bc 01 movw r22, r24 1258e: cd 01 movw r24, r26 12590: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 12594: 4b 01 movw r8, r22 12596: 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; 12598: 30 90 2b 0e lds r3, 0x0E2B ; 0x800e2b 1259c: 20 90 2c 0e lds r2, 0x0E2C ; 0x800e2c 125a0: 90 91 2d 0e lds r25, 0x0E2D ; 0x800e2d 125a4: 9c ab std Y+52, r25 ; 0x34 125a6: a0 91 2e 0e lds r26, 0x0E2E ; 0x800e2e 125aa: 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; 125ac: b0 91 33 0e lds r27, 0x0E33 ; 0x800e33 125b0: 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); 125b2: a7 01 movw r20, r14 125b4: 96 01 movw r18, r12 125b6: 68 a5 ldd r22, Y+40 ; 0x28 125b8: 79 a5 ldd r23, Y+41 ; 0x29 125ba: 8a a5 ldd r24, Y+42 ; 0x2a 125bc: 9b a5 ldd r25, Y+43 ; 0x2b 125be: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 125c2: 2b 01 movw r4, r22 125c4: 3c 01 movw r6, r24 125c6: a5 01 movw r20, r10 125c8: 94 01 movw r18, r8 125ca: 6c a5 ldd r22, Y+44 ; 0x2c 125cc: 7d a5 ldd r23, Y+45 ; 0x2d 125ce: 8e a5 ldd r24, Y+46 ; 0x2e 125d0: 9f a5 ldd r25, Y+47 ; 0x2f 125d2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 125d6: 9b 01 movw r18, r22 125d8: ac 01 movw r20, r24 125da: c3 01 movw r24, r6 125dc: b2 01 movw r22, r4 125de: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 125e2: 2b 01 movw r4, r22 125e4: 3c 01 movw r6, r24 125e6: a5 01 movw r20, r10 125e8: 94 01 movw r18, r8 125ea: 68 a5 ldd r22, Y+40 ; 0x28 125ec: 79 a5 ldd r23, Y+41 ; 0x29 125ee: 8a a5 ldd r24, Y+42 ; 0x2a 125f0: 9b a5 ldd r25, Y+43 ; 0x2b 125f2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 125f6: 4b 01 movw r8, r22 125f8: 5c 01 movw r10, r24 125fa: a7 01 movw r20, r14 125fc: 96 01 movw r18, r12 125fe: 6c a5 ldd r22, Y+44 ; 0x2c 12600: 7d a5 ldd r23, Y+45 ; 0x2d 12602: 8e a5 ldd r24, Y+46 ; 0x2e 12604: 9f a5 ldd r25, Y+47 ; 0x2f 12606: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1260a: 9b 01 movw r18, r22 1260c: ac 01 movw r20, r24 1260e: c5 01 movw r24, r10 12610: b4 01 movw r22, r8 12612: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 12616: a3 01 movw r20, r6 12618: 92 01 movw r18, r4 1261a: 0f 94 28 a6 call 0x34c50 ; 0x34c50 1261e: 6b 01 movw r12, r22 12620: 7c 01 movw r14, r24 if (angular_travel_total < 0) { angular_travel_total += 2 * M_PI; } 12622: 20 e0 ldi r18, 0x00 ; 0 12624: 30 e0 ldi r19, 0x00 ; 0 12626: a9 01 movw r20, r18 12628: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1262c: 87 ff sbrs r24, 7 1262e: 0a c0 rjmp .+20 ; 0x12644 12630: 2b ed ldi r18, 0xDB ; 219 12632: 3f e0 ldi r19, 0x0F ; 15 12634: 49 ec ldi r20, 0xC9 ; 201 12636: 50 e4 ldi r21, 0x40 ; 64 12638: c7 01 movw r24, r14 1263a: b6 01 movw r22, r12 1263c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 12640: 6b 01 movw r12, r22 12642: 7c 01 movw r14, r24 if (cs.min_arc_segments > 0) 12644: 60 91 34 0e lds r22, 0x0E34 ; 0x800e34 12648: 70 91 35 0e lds r23, 0x0E35 ; 0x800e35 1264c: 61 15 cp r22, r1 1264e: 71 05 cpc r23, r1 12650: 09 f4 brne .+2 ; 0x12654 12652: 61 c2 rjmp .+1218 ; 0x12b16 { // 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); 12654: 90 e0 ldi r25, 0x00 ; 0 12656: 80 e0 ldi r24, 0x00 ; 0 12658: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 1265c: 9b 01 movw r18, r22 1265e: ac 01 movw r20, r24 12660: 6b ed ldi r22, 0xDB ; 219 12662: 7f e0 ldi r23, 0x0F ; 15 12664: 89 ec ldi r24, 0xC9 ; 201 12666: 90 e4 ldi r25, 0x40 ; 64 12668: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1266c: 24 96 adiw r28, 0x04 ; 4 1266e: 2c ad ldd r18, Y+60 ; 0x3c 12670: 3d ad ldd r19, Y+61 ; 0x3d 12672: 4e ad ldd r20, Y+62 ; 0x3e 12674: 5f ad ldd r21, Y+63 ; 0x3f 12676: 24 97 sbiw r28, 0x04 ; 4 12678: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1267c: 5b 01 movw r10, r22 1267e: 8c 01 movw r16, r24 } if (cs.arc_segments_per_sec > 0) 12680: 60 91 36 0e lds r22, 0x0E36 ; 0x800e36 12684: 70 91 37 0e lds r23, 0x0E37 ; 0x800e37 12688: 61 15 cp r22, r1 1268a: 71 05 cpc r23, r1 1268c: e1 f0 breq .+56 ; 0x126c6 { // 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)); 1268e: 90 e0 ldi r25, 0x00 ; 0 12690: 80 e0 ldi r24, 0x00 ; 0 12692: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 12696: 20 e0 ldi r18, 0x00 ; 0 12698: 30 e0 ldi r19, 0x00 ; 0 1269a: 40 e7 ldi r20, 0x70 ; 112 1269c: 52 e4 ldi r21, 0x42 ; 66 1269e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 126a2: 9b 01 movw r18, r22 126a4: ac 01 movw r20, r24 126a6: 68 ad ldd r22, Y+56 ; 0x38 126a8: 79 ad ldd r23, Y+57 ; 0x39 126aa: 8a ad ldd r24, Y+58 ; 0x3a 126ac: 9b ad ldd r25, Y+59 ; 0x3b 126ae: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 126b2: 3b 01 movw r6, r22 126b4: 4c 01 movw r8, r24 if (mm_per_arc_segment_sec < mm_per_arc_segment) 126b6: 95 01 movw r18, r10 126b8: a8 01 movw r20, r16 126ba: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 126be: 87 ff sbrs r24, 7 126c0: 02 c0 rjmp .+4 ; 0x126c6 mm_per_arc_segment = mm_per_arc_segment_sec; 126c2: 53 01 movw r10, r6 126c4: 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) 126c6: 40 90 2f 0e lds r4, 0x0E2F ; 0x800e2f 126ca: 50 90 30 0e lds r5, 0x0E30 ; 0x800e30 126ce: 60 90 31 0e lds r6, 0x0E31 ; 0x800e31 126d2: 70 90 32 0e lds r7, 0x0E32 ; 0x800e32 126d6: 95 01 movw r18, r10 126d8: a8 01 movw r20, r16 126da: b2 01 movw r22, r4 126dc: c3 01 movw r24, r6 126de: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 126e2: 18 16 cp r1, r24 126e4: 84 f0 brlt .+32 ; 0x12706 { // 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) { 126e6: 95 01 movw r18, r10 126e8: a8 01 movw r20, r16 126ea: 63 2d mov r22, r3 126ec: 72 2d mov r23, r2 126ee: 8c a9 ldd r24, Y+52 ; 0x34 126f0: 9c ad ldd r25, Y+60 ; 0x3c 126f2: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 126f6: 25 01 movw r4, r10 126f8: 38 01 movw r6, r16 126fa: 87 ff sbrs r24, 7 126fc: 04 c0 rjmp .+8 ; 0x12706 // 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; 126fe: 43 2c mov r4, r3 12700: 52 2c mov r5, r2 12702: 6c a8 ldd r6, Y+52 ; 0x34 12704: 7c ac ldd r7, Y+60 ; 0x3c } // Adjust the angular travel if the direction is clockwise if (isclockwise) { angular_travel_total -= 2 * M_PI; } 12706: a4 96 adiw r28, 0x24 ; 36 12708: ee ad ldd r30, Y+62 ; 0x3e 1270a: ff ad ldd r31, Y+63 ; 0x3f 1270c: a4 97 sbiw r28, 0x24 ; 36 1270e: 32 97 sbiw r30, 0x02 ; 2 12710: 51 f4 brne .+20 ; 0x12726 12712: 2b ed ldi r18, 0xDB ; 219 12714: 3f e0 ldi r19, 0x0F ; 15 12716: 49 ec ldi r20, 0xC9 ; 201 12718: 50 e4 ldi r21, 0x40 ; 64 1271a: c7 01 movw r24, r14 1271c: b6 01 movw r22, r12 1271e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 12722: 6b 01 movw r12, r22 12724: 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) 12726: 6e 96 adiw r28, 0x1e ; 30 12728: 2c ad ldd r18, Y+60 ; 0x3c 1272a: 3d ad ldd r19, Y+61 ; 0x3d 1272c: 4e ad ldd r20, Y+62 ; 0x3e 1272e: 5f ad ldd r21, Y+63 ; 0x3f 12730: 6e 97 sbiw r28, 0x1e ; 30 12732: 28 96 adiw r28, 0x08 ; 8 12734: 6c ad ldd r22, Y+60 ; 0x3c 12736: 7d ad ldd r23, Y+61 ; 0x3d 12738: 8e ad ldd r24, Y+62 ; 0x3e 1273a: 9f ad ldd r25, Y+63 ; 0x3f 1273c: 28 97 sbiw r28, 0x08 ; 8 1273e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 12742: 81 11 cpse r24, r1 12744: 23 c0 rjmp .+70 ; 0x1278c 12746: a2 96 adiw r28, 0x22 ; 34 12748: 2c ad ldd r18, Y+60 ; 0x3c 1274a: 3d ad ldd r19, Y+61 ; 0x3d 1274c: 4e ad ldd r20, Y+62 ; 0x3e 1274e: 5f ad ldd r21, Y+63 ; 0x3f 12750: a2 97 sbiw r28, 0x22 ; 34 12752: 2c 96 adiw r28, 0x0c ; 12 12754: 6c ad ldd r22, Y+60 ; 0x3c 12756: 7d ad ldd r23, Y+61 ; 0x3d 12758: 8e ad ldd r24, Y+62 ; 0x3e 1275a: 9f ad ldd r25, Y+63 ; 0x3f 1275c: 2c 97 sbiw r28, 0x0c ; 12 1275e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 12762: 81 11 cpse r24, r1 12764: 13 c0 rjmp .+38 ; 0x1278c 12766: 20 e0 ldi r18, 0x00 ; 0 12768: 30 e0 ldi r19, 0x00 ; 0 1276a: a9 01 movw r20, r18 1276c: c7 01 movw r24, r14 1276e: b6 01 movw r22, r12 12770: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 12774: 81 11 cpse r24, r1 12776: 0a c0 rjmp .+20 ; 0x1278c { angular_travel_total += 2 * M_PI; 12778: 2b ed ldi r18, 0xDB ; 219 1277a: 3f e0 ldi r19, 0x0F ; 15 1277c: 49 ec ldi r20, 0xC9 ; 201 1277e: 50 e4 ldi r21, 0x40 ; 64 12780: c7 01 movw r24, r14 12782: b6 01 movw r22, r12 12784: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 12788: 6b 01 movw r12, r22 1278a: 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)); 1278c: a7 01 movw r20, r14 1278e: 96 01 movw r18, r12 12790: 24 96 adiw r28, 0x04 ; 4 12792: 6c ad ldd r22, Y+60 ; 0x3c 12794: 7d ad ldd r23, Y+61 ; 0x3d 12796: 8e ad ldd r24, Y+62 ; 0x3e 12798: 9f ad ldd r25, Y+63 ; 0x3f 1279a: 24 97 sbiw r28, 0x04 ; 4 1279c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 127a0: 6a 96 adiw r28, 0x1a ; 26 127a2: 2c ad ldd r18, Y+60 ; 0x3c 127a4: 3d ad ldd r19, Y+61 ; 0x3d 127a6: 4e ad ldd r20, Y+62 ; 0x3e 127a8: 5f ad ldd r21, Y+63 ; 0x3f 127aa: 6a 97 sbiw r28, 0x1a ; 26 127ac: 0f 94 45 a8 call 0x3508a ; 0x3508a 127b0: 4b 01 movw r8, r22 127b2: 5c 01 movw r10, r24 if (millimeters_of_travel_arc < 0.001) { return; } 127b4: 2f e6 ldi r18, 0x6F ; 111 127b6: 32 e1 ldi r19, 0x12 ; 18 127b8: 43 e8 ldi r20, 0x83 ; 131 127ba: 5a e3 ldi r21, 0x3A ; 58 127bc: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 127c0: 87 fd sbrc r24, 7 127c2: 9e c1 rjmp .+828 ; 0x12b00 // Calculate the number of arc segments unsigned short segments = static_cast(ceil(millimeters_of_travel_arc / mm_per_arc_segment)); 127c4: 92 01 movw r18, r4 127c6: a3 01 movw r20, r6 127c8: c5 01 movw r24, r10 127ca: b4 01 movw r22, r8 127cc: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 127d0: 0f 94 87 a6 call 0x34d0e ; 0x34d0e 127d4: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 127d8: 7d ab std Y+53, r23 ; 0x35 127da: 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) 127dc: 62 30 cpi r22, 0x02 ; 2 127de: 71 05 cpc r23, r1 127e0: 08 f4 brcc .+2 ; 0x127e4 127e2: 5e c1 rjmp .+700 ; 0x12aa0 127e4: 2e 96 adiw r28, 0x0e ; 14 127e6: 4e ad ldd r20, Y+62 ; 0x3e 127e8: 5f ad ldd r21, Y+63 ; 0x3f 127ea: 2e 97 sbiw r28, 0x0e ; 14 127ec: 45 2b or r20, r21 127ee: 09 f4 brne .+2 ; 0x127f2 127f0: 57 c1 rjmp .+686 ; 0x12aa0 { // 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, 127f2: 90 e0 ldi r25, 0x00 ; 0 127f4: 80 e0 ldi r24, 0x00 ; 0 127f6: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 127fa: 4b 01 movw r8, r22 127fc: 5c 01 movw r10, r24 127fe: ac 01 movw r20, r24 12800: 9b 01 movw r18, r22 12802: c7 01 movw r24, r14 12804: b6 01 movw r22, r12 12806: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1280a: 2b 01 movw r4, r22 1280c: 3c 01 movw r6, r24 linear_per_segment = travel_z / (segments), 1280e: a5 01 movw r20, r10 12810: 94 01 movw r18, r8 12812: 6a 96 adiw r28, 0x1a ; 26 12814: 6c ad ldd r22, Y+60 ; 0x3c 12816: 7d ad ldd r23, Y+61 ; 0x3d 12818: 8e ad ldd r24, Y+62 ; 0x3e 1281a: 9f ad ldd r25, Y+63 ; 0x3f 1281c: 6a 97 sbiw r28, 0x1a ; 26 1281e: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 12822: 28 96 adiw r28, 0x08 ; 8 12824: 6c af std Y+60, r22 ; 0x3c 12826: 7d af std Y+61, r23 ; 0x3d 12828: 8e af std Y+62, r24 ; 0x3e 1282a: 9f af std Y+63, r25 ; 0x3f 1282c: 28 97 sbiw r28, 0x08 ; 8 segment_extruder_travel = (target[E_AXIS] - start_position[E_AXIS]) / (segments), 1282e: 2d 85 ldd r18, Y+13 ; 0x0d 12830: 3e 85 ldd r19, Y+14 ; 0x0e 12832: 4f 85 ldd r20, Y+15 ; 0x0f 12834: 58 89 ldd r21, Y+16 ; 0x10 12836: 60 91 35 06 lds r22, 0x0635 ; 0x800635 1283a: 70 91 36 06 lds r23, 0x0636 ; 0x800636 1283e: 80 91 37 06 lds r24, 0x0637 ; 0x800637 12842: 90 91 38 06 lds r25, 0x0638 ; 0x800638 12846: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1284a: a5 01 movw r20, r10 1284c: 94 01 movw r18, r8 1284e: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 12852: 2c 96 adiw r28, 0x0c ; 12 12854: 6c af std Y+60, r22 ; 0x3c 12856: 7d af std Y+61, r23 ; 0x3d 12858: 8e af std Y+62, r24 ; 0x3e 1285a: 9f af std Y+63, r25 ; 0x3f 1285c: 2c 97 sbiw r28, 0x0c ; 12 sq_theta_per_segment = theta_per_segment * theta_per_segment, 1285e: a3 01 movw r20, r6 12860: 92 01 movw r18, r4 12862: c3 01 movw r24, r6 12864: b2 01 movw r22, r4 12866: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1286a: 6b 01 movw r12, r22 1286c: 7c 01 movw r14, r24 sin_T = theta_per_segment - sq_theta_per_segment * theta_per_segment / 6, 1286e: ac 01 movw r20, r24 12870: 9b 01 movw r18, r22 12872: c3 01 movw r24, r6 12874: b2 01 movw r22, r4 12876: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1287a: 20 e0 ldi r18, 0x00 ; 0 1287c: 30 e0 ldi r19, 0x00 ; 0 1287e: 40 ec ldi r20, 0xC0 ; 192 12880: 50 e4 ldi r21, 0x40 ; 64 12882: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 12886: 9b 01 movw r18, r22 12888: ac 01 movw r20, r24 1288a: c3 01 movw r24, r6 1288c: b2 01 movw r22, r4 1288e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 12892: 6c af std Y+60, r22 ; 0x3c 12894: 7d af std Y+61, r23 ; 0x3d 12896: 8e af std Y+62, r24 ; 0x3e 12898: 9f af std Y+63, r25 ; 0x3f cos_T = 1 - 0.5f * sq_theta_per_segment; 1289a: 20 e0 ldi r18, 0x00 ; 0 1289c: 30 e0 ldi r19, 0x00 ; 0 1289e: 40 e0 ldi r20, 0x00 ; 0 128a0: 5f e3 ldi r21, 0x3F ; 63 128a2: c7 01 movw r24, r14 128a4: b6 01 movw r22, r12 128a6: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 128aa: 9b 01 movw r18, r22 128ac: ac 01 movw r20, r24 128ae: 60 e0 ldi r22, 0x00 ; 0 128b0: 70 e0 ldi r23, 0x00 ; 0 128b2: 80 e8 ldi r24, 0x80 ; 128 128b4: 9f e3 ldi r25, 0x3F ; 63 128b6: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 128ba: 24 96 adiw r28, 0x04 ; 4 128bc: 6c af std Y+60, r22 ; 0x3c 128be: 7d af std Y+61, r23 ; 0x3d 128c0: 8e af std Y+62, r24 ; 0x3e 128c2: 9f af std Y+63, r25 ; 0x3f 128c4: 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++) { 128c6: 22 24 eor r2, r2 128c8: 23 94 inc r2 128ca: 31 2c mov r3, r1 if (n_arc_correction-- == 0) { 128cc: d8 a8 ldd r13, Y+48 ; 0x30 128ce: da 94 dec r13 128d0: 58 a9 ldd r21, Y+48 ; 0x30 128d2: 51 11 cpse r21, r1 128d4: 25 c1 rjmp .+586 ; 0x12b20 // 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); 128d6: b1 01 movw r22, r2 128d8: 90 e0 ldi r25, 0x00 ; 0 128da: 80 e0 ldi r24, 0x00 ; 0 128dc: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 128e0: a3 01 movw r20, r6 128e2: 92 01 movw r18, r4 128e4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 128e8: 6b 01 movw r12, r22 128ea: 7c 01 movw r14, r24 128ec: 0f 94 a3 a6 call 0x34d46 ; 0x34d46 128f0: 6c a7 std Y+44, r22 ; 0x2c 128f2: 7d a7 std Y+45, r23 ; 0x2d 128f4: 8e a7 std Y+46, r24 ; 0x2e 128f6: 9f a7 std Y+47, r25 ; 0x2f 128f8: c7 01 movw r24, r14 128fa: b6 01 movw r22, r12 128fc: 0f 94 69 a9 call 0x352d2 ; 0x352d2 12900: 4b 01 movw r8, r22 12902: 5c 01 movw r10, r24 r_axis_x = -offset[X_AXIS] * cos_Ti + offset[Y_AXIS] * sin_Ti; 12904: c0 90 4d 03 lds r12, 0x034D ; 0x80034d 12908: d0 90 4e 03 lds r13, 0x034E ; 0x80034e 1290c: e0 90 4f 03 lds r14, 0x034F ; 0x80034f 12910: f0 90 50 03 lds r15, 0x0350 ; 0x800350 12914: f7 fa bst r15, 7 12916: f0 94 com r15 12918: f7 f8 bld r15, 7 1291a: f0 94 com r15 1291c: 80 91 51 03 lds r24, 0x0351 ; 0x800351 12920: 90 91 52 03 lds r25, 0x0352 ; 0x800352 12924: a0 91 53 03 lds r26, 0x0353 ; 0x800353 12928: b0 91 54 03 lds r27, 0x0354 ; 0x800354 1292c: 88 ab std Y+48, r24 ; 0x30 1292e: 99 ab std Y+49, r25 ; 0x31 12930: aa ab std Y+50, r26 ; 0x32 12932: bb ab std Y+51, r27 ; 0x33 12934: a7 01 movw r20, r14 12936: 96 01 movw r18, r12 12938: 6c a5 ldd r22, Y+44 ; 0x2c 1293a: 7d a5 ldd r23, Y+45 ; 0x2d 1293c: 8e a5 ldd r24, Y+46 ; 0x2e 1293e: 9f a5 ldd r25, Y+47 ; 0x2f 12940: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 12944: 68 a7 std Y+40, r22 ; 0x28 12946: 79 a7 std Y+41, r23 ; 0x29 12948: 8a a7 std Y+42, r24 ; 0x2a 1294a: 9b a7 std Y+43, r25 ; 0x2b 1294c: 28 a9 ldd r18, Y+48 ; 0x30 1294e: 39 a9 ldd r19, Y+49 ; 0x31 12950: 4a a9 ldd r20, Y+50 ; 0x32 12952: 5b a9 ldd r21, Y+51 ; 0x33 12954: c5 01 movw r24, r10 12956: b4 01 movw r22, r8 12958: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1295c: 9b 01 movw r18, r22 1295e: ac 01 movw r20, r24 12960: 68 a5 ldd r22, Y+40 ; 0x28 12962: 79 a5 ldd r23, Y+41 ; 0x29 12964: 8a a5 ldd r24, Y+42 ; 0x2a 12966: 9b a5 ldd r25, Y+43 ; 0x2b 12968: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1296c: 68 a7 std Y+40, r22 ; 0x28 1296e: 79 a7 std Y+41, r23 ; 0x29 12970: 8a a7 std Y+42, r24 ; 0x2a 12972: 9b a7 std Y+43, r25 ; 0x2b r_axis_y = -offset[X_AXIS] * sin_Ti - offset[Y_AXIS] * cos_Ti; 12974: a7 01 movw r20, r14 12976: 96 01 movw r18, r12 12978: c5 01 movw r24, r10 1297a: b4 01 movw r22, r8 1297c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 12980: 6b 01 movw r12, r22 12982: 7c 01 movw r14, r24 12984: 28 a9 ldd r18, Y+48 ; 0x30 12986: 39 a9 ldd r19, Y+49 ; 0x31 12988: 4a a9 ldd r20, Y+50 ; 0x32 1298a: 5b a9 ldd r21, Y+51 ; 0x33 1298c: 6c a5 ldd r22, Y+44 ; 0x2c 1298e: 7d a5 ldd r23, Y+45 ; 0x2d 12990: 8e a5 ldd r24, Y+46 ; 0x2e 12992: 9f a5 ldd r25, Y+47 ; 0x2f 12994: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 12998: 9b 01 movw r18, r22 1299a: ac 01 movw r20, r24 1299c: c7 01 movw r24, r14 1299e: b6 01 movw r22, r12 129a0: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 129a4: 6c a7 std Y+44, r22 ; 0x2c 129a6: 7d a7 std Y+45, r23 ; 0x2d 129a8: 8e a7 std Y+46, r24 ; 0x2e 129aa: 9f a7 std Y+47, r25 ; 0x2f // reset n_arc_correction n_arc_correction = cs.n_arc_correction; 129ac: 90 91 33 0e lds r25, 0x0E33 ; 0x800e33 129b0: 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; 129b2: 28 a5 ldd r18, Y+40 ; 0x28 129b4: 39 a5 ldd r19, Y+41 ; 0x29 129b6: 4a a5 ldd r20, Y+42 ; 0x2a 129b8: 5b a5 ldd r21, Y+43 ; 0x2b 129ba: 62 96 adiw r28, 0x12 ; 18 129bc: 6c ad ldd r22, Y+60 ; 0x3c 129be: 7d ad ldd r23, Y+61 ; 0x3d 129c0: 8e ad ldd r24, Y+62 ; 0x3e 129c2: 9f ad ldd r25, Y+63 ; 0x3f 129c4: 62 97 sbiw r28, 0x12 ; 18 129c6: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 129ca: 69 83 std Y+1, r22 ; 0x01 129cc: 7a 83 std Y+2, r23 ; 0x02 129ce: 8b 83 std Y+3, r24 ; 0x03 129d0: 9c 83 std Y+4, r25 ; 0x04 start_position[Y_AXIS] = center_axis_y + r_axis_y; 129d2: 2c a5 ldd r18, Y+44 ; 0x2c 129d4: 3d a5 ldd r19, Y+45 ; 0x2d 129d6: 4e a5 ldd r20, Y+46 ; 0x2e 129d8: 5f a5 ldd r21, Y+47 ; 0x2f 129da: 66 96 adiw r28, 0x16 ; 22 129dc: 6c ad ldd r22, Y+60 ; 0x3c 129de: 7d ad ldd r23, Y+61 ; 0x3d 129e0: 8e ad ldd r24, Y+62 ; 0x3e 129e2: 9f ad ldd r25, Y+63 ; 0x3f 129e4: 66 97 sbiw r28, 0x16 ; 22 129e6: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 129ea: 6d 83 std Y+5, r22 ; 0x05 129ec: 7e 83 std Y+6, r23 ; 0x06 129ee: 8f 83 std Y+7, r24 ; 0x07 129f0: 98 87 std Y+8, r25 ; 0x08 start_position[Z_AXIS] += linear_per_segment; 129f2: 28 96 adiw r28, 0x08 ; 8 129f4: 2c ad ldd r18, Y+60 ; 0x3c 129f6: 3d ad ldd r19, Y+61 ; 0x3d 129f8: 4e ad ldd r20, Y+62 ; 0x3e 129fa: 5f ad ldd r21, Y+63 ; 0x3f 129fc: 28 97 sbiw r28, 0x08 ; 8 129fe: 69 85 ldd r22, Y+9 ; 0x09 12a00: 7a 85 ldd r23, Y+10 ; 0x0a 12a02: 8b 85 ldd r24, Y+11 ; 0x0b 12a04: 9c 85 ldd r25, Y+12 ; 0x0c 12a06: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 12a0a: 69 87 std Y+9, r22 ; 0x09 12a0c: 7a 87 std Y+10, r23 ; 0x0a 12a0e: 8b 87 std Y+11, r24 ; 0x0b 12a10: 9c 87 std Y+12, r25 ; 0x0c start_position[E_AXIS] += segment_extruder_travel; 12a12: 2c 96 adiw r28, 0x0c ; 12 12a14: 2c ad ldd r18, Y+60 ; 0x3c 12a16: 3d ad ldd r19, Y+61 ; 0x3d 12a18: 4e ad ldd r20, Y+62 ; 0x3e 12a1a: 5f ad ldd r21, Y+63 ; 0x3f 12a1c: 2c 97 sbiw r28, 0x0c ; 12 12a1e: 6d 85 ldd r22, Y+13 ; 0x0d 12a20: 7e 85 ldd r23, Y+14 ; 0x0e 12a22: 8f 85 ldd r24, Y+15 ; 0x0f 12a24: 98 89 ldd r25, Y+16 ; 0x10 12a26: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 12a2a: 6d 87 std Y+13, r22 ; 0x0d 12a2c: 7e 87 std Y+14, r23 ; 0x0e 12a2e: 8f 87 std Y+15, r24 ; 0x0f 12a30: 98 8b std Y+16, r25 ; 0x10 // Clamp to the calculated position. clamp_to_software_endstops(start_position); 12a32: ce 01 movw r24, r28 12a34: 01 96 adiw r24, 0x01 ; 1 12a36: 0e 94 cd 6a call 0xd59a ; 0xd59a // Insert the segment into the buffer if (i >= start_segment_idx) 12a3a: 2e 96 adiw r28, 0x0e ; 14 12a3c: ae ad ldd r26, Y+62 ; 0x3e 12a3e: bf ad ldd r27, Y+63 ; 0x3f 12a40: 2e 97 sbiw r28, 0x0e ; 14 12a42: 2a 16 cp r2, r26 12a44: 3b 06 cpc r3, r27 12a46: f8 f0 brcs .+62 ; 0x12a86 plan_buffer_line(start_position[X_AXIS], start_position[Y_AXIS], start_position[Z_AXIS], start_position[E_AXIS], feed_rate, position, i); 12a48: e9 84 ldd r14, Y+9 ; 0x09 12a4a: fa 84 ldd r15, Y+10 ; 0x0a 12a4c: 0b 85 ldd r16, Y+11 ; 0x0b 12a4e: 1c 85 ldd r17, Y+12 ; 0x0c 12a50: 2d 81 ldd r18, Y+5 ; 0x05 12a52: 3e 81 ldd r19, Y+6 ; 0x06 12a54: 4f 81 ldd r20, Y+7 ; 0x07 12a56: 58 85 ldd r21, Y+8 ; 0x08 12a58: 69 81 ldd r22, Y+1 ; 0x01 12a5a: 7a 81 ldd r23, Y+2 ; 0x02 12a5c: 8b 81 ldd r24, Y+3 ; 0x03 12a5e: 9c 81 ldd r25, Y+4 ; 0x04 12a60: 3f 92 push r3 12a62: 2f 92 push r2 12a64: e1 e6 ldi r30, 0x61 ; 97 12a66: f2 e1 ldi r31, 0x12 ; 18 12a68: ff 93 push r31 12a6a: ef 93 push r30 12a6c: 88 ac ldd r8, Y+56 ; 0x38 12a6e: 99 ac ldd r9, Y+57 ; 0x39 12a70: aa ac ldd r10, Y+58 ; 0x3a 12a72: bb ac ldd r11, Y+59 ; 0x3b 12a74: fe 01 movw r30, r28 12a76: 3d 96 adiw r30, 0x0d ; 13 12a78: 6f 01 movw r12, r30 12a7a: 0f 94 bf 3a call 0x2757e ; 0x2757e 12a7e: 0f 90 pop r0 12a80: 0f 90 pop r0 12a82: 0f 90 pop r0 12a84: 0f 90 pop r0 // Handle the situation where the planner is aborted hard. if (planner_aborted) 12a86: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 12a8a: 81 11 cpse r24, r1 12a8c: 39 c0 rjmp .+114 ; 0x12b00 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++) { 12a8e: ff ef ldi r31, 0xFF ; 255 12a90: 2f 1a sub r2, r31 12a92: 3f 0a sbc r3, r31 12a94: 2c a9 ldd r18, Y+52 ; 0x34 12a96: 3d a9 ldd r19, Y+53 ; 0x35 12a98: 22 15 cp r18, r2 12a9a: 33 05 cpc r19, r3 12a9c: 09 f0 breq .+2 ; 0x12aa0 12a9e: 16 cf rjmp .-468 ; 0x128cc if (planner_aborted) return; } } // Clamp to the target position. clamp_to_software_endstops(target); 12aa0: 89 e2 ldi r24, 0x29 ; 41 12aa2: 96 e0 ldi r25, 0x06 ; 6 12aa4: 0e 94 cd 6a call 0xd59a ; 0xd59a // 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); 12aa8: e0 90 31 06 lds r14, 0x0631 ; 0x800631 12aac: f0 90 32 06 lds r15, 0x0632 ; 0x800632 12ab0: 00 91 33 06 lds r16, 0x0633 ; 0x800633 12ab4: 10 91 34 06 lds r17, 0x0634 ; 0x800634 12ab8: 20 91 2d 06 lds r18, 0x062D ; 0x80062d 12abc: 30 91 2e 06 lds r19, 0x062E ; 0x80062e 12ac0: 40 91 2f 06 lds r20, 0x062F ; 0x80062f 12ac4: 50 91 30 06 lds r21, 0x0630 ; 0x800630 12ac8: 60 91 29 06 lds r22, 0x0629 ; 0x800629 12acc: 70 91 2a 06 lds r23, 0x062A ; 0x80062a 12ad0: 80 91 2b 06 lds r24, 0x062B ; 0x80062b 12ad4: 90 91 2c 06 lds r25, 0x062C ; 0x80062c 12ad8: 1f 92 push r1 12ada: 1f 92 push r1 12adc: e1 e6 ldi r30, 0x61 ; 97 12ade: f2 e1 ldi r31, 0x12 ; 18 12ae0: ff 93 push r31 12ae2: ef 93 push r30 12ae4: 88 ac ldd r8, Y+56 ; 0x38 12ae6: 99 ac ldd r9, Y+57 ; 0x39 12ae8: aa ac ldd r10, Y+58 ; 0x3a 12aea: bb ac ldd r11, Y+59 ; 0x3b 12aec: a5 e3 ldi r26, 0x35 ; 53 12aee: ca 2e mov r12, r26 12af0: a6 e0 ldi r26, 0x06 ; 6 12af2: da 2e mov r13, r26 12af4: 0f 94 bf 3a call 0x2757e ; 0x2757e 12af8: 0f 90 pop r0 12afa: 0f 90 pop r0 12afc: 0f 90 pop r0 12afe: 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(); 12b00: 0e 94 73 55 call 0xaae6 ; 0xaae6 previous_millis_cmd.start(); 12b04: 88 e4 ldi r24, 0x48 ; 72 12b06: 93 e0 ldi r25, 0x03 ; 3 12b08: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> 12b0c: 4d cc rjmp .-1894 ; 0x123a8 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; 12b0e: 60 e0 ldi r22, 0x00 ; 0 12b10: 70 e0 ldi r23, 0x00 ; 0 12b12: cb 01 movw r24, r22 12b14: 5e cc rjmp .-1860 ; 0x123d2 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; 12b16: a3 2c mov r10, r3 12b18: b2 2c mov r11, r2 12b1a: 0c a9 ldd r16, Y+52 ; 0x34 12b1c: 1c ad ldd r17, Y+60 ; 0x3c 12b1e: b0 cd rjmp .-1184 ; 0x12680 // 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; 12b20: 28 a5 ldd r18, Y+40 ; 0x28 12b22: 39 a5 ldd r19, Y+41 ; 0x29 12b24: 4a a5 ldd r20, Y+42 ; 0x2a 12b26: 5b a5 ldd r21, Y+43 ; 0x2b 12b28: 6c ad ldd r22, Y+60 ; 0x3c 12b2a: 7d ad ldd r23, Y+61 ; 0x3d 12b2c: 8e ad ldd r24, Y+62 ; 0x3e 12b2e: 9f ad ldd r25, Y+63 ; 0x3f 12b30: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 12b34: 4b 01 movw r8, r22 12b36: 5c 01 movw r10, r24 12b38: 2c a5 ldd r18, Y+44 ; 0x2c 12b3a: 3d a5 ldd r19, Y+45 ; 0x2d 12b3c: 4e a5 ldd r20, Y+46 ; 0x2e 12b3e: 5f a5 ldd r21, Y+47 ; 0x2f 12b40: 24 96 adiw r28, 0x04 ; 4 12b42: 6c ad ldd r22, Y+60 ; 0x3c 12b44: 7d ad ldd r23, Y+61 ; 0x3d 12b46: 8e ad ldd r24, Y+62 ; 0x3e 12b48: 9f ad ldd r25, Y+63 ; 0x3f 12b4a: 24 97 sbiw r28, 0x04 ; 4 12b4c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 12b50: 9b 01 movw r18, r22 12b52: ac 01 movw r20, r24 12b54: c5 01 movw r24, r10 12b56: b4 01 movw r22, r8 12b58: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 12b5c: 7b 01 movw r14, r22 12b5e: 8c 01 movw r16, r24 r_axis_x = r_axis_x * cos_T - r_axis_y * sin_T; 12b60: 28 a5 ldd r18, Y+40 ; 0x28 12b62: 39 a5 ldd r19, Y+41 ; 0x29 12b64: 4a a5 ldd r20, Y+42 ; 0x2a 12b66: 5b a5 ldd r21, Y+43 ; 0x2b 12b68: 24 96 adiw r28, 0x04 ; 4 12b6a: 6c ad ldd r22, Y+60 ; 0x3c 12b6c: 7d ad ldd r23, Y+61 ; 0x3d 12b6e: 8e ad ldd r24, Y+62 ; 0x3e 12b70: 9f ad ldd r25, Y+63 ; 0x3f 12b72: 24 97 sbiw r28, 0x04 ; 4 12b74: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 12b78: 4b 01 movw r8, r22 12b7a: 5c 01 movw r10, r24 12b7c: 2c a5 ldd r18, Y+44 ; 0x2c 12b7e: 3d a5 ldd r19, Y+45 ; 0x2d 12b80: 4e a5 ldd r20, Y+46 ; 0x2e 12b82: 5f a5 ldd r21, Y+47 ; 0x2f 12b84: 6c ad ldd r22, Y+60 ; 0x3c 12b86: 7d ad ldd r23, Y+61 ; 0x3d 12b88: 8e ad ldd r24, Y+62 ; 0x3e 12b8a: 9f ad ldd r25, Y+63 ; 0x3f 12b8c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 12b90: 9b 01 movw r18, r22 12b92: ac 01 movw r20, r24 12b94: c5 01 movw r24, r10 12b96: b4 01 movw r22, r8 12b98: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 12b9c: 68 a7 std Y+40, r22 ; 0x28 12b9e: 79 a7 std Y+41, r23 ; 0x29 12ba0: 8a a7 std Y+42, r24 ; 0x2a 12ba2: 9b a7 std Y+43, r25 ; 0x2b 12ba4: d8 aa std Y+48, r13 ; 0x30 r_axis_y = r_axisi; 12ba6: c7 01 movw r24, r14 12ba8: d8 01 movw r26, r16 12baa: 8c a7 std Y+44, r24 ; 0x2c 12bac: 9d a7 std Y+45, r25 ; 0x2d 12bae: ae a7 std Y+46, r26 ; 0x2e 12bb0: bf a7 std Y+47, r27 ; 0x2f 12bb2: ff ce rjmp .-514 ; 0x129b2 - `S` - Time to wait, in seconds */ case 4: codenum = 0; if(code_seen('P')) codenum = code_value(); // milliseconds to wait 12bb4: 80 e5 ldi r24, 0x50 ; 80 12bb6: 0e 94 80 56 call 0xad00 ; 0xad00 - `P` - Time to wait, in milliseconds - `S` - Time to wait, in seconds */ case 4: codenum = 0; 12bba: c1 2c mov r12, r1 12bbc: d1 2c mov r13, r1 12bbe: 76 01 movw r14, r12 if(code_seen('P')) codenum = code_value(); // milliseconds to wait 12bc0: 88 23 and r24, r24 12bc2: 31 f0 breq .+12 ; 0x12bd0 12bc4: 0e 94 10 5b call 0xb620 ; 0xb620 12bc8: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 12bcc: 6b 01 movw r12, r22 12bce: 7c 01 movw r14, r24 if(code_seen('S')) codenum = code_value() * 1000; // seconds to wait 12bd0: 83 e5 ldi r24, 0x53 ; 83 12bd2: 0e 94 80 56 call 0xad00 ; 0xad00 12bd6: 88 23 and r24, r24 12bd8: 61 f0 breq .+24 ; 0x12bf2 12bda: 0e 94 10 5b call 0xb620 ; 0xb620 12bde: 20 e0 ldi r18, 0x00 ; 0 12be0: 30 e0 ldi r19, 0x00 ; 0 12be2: 4a e7 ldi r20, 0x7A ; 122 12be4: 54 e4 ldi r21, 0x44 ; 68 12be6: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 12bea: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 12bee: 6b 01 movw r12, r22 12bf0: 7c 01 movw r14, r24 if(codenum != 0) 12bf2: c1 14 cp r12, r1 12bf4: d1 04 cpc r13, r1 12bf6: e1 04 cpc r14, r1 12bf8: f1 04 cpc r15, r1 12bfa: 41 f0 breq .+16 ; 0x12c0c { if(custom_message_type != CustomMsg::M117) 12bfc: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 12c00: 87 30 cpi r24, 0x07 ; 7 12c02: 21 f0 breq .+8 ; 0x12c0c { LCD_MESSAGERPGM(_n("Sleep..."));////MSG_DWELL 12c04: 89 ed ldi r24, 0xD9 ; 217 12c06: 97 e6 ldi r25, 0x67 ; 103 12c08: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 } } st_synchronize(); 12c0c: 0f 94 94 18 call 0x23128 ; 0x23128 codenum += _millis(); // keep track of when we started waiting 12c10: 0f 94 89 0b call 0x21712 ; 0x21712 12c14: c6 0e add r12, r22 12c16: d7 1e adc r13, r23 12c18: e8 1e adc r14, r24 12c1a: f9 1e adc r15, r25 previous_millis_cmd.start(); 12c1c: 88 e4 ldi r24, 0x48 ; 72 12c1e: 93 e0 ldi r25, 0x03 ; 3 12c20: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> while(_millis() < codenum) { 12c24: 0f 94 89 0b call 0x21712 ; 0x21712 12c28: 6c 15 cp r22, r12 12c2a: 7d 05 cpc r23, r13 12c2c: 8e 05 cpc r24, r14 12c2e: 9f 05 cpc r25, r15 12c30: 08 f0 brcs .+2 ; 0x12c34 12c32: ba cb rjmp .-2188 ; 0x123a8 manage_heater(); 12c34: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(); 12c38: 80 e0 ldi r24, 0x00 ; 0 12c3a: 0e 94 ad 8a call 0x1155a ; 0x1155a lcd_update(0); 12c3e: 80 e0 ldi r24, 0x00 ; 0 12c40: 0e 94 4a 6f call 0xde94 ; 0xde94 12c44: ef cf rjmp .-34 ; 0x12c24 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); 12c46: 81 e0 ldi r24, 0x01 ; 1 */ case 11: #if EXTRUDERS > 1 retract(false,retracted_swap[active_extruder]); #else retract(false); 12c48: 0f 94 cd 90 call 0x3219a ; 0x3219a 12c4c: ad cb rjmp .-2214 ; 0x123a8 12c4e: 80 e0 ldi r24, 0x00 ; 0 12c50: fb cf rjmp .-10 ; 0x12c48 { 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]); 12c52: 88 e5 ldi r24, 0x58 ; 88 12c54: 0e 94 80 56 call 0xad00 ; 0xad00 12c58: 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; 12c5a: 41 2c mov r4, r1 12c5c: 51 2c mov r5, r1 12c5e: 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(); 12c60: 88 23 and r24, r24 12c62: 21 f0 breq .+8 ; 0x12c6c 12c64: 0e 94 e8 56 call 0xadd0 ; 0xadd0 12c68: 2b 01 movw r4, r22 12c6a: 3c 01 movw r6, r24 bool home_y = code_seen(axis_codes[Y_AXIS]); 12c6c: 89 e5 ldi r24, 0x59 ; 89 12c6e: 0e 94 80 56 call 0xad00 ; 0xad00 12c72: 28 2e mov r2, r24 if (home_y) home_y_value = code_value_long(); 12c74: 88 23 and r24, r24 12c76: 71 f1 breq .+92 ; 0x12cd4 12c78: 0e 94 e8 56 call 0xadd0 ; 0xadd0 12c7c: 6c a7 std Y+44, r22 ; 0x2c 12c7e: 7d a7 std Y+45, r23 ; 0x2d 12c80: 8e a7 std Y+46, r24 ; 0x2e 12c82: 9f a7 std Y+47, r25 ; 0x2f bool home_z = code_seen(axis_codes[Z_AXIS]); 12c84: 8a e5 ldi r24, 0x5A ; 90 12c86: 0e 94 80 56 call 0xad00 ; 0xad00 12c8a: d8 2e mov r13, r24 */ case 28: { long home_x_value = 0; long home_y_value = 0; long home_z_value = 0; 12c8c: 81 2c mov r8, r1 12c8e: 91 2c mov r9, r1 12c90: 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(); 12c92: 88 23 and r24, r24 12c94: 21 f0 breq .+8 ; 0x12c9e 12c96: 0e 94 e8 56 call 0xadd0 ; 0xadd0 12c9a: 4b 01 movw r8, r22 12c9c: 5c 01 movw r10, r24 bool without_mbl = code_seen('W'); 12c9e: 87 e5 ldi r24, 0x57 ; 87 12ca0: 0e 94 80 56 call 0xad00 ; 0xad00 12ca4: 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); 12ca6: 8f 93 push r24 12ca8: cd 2c mov r12, r13 12caa: ec a4 ldd r14, Y+44 ; 0x2c 12cac: fd a4 ldd r15, Y+45 ; 0x2d 12cae: 0e a5 ldd r16, Y+46 ; 0x2e 12cb0: 1f a5 ldd r17, Y+47 ; 0x2f 12cb2: 22 2d mov r18, r2 12cb4: b3 01 movw r22, r6 12cb6: a2 01 movw r20, r4 12cb8: 83 2d mov r24, r3 12cba: 0e 94 7b 6d call 0xdaf6 ; 0xdaf6 #endif //TMC2130 if ((home_x || home_y || without_mbl || home_z) == false) { 12cbe: 0f 90 pop r0 12cc0: 31 10 cpse r3, r1 12cc2: 72 cb rjmp .-2332 ; 0x123a8 12cc4: 21 10 cpse r2, r1 12cc6: 70 cb rjmp .-2336 ; 0x123a8 12cc8: 38 a5 ldd r19, Y+40 ; 0x28 12cca: 31 11 cpse r19, r1 12ccc: 6d cb rjmp .-2342 ; 0x123a8 12cce: d1 10 cpse r13, r1 12cd0: 6b cb rjmp .-2346 ; 0x123a8 12cd2: 20 cb rjmp .-2496 ; 0x12314 - `C` - Calibrate X and Y origin (home) - Only on MK3/s */ case 28: { long home_x_value = 0; long home_y_value = 0; 12cd4: 1c a6 std Y+44, r1 ; 0x2c 12cd6: 1d a6 std Y+45, r1 ; 0x2d 12cd8: 1e a6 std Y+46, r1 ; 0x2e 12cda: 1f a6 std Y+47, r1 ; 0x2f 12cdc: d3 cf rjmp .-90 ; 0x12c84 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) 12cde: 08 e2 ldi r16, 0x28 ; 40 12ce0: 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)); 12ce2: f4 eb ldi r31, 0xB4 ; 180 12ce4: ef 2e mov r14, r31 12ce6: f7 e6 ldi r31, 0x67 ; 103 12ce8: ff 2e mov r15, r31 12cea: 60 2f mov r22, r16 12cec: 70 e0 ldi r23, 0x00 ; 0 12cee: 90 e0 ldi r25, 0x00 ; 0 12cf0: 80 e0 ldi r24, 0x00 ; 0 12cf2: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 12cf6: 0e 94 11 57 call 0xae22 ; 0xae22 12cfa: 9f 93 push r25 12cfc: 8f 93 push r24 12cfe: 7f 93 push r23 12d00: 6f 93 push r22 12d02: 1f 93 push r17 12d04: 0f 93 push r16 12d06: ff 92 push r15 12d08: ef 92 push r14 12d0a: 0f 94 43 a3 call 0x34686 ; 0x34686 12d0e: 0f 5f subi r16, 0xFF ; 255 12d10: 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++) 12d12: 0f b6 in r0, 0x3f ; 63 12d14: f8 94 cli 12d16: de bf out 0x3e, r29 ; 62 12d18: 0f be out 0x3f, r0 ; 63 12d1a: cd bf out 0x3d, r28 ; 61 12d1c: 0f 36 cpi r16, 0x6F ; 111 12d1e: 11 05 cpc r17, r1 12d20: 21 f7 brne .-56 ; 0x12cea 12d22: 42 cb rjmp .-2428 ; 0x123a8 ``` */ case 76: { #ifdef PINDA_THERMISTOR if (!has_temperature_compensation()) 12d24: 0f 94 f1 10 call 0x221e2 ; 0x221e2 12d28: 81 11 cpse r24, r1 12d2a: 05 c0 rjmp .+10 ; 0x12d36 { SERIAL_ECHOLNPGM("No PINDA thermistor"); 12d2c: 88 e6 ldi r24, 0x68 ; 104 12d2e: 91 e8 ldi r25, 0x81 ; 129 12d30: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 12d34: 39 cb rjmp .-2446 ; 0x123a8 break; } if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 12d36: 82 e0 ldi r24, 0x02 ; 2 12d38: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 12d3c: 81 11 cpse r24, r1 12d3e: 07 c0 rjmp .+14 ; 0x12d4e //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)); 12d40: 8b e2 ldi r24, 0x2B ; 43 12d42: 9a e3 ldi r25, 0x3A ; 58 12d44: 0e 94 8b 75 call 0xeb16 ; 0xeb16 12d48: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 12d4c: 2d cb rjmp .-2470 ; 0x123a8 break; } if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS])) 12d4e: 80 91 39 06 lds r24, 0x0639 ; 0x800639 12d52: 88 23 and r24, r24 12d54: 41 f0 breq .+16 ; 0x12d66 12d56: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 12d5a: 88 23 and r24, r24 12d5c: 21 f0 breq .+8 ; 0x12d66 12d5e: d0 90 3b 06 lds r13, 0x063B ; 0x80063b 12d62: d1 10 cpse r13, r1 12d64: 08 c0 rjmp .+16 ; 0x12d76 // 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; 12d66: 81 e0 ldi r24, 0x01 ; 1 12d68: 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); 12d6c: 81 e7 ldi r24, 0x71 ; 113 12d6e: 99 e6 ldi r25, 0x69 ; 105 12d70: 0f 94 16 67 call 0x2ce2c ; 0x2ce2c 12d74: 19 cb rjmp .-2510 ; 0x123a8 break; } lcd_show_fullscreen_message_and_wait_P(_T(MSG_TEMP_CAL_WARNING)); 12d76: 82 ee ldi r24, 0xE2 ; 226 12d78: 99 e3 ldi r25, 0x39 ; 57 12d7a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 12d7e: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_STEEL_SHEET_CHECK), false); 12d82: 86 e2 ldi r24, 0x26 ; 38 12d84: 90 e4 ldi r25, 0x40 ; 64 12d86: 0e 94 8b 75 call 0xeb16 ; 0xeb16 12d8a: 41 e0 ldi r20, 0x01 ; 1 12d8c: 60 e0 ldi r22, 0x00 ; 0 12d8e: 0e 94 5f e3 call 0x1c6be ; 0x1c6be if (result == LCD_LEFT_BUTTON_CHOICE) 12d92: 81 11 cpse r24, r1 12d94: 6e c0 rjmp .+220 ; 0x12e72 { current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 12d96: 80 e0 ldi r24, 0x00 ; 0 12d98: 90 e0 ldi r25, 0x00 ; 0 12d9a: a0 ea ldi r26, 0xA0 ; 160 12d9c: b0 e4 ldi r27, 0x40 ; 64 12d9e: 80 93 69 12 sts 0x1269, r24 ; 0x801269 12da2: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 12da6: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 12daa: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 12dae: 60 e0 ldi r22, 0x00 ; 0 12db0: 70 e0 ldi r23, 0x00 ; 0 12db2: 88 e4 ldi r24, 0x48 ; 72 12db4: 92 e4 ldi r25, 0x42 ; 66 12db6: 0f 94 0d 4a call 0x2941a ; 0x2941a current_position[Z_AXIS] = 50; 12dba: 80 e0 ldi r24, 0x00 ; 0 12dbc: 90 e0 ldi r25, 0x00 ; 0 12dbe: a8 e4 ldi r26, 0x48 ; 72 12dc0: b2 e4 ldi r27, 0x42 ; 66 12dc2: 80 93 69 12 sts 0x1269, r24 ; 0x801269 12dc6: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 12dca: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 12dce: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c current_position[Y_AXIS] = 180; 12dd2: 80 e0 ldi r24, 0x00 ; 0 12dd4: 90 e0 ldi r25, 0x00 ; 0 12dd6: a4 e3 ldi r26, 0x34 ; 52 12dd8: b3 e4 ldi r27, 0x43 ; 67 12dda: 80 93 65 12 sts 0x1265, r24 ; 0x801265 12dde: 90 93 66 12 sts 0x1266, r25 ; 0x801266 12de2: a0 93 67 12 sts 0x1267, r26 ; 0x801267 12de6: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 12dea: 60 e0 ldi r22, 0x00 ; 0 12dec: 70 e0 ldi r23, 0x00 ; 0 12dee: 88 e4 ldi r24, 0x48 ; 72 12df0: 92 e4 ldi r25, 0x42 ; 66 12df2: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 12df6: 0f 94 94 18 call 0x23128 ; 0x23128 lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_STEEL_SHEET)); 12dfa: 8c ef ldi r24, 0xFC ; 252 12dfc: 9f e3 ldi r25, 0x3F ; 63 12dfe: 0e 94 8b 75 call 0xeb16 ; 0xeb16 12e02: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 12e06: e5 e0 ldi r30, 0x05 ; 5 12e08: fd e9 ldi r31, 0x9D ; 157 12e0a: 85 91 lpm r24, Z+ 12e0c: 95 91 lpm r25, Z+ 12e0e: a5 91 lpm r26, Z+ 12e10: b4 91 lpm r27, Z 12e12: 80 93 65 12 sts 0x1265, r24 ; 0x801265 12e16: 90 93 66 12 sts 0x1266, r25 ; 0x801266 12e1a: a0 93 67 12 sts 0x1267, r26 ; 0x801267 12e1e: b0 93 68 12 sts 0x1268, r27 ; 0x801268 current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 12e22: e1 e0 ldi r30, 0x01 ; 1 12e24: fd e9 ldi r31, 0x9D ; 157 12e26: 85 91 lpm r24, Z+ 12e28: 95 91 lpm r25, Z+ 12e2a: a5 91 lpm r26, Z+ 12e2c: b4 91 lpm r27, Z 12e2e: 80 93 61 12 sts 0x1261, r24 ; 0x801261 12e32: 90 93 62 12 sts 0x1262, r25 ; 0x801262 12e36: a0 93 63 12 sts 0x1263, r26 ; 0x801263 12e3a: b0 93 64 12 sts 0x1264, r27 ; 0x801264 plan_buffer_line_curposXYZE(3000 / 60); 12e3e: 60 e0 ldi r22, 0x00 ; 0 12e40: 70 e0 ldi r23, 0x00 ; 0 12e42: 88 e4 ldi r24, 0x48 ; 72 12e44: 92 e4 ldi r25, 0x42 ; 66 12e46: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 12e4a: 0f 94 94 18 call 0x23128 ; 0x23128 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); 12e4e: 81 e0 ldi r24, 0x01 ; 1 12e50: 8f 93 push r24 12e52: 81 2c mov r8, r1 12e54: 91 2c mov r9, r1 12e56: 54 01 movw r10, r8 12e58: cc 24 eor r12, r12 12e5a: c3 94 inc r12 12e5c: e1 2c mov r14, r1 12e5e: f1 2c mov r15, r1 12e60: 87 01 movw r16, r14 12e62: 20 e0 ldi r18, 0x00 ; 0 12e64: 40 e0 ldi r20, 0x00 ; 0 12e66: 50 e0 ldi r21, 0x00 ; 0 12e68: ba 01 movw r22, r20 12e6a: 80 e0 ldi r24, 0x00 ; 0 12e6c: 0e 94 7b 6d call 0xdaf6 ; 0xdaf6 12e70: 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)) { 12e72: 20 e0 ldi r18, 0x00 ; 0 12e74: 30 e0 ldi r19, 0x00 ; 0 12e76: 4c e0 ldi r20, 0x0C ; 12 12e78: 52 e4 ldi r21, 0x42 ; 66 12e7a: 60 91 85 03 lds r22, 0x0385 ; 0x800385 12e7e: 70 91 86 03 lds r23, 0x0386 ; 0x800386 12e82: 80 91 87 03 lds r24, 0x0387 ; 0x800387 12e86: 90 91 88 03 lds r25, 0x0388 ; 0x800388 12e8a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 12e8e: 18 16 cp r1, r24 12e90: 0c f0 brlt .+2 ; 0x12e94 12e92: 76 c0 rjmp .+236 ; 0x12f80 12e94: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 12e98: 81 11 cpse r24, r1 12e9a: 72 c0 rjmp .+228 ; 0x12f80 //waiting for PIDNA probe to cool down in case that we are not in farm mode current_position[Z_AXIS] = 100; 12e9c: 80 e0 ldi r24, 0x00 ; 0 12e9e: 90 e0 ldi r25, 0x00 ; 0 12ea0: a8 ec ldi r26, 0xC8 ; 200 12ea2: b2 e4 ldi r27, 0x42 ; 66 12ea4: 80 93 69 12 sts 0x1269, r24 ; 0x801269 12ea8: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 12eac: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 12eb0: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 12eb4: 60 e0 ldi r22, 0x00 ; 0 12eb6: 70 e0 ldi r23, 0x00 ; 0 12eb8: 88 e4 ldi r24, 0x48 ; 72 12eba: 92 e4 ldi r25, 0x42 ; 66 12ebc: 0f 94 0d 4a call 0x2941a ; 0x2941a } #ifdef PINDA_THERMISTOR bool lcd_wait_for_pinda(float temp) { disable_heater(); 12ec0: 0f 94 9e 0e call 0x21d3c ; 0x21d3c LongTimer pinda_timeout; 12ec4: 19 82 std Y+1, r1 ; 0x01 12ec6: 1a 82 std Y+2, r1 ; 0x02 12ec8: 1b 82 std Y+3, r1 ; 0x03 12eca: 1c 82 std Y+4, r1 ; 0x04 12ecc: 1d 82 std Y+5, r1 ; 0x05 pinda_timeout.start(); 12ece: ce 01 movw r24, r28 12ed0: 01 96 adiw r24, 0x01 ; 1 12ed2: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::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); 12ed6: e3 e2 ldi r30, 0x23 ; 35 12ed8: fe 2e mov r15, r30 12eda: 05 ee ldi r16, 0xE5 ; 229 12edc: 1e e7 ldi r17, 0x7E ; 126 disable_heater(); LongTimer pinda_timeout; pinda_timeout.start(); bool target_temp_reached = true; while (current_temperature_pinda > temp){ 12ede: 20 e0 ldi r18, 0x00 ; 0 12ee0: 30 e0 ldi r19, 0x00 ; 0 12ee2: 4c e0 ldi r20, 0x0C ; 12 12ee4: 52 e4 ldi r21, 0x42 ; 66 12ee6: 60 91 85 03 lds r22, 0x0385 ; 0x800385 12eea: 70 91 86 03 lds r23, 0x0386 ; 0x800386 12eee: 80 91 87 03 lds r24, 0x0387 ; 0x800387 12ef2: 90 91 88 03 lds r25, 0x0388 ; 0x800388 12ef6: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 12efa: 18 16 cp r1, r24 12efc: c4 f5 brge .+112 ; 0x12f6e lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP_PINDA)); 12efe: 84 e9 ldi r24, 0x94 ; 148 12f00: 99 e3 ldi r25, 0x39 ; 57 12f02: 0e 94 8b 75 call 0xeb16 ; 0xeb16 12f06: 0e 94 91 de call 0x1bd22 ; 0x1bd22 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 12f0a: 42 e8 ldi r20, 0x82 ; 130 12f0c: 64 e0 ldi r22, 0x04 ; 4 12f0e: 80 e0 ldi r24, 0x00 ; 0 12f10: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)current_temperature_pinda, (int16_t) temp); 12f14: 1f 92 push r1 12f16: ff 92 push r15 12f18: 60 91 85 03 lds r22, 0x0385 ; 0x800385 12f1c: 70 91 86 03 lds r23, 0x0386 ; 0x800386 12f20: 80 91 87 03 lds r24, 0x0387 ; 0x800387 12f24: 90 91 88 03 lds r25, 0x0388 ; 0x800388 12f28: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 12f2c: 7f 93 push r23 12f2e: 6f 93 push r22 12f30: 1f 93 push r17 12f32: 0f 93 push r16 12f34: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 lcd_putc(LCD_STR_DEGREE[0]); 12f38: 81 e8 ldi r24, 0x81 ; 129 12f3a: 0e 94 72 6f call 0xdee4 ; 0xdee4 delay_keep_alive(1000); 12f3e: 88 ee ldi r24, 0xE8 ; 232 12f40: 93 e0 ldi r25, 0x03 ; 3 12f42: 0e 94 07 8d call 0x11a0e ; 0x11a0e serialecho_temperatures(); 12f46: 0e 94 23 7b call 0xf646 ; 0xf646 if (pinda_timeout.expired(8 * 60 * 1000ul)) { //PINDA cooling from 60 C to 35 C takes about 7 minutes 12f4a: 40 e0 ldi r20, 0x00 ; 0 12f4c: 53 e5 ldi r21, 0x53 ; 83 12f4e: 67 e0 ldi r22, 0x07 ; 7 12f50: 70 e0 ldi r23, 0x00 ; 0 12f52: ce 01 movw r24, r28 12f54: 01 96 adiw r24, 0x01 ; 1 12f56: 0f 94 21 0c call 0x21842 ; 0x21842 ::expired(unsigned long)> 12f5a: 0f 90 pop r0 12f5c: 0f 90 pop r0 12f5e: 0f 90 pop r0 12f60: 0f 90 pop r0 12f62: 0f 90 pop r0 12f64: 0f 90 pop r0 12f66: 88 23 and r24, r24 12f68: 09 f4 brne .+2 ; 0x12f6c 12f6a: b9 cf rjmp .-142 ; 0x12ede target_temp_reached = false; 12f6c: d1 2c mov r13, r1 break; } } lcd_update_enable(true); 12f6e: 81 e0 ldi r24, 0x01 ; 1 12f70: 0e 94 89 70 call 0xe112 ; 0xe112 if (lcd_wait_for_pinda(35) == false) { //waiting for PINDA probe to cool, if this takes more then time expected, temp. cal. fails 12f74: d1 10 cpse r13, r1 12f76: 04 c0 rjmp .+8 ; 0x12f80 lcd_temp_cal_show_result(false); 12f78: 80 e0 ldi r24, 0x00 ; 0 12f7a: 0e 94 77 f9 call 0x1f2ee ; 0x1f2ee 12f7e: 14 ca rjmp .-3032 ; 0x123a8 break; } } st_synchronize(); 12f80: 0f 94 94 18 call 0x23128 ; 0x23128 homing_flag = true; // keep homing on to avoid babystepping while the LCD is enabled 12f84: 81 e0 ldi r24, 0x01 ; 1 12f86: 80 93 71 12 sts 0x1271, r24 ; 0x801271 lcd_update_enable(true); 12f8a: 0e 94 89 70 call 0xe112 ; 0xe112 SERIAL_ECHOLNPGM("PINDA probe calibration start"); 12f8e: 8a e4 ldi r24, 0x4A ; 74 12f90: 91 e8 ldi r25, 0x81 ; 129 12f92: 0e 94 0e 7d call 0xfa1c ; 0xfa1c float zero_z; int z_shift = 0; //unit: steps float start_temp = 5 * (int)(current_temperature_pinda / 5); 12f96: 80 90 85 03 lds r8, 0x0385 ; 0x800385 12f9a: 90 90 86 03 lds r9, 0x0386 ; 0x800386 12f9e: a0 90 87 03 lds r10, 0x0387 ; 0x800387 12fa2: b0 90 88 03 lds r11, 0x0388 ; 0x800388 12fa6: 20 e0 ldi r18, 0x00 ; 0 12fa8: 30 e0 ldi r19, 0x00 ; 0 12faa: 40 ea ldi r20, 0xA0 ; 160 12fac: 50 e4 ldi r21, 0x40 ; 64 12fae: c5 01 movw r24, r10 12fb0: b4 01 movw r22, r8 12fb2: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 12fb6: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 12fba: 25 e0 ldi r18, 0x05 ; 5 12fbc: 26 9f mul r18, r22 12fbe: a0 01 movw r20, r0 12fc0: 27 9f mul r18, r23 12fc2: 50 0d add r21, r0 12fc4: 11 24 eor r1, r1 12fc6: ba 01 movw r22, r20 12fc8: 55 0f add r21, r21 12fca: 88 0b sbc r24, r24 12fcc: 99 0b sbc r25, r25 12fce: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 12fd2: 1b 01 movw r2, r22 12fd4: 7c 01 movw r14, r24 if (start_temp < 35) start_temp = 35; 12fd6: 20 e0 ldi r18, 0x00 ; 0 12fd8: 30 e0 ldi r19, 0x00 ; 0 12fda: 4c e0 ldi r20, 0x0C ; 12 12fdc: 52 e4 ldi r21, 0x42 ; 66 12fde: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 12fe2: 87 ff sbrs r24, 7 12fe4: 06 c0 rjmp .+12 ; 0x12ff2 12fe6: 21 2c mov r2, r1 12fe8: 31 2c mov r3, r1 12fea: 6c e0 ldi r22, 0x0C ; 12 12fec: e6 2e mov r14, r22 12fee: 72 e4 ldi r23, 0x42 ; 66 12ff0: f7 2e mov r15, r23 if (start_temp < current_temperature_pinda) start_temp += 5; 12ff2: 22 2d mov r18, r2 12ff4: 33 2d mov r19, r3 12ff6: 4e 2d mov r20, r14 12ff8: 5f 2d mov r21, r15 12ffa: c5 01 movw r24, r10 12ffc: b4 01 movw r22, r8 12ffe: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 13002: 18 16 cp r1, r24 13004: 64 f4 brge .+24 ; 0x1301e 13006: 20 e0 ldi r18, 0x00 ; 0 13008: 30 e0 ldi r19, 0x00 ; 0 1300a: 40 ea ldi r20, 0xA0 ; 160 1300c: 50 e4 ldi r21, 0x40 ; 64 1300e: 62 2d mov r22, r2 13010: 73 2d mov r23, r3 13012: 8e 2d mov r24, r14 13014: 9f 2d mov r25, r15 13016: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1301a: 1b 01 movw r2, r22 1301c: 7c 01 movw r14, r24 printf_P(_N("start temperature: %.1f\n"), start_temp); 1301e: ff 92 push r15 13020: ef 92 push r14 13022: 3f 92 push r3 13024: 2f 92 push r2 13026: 8b e9 ldi r24, 0x9B ; 155 13028: 97 e6 ldi r25, 0x67 ; 103 1302a: 9f 93 push r25 1302c: 8f 93 push r24 1302e: 0f 94 43 a3 call 0x34686 ; 0x34686 setTargetBed(70 + (start_temp - 30)); 13032: 20 e0 ldi r18, 0x00 ; 0 13034: 30 e0 ldi r19, 0x00 ; 0 13036: 40 ef ldi r20, 0xF0 ; 240 13038: 51 e4 ldi r21, 0x41 ; 65 1303a: 62 2d mov r22, r2 1303c: 73 2d mov r23, r3 1303e: 8e 2d mov r24, r14 13040: 9f 2d mov r25, r15 13042: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 13046: 20 e0 ldi r18, 0x00 ; 0 13048: 30 e0 ldi r19, 0x00 ; 0 1304a: 4c e8 ldi r20, 0x8C ; 140 1304c: 52 e4 ldi r21, 0x42 ; 66 1304e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 13052: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 13056: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 1305a: 60 93 59 12 sts 0x1259, r22 ; 0x801259 custom_message_type = CustomMsg::TempCal; 1305e: 84 e0 ldi r24, 0x04 ; 4 13060: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d custom_message_state = 1; 13064: 81 e0 ldi r24, 0x01 ; 1 13066: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de lcd_setstatuspgm(_T(MSG_PINDA_CALIBRATION)); 1306a: 85 ed ldi r24, 0xD5 ; 213 1306c: 95 e4 ldi r25, 0x45 ; 69 1306e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 13072: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 13076: 80 e0 ldi r24, 0x00 ; 0 13078: 90 e0 ldi r25, 0x00 ; 0 1307a: a0 ea ldi r26, 0xA0 ; 160 1307c: b0 e4 ldi r27, 0x40 ; 64 1307e: 80 93 69 12 sts 0x1269, r24 ; 0x801269 13082: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 13086: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 1308a: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 1308e: 60 e0 ldi r22, 0x00 ; 0 13090: 70 e0 ldi r23, 0x00 ; 0 13092: 88 e4 ldi r24, 0x48 ; 72 13094: 92 e4 ldi r25, 0x42 ; 66 13096: 0f 94 0d 4a call 0x2941a ; 0x2941a current_position[X_AXIS] = PINDA_PREHEAT_X; 1309a: 80 e0 ldi r24, 0x00 ; 0 1309c: 90 e0 ldi r25, 0x00 ; 0 1309e: a0 ea ldi r26, 0xA0 ; 160 130a0: b1 e4 ldi r27, 0x41 ; 65 130a2: 80 93 61 12 sts 0x1261, r24 ; 0x801261 130a6: 90 93 62 12 sts 0x1262, r25 ; 0x801262 130aa: a0 93 63 12 sts 0x1263, r26 ; 0x801263 130ae: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 130b2: 80 e0 ldi r24, 0x00 ; 0 130b4: 90 e0 ldi r25, 0x00 ; 0 130b6: a0 e7 ldi r26, 0x70 ; 112 130b8: b2 e4 ldi r27, 0x42 ; 66 130ba: 80 93 65 12 sts 0x1265, r24 ; 0x801265 130be: 90 93 66 12 sts 0x1266, r25 ; 0x801266 130c2: a0 93 67 12 sts 0x1267, r26 ; 0x801267 130c6: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 130ca: 60 e0 ldi r22, 0x00 ; 0 130cc: 70 e0 ldi r23, 0x00 ; 0 130ce: 88 e4 ldi r24, 0x48 ; 72 130d0: 92 e4 ldi r25, 0x42 ; 66 130d2: 0f 94 0d 4a call 0x2941a ; 0x2941a current_position[Z_AXIS] = PINDA_PREHEAT_Z; 130d6: 8a e9 ldi r24, 0x9A ; 154 130d8: 99 e9 ldi r25, 0x99 ; 153 130da: a9 e1 ldi r26, 0x19 ; 25 130dc: be e3 ldi r27, 0x3E ; 62 130de: 80 93 69 12 sts 0x1269, r24 ; 0x801269 130e2: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 130e6: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 130ea: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 130ee: 60 e0 ldi r22, 0x00 ; 0 130f0: 70 e0 ldi r23, 0x00 ; 0 130f2: 88 e4 ldi r24, 0x48 ; 72 130f4: 92 e4 ldi r25, 0x42 ; 66 130f6: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 130fa: 0f 94 94 18 call 0x23128 ; 0x23128 130fe: 0f 90 pop r0 13100: 0f 90 pop r0 13102: 0f 90 pop r0 13104: 0f 90 pop r0 13106: 0f 90 pop r0 13108: 0f 90 pop r0 while (current_temperature_pinda < start_temp) 1310a: 20 91 85 03 lds r18, 0x0385 ; 0x800385 1310e: 30 91 86 03 lds r19, 0x0386 ; 0x800386 13112: 40 91 87 03 lds r20, 0x0387 ; 0x800387 13116: 50 91 88 03 lds r21, 0x0388 ; 0x800388 1311a: 62 2d mov r22, r2 1311c: 73 2d mov r23, r3 1311e: 8e 2d mov r24, r14 13120: 9f 2d mov r25, r15 13122: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 13126: 18 16 cp r1, r24 13128: 3c f4 brge .+14 ; 0x13138 { delay_keep_alive(1000); 1312a: 88 ee ldi r24, 0xE8 ; 232 1312c: 93 e0 ldi r25, 0x03 ; 3 1312e: 0e 94 07 8d call 0x11a0e ; 0x11a0e serialecho_temperatures(); 13132: 0e 94 23 7b call 0xf646 ; 0xf646 13136: e9 cf rjmp .-46 ; 0x1310a 13138: 60 e0 ldi r22, 0x00 ; 0 1313a: 86 ea ldi r24, 0xA6 ; 166 1313c: 9f e0 ldi r25, 0x0F ; 15 1313e: 0f 94 a5 a4 call 0x3494a ; 0x3494a } 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; 13142: 80 e0 ldi r24, 0x00 ; 0 13144: 90 e0 ldi r25, 0x00 ; 0 13146: a0 ea ldi r26, 0xA0 ; 160 13148: b0 e4 ldi r27, 0x40 ; 64 1314a: 80 93 69 12 sts 0x1269, r24 ; 0x801269 1314e: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 13152: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 13156: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 1315a: 60 e0 ldi r22, 0x00 ; 0 1315c: 70 e0 ldi r23, 0x00 ; 0 1315e: 88 e4 ldi r24, 0x48 ; 72 13160: 92 e4 ldi r25, 0x42 ; 66 13162: 0f 94 0d 4a call 0x2941a ; 0x2941a current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 13166: e1 e0 ldi r30, 0x01 ; 1 13168: fd e9 ldi r31, 0x9D ; 157 1316a: 85 91 lpm r24, Z+ 1316c: 95 91 lpm r25, Z+ 1316e: a5 91 lpm r26, Z+ 13170: b4 91 lpm r27, Z 13172: 80 93 61 12 sts 0x1261, r24 ; 0x801261 13176: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1317a: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1317e: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 13182: e5 e0 ldi r30, 0x05 ; 5 13184: fd e9 ldi r31, 0x9D ; 157 13186: 85 91 lpm r24, Z+ 13188: 95 91 lpm r25, Z+ 1318a: a5 91 lpm r26, Z+ 1318c: b4 91 lpm r27, Z 1318e: 80 93 65 12 sts 0x1265, r24 ; 0x801265 13192: 90 93 66 12 sts 0x1266, r25 ; 0x801266 13196: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1319a: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 1319e: 60 e0 ldi r22, 0x00 ; 0 131a0: 70 e0 ldi r23, 0x00 ; 0 131a2: 88 e4 ldi r24, 0x48 ; 72 131a4: 92 e4 ldi r25, 0x42 ; 66 131a6: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 131aa: 0f 94 94 18 call 0x23128 ; 0x23128 bool find_z_result = find_bed_induction_sensor_point_z(-1.f); 131ae: 43 e0 ldi r20, 0x03 ; 3 131b0: 60 e0 ldi r22, 0x00 ; 0 131b2: 70 e0 ldi r23, 0x00 ; 0 131b4: 80 e8 ldi r24, 0x80 ; 128 131b6: 9f eb ldi r25, 0xBF ; 191 131b8: 0f 94 8e 7c call 0x2f91c ; 0x2f91c if (find_z_result == false) { 131bc: 81 11 cpse r24, r1 131be: 05 c0 rjmp .+10 ; 0x131ca 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); 131c0: 0e 94 77 f9 call 0x1f2ee ; 0x1f2ee homing_flag = false; 131c4: 10 92 71 12 sts 0x1271, r1 ; 0x801271 131c8: ef c8 rjmp .-3618 ; 0x123a8 if (find_z_result == false) { lcd_temp_cal_show_result(find_z_result); homing_flag = false; break; } zero_z = current_position[Z_AXIS]; 131ca: 90 91 69 12 lds r25, 0x1269 ; 0x801269 131ce: 98 a7 std Y+40, r25 ; 0x28 131d0: a0 91 6a 12 lds r26, 0x126A ; 0x80126a 131d4: ac a7 std Y+44, r26 ; 0x2c 131d6: b0 91 6b 12 lds r27, 0x126B ; 0x80126b 131da: b8 ab std Y+48, r27 ; 0x30 131dc: e0 91 6c 12 lds r30, 0x126C ; 0x80126c 131e0: e8 af std Y+56, r30 ; 0x38 printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); 131e2: ef 93 push r30 131e4: bf 93 push r27 131e6: af 93 push r26 131e8: 9f 93 push r25 131ea: 8e e8 ldi r24, 0x8E ; 142 131ec: 97 e6 ldi r25, 0x67 ; 103 131ee: 9f 93 push r25 131f0: 8f 93 push r24 131f2: 0f 94 43 a3 call 0x34686 ; 0x34686 131f6: 0f 90 pop r0 131f8: 0f 90 pop r0 131fa: 0f 90 pop r0 131fc: 0f 90 pop r0 131fe: 0f 90 pop r0 13200: 0f 90 pop r0 13202: 4e ea ldi r20, 0xAE ; 174 13204: 84 2e mov r8, r20 13206: 4f e0 ldi r20, 0x0F ; 15 13208: 94 2e mov r9, r20 1320a: 53 e2 ldi r21, 0x23 ; 35 1320c: c5 2e mov r12, r21 1320e: d1 2c mov r13, r1 int i = -1; for (; i < 5; i++) 13210: 0f ef ldi r16, 0xFF ; 255 13212: 1f ef ldi r17, 0xFF ; 255 { float temp = (40 + i * 5); 13214: b6 01 movw r22, r12 13216: 0d 2c mov r0, r13 13218: 00 0c add r0, r0 1321a: 88 0b sbc r24, r24 1321c: 99 0b sbc r25, r25 1321e: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 13222: 2b 01 movw r4, r22 13224: 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)); 13226: df 92 push r13 13228: cf 92 push r12 1322a: c8 01 movw r24, r16 1322c: 02 96 adiw r24, 0x02 ; 2 1322e: 9f 93 push r25 13230: 8f 93 push r24 13232: 22 e5 ldi r18, 0x52 ; 82 13234: 37 e6 ldi r19, 0x67 ; 103 13236: 3f 93 push r19 13238: 2f 93 push r18 1323a: 0f 94 43 a3 call 0x34686 ; 0x34686 1323e: 58 01 movw r10, r16 13240: 5f ef ldi r21, 0xFF ; 255 13242: a5 1a sub r10, r21 13244: b5 0a sbc r11, r21 if (i >= 0) { 13246: 0f 90 pop r0 13248: 0f 90 pop r0 1324a: 0f 90 pop r0 1324c: 0f 90 pop r0 1324e: 0f 90 pop r0 13250: 0f 90 pop r0 13252: 11 f4 brne .+4 ; 0x13258 13254: 0c 94 04 ba jmp 0x17408 ; 0x17408 if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 13258: 70 e0 ldi r23, 0x00 ; 0 1325a: 60 e0 ldi r22, 0x00 ; 0 1325c: c4 01 movw r24, r8 1325e: 0f 94 c3 a4 call 0x34986 ; 0x34986 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } if (start_temp <= temp) break; 13262: a3 01 movw r20, r6 13264: 92 01 movw r18, r4 13266: 62 2d mov r22, r2 13268: 73 2d mov r23, r3 1326a: 8e 2d mov r24, r14 1326c: 9f 2d mov r25, r15 1326e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 13272: 18 16 cp r1, r24 13274: 44 f4 brge .+16 ; 0x13286 } zero_z = current_position[Z_AXIS]; printf_P(_N("\nZERO: %.3f\n"), current_position[Z_AXIS]); int i = -1; for (; i < 5; i++) 13276: 85 e0 ldi r24, 0x05 ; 5 13278: a8 16 cp r10, r24 1327a: b1 04 cpc r11, r1 1327c: 11 f0 breq .+4 ; 0x13282 1327e: 0c 94 10 ba jmp 0x17420 ; 0x17420 13282: 05 e0 ldi r16, 0x05 ; 5 13284: 10 e0 ldi r17, 0x00 ; 0 13286: 58 01 movw r10, r16 13288: 97 e2 ldi r25, 0x27 ; 39 1328a: a9 1a sub r10, r25 1328c: 98 ef ldi r25, 0xF8 ; 248 1328e: b9 0a sbc r11, r25 13290: aa 0c add r10, r10 13292: bb 1c adc r11, r11 13294: 85 e0 ldi r24, 0x05 ; 5 13296: 80 9f mul r24, r16 13298: 10 01 movw r2, r0 1329a: 81 9f mul r24, r17 1329c: 30 0c add r3, r0 1329e: 11 24 eor r1, r1 132a0: 0d 5f subi r16, 0xFD ; 253 132a2: 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; 132a4: 2a e9 ldi r18, 0x9A ; 154 132a6: 42 2e mov r4, r18 132a8: 29 e9 ldi r18, 0x99 ; 153 132aa: 52 2e mov r5, r18 132ac: 29 e1 ldi r18, 0x19 ; 25 132ae: 62 2e mov r6, r18 132b0: 2e e3 ldi r18, 0x3E ; 62 132b2: 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); 132b4: 39 e1 ldi r19, 0x19 ; 25 132b6: 83 2e mov r8, r19 132b8: 37 e6 ldi r19, 0x67 ; 103 132ba: 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++) 132bc: c8 01 movw r24, r16 132be: 02 97 sbiw r24, 0x02 ; 2 132c0: 05 97 sbiw r24, 0x05 ; 5 132c2: 0c f0 brlt .+2 ; 0x132c6 132c4: d4 c0 rjmp .+424 ; 0x1346e { float temp = (40 + i * 5); 132c6: b1 01 movw r22, r2 132c8: 63 5d subi r22, 0xD3 ; 211 132ca: 7f 4f sbci r23, 0xFF ; 255 132cc: 07 2e mov r0, r23 132ce: 00 0c add r0, r0 132d0: 88 0b sbc r24, r24 132d2: 99 0b sbc r25, r25 132d4: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 132d8: 6b 01 movw r12, r22 132da: 7c 01 movw r14, r24 printf_P(_N("\nStep: %d/6\n"), i + 2); 132dc: 1f 93 push r17 132de: 0f 93 push r16 132e0: a5 e4 ldi r26, 0x45 ; 69 132e2: b7 e6 ldi r27, 0x67 ; 103 132e4: bf 93 push r27 132e6: af 93 push r26 132e8: 0f 94 43 a3 call 0x34686 ; 0x34686 custom_message_state = i + 2; 132ec: 00 93 de 03 sts 0x03DE, r16 ; 0x8003de setTargetBed(50 + 10 * (temp - 30) / 5); 132f0: 20 e0 ldi r18, 0x00 ; 0 132f2: 30 e0 ldi r19, 0x00 ; 0 132f4: 40 ef ldi r20, 0xF0 ; 240 132f6: 51 e4 ldi r21, 0x41 ; 65 132f8: c7 01 movw r24, r14 132fa: b6 01 movw r22, r12 132fc: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 13300: 20 e0 ldi r18, 0x00 ; 0 13302: 30 e0 ldi r19, 0x00 ; 0 13304: 40 e2 ldi r20, 0x20 ; 32 13306: 51 e4 ldi r21, 0x41 ; 65 13308: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1330c: 20 e0 ldi r18, 0x00 ; 0 1330e: 30 e0 ldi r19, 0x00 ; 0 13310: 40 ea ldi r20, 0xA0 ; 160 13312: 50 e4 ldi r21, 0x40 ; 64 13314: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 13318: 20 e0 ldi r18, 0x00 ; 0 1331a: 30 e0 ldi r19, 0x00 ; 0 1331c: 48 e4 ldi r20, 0x48 ; 72 1331e: 52 e4 ldi r21, 0x42 ; 66 13320: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 13324: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 13328: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 1332c: 60 93 59 12 sts 0x1259, r22 ; 0x801259 current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 13330: 80 e0 ldi r24, 0x00 ; 0 13332: 90 e0 ldi r25, 0x00 ; 0 13334: a0 ea ldi r26, 0xA0 ; 160 13336: b0 e4 ldi r27, 0x40 ; 64 13338: 80 93 69 12 sts 0x1269, r24 ; 0x801269 1333c: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 13340: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 13344: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 13348: 60 e0 ldi r22, 0x00 ; 0 1334a: 70 e0 ldi r23, 0x00 ; 0 1334c: 88 e4 ldi r24, 0x48 ; 72 1334e: 92 e4 ldi r25, 0x42 ; 66 13350: 0f 94 0d 4a call 0x2941a ; 0x2941a current_position[X_AXIS] = PINDA_PREHEAT_X; 13354: 20 e0 ldi r18, 0x00 ; 0 13356: 30 e0 ldi r19, 0x00 ; 0 13358: 40 ea ldi r20, 0xA0 ; 160 1335a: 51 e4 ldi r21, 0x41 ; 65 1335c: 20 93 61 12 sts 0x1261, r18 ; 0x801261 13360: 30 93 62 12 sts 0x1262, r19 ; 0x801262 13364: 40 93 63 12 sts 0x1263, r20 ; 0x801263 13368: 50 93 64 12 sts 0x1264, r21 ; 0x801264 current_position[Y_AXIS] = PINDA_PREHEAT_Y; 1336c: 80 e0 ldi r24, 0x00 ; 0 1336e: 90 e0 ldi r25, 0x00 ; 0 13370: a0 e7 ldi r26, 0x70 ; 112 13372: b2 e4 ldi r27, 0x42 ; 66 13374: 80 93 65 12 sts 0x1265, r24 ; 0x801265 13378: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1337c: a0 93 67 12 sts 0x1267, r26 ; 0x801267 13380: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 13384: 60 e0 ldi r22, 0x00 ; 0 13386: 70 e0 ldi r23, 0x00 ; 0 13388: 88 e4 ldi r24, 0x48 ; 72 1338a: 92 e4 ldi r25, 0x42 ; 66 1338c: 0f 94 0d 4a call 0x2941a ; 0x2941a current_position[Z_AXIS] = PINDA_PREHEAT_Z; 13390: 40 92 69 12 sts 0x1269, r4 ; 0x801269 13394: 50 92 6a 12 sts 0x126A, r5 ; 0x80126a 13398: 60 92 6b 12 sts 0x126B, r6 ; 0x80126b 1339c: 70 92 6c 12 sts 0x126C, r7 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 133a0: 60 e0 ldi r22, 0x00 ; 0 133a2: 70 e0 ldi r23, 0x00 ; 0 133a4: 88 e4 ldi r24, 0x48 ; 72 133a6: 92 e4 ldi r25, 0x42 ; 66 133a8: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 133ac: 0f 94 94 18 call 0x23128 ; 0x23128 133b0: 0f 90 pop r0 133b2: 0f 90 pop r0 133b4: 0f 90 pop r0 133b6: 0f 90 pop r0 while (current_temperature_pinda < temp) 133b8: 20 91 85 03 lds r18, 0x0385 ; 0x800385 133bc: 30 91 86 03 lds r19, 0x0386 ; 0x800386 133c0: 40 91 87 03 lds r20, 0x0387 ; 0x800387 133c4: 50 91 88 03 lds r21, 0x0388 ; 0x800388 133c8: c7 01 movw r24, r14 133ca: b6 01 movw r22, r12 133cc: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 133d0: 18 16 cp r1, r24 133d2: 3c f4 brge .+14 ; 0x133e2 { delay_keep_alive(1000); 133d4: 88 ee ldi r24, 0xE8 ; 232 133d6: 93 e0 ldi r25, 0x03 ; 3 133d8: 0e 94 07 8d call 0x11a0e ; 0x11a0e serialecho_temperatures(); 133dc: 0e 94 23 7b call 0xf646 ; 0xf646 133e0: eb cf rjmp .-42 ; 0x133b8 } current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 133e2: 80 e0 ldi r24, 0x00 ; 0 133e4: 90 e0 ldi r25, 0x00 ; 0 133e6: a0 ea ldi r26, 0xA0 ; 160 133e8: b0 e4 ldi r27, 0x40 ; 64 133ea: 80 93 69 12 sts 0x1269, r24 ; 0x801269 133ee: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 133f2: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 133f6: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(3000 / 60); 133fa: 60 e0 ldi r22, 0x00 ; 0 133fc: 70 e0 ldi r23, 0x00 ; 0 133fe: 88 e4 ldi r24, 0x48 ; 72 13400: 92 e4 ldi r25, 0x42 ; 66 13402: 0f 94 0d 4a call 0x2941a ; 0x2941a current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 13406: e1 e0 ldi r30, 0x01 ; 1 13408: fd e9 ldi r31, 0x9D ; 157 1340a: 85 91 lpm r24, Z+ 1340c: 95 91 lpm r25, Z+ 1340e: a5 91 lpm r26, Z+ 13410: b4 91 lpm r27, Z 13412: 80 93 61 12 sts 0x1261, r24 ; 0x801261 13416: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1341a: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1341e: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + 1); 13422: e5 e0 ldi r30, 0x05 ; 5 13424: fd e9 ldi r31, 0x9D ; 157 13426: 85 91 lpm r24, Z+ 13428: 95 91 lpm r25, Z+ 1342a: a5 91 lpm r26, Z+ 1342c: b4 91 lpm r27, Z 1342e: 80 93 65 12 sts 0x1265, r24 ; 0x801265 13432: 90 93 66 12 sts 0x1266, r25 ; 0x801266 13436: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1343a: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(3000 / 60); 1343e: 60 e0 ldi r22, 0x00 ; 0 13440: 70 e0 ldi r23, 0x00 ; 0 13442: 88 e4 ldi r24, 0x48 ; 72 13444: 92 e4 ldi r25, 0x42 ; 66 13446: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1344a: 0f 94 94 18 call 0x23128 ; 0x23128 find_z_result = find_bed_induction_sensor_point_z(-1.f); 1344e: 43 e0 ldi r20, 0x03 ; 3 13450: 60 e0 ldi r22, 0x00 ; 0 13452: 70 e0 ldi r23, 0x00 ; 0 13454: 80 e8 ldi r24, 0x80 ; 128 13456: 9f eb ldi r25, 0xBF ; 191 13458: 0f 94 8e 7c call 0x2f91c ; 0x2f91c 1345c: 95 e0 ldi r25, 0x05 ; 5 1345e: 29 0e add r2, r25 13460: 31 1c adc r3, r1 13462: 0f 5f subi r16, 0xFF ; 255 13464: 1f 4f sbci r17, 0xFF ; 255 if (find_z_result == false) { 13466: 81 11 cpse r24, r1 13468: 04 c0 rjmp .+8 ; 0x13472 lcd_temp_cal_show_result(find_z_result); 1346a: 0e 94 77 f9 call 0x1f2ee ; 0x1f2ee 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); 1346e: 81 e0 ldi r24, 0x01 ; 1 13470: a7 ce rjmp .-690 ; 0x131c0 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]); 13472: 78 a5 ldd r23, Y+40 ; 0x28 13474: 6c a5 ldd r22, Y+44 ; 0x2c 13476: 98 a9 ldd r25, Y+48 ; 0x30 13478: 88 ad ldd r24, Y+56 ; 0x38 1347a: 27 2f mov r18, r23 1347c: 36 2f mov r19, r22 1347e: 49 2f mov r20, r25 13480: 58 2f mov r21, r24 13482: 60 91 69 12 lds r22, 0x1269 ; 0x801269 13486: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 1348a: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 1348e: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 13492: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 13496: f6 2e mov r15, r22 13498: e7 2e mov r14, r23 1349a: d8 2e mov r13, r24 1349c: c9 2e mov r12, r25 1349e: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 134a2: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 134a6: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 134aa: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 134ae: d7 01 movw r26, r14 134b0: f6 01 movw r30, r12 134b2: 6b 2f mov r22, r27 134b4: 7a 2f mov r23, r26 134b6: 8f 2f mov r24, r31 134b8: 9e 2f mov r25, r30 134ba: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 134be: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 134c2: 6c ab std Y+52, r22 ; 0x34 134c4: 7d ab std Y+53, r23 ; 0x35 134c6: 8e ab std Y+54, r24 ; 0x36 134c8: 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); 134ca: cf 92 push r12 134cc: df 92 push r13 134ce: ef 92 push r14 134d0: ff 92 push r15 134d2: 80 91 88 03 lds r24, 0x0388 ; 0x800388 134d6: 8f 93 push r24 134d8: 80 91 87 03 lds r24, 0x0387 ; 0x800387 134dc: 8f 93 push r24 134de: 80 91 86 03 lds r24, 0x0386 ; 0x800386 134e2: 8f 93 push r24 134e4: 80 91 85 03 lds r24, 0x0385 ; 0x800385 134e8: 8f 93 push r24 134ea: 9f 92 push r9 134ec: 8f 92 push r8 134ee: 0f 94 43 a3 call 0x34686 ; 0x34686 134f2: 6c a9 ldd r22, Y+52 ; 0x34 134f4: 7d a9 ldd r23, Y+53 ; 0x35 134f6: c5 01 movw r24, r10 134f8: 0f 94 c3 a4 call 0x34986 ; 0x34986 134fc: a2 e0 ldi r26, 0x02 ; 2 134fe: aa 0e add r10, r26 13500: b1 1c adc r11, r1 13502: 0f b6 in r0, 0x3f ; 63 13504: f8 94 cli 13506: de bf out 0x3e, r29 ; 62 13508: 0f be out 0x3f, r0 ; 63 1350a: cd bf out 0x3d, r28 ; 61 1350c: d7 ce rjmp .-594 ; 0x132bc /*! ### 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(); 1350e: 0e 94 cc 83 call 0x10798 ; 0x10798 13512: 0c 94 d4 91 jmp 0x123a8 ; 0x123a8 This G-code will be performed at the start of a calibration script. (Prusa3D specific) */ case 86: calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 13516: 80 e1 ldi r24, 0x10 ; 16 13518: 0e 94 e1 d4 call 0x1a9c2 ; 0x1a9c2 1351c: 0c 94 d4 91 jmp 0x123a8 ; 0x123a8 /*! ### 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); 13520: 80 91 57 12 lds r24, 0x1257 ; 0x801257 13524: 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; 13526: 80 93 57 12 sts 0x1257, r24 ; 0x801257 1352a: 0c 94 d4 91 jmp 0x123a8 ; 0x123a8 1352e: b4 ec ldi r27, 0xC4 ; 196 13530: cb 2e mov r12, r27 13532: b2 e0 ldi r27, 0x02 ; 2 13534: db 2e mov r13, r27 13536: 8e 01 movw r16, r28 13538: 0c 5d subi r16, 0xDC ; 220 1353a: 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) 1353c: 58 01 movw r10, r16 1353e: ee 24 eor r14, r14 13540: e3 94 inc r14 13542: 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]); 13544: d6 01 movw r26, r12 13546: 8d 91 ld r24, X+ 13548: 6d 01 movw r12, r26 1354a: 0e 94 80 56 call 0xad00 ; 0xad00 1354e: f5 01 movw r30, r10 13550: 81 93 st Z+, r24 13552: 5f 01 movw r10, r30 if(codes[i]) 13554: 88 23 and r24, r24 13556: 91 f0 breq .+36 ; 0x1357c values[i] = code_value(); 13558: 0e 94 10 5b call 0xb620 ; 0xb620 1355c: f7 01 movw r30, r14 1355e: ee 0f add r30, r30 13560: ff 1f adc r31, r31 13562: ee 0f add r30, r30 13564: ff 1f adc r31, r31 13566: 34 97 sbiw r30, 0x04 ; 4 13568: 21 e0 ldi r18, 0x01 ; 1 1356a: 30 e0 ldi r19, 0x00 ; 0 1356c: 2c 0f add r18, r28 1356e: 3d 1f adc r19, r29 13570: e2 0f add r30, r18 13572: f3 1f adc r31, r19 13574: 60 83 st Z, r22 13576: 71 83 std Z+1, r23 ; 0x01 13578: 82 83 std Z+2, r24 ; 0x02 1357a: 93 83 std Z+3, r25 ; 0x03 1357c: 3f ef ldi r19, 0xFF ; 255 1357e: e3 1a sub r14, r19 13580: 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) 13582: 45 e0 ldi r20, 0x05 ; 5 13584: e4 16 cp r14, r20 13586: f1 04 cpc r15, r1 13588: e9 f6 brne .-70 ; 0x13544 codes[i] = code_seen(axis_codes[i]); if(codes[i]) values[i] = code_value(); } if((codes[E_AXIS] && values[E_AXIS] == 0) && 1358a: 9f a0 ldd r9, Y+39 ; 0x27 1358c: fc a0 ldd r15, Y+36 ; 0x24 1358e: 99 20 and r9, r9 13590: 01 f1 breq .+64 ; 0x135d2 13592: 20 e0 ldi r18, 0x00 ; 0 13594: 30 e0 ldi r19, 0x00 ; 0 13596: a9 01 movw r20, r18 13598: 6d 85 ldd r22, Y+13 ; 0x0d 1359a: 7e 85 ldd r23, Y+14 ; 0x0e 1359c: 8f 85 ldd r24, Y+15 ; 0x0f 1359e: 98 89 ldd r25, Y+16 ; 0x10 135a0: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 135a4: 81 11 cpse r24, r1 135a6: 15 c0 rjmp .+42 ; 0x135d2 135a8: f1 10 cpse r15, r1 135aa: 13 c0 rjmp .+38 ; 0x135d2 (!codes[X_AXIS] && !codes[Y_AXIS] && !codes[Z_AXIS])) 135ac: 8d a1 ldd r24, Y+37 ; 0x25 135ae: 81 11 cpse r24, r1 135b0: 10 c0 rjmp .+32 ; 0x135d2 135b2: 8e a1 ldd r24, Y+38 ; 0x26 135b4: 81 11 cpse r24, r1 135b6: 0d c0 rjmp .+26 ; 0x135d2 { // 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; 135b8: 10 92 6d 12 sts 0x126D, r1 ; 0x80126d 135bc: 10 92 6e 12 sts 0x126E, r1 ; 0x80126e 135c0: 10 92 6f 12 sts 0x126F, r1 ; 0x80126f 135c4: 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; 135c8: 81 e0 ldi r24, 0x01 ; 1 135ca: 80 93 21 04 sts 0x0421, r24 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.441> 135ce: 0c 94 d4 91 jmp 0x123a8 ; 0x123a8 plan_reset_next_e(); } else { // In any other case we're forced to synchronize st_synchronize(); 135d2: 0f 94 94 18 call 0x23128 ; 0x23128 135d6: ce 01 movw r24, r28 135d8: 01 96 adiw r24, 0x01 ; 1 135da: 5c 01 movw r10, r24 135dc: 5f eb ldi r21, 0xBF ; 191 135de: c5 2e mov r12, r21 135e0: 5d e0 ldi r21, 0x0D ; 13 135e2: d5 2e mov r13, r21 135e4: 61 e6 ldi r22, 0x61 ; 97 135e6: e6 2e mov r14, r22 135e8: 62 e1 ldi r22, 0x12 ; 18 135ea: f6 2e mov r15, r22 135ec: 38 01 movw r6, r16 135ee: 93 e0 ldi r25, 0x03 ; 3 135f0: 69 0e add r6, r25 135f2: 71 1c adc r7, r1 for(uint8_t i = 0; i < 3; ++i) { if(codes[i]) 135f4: d8 01 movw r26, r16 135f6: 8d 91 ld r24, X+ 135f8: 8d 01 movw r16, r26 135fa: 88 23 and r24, r24 135fc: 89 f0 breq .+34 ; 0x13620 current_position[i] = values[i] + cs.add_homing[i]; 135fe: f6 01 movw r30, r12 13600: 20 81 ld r18, Z 13602: 31 81 ldd r19, Z+1 ; 0x01 13604: 42 81 ldd r20, Z+2 ; 0x02 13606: 53 81 ldd r21, Z+3 ; 0x03 13608: d5 01 movw r26, r10 1360a: 6d 91 ld r22, X+ 1360c: 7d 91 ld r23, X+ 1360e: 8d 91 ld r24, X+ 13610: 9c 91 ld r25, X 13612: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 13616: f7 01 movw r30, r14 13618: 60 83 st Z, r22 1361a: 71 83 std Z+1, r23 ; 0x01 1361c: 82 83 std Z+2, r24 ; 0x02 1361e: 93 83 std Z+3, r25 ; 0x03 13620: f4 e0 ldi r31, 0x04 ; 4 13622: af 0e add r10, r31 13624: b1 1c adc r11, r1 13626: 24 e0 ldi r18, 0x04 ; 4 13628: c2 0e add r12, r18 1362a: d1 1c adc r13, r1 1362c: 34 e0 ldi r19, 0x04 ; 4 1362e: e3 0e add r14, r19 13630: 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) 13632: 60 16 cp r6, r16 13634: 71 06 cpc r7, r17 13636: f1 f6 brne .-68 ; 0x135f4 { if(codes[i]) current_position[i] = values[i] + cs.add_homing[i]; } if(codes[E_AXIS]) 13638: 99 20 and r9, r9 1363a: 61 f0 breq .+24 ; 0x13654 current_position[E_AXIS] = values[E_AXIS]; 1363c: 8d 85 ldd r24, Y+13 ; 0x0d 1363e: 9e 85 ldd r25, Y+14 ; 0x0e 13640: af 85 ldd r26, Y+15 ; 0x0f 13642: b8 89 ldd r27, Y+16 ; 0x10 13644: 80 93 6d 12 sts 0x126D, r24 ; 0x80126d 13648: 90 93 6e 12 sts 0x126E, r25 ; 0x80126e 1364c: a0 93 6f 12 sts 0x126F, r26 ; 0x80126f 13650: b0 93 70 12 sts 0x1270, r27 ; 0x801270 // Set all at once plan_set_position_curposXYZE(); 13654: 0f 94 cd 48 call 0x2919a ; 0x2919a 13658: 0c 94 d4 91 jmp 0x123a8 ; 0x123a8 return true; } void farm_gcode_g98() { farm_mode = 1; 1365c: 81 e0 ldi r24, 0x01 ; 1 1365e: 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); 13662: 61 e0 ldi r22, 0x01 ; 1 13664: 84 ec ldi r24, 0xC4 ; 196 13666: 9f e0 ldi r25, 0x0F ; 15 13668: 0f 94 a5 a4 call 0x3494a ; 0x3494a eeprom_update_byte_notify((unsigned char *)EEPROM_FARM_MODE, farm_mode); SilentModeMenu = SILENT_MODE_OFF; 1366c: 10 92 bb 03 sts 0x03BB, r1 ; 0x8003bb 13670: 60 e0 ldi r22, 0x00 ; 0 13672: 8f ef ldi r24, 0xFF ; 255 13674: 9f e0 ldi r25, 0x0F ; 15 13676: 0f 94 a5 a4 call 0x3494a ; 0x3494a } void farm_gcode_g99() { farm_disable(); lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset 1367a: 0e 94 46 d7 call 0x1ae8c ; 0x1ae8c 1367e: 0c 94 d4 91 jmp 0x123a8 ; 0x123a8 /*! --------------------------------------------------------------------------------- # M Commands */ else if(*CMDBUFFER_CURRENT_STRING == 'M') 13682: 8d 34 cpi r24, 0x4D ; 77 13684: 11 f0 breq .+4 ; 0x1368a 13686: 0c 94 06 b9 jmp 0x1720c ; 0x1720c { strchr_pointer = CMDBUFFER_CURRENT_STRING; 1368a: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 1368e: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb 13692: f8 01 movw r30, r16 13694: 31 96 adiw r30, 0x01 ; 1 int index; for (index = 1; *(strchr_pointer + index) == ' ' || *(strchr_pointer + index) == '\t'; index++); 13696: 81 91 ld r24, Z+ 13698: 80 32 cpi r24, 0x20 ; 32 1369a: e9 f3 breq .-6 ; 0x13696 1369c: 89 30 cpi r24, 0x09 ; 9 1369e: d9 f3 breq .-10 ; 0x13696 /*for (++strchr_pointer; *strchr_pointer == ' ' || *strchr_pointer == '\t'; ++strchr_pointer);*/ if (*(strchr_pointer+index) < '0' || *(strchr_pointer+index) > '9') { 136a0: 80 53 subi r24, 0x30 ; 48 136a2: 8a 30 cpi r24, 0x0A ; 10 136a4: 30 f0 brcs .+12 ; 0x136b2 printf_P(PSTR("Invalid M code: %s\n"), cmdbuffer + bufindr + CMDHDRSIZE); 136a6: 1f 93 push r17 136a8: 0f 93 push r16 136aa: 86 e3 ldi r24, 0x36 ; 54 136ac: 91 e8 ldi r25, 0x81 ; 129 136ae: 0c 94 8c 8e jmp 0x11d18 ; 0x11d18 } else { mcode_in_progress = code_value_short(); 136b2: 0e 94 a2 56 call 0xad44 ; 0xad44 136b6: 90 93 41 0d sts 0x0D41, r25 ; 0x800d41 <_ZL17mcode_in_progress.lto_priv.486+0x1> 136ba: 80 93 40 0d sts 0x0D40, r24 ; 0x800d40 <_ZL17mcode_in_progress.lto_priv.486> // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 136be: 8e 3b cpi r24, 0xBE ; 190 136c0: 91 05 cpc r25, r1 136c2: 11 f4 brne .+4 ; 0x136c8 136c4: 0c 94 19 a6 jmp 0x14c32 ; 0x14c32 136c8: 0c f0 brlt .+2 ; 0x136cc 136ca: 07 c3 rjmp .+1550 ; 0x13cda 136cc: 8c 34 cpi r24, 0x4C ; 76 136ce: 91 05 cpc r25, r1 136d0: 11 f4 brne .+4 ; 0x136d6 136d2: 0c 94 32 a5 jmp 0x14a64 ; 0x14a64 136d6: 0c f0 brlt .+2 ; 0x136da 136d8: de c1 rjmp .+956 ; 0x13a96 136da: 8c 31 cpi r24, 0x1C ; 28 136dc: 91 05 cpc r25, r1 136de: 11 f4 brne .+4 ; 0x136e4 136e0: 0c 94 69 a3 jmp 0x146d2 ; 0x146d2 136e4: 0c f0 brlt .+2 ; 0x136e8 136e6: f4 c0 rjmp .+488 ; 0x138d0 136e8: 85 31 cpi r24, 0x15 ; 21 136ea: 91 05 cpc r25, r1 136ec: 09 f4 brne .+2 ; 0x136f0 136ee: 0a c7 rjmp .+3604 ; 0x14504 136f0: 0c f0 brlt .+2 ; 0x136f4 136f2: 5a c0 rjmp .+180 ; 0x137a8 136f4: 81 31 cpi r24, 0x11 ; 17 136f6: 91 05 cpc r25, r1 136f8: 09 f4 brne .+2 ; 0x136fc 136fa: f9 c6 rjmp .+3570 ; 0x144ee 136fc: dc f4 brge .+54 ; 0x13734 136fe: 02 97 sbiw r24, 0x02 ; 2 13700: 08 f4 brcc .+2 ; 0x13704 13702: 5d c6 rjmp .+3258 ; 0x143be /*! #### End of M-Commands */ default: printf_P(MSG_UNKNOWN_CODE, 'M', cmdbuffer + bufindr + CMDHDRSIZE); 13704: 80 91 38 12 lds r24, 0x1238 ; 0x801238 13708: 90 91 39 12 lds r25, 0x1239 ; 0x801239 1370c: 82 5b subi r24, 0xB2 ; 178 1370e: 9f 4e sbci r25, 0xEF ; 239 13710: 9f 93 push r25 13712: 8f 93 push r24 13714: 1f 92 push r1 13716: 8d e4 ldi r24, 0x4D ; 77 13718: 8f 93 push r24 1371a: 84 e0 ldi r24, 0x04 ; 4 1371c: 97 e6 ldi r25, 0x67 ; 103 1371e: 9f 93 push r25 13720: 8f 93 push r24 13722: 0f 94 43 a3 call 0x34686 ; 0x34686 13726: 0f 90 pop r0 13728: 0f 90 pop r0 1372a: 0f 90 pop r0 1372c: 0f 90 pop r0 1372e: 0f 90 pop r0 13730: 0f 90 pop r0 13732: a8 c6 rjmp .+3408 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13734: 82 31 cpi r24, 0x12 ; 18 13736: 91 05 cpc r25, r1 13738: 11 f4 brne .+4 ; 0x1373e 1373a: 0c 94 c4 a6 jmp 0x14d88 ; 0x14d88 1373e: 44 97 sbiw r24, 0x14 ; 20 13740: 09 f7 brne .-62 ; 0x13704 #### 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() 13742: 81 e0 ldi r24, 0x01 ; 1 13744: 80 93 78 02 sts 0x0278, r24 ; 0x800278 SERIAL_PROTOCOLLNRPGM(_N("Begin file list"));////MSG_BEGIN_FILE_LIST 13748: 84 ef ldi r24, 0xF4 ; 244 1374a: 96 e6 ldi r25, 0x66 ; 102 1374c: 0e 94 0e 7d call 0xfa1c ; 0xfa1c card.ls(CardReader::ls_param(code_seen('L'), code_seen('T'))); 13750: 84 e5 ldi r24, 0x54 ; 84 13752: 0e 94 80 56 call 0xad00 ; 0xad00 13756: 18 2f mov r17, r24 13758: 8c e4 ldi r24, 0x4C ; 76 1375a: 0e 94 80 56 call 0xad00 ; 0xad00 1375e: 00 e0 ldi r16, 0x00 ; 0 13760: 80 fb bst r24, 0 13762: 00 f9 bld r16, 0 13764: 10 fb bst r17, 0 13766: 01 f9 bld r16, 1 } // while readDir } void CardReader::ls(ls_param params) { root.rewind(); 13768: 8d e5 ldi r24, 0x5D ; 93 1376a: 94 e1 ldi r25, 0x14 ; 20 1376c: 0e 94 f7 79 call 0xf3ee ; 0xf3ee lsDive("",root, NULL, LS_SerialPrint, params); 13770: 83 e2 ldi r24, 0x23 ; 35 13772: ed e5 ldi r30, 0x5D ; 93 13774: f4 e1 ldi r31, 0x14 ; 20 13776: de 01 movw r26, r28 13778: 11 96 adiw r26, 0x01 ; 1 1377a: 01 90 ld r0, Z+ 1377c: 0d 92 st X+, r0 1377e: 8a 95 dec r24 13780: e1 f7 brne .-8 ; 0x1377a 13782: 20 e0 ldi r18, 0x00 ; 0 13784: 50 e0 ldi r21, 0x00 ; 0 13786: 40 e0 ldi r20, 0x00 ; 0 13788: be 01 movw r22, r28 1378a: 6f 5f subi r22, 0xFF ; 255 1378c: 7f 4f sbci r23, 0xFF ; 255 1378e: 8f ed ldi r24, 0xDF ; 223 13790: 92 e0 ldi r25, 0x02 ; 2 13792: 0f 94 28 69 call 0x2d250 ; 0x2d250 13796: ce 01 movw r24, r28 13798: 01 96 adiw r24, 0x01 ; 1 1379a: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 SERIAL_PROTOCOLLNRPGM(_N("End file list"));////MSG_END_FILE_LIST 1379e: 86 ee ldi r24, 0xE6 ; 230 137a0: 96 e6 ldi r25, 0x66 ; 102 137a2: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 137a6: 6e c6 rjmp .+3292 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 137a8: 88 31 cpi r24, 0x18 ; 24 137aa: 91 05 cpc r25, r1 137ac: 09 f4 brne .+2 ; 0x137b0 137ae: bb c6 rjmp .+3446 ; 0x14526 137b0: 84 f4 brge .+32 ; 0x137d2 137b2: 86 31 cpi r24, 0x16 ; 22 137b4: 91 05 cpc r25, r1 137b6: 09 f4 brne .+2 ; 0x137ba 137b8: a9 c6 rjmp .+3410 ; 0x1450c 137ba: 47 97 sbiw r24, 0x17 ; 23 137bc: 09 f0 breq .+2 ; 0x137c0 137be: a2 cf rjmp .-188 ; 0x13704 M23 [filename] */ case 23: card.openFileReadFilteredGcode(strchr_pointer + 4, true); 137c0: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 137c4: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 137c8: 61 e0 ldi r22, 0x01 ; 1 137ca: 04 96 adiw r24, 0x04 ; 4 137cc: 0f 94 91 71 call 0x2e322 ; 0x2e322 137d0: 59 c6 rjmp .+3250 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 137d2: 8a 31 cpi r24, 0x1A ; 26 137d4: 91 05 cpc r25, r1 137d6: 09 f4 brne .+2 ; 0x137da 137d8: ec c6 rjmp .+3544 ; 0x145b2 137da: 0c f0 brlt .+2 ; 0x137de 137dc: 0c c7 rjmp .+3608 ; 0x145f6 137de: 04 ec ldi r16, 0xC4 ; 196 137e0: 12 e0 ldi r17, 0x02 ; 2 137e2: f2 e4 ldi r31, 0x42 ; 66 137e4: af 2e mov r10, r31 137e6: f2 e0 ldi r31, 0x02 ; 2 137e8: bf 2e mov r11, r31 137ea: a4 e2 ldi r26, 0x24 ; 36 137ec: ca 2e mov r12, r26 137ee: a2 e0 ldi r26, 0x02 ; 2 137f0: da 2e mov r13, r26 137f2: b8 e1 ldi r27, 0x18 ; 24 137f4: eb 2e mov r14, r27 137f6: b2 e0 ldi r27, 0x02 ; 2 137f8: fb 2e mov r15, r27 137fa: 87 ec ldi r24, 0xC7 ; 199 137fc: 88 2e mov r8, r24 137fe: 82 e0 ldi r24, 0x02 ; 2 13800: 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])) { 13802: f8 01 movw r30, r16 13804: 81 91 ld r24, Z+ 13806: 8f 01 movw r16, r30 13808: 0e 94 80 56 call 0xad00 ; 0xad00 1380c: 88 23 and r24, r24 1380e: 21 f1 breq .+72 ; 0x13858 //Check that the positions are within hardware limits pause_position[axis] = constrain(code_value(), min_pos[axis], max_pos[axis]); 13810: 0e 94 10 5b call 0xb620 ; 0xb620 13814: d6 01 movw r26, r12 13816: 4d 90 ld r4, X+ 13818: 5d 90 ld r5, X+ 1381a: 6d 90 ld r6, X+ 1381c: 7c 90 ld r7, X 1381e: a3 01 movw r20, r6 13820: 92 01 movw r18, r4 13822: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 13826: 87 fd sbrc r24, 7 13828: 11 c0 rjmp .+34 ; 0x1384c 1382a: 0e 94 10 5b call 0xb620 ; 0xb620 1382e: f7 01 movw r30, r14 13830: 40 80 ld r4, Z 13832: 51 80 ldd r5, Z+1 ; 0x01 13834: 62 80 ldd r6, Z+2 ; 0x02 13836: 73 80 ldd r7, Z+3 ; 0x03 13838: a3 01 movw r20, r6 1383a: 92 01 movw r18, r4 1383c: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 13840: 18 16 cp r1, r24 13842: 24 f0 brlt .+8 ; 0x1384c 13844: 0e 94 10 5b call 0xb620 ; 0xb620 13848: 2b 01 movw r4, r22 1384a: 3c 01 movw r6, r24 1384c: d5 01 movw r26, r10 1384e: 4d 92 st X+, r4 13850: 5d 92 st X+, r5 13852: 6d 92 st X+, r6 13854: 7c 92 st X, r7 13856: 13 97 sbiw r26, 0x03 ; 3 13858: b4 e0 ldi r27, 0x04 ; 4 1385a: ab 0e add r10, r27 1385c: b1 1c adc r11, r1 1385e: e4 e0 ldi r30, 0x04 ; 4 13860: ce 0e add r12, r30 13862: d1 1c adc r13, r1 13864: f4 e0 ldi r31, 0x04 ; 4 13866: ef 0e add r14, r31 13868: 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++) { 1386a: 80 16 cp r8, r16 1386c: 91 06 cpc r9, r17 1386e: 49 f6 brne .-110 ; 0x13802 //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')) { 13870: 83 e5 ldi r24, 0x53 ; 83 13872: 0e 94 80 56 call 0xad00 ; 0xad00 13876: 88 23 and r24, r24 13878: 11 f4 brne .+4 ; 0x1387e 1387a: 0c 94 e1 b2 jmp 0x165c2 ; 0x165c2 if ( code_value_uint8() == 0 ) { 1387e: 0e 94 95 56 call 0xad2a ; 0xad2a 13882: 81 11 cpse r24, r1 13884: ff c5 rjmp .+3070 ; 0x14484 pause_position[X_AXIS] = X_PAUSE_POS; 13886: 80 e0 ldi r24, 0x00 ; 0 13888: 90 e0 ldi r25, 0x00 ; 0 1388a: a8 e4 ldi r26, 0x48 ; 72 1388c: b2 e4 ldi r27, 0x42 ; 66 1388e: 80 93 42 02 sts 0x0242, r24 ; 0x800242 <_ZL14pause_position.lto_priv.488> 13892: 90 93 43 02 sts 0x0243, r25 ; 0x800243 <_ZL14pause_position.lto_priv.488+0x1> 13896: a0 93 44 02 sts 0x0244, r26 ; 0x800244 <_ZL14pause_position.lto_priv.488+0x2> 1389a: b0 93 45 02 sts 0x0245, r27 ; 0x800245 <_ZL14pause_position.lto_priv.488+0x3> pause_position[Y_AXIS] = Y_PAUSE_POS; 1389e: 80 e0 ldi r24, 0x00 ; 0 138a0: 90 e0 ldi r25, 0x00 ; 0 138a2: ae e3 ldi r26, 0x3E ; 62 138a4: b3 e4 ldi r27, 0x43 ; 67 138a6: 80 93 46 02 sts 0x0246, r24 ; 0x800246 <_ZL14pause_position.lto_priv.488+0x4> 138aa: 90 93 47 02 sts 0x0247, r25 ; 0x800247 <_ZL14pause_position.lto_priv.488+0x5> 138ae: a0 93 48 02 sts 0x0248, r26 ; 0x800248 <_ZL14pause_position.lto_priv.488+0x6> 138b2: b0 93 49 02 sts 0x0249, r27 ; 0x800249 <_ZL14pause_position.lto_priv.488+0x7> pause_position[Z_AXIS] = Z_PAUSE_LIFT; 138b6: 80 e0 ldi r24, 0x00 ; 0 138b8: 90 e0 ldi r25, 0x00 ; 0 138ba: a0 ea ldi r26, 0xA0 ; 160 138bc: b1 e4 ldi r27, 0x41 ; 65 138be: 80 93 4a 02 sts 0x024A, r24 ; 0x80024a <_ZL14pause_position.lto_priv.488+0x8> 138c2: 90 93 4b 02 sts 0x024B, r25 ; 0x80024b <_ZL14pause_position.lto_priv.488+0x9> 138c6: a0 93 4c 02 sts 0x024C, r26 ; 0x80024c <_ZL14pause_position.lto_priv.488+0xa> 138ca: b0 93 4d 02 sts 0x024D, r27 ; 0x80024d <_ZL14pause_position.lto_priv.488+0xb> 138ce: da c5 rjmp .+2996 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 138d0: 8c 32 cpi r24, 0x2C ; 44 138d2: 91 05 cpc r25, r1 138d4: 09 f4 brne .+2 ; 0x138d8 138d6: ce c7 rjmp .+3996 ; 0x14874 138d8: 0c f0 brlt .+2 ; 0x138dc 138da: 8f c0 rjmp .+286 ; 0x139fa 138dc: 8f 31 cpi r24, 0x1F ; 31 138de: 91 05 cpc r25, r1 138e0: 09 f4 brne .+2 ; 0x138e4 138e2: 9e c7 rjmp .+3900 ; 0x14820 138e4: 0c f0 brlt .+2 ; 0x138e8 138e6: 52 c0 rjmp .+164 ; 0x1398c 138e8: 8d 31 cpi r24, 0x1D ; 29 138ea: 91 05 cpc r25, r1 138ec: 09 f4 brne .+2 ; 0x138f0 138ee: ca c5 rjmp .+2964 ; 0x14484 138f0: 4e 97 sbiw r24, 0x1e ; 30 138f2: 09 f0 breq .+2 ; 0x138f6 138f4: 07 cf rjmp .-498 ; 0x13704 M30 [filename] */ case 30: if (card.mounted){ 138f6: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 138fa: 88 23 and r24, r24 138fc: 09 f4 brne .+2 ; 0x13900 138fe: c2 c5 rjmp .+2948 ; 0x14484 card.closefile(); 13900: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e card.removeFile(strchr_pointer + 4); 13904: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 13908: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 1390c: 0c 5f subi r16, 0xFC ; 252 1390e: 1f 4f sbci r17, 0xFF ; 255 } } void CardReader::removeFile(const char* name) { if(!mounted) return; 13910: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 13914: 88 23 and r24, r24 13916: 09 f4 brne .+2 ; 0x1391a 13918: b5 c5 rjmp .+2922 ; 0x14484 file.close(); 1391a: 87 e6 ldi r24, 0x67 ; 103 1391c: 96 e1 ldi r25, 0x16 ; 22 1391e: 0f 94 75 2c call 0x258ea ; 0x258ea sdprinting = false; 13922: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 const char *fname=name; 13926: 1d a3 std Y+37, r17 ; 0x25 13928: 0c a3 std Y+36, r16 ; 0x24 if (!diveSubfolder(fname)) 1392a: ce 01 movw r24, r28 1392c: 84 96 adiw r24, 0x24 ; 36 1392e: 0f 94 0c 71 call 0x2e218 ; 0x2e218 13932: 88 23 and r24, r24 13934: 09 f4 brne .+2 ; 0x13938 13936: a6 c5 rjmp .+2892 ; 0x14484 return; if (file.remove(curDir, fname)) 13938: 4c a1 ldd r20, Y+36 ; 0x24 1393a: 5d a1 ldd r21, Y+37 ; 0x25 1393c: 60 91 80 14 lds r22, 0x1480 ; 0x801480 13940: 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) {} 13944: 19 82 std Y+1, r1 ; 0x01 13946: 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; 13948: 22 e0 ldi r18, 0x02 ; 2 1394a: ce 01 movw r24, r28 1394c: 01 96 adiw r24, 0x01 ; 1 1394e: 0f 94 63 54 call 0x2a8c6 ; 0x2a8c6 13952: 81 11 cpse r24, r1 13954: c6 c6 rjmp .+3468 ; 0x146e2 return file.remove(); fail: // can't set iostate - static function return false; 13956: 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; 13958: ce 01 movw r24, r28 1395a: 01 96 adiw r24, 0x01 ; 1 1395c: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 13960: 11 23 and r17, r17 13962: 09 f4 brne .+2 ; 0x13966 13964: d5 c6 rjmp .+3498 ; 0x14710 { SERIAL_PROTOCOLPGM("File deleted:"); 13966: 8b ea ldi r24, 0xAB ; 171 13968: 9e e7 ldi r25, 0x7E ; 126 1396a: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOLLN(fname); 1396e: 8c a1 ldd r24, Y+36 ; 0x24 13970: 9d a1 ldd r25, Y+37 ; 0x25 13972: 0e 94 1a 86 call 0x10c34 ; 0x10c34 sdpos = 0; 13976: 10 92 eb 16 sts 0x16EB, r1 ; 0x8016eb 1397a: 10 92 ec 16 sts 0x16EC, r1 ; 0x8016ec 1397e: 10 92 ed 16 sts 0x16ED, r1 ; 0x8016ed 13982: 10 92 ee 16 sts 0x16EE, r1 ; 0x8016ee #ifdef SDCARD_SORT_ALPHA presort(); 13986: 0f 94 d0 6e call 0x2dda0 ; 0x2dda0 1398a: 7c c5 rjmp .+2808 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1398c: 80 32 cpi r24, 0x20 ; 32 1398e: 91 05 cpc r25, r1 13990: 09 f4 brne .+2 ; 0x13994 13992: cc c6 rjmp .+3480 ; 0x1472c 13994: 8a 97 sbiw r24, 0x2a ; 42 13996: 09 f0 breq .+2 ; 0x1399a 13998: b5 ce rjmp .-662 ; 0x13704 #### 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')) 1399a: 83 e5 ldi r24, 0x53 ; 83 1399c: 0e 94 80 56 call 0xad00 ; 0xad00 139a0: 88 23 and r24, r24 139a2: 09 f4 brne .+2 ; 0x139a6 139a4: 6f c5 rjmp .+2782 ; 0x14484 { uint8_t pin_status = code_value_uint8(); 139a6: 0e 94 95 56 call 0xad2a ; 0xad2a 139aa: 08 2f mov r16, r24 int8_t pin_number = LED_PIN; if (code_seen('P')) 139ac: 80 e5 ldi r24, 0x50 ; 80 139ae: 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; 139b2: 1d e0 ldi r17, 0x0D ; 13 if (code_seen('P')) 139b4: 88 23 and r24, r24 139b6: 19 f0 breq .+6 ; 0x139be pin_number = code_value_uint8(); 139b8: 0e 94 95 56 call 0xad2a ; 0xad2a 139bc: 18 2f mov r17, r24 139be: eb e0 ldi r30, 0x0B ; 11 139c0: 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) 139c2: 84 91 lpm r24, Z 139c4: 81 17 cp r24, r17 139c6: 09 f4 brne .+2 ; 0x139ca 139c8: 5d c5 rjmp .+2746 ; 0x14484 139ca: 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++) 139cc: 31 e8 ldi r19, 0x81 ; 129 139ce: e7 32 cpi r30, 0x27 ; 39 139d0: f3 07 cpc r31, r19 139d2: b9 f7 brne .-18 ; 0x139c2 pin_number = -1; break; } } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) 139d4: 16 30 cpi r17, 0x06 ; 6 139d6: 09 f0 breq .+2 ; 0x139da 139d8: 4a c7 rjmp .+3732 ; 0x1486e fanSpeed = pin_status; 139da: 00 93 55 12 sts 0x1255, r16 ; 0x801255 #endif if (pin_number > -1) { pinMode(pin_number, OUTPUT); 139de: 61 e0 ldi r22, 0x01 ; 1 139e0: 81 2f mov r24, r17 139e2: 0e 94 25 d1 call 0x1a24a ; 0x1a24a digitalWrite(pin_number, pin_status); 139e6: 60 2f mov r22, r16 139e8: 81 2f mov r24, r17 139ea: 0e 94 f7 d0 call 0x1a1ee ; 0x1a1ee analogWrite(pin_number, pin_status); 139ee: 60 2f mov r22, r16 139f0: 70 e0 ldi r23, 0x00 ; 0 139f2: 81 2f mov r24, r17 139f4: 0e 94 56 d1 call 0x1a2ac ; 0x1a2ac 139f8: 45 c5 rjmp .+2698 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 139fa: 8f 32 cpi r24, 0x2F ; 47 139fc: 91 05 cpc r25, r1 139fe: 09 f4 brne .+2 ; 0x13a02 13a00: 62 c7 rjmp .+3780 ; 0x148c6 13a02: 5c f5 brge .+86 ; 0x13a5a 13a04: 8d 32 cpi r24, 0x2D ; 45 13a06: 91 05 cpc r25, r1 13a08: 09 f4 brne .+2 ; 0x13a0c 13a0a: 4d c7 rjmp .+3738 ; 0x148a6 13a0c: 8e 97 sbiw r24, 0x2e ; 46 13a0e: 09 f0 breq .+2 ; 0x13a12 13a10: 79 ce rjmp .-782 ; 0x13704 ### 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()) { 13a12: 80 91 48 16 lds r24, 0x1648 ; 0x801648 13a16: 88 23 and r24, r24 13a18: 09 f4 brne .+2 ; 0x13a1c 13a1a: 50 c7 rjmp .+3744 ; 0x148bc uint8_t ip[4]; if (card.ToshibaFlashAir_GetIP(ip)) { 13a1c: ce 01 movw r24, r28 13a1e: 01 96 adiw r24, 0x01 ; 1 13a20: 0f 94 15 78 call 0x2f02a ; 0x2f02a 13a24: 88 23 and r24, r24 13a26: 09 f4 brne .+2 ; 0x13a2a 13a28: 44 c7 rjmp .+3720 ; 0x148b2 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13a2a: 89 81 ldd r24, Y+1 ; 0x01 13a2c: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 13a30: 8e e2 ldi r24, 0x2E ; 46 13a32: 0e 94 02 7a call 0xf404 ; 0xf404 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13a36: 8a 81 ldd r24, Y+2 ; 0x02 13a38: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 13a3c: 8e e2 ldi r24, 0x2E ; 46 13a3e: 0e 94 02 7a call 0xf404 ; 0xf404 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13a42: 8b 81 ldd r24, Y+3 ; 0x03 13a44: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 13a48: 8e e2 ldi r24, 0x2E ; 46 13a4a: 0e 94 02 7a call 0xf404 ; 0xf404 } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 13a4e: 8c 81 ldd r24, Y+4 ; 0x04 13a50: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 13a54: 0e 94 0d 7b call 0xf61a ; 0xf61a 13a58: 15 c5 rjmp .+2602 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13a5a: 89 34 cpi r24, 0x49 ; 73 13a5c: 91 05 cpc r25, r1 13a5e: 09 f4 brne .+2 ; 0x13a62 13a60: 5b c7 rjmp .+3766 ; 0x14918 13a62: 8b 34 cpi r24, 0x4B ; 75 13a64: 91 05 cpc r25, r1 13a66: 11 f4 brne .+4 ; 0x13a6c 13a68: 0c 94 2c a5 jmp 0x14a58 ; 0x14a58 13a6c: 88 34 cpi r24, 0x48 ; 72 13a6e: 91 05 cpc r25, r1 13a70: 09 f0 breq .+2 ; 0x13a74 13a72: 48 ce rjmp .-880 ; 0x13704 #### Parameters - `Snnn` - Set printer state 0 = not_ready, 1 = ready */ case 72: { if(code_seen('S')){ 13a74: 83 e5 ldi r24, 0x53 ; 83 13a76: 0e 94 80 56 call 0xad00 ; 0xad00 13a7a: 88 23 and r24, r24 13a7c: 09 f4 brne .+2 ; 0x13a80 13a7e: 3d c7 rjmp .+3706 ; 0x148fa switch (code_value_uint8()){ 13a80: 0e 94 95 56 call 0xad2a ; 0xad2a 13a84: 88 23 and r24, r24 13a86: 09 f4 brne .+2 ; 0x13a8a 13a88: 35 c7 rjmp .+3690 ; 0x148f4 13a8a: 81 30 cpi r24, 0x01 ; 1 13a8c: 09 f0 breq .+2 ; 0x13a90 13a8e: fa c4 rjmp .+2548 ; 0x14484 13a90: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.384> 13a94: f7 c4 rjmp .+2542 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13a96: 8b 36 cpi r24, 0x6B ; 107 13a98: 91 05 cpc r25, r1 13a9a: 11 f4 brne .+4 ; 0x13aa0 13a9c: 0c 94 bb a6 jmp 0x14d76 ; 0x14d76 13aa0: 0c f0 brlt .+2 ; 0x13aa4 13aa2: 83 c0 rjmp .+262 ; 0x13baa 13aa4: 84 35 cpi r24, 0x54 ; 84 13aa6: 91 05 cpc r25, r1 13aa8: 11 f4 brne .+4 ; 0x13aae 13aaa: 0c 94 c4 a6 jmp 0x14d88 ; 0x14d88 13aae: bc f5 brge .+110 ; 0x13b1e 13ab0: 8f 34 cpi r24, 0x4F ; 79 13ab2: 91 05 cpc r25, r1 13ab4: 09 f4 brne .+2 ; 0x13ab8 13ab6: ee c7 rjmp .+4060 ; 0x14a94 13ab8: 1c f5 brge .+70 ; 0x13b00 13aba: 8d 34 cpi r24, 0x4D ; 77 13abc: 91 05 cpc r25, r1 13abe: 09 f4 brne .+2 ; 0x13ac2 13ac0: e4 c7 rjmp .+4040 ; 0x14a8a 13ac2: 8e 34 cpi r24, 0x4E ; 78 13ac4: 91 05 cpc r25, r1 13ac6: 09 f0 breq .+2 ; 0x13aca 13ac8: 1d ce rjmp .-966 ; 0x13704 ### 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 "); 13aca: 80 ee ldi r24, 0xE0 ; 224 13acc: 90 e8 ldi r25, 0x80 ; 128 13ace: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME)); 13ad2: 8d ee ldi r24, 0xED ; 237 13ad4: 9f e0 ldi r25, 0x0F ; 15 13ad6: 0f 94 89 a4 call 0x34912 ; 0x34912 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 13ada: 4a e0 ldi r20, 0x0A ; 10 13adc: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_ECHOPGM(" min "); 13ae0: 8a ed ldi r24, 0xDA ; 218 13ae2: 90 e8 ldi r25, 0x80 ; 128 13ae4: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHO(eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED)); 13ae8: 81 ef ldi r24, 0xF1 ; 241 13aea: 9f e0 ldi r25, 0x0F ; 15 13aec: 0f 94 89 a4 call 0x34912 ; 0x34912 13af0: 4a e0 ldi r20, 0x0A ; 10 13af2: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_ECHOLNPGM(" cm."); 13af6: 85 ed ldi r24, 0xD5 ; 213 13af8: 90 e8 ldi r25, 0x80 ; 128 13afa: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 13afe: c2 c4 rjmp .+2436 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13b00: 82 35 cpi r24, 0x52 ; 82 13b02: 91 05 cpc r25, r1 13b04: 11 f4 brne .+4 ; 0x13b0a 13b06: 0c 94 be a6 jmp 0x14d7c ; 0x14d7c 13b0a: 83 35 cpi r24, 0x53 ; 83 13b0c: 91 05 cpc r25, r1 13b0e: 09 f0 breq .+2 ; 0x13b12 13b10: f9 cd rjmp .-1038 ; 0x13704 /*! ### 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; 13b12: 80 91 57 12 lds r24, 0x1257 ; 0x801257 13b16: 88 60 ori r24, 0x08 ; 8 13b18: 80 93 57 12 sts 0x1257, r24 ; 0x801257 13b1c: b3 c4 rjmp .+2406 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13b1e: 8c 35 cpi r24, 0x5C ; 92 13b20: 91 05 cpc r25, r1 13b22: 11 f4 brne .+4 ; 0x13b28 13b24: 0c 94 2d a7 jmp 0x14e5a ; 0x14e5a 13b28: 34 f5 brge .+76 ; 0x13b76 13b2a: 85 35 cpi r24, 0x55 ; 85 13b2c: 91 05 cpc r25, r1 13b2e: 11 f4 brne .+4 ; 0x13b34 13b30: 0c 94 14 a7 jmp 0x14e28 ; 0x14e28 13b34: 86 35 cpi r24, 0x56 ; 86 13b36: 91 05 cpc r25, r1 13b38: 09 f0 breq .+2 ; 0x13b3c 13b3a: e4 cd rjmp .-1080 ; 0x13704 #### Parameters - `S` - specifies the time in seconds. If a value of 0 is specified, the timer is disabled. */ case 86: if (code_seen('S')) { 13b3c: 83 e5 ldi r24, 0x53 ; 83 13b3e: 0e 94 80 56 call 0xad00 ; 0xad00 13b42: 88 23 and r24, r24 13b44: 09 f4 brne .+2 ; 0x13b48 13b46: 9e c4 rjmp .+2364 ; 0x14484 safetytimer_inactive_time = code_value() * 1000; 13b48: 0e 94 10 5b call 0xb620 ; 0xb620 13b4c: 20 e0 ldi r18, 0x00 ; 0 13b4e: 30 e0 ldi r19, 0x00 ; 0 13b50: 4a e7 ldi r20, 0x7A ; 122 13b52: 54 e4 ldi r21, 0x44 ; 68 13b54: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 13b58: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 13b5c: 60 93 33 02 sts 0x0233, r22 ; 0x800233 13b60: 70 93 34 02 sts 0x0234, r23 ; 0x800234 13b64: 80 93 35 02 sts 0x0235, r24 ; 0x800235 13b68: 90 93 36 02 sts 0x0236, r25 ; 0x800236 safetyTimer.start(); 13b6c: 8d ea ldi r24, 0xAD ; 173 13b6e: 95 e0 ldi r25, 0x05 ; 5 13b70: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> 13b74: 87 c4 rjmp .+2318 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13b76: 89 36 cpi r24, 0x69 ; 105 13b78: 91 05 cpc r25, r1 13b7a: 09 f4 brne .+2 ; 0x13b7e 13b7c: de c7 rjmp .+4028 ; 0x14b3a 13b7e: 14 f0 brlt .+4 ; 0x13b84 13b80: 0c 94 ad a6 jmp 0x14d5a ; 0x14d5a 13b84: 88 36 cpi r24, 0x68 ; 104 13b86: 91 05 cpc r25, r1 13b88: 09 f0 breq .+2 ; 0x13b8c 13b8a: bc cd rjmp .-1160 ; 0x13704 #### Parameters - `S` - Target temperature */ case 104: // M104 { if (code_seen('S')) 13b8c: 83 e5 ldi r24, 0x53 ; 83 13b8e: 0e 94 80 56 call 0xad00 ; 0xad00 13b92: 88 23 and r24, r24 13b94: 09 f4 brne .+2 ; 0x13b98 13b96: 76 c4 rjmp .+2284 ; 0x14484 { setTargetHotend(code_value()); 13b98: 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; 13b9c: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 13ba0: 70 93 5e 12 sts 0x125E, r23 ; 0x80125e 13ba4: 60 93 5d 12 sts 0x125D, r22 ; 0x80125d 13ba8: 6d c4 rjmp .+2266 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13baa: 85 37 cpi r24, 0x75 ; 117 13bac: 91 05 cpc r25, r1 13bae: 11 f4 brne .+4 ; 0x13bb4 13bb0: 0c 94 ad a8 jmp 0x1515a ; 0x1515a 13bb4: b4 f5 brge .+108 ; 0x13c22 13bb6: 80 37 cpi r24, 0x70 ; 112 13bb8: 91 05 cpc r25, r1 13bba: 09 f4 brne .+2 ; 0x13bbe 13bbc: ab c7 rjmp .+3926 ; 0x14b14 13bbe: cc f4 brge .+50 ; 0x13bf2 13bc0: 8d 36 cpi r24, 0x6D ; 109 13bc2: 91 05 cpc r25, r1 13bc4: 09 f4 brne .+2 ; 0x13bc8 13bc6: e5 c7 rjmp .+4042 ; 0x14b92 13bc8: 8e 36 cpi r24, 0x6E ; 110 13bca: 91 05 cpc r25, r1 13bcc: 09 f0 breq .+2 ; 0x13bd0 13bce: 9a cd rjmp .-1228 ; 0x13704 #### Parameters - `N` - Line number */ case 110: if (code_seen('N')) 13bd0: 8e e4 ldi r24, 0x4E ; 78 13bd2: 0e 94 80 56 call 0xad00 ; 0xad00 13bd6: 88 23 and r24, r24 13bd8: 09 f4 brne .+2 ; 0x13bdc 13bda: 54 c4 rjmp .+2216 ; 0x14484 gcode_LastN = code_value_long(); 13bdc: 0e 94 e8 56 call 0xadd0 ; 0xadd0 13be0: 60 93 3e 12 sts 0x123E, r22 ; 0x80123e 13be4: 70 93 3f 12 sts 0x123F, r23 ; 0x80123f 13be8: 80 93 40 12 sts 0x1240, r24 ; 0x801240 13bec: 90 93 41 12 sts 0x1241, r25 ; 0x801241 13bf0: 49 c4 rjmp .+2194 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13bf2: 82 37 cpi r24, 0x72 ; 114 13bf4: 91 05 cpc r25, r1 13bf6: 11 f4 brne .+4 ; 0x13bfc 13bf8: 0c 94 aa a8 jmp 0x15154 ; 0x15154 13bfc: 14 f4 brge .+4 ; 0x13c02 13bfe: 0c 94 b7 a7 jmp 0x14f6e ; 0x14f6e 13c02: 83 37 cpi r24, 0x73 ; 115 13c04: 91 05 cpc r25, r1 13c06: 09 f0 breq .+2 ; 0x13c0a 13c08: 7d cd rjmp .-1286 ; 0x13704 #### 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')) { 13c0a: 86 e5 ldi r24, 0x56 ; 86 13c0c: 0e 94 80 56 call 0xad00 ; 0xad00 13c10: 88 23 and r24, r24 13c12: 11 f4 brne .+4 ; 0x13c18 13c14: 0c 94 d6 a7 jmp 0x14fac ; 0x14fac // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); 13c18: 8f ee ldi r24, 0xEF ; 239 13c1a: 99 e8 ldi r25, 0x89 ; 137 13c1c: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 13c20: 31 c4 rjmp .+2146 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13c22: 8b 37 cpi r24, 0x7B ; 123 13c24: 91 05 cpc r25, r1 13c26: 11 f4 brne .+4 ; 0x13c2c 13c28: 0c 94 05 a9 jmp 0x1520a ; 0x1520a 13c2c: 0c f0 brlt .+2 ; 0x13c30 13c2e: 48 c0 rjmp .+144 ; 0x13cc0 13c30: 86 37 cpi r24, 0x76 ; 118 13c32: 91 05 cpc r25, r1 13c34: 11 f4 brne .+4 ; 0x13c3a 13c36: 0c 94 bd a8 jmp 0x1517a ; 0x1517a 13c3a: 87 37 cpi r24, 0x77 ; 119 13c3c: 91 05 cpc r25, r1 13c3e: 09 f0 breq .+2 ; 0x13c42 13c40: 61 cd rjmp .-1342 ; 0x13704 /*! ### 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 13c42: 80 e2 ldi r24, 0x20 ; 32 13c44: 96 e6 ldi r25, 0x66 ; 102 13c46: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOLLN(); 13c4a: 0e 94 0d 7b call 0xf61a ; 0xf61a #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(_n("x_min: "));////MSG_X_MIN 13c4e: 88 e1 ldi r24, 0x18 ; 24 13c50: 96 e6 ldi r25, 0x66 ; 102 13c52: 0e 94 15 7b call 0xf62a ; 0xf62a if(READ(X_MIN_PIN)^X_MIN_ENDSTOP_INVERTING){ 13c56: 1e 9b sbis 0x03, 6 ; 3 13c58: 02 c0 rjmp .+4 ; 0x13c5e 13c5a: 0c 94 f5 a8 jmp 0x151ea ; 0x151ea SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13c5e: 83 e1 ldi r24, 0x13 ; 19 13c60: 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); 13c62: 0e 94 15 7b call 0xf62a ; 0xf62a }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13c66: 0e 94 0d 7b call 0xf61a ; 0xf61a 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 13c6a: 81 e0 ldi r24, 0x01 ; 1 13c6c: 96 e6 ldi r25, 0x66 ; 102 13c6e: 0e 94 15 7b call 0xf62a ; 0xf62a if(READ(Y_MIN_PIN)^Y_MIN_ENDSTOP_INVERTING){ 13c72: 1d 9b sbis 0x03, 5 ; 3 13c74: 02 c0 rjmp .+4 ; 0x13c7a 13c76: 0c 94 f9 a8 jmp 0x151f2 ; 0x151f2 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13c7a: 83 e1 ldi r24, 0x13 ; 19 13c7c: 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); 13c7e: 0e 94 15 7b call 0xf62a ; 0xf62a }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13c82: 0e 94 0d 7b call 0xf61a ; 0xf61a SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MIN); 13c86: 89 ef ldi r24, 0xF9 ; 249 13c88: 95 e6 ldi r25, 0x65 ; 101 13c8a: 0e 94 15 7b call 0xf62a ; 0xf62a if(READ(Z_MIN_PIN)^Z_MIN_ENDSTOP_INVERTING){ 13c8e: 1c 9b sbis 0x03, 4 ; 3 13c90: 02 c0 rjmp .+4 ; 0x13c96 13c92: 0c 94 fd a8 jmp 0x151fa ; 0x151fa SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13c96: 83 e1 ldi r24, 0x13 ; 19 13c98: 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); 13c9a: 0e 94 15 7b call 0xf62a ; 0xf62a }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13c9e: 0e 94 0d 7b call 0xf61a ; 0xf61a #endif #if defined(Z_MAX_PIN) && Z_MAX_PIN > -1 SERIAL_PROTOCOLRPGM(MSG_Z_MAX); 13ca2: 81 ef ldi r24, 0xF1 ; 241 13ca4: 95 e6 ldi r25, 0x65 ; 101 13ca6: 0e 94 15 7b call 0xf62a ; 0xf62a if(READ(Z_MAX_PIN)^Z_MAX_ENDSTOP_INVERTING){ 13caa: 01 99 sbic 0x00, 1 ; 0 13cac: 02 c0 rjmp .+4 ; 0x13cb2 13cae: 0c 94 01 a9 jmp 0x15202 ; 0x15202 SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_HIT); }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); 13cb2: 83 e1 ldi r24, 0x13 ; 19 13cb4: 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); 13cb6: 0e 94 15 7b call 0xf62a ; 0xf62a }else{ SERIAL_PROTOCOLRPGM(MSG_ENDSTOP_OPEN); } SERIAL_PROTOCOLLN(); 13cba: 0e 94 0d 7b call 0xf61a ; 0xf61a 13cbe: e2 c3 rjmp .+1988 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13cc0: 8c 38 cpi r24, 0x8C ; 140 13cc2: 91 05 cpc r25, r1 13cc4: 09 f4 brne .+2 ; 0x13cc8 13cc6: 2a c7 rjmp .+3668 ; 0x14b1c 13cc8: 8b 39 cpi r24, 0x9B ; 155 13cca: 91 05 cpc r25, r1 13ccc: 09 f4 brne .+2 ; 0x13cd0 13cce: 41 c7 rjmp .+3714 ; 0x14b52 13cd0: 8d 37 cpi r24, 0x7D ; 125 13cd2: 91 05 cpc r25, r1 13cd4: 09 f0 breq .+2 ; 0x13cd8 13cd6: 16 cd rjmp .-1492 ; 0x13704 13cd8: 82 cd rjmp .-1276 ; 0x137de 13cda: 84 3a cpi r24, 0xA4 ; 164 13cdc: 41 e0 ldi r20, 0x01 ; 1 13cde: 94 07 cpc r25, r20 13ce0: 11 f4 brne .+4 ; 0x13ce6 13ce2: 0c 94 24 ac jmp 0x15848 ; 0x15848 13ce6: 0c f0 brlt .+2 ; 0x13cea 13ce8: 38 c2 rjmp .+1136 ; 0x1415a 13cea: 82 3e cpi r24, 0xE2 ; 226 13cec: 91 05 cpc r25, r1 13cee: 11 f4 brne .+4 ; 0x13cf4 13cf0: 0c 94 ae aa jmp 0x1555c ; 0x1555c 13cf4: 0c f0 brlt .+2 ; 0x13cf8 13cf6: 6b c1 rjmp .+726 ; 0x13fce 13cf8: 8e 3c cpi r24, 0xCE ; 206 13cfa: 91 05 cpc r25, r1 13cfc: 11 f4 brne .+4 ; 0x13d02 13cfe: 0c 94 c1 a9 jmp 0x15382 ; 0x15382 13d02: 0c f0 brlt .+2 ; 0x13d06 13d04: b1 c0 rjmp .+354 ; 0x13e68 13d06: 8b 3c cpi r24, 0xCB ; 203 13d08: 91 05 cpc r25, r1 13d0a: 11 f4 brne .+4 ; 0x13d10 13d0c: 0c 94 4b a9 jmp 0x15296 ; 0x15296 13d10: 5c f5 brge .+86 ; 0x13d68 13d12: 88 3c cpi r24, 0xC8 ; 200 13d14: 91 05 cpc r25, r1 13d16: 11 f4 brne .+4 ; 0x13d1c 13d18: 0c 94 08 a9 jmp 0x15210 ; 0x15210 13d1c: 89 3c cpi r24, 0xC9 ; 201 13d1e: 91 05 cpc r25, r1 13d20: 09 f0 breq .+2 ; 0x13d24 13d22: f0 cc rjmp .-1568 ; 0x13704 13d24: 04 ec ldi r16, 0xC4 ; 196 13d26: 12 e0 ldi r17, 0x02 ; 2 13d28: b7 e6 ldi r27, 0x67 ; 103 13d2a: eb 2e mov r14, r27 13d2c: bd e0 ldi r27, 0x0D ; 13 13d2e: fb 2e mov r15, r27 13d30: 88 ec ldi r24, 0xC8 ; 200 13d32: c8 2e mov r12, r24 13d34: 82 e0 ldi r24, 0x02 ; 2 13d36: 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])) 13d38: d8 01 movw r26, r16 13d3a: 8d 91 ld r24, X+ 13d3c: 8d 01 movw r16, r26 13d3e: 0e 94 80 56 call 0xad00 ; 0xad00 13d42: 88 23 and r24, r24 13d44: 49 f0 breq .+18 ; 0x13d58 { unsigned long val = code_value(); 13d46: 0e 94 10 5b call 0xb620 ; 0xb620 13d4a: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 13d4e: f7 01 movw r30, r14 13d50: 64 a3 std Z+36, r22 ; 0x24 13d52: 75 a3 std Z+37, r23 ; 0x25 13d54: 86 a3 std Z+38, r24 ; 0x26 13d56: 97 a3 std Z+39, r25 ; 0x27 13d58: f4 e0 ldi r31, 0x04 ; 4 13d5a: ef 0e add r14, r31 13d5c: 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++) 13d5e: c0 16 cp r12, r16 13d60: d1 06 cpc r13, r17 13d62: 51 f7 brne .-44 ; 0x13d38 13d64: 0c 94 ac a7 jmp 0x14f58 ; 0x14f58 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13d68: 8c 3c cpi r24, 0xCC ; 204 13d6a: 91 05 cpc r25, r1 13d6c: 11 f4 brne .+4 ; 0x13d72 13d6e: 0c 94 6a a9 jmp 0x152d4 ; 0x152d4 13d72: 8d 3c cpi r24, 0xCD ; 205 13d74: 91 05 cpc r25, r1 13d76: 09 f0 breq .+2 ; 0x13d7a 13d78: c5 cc rjmp .-1654 ; 0x13704 - `Z` - Maximum Z jerk (units/s) - `E` - Maximum E jerk (units/s) */ case 205: { if(code_seen('S')) cs.minimumfeedrate = code_value(); 13d7a: 83 e5 ldi r24, 0x53 ; 83 13d7c: 0e 94 80 56 call 0xad00 ; 0xad00 13d80: 88 23 and r24, r24 13d82: 51 f0 breq .+20 ; 0x13d98 13d84: 0e 94 10 5b call 0xb620 ; 0xb620 13d88: 60 93 a3 0d sts 0x0DA3, r22 ; 0x800da3 13d8c: 70 93 a4 0d sts 0x0DA4, r23 ; 0x800da4 13d90: 80 93 a5 0d sts 0x0DA5, r24 ; 0x800da5 13d94: 90 93 a6 0d sts 0x0DA6, r25 ; 0x800da6 if(code_seen('T')) cs.mintravelfeedrate = code_value(); 13d98: 84 e5 ldi r24, 0x54 ; 84 13d9a: 0e 94 80 56 call 0xad00 ; 0xad00 13d9e: 88 23 and r24, r24 13da0: 51 f0 breq .+20 ; 0x13db6 13da2: 0e 94 10 5b call 0xb620 ; 0xb620 13da6: 60 93 a7 0d sts 0x0DA7, r22 ; 0x800da7 13daa: 70 93 a8 0d sts 0x0DA8, r23 ; 0x800da8 13dae: 80 93 a9 0d sts 0x0DA9, r24 ; 0x800da9 13db2: 90 93 aa 0d sts 0x0DAA, r25 ; 0x800daa if(code_seen('B')) cs.min_segment_time_us = (uint32_t)code_value(); 13db6: 82 e4 ldi r24, 0x42 ; 66 13db8: 0e 94 80 56 call 0xad00 ; 0xad00 13dbc: 88 23 and r24, r24 13dbe: 61 f0 breq .+24 ; 0x13dd8 13dc0: 0e 94 10 5b call 0xb620 ; 0xb620 13dc4: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 13dc8: 60 93 ab 0d sts 0x0DAB, r22 ; 0x800dab 13dcc: 70 93 ac 0d sts 0x0DAC, r23 ; 0x800dac 13dd0: 80 93 ad 0d sts 0x0DAD, r24 ; 0x800dad 13dd4: 90 93 ae 0d sts 0x0DAE, r25 ; 0x800dae if(code_seen('X')) cs.max_jerk[X_AXIS] = cs.max_jerk[Y_AXIS] = code_value(); 13dd8: 88 e5 ldi r24, 0x58 ; 88 13dda: 0e 94 80 56 call 0xad00 ; 0xad00 13dde: 88 23 and r24, r24 13de0: 91 f0 breq .+36 ; 0x13e06 13de2: 0e 94 10 5b call 0xb620 ; 0xb620 13de6: 60 93 b3 0d sts 0x0DB3, r22 ; 0x800db3 13dea: 70 93 b4 0d sts 0x0DB4, r23 ; 0x800db4 13dee: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 13df2: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 13df6: 60 93 af 0d sts 0x0DAF, r22 ; 0x800daf 13dfa: 70 93 b0 0d sts 0x0DB0, r23 ; 0x800db0 13dfe: 80 93 b1 0d sts 0x0DB1, r24 ; 0x800db1 13e02: 90 93 b2 0d sts 0x0DB2, r25 ; 0x800db2 if(code_seen('Y')) cs.max_jerk[Y_AXIS] = code_value(); 13e06: 89 e5 ldi r24, 0x59 ; 89 13e08: 0e 94 80 56 call 0xad00 ; 0xad00 13e0c: 88 23 and r24, r24 13e0e: 51 f0 breq .+20 ; 0x13e24 13e10: 0e 94 10 5b call 0xb620 ; 0xb620 13e14: 60 93 b3 0d sts 0x0DB3, r22 ; 0x800db3 13e18: 70 93 b4 0d sts 0x0DB4, r23 ; 0x800db4 13e1c: 80 93 b5 0d sts 0x0DB5, r24 ; 0x800db5 13e20: 90 93 b6 0d sts 0x0DB6, r25 ; 0x800db6 if(code_seen('Z')) cs.max_jerk[Z_AXIS] = code_value(); 13e24: 8a e5 ldi r24, 0x5A ; 90 13e26: 0e 94 80 56 call 0xad00 ; 0xad00 13e2a: 88 23 and r24, r24 13e2c: 51 f0 breq .+20 ; 0x13e42 13e2e: 0e 94 10 5b call 0xb620 ; 0xb620 13e32: 60 93 b7 0d sts 0x0DB7, r22 ; 0x800db7 13e36: 70 93 b8 0d sts 0x0DB8, r23 ; 0x800db8 13e3a: 80 93 b9 0d sts 0x0DB9, r24 ; 0x800db9 13e3e: 90 93 ba 0d sts 0x0DBA, r25 ; 0x800dba if(code_seen('E')) 13e42: 85 e4 ldi r24, 0x45 ; 69 13e44: 0e 94 80 56 call 0xad00 ; 0xad00 13e48: 88 23 and r24, r24 13e4a: 09 f4 brne .+2 ; 0x13e4e 13e4c: 1b c3 rjmp .+1590 ; 0x14484 { float e = code_value(); 13e4e: 0e 94 10 5b call 0xb620 ; 0xb620 #ifndef LA_NOCOMPAT e = la10c_jerk(e); 13e52: 0e 94 18 84 call 0x10830 ; 0x10830 #endif cs.max_jerk[E_AXIS] = e; 13e56: 60 93 bb 0d sts 0x0DBB, r22 ; 0x800dbb 13e5a: 70 93 bc 0d sts 0x0DBC, r23 ; 0x800dbc 13e5e: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd 13e62: 90 93 be 0d sts 0x0DBE, r25 ; 0x800dbe 13e66: 0e c3 rjmp .+1564 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13e68: 81 3d cpi r24, 0xD1 ; 209 13e6a: 91 05 cpc r25, r1 13e6c: 11 f4 brne .+4 ; 0x13e72 13e6e: 0c 94 0e aa jmp 0x1541c ; 0x1541c 13e72: 5c f5 brge .+86 ; 0x13eca 13e74: 8f 3c cpi r24, 0xCF ; 207 13e76: 91 05 cpc r25, r1 13e78: 11 f4 brne .+4 ; 0x13e7e 13e7a: 0c 94 dd a9 jmp 0x153ba ; 0x153ba 13e7e: 80 3d cpi r24, 0xD0 ; 208 13e80: 91 05 cpc r25, r1 13e82: 09 f0 breq .+2 ; 0x13e86 13e84: 3f cc rjmp .-1922 ; 0x13704 - `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')) 13e86: 83 e5 ldi r24, 0x53 ; 83 13e88: 0e 94 80 56 call 0xad00 ; 0xad00 13e8c: 88 23 and r24, r24 13e8e: 51 f0 breq .+20 ; 0x13ea4 { cs.retract_recover_length = code_value() ; 13e90: 0e 94 10 5b call 0xb620 ; 0xb620 13e94: 60 93 f6 0d sts 0x0DF6, r22 ; 0x800df6 13e98: 70 93 f7 0d sts 0x0DF7, r23 ; 0x800df7 13e9c: 80 93 f8 0d sts 0x0DF8, r24 ; 0x800df8 13ea0: 90 93 f9 0d sts 0x0DF9, r25 ; 0x800df9 } if(code_seen('F')) 13ea4: 86 e4 ldi r24, 0x46 ; 70 13ea6: 0e 94 80 56 call 0xad00 ; 0xad00 13eaa: 88 23 and r24, r24 13eac: 09 f4 brne .+2 ; 0x13eb0 13eae: ea c2 rjmp .+1492 ; 0x14484 { cs.retract_recover_feedrate = get_feedrate_mm_s(code_value()); 13eb0: 0e 94 10 5b call 0xb620 ; 0xb620 13eb4: 0e 94 96 65 call 0xcb2c ; 0xcb2c 13eb8: 60 93 fa 0d sts 0x0DFA, r22 ; 0x800dfa 13ebc: 70 93 fb 0d sts 0x0DFB, r23 ; 0x800dfb 13ec0: 80 93 fc 0d sts 0x0DFC, r24 ; 0x800dfc 13ec4: 90 93 fd 0d sts 0x0DFD, r25 ; 0x800dfd 13ec8: dd c2 rjmp .+1466 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13eca: 8c 3d cpi r24, 0xDC ; 220 13ecc: 91 05 cpc r25, r1 13ece: 11 f4 brne .+4 ; 0x13ed4 13ed0: 0c 94 4e aa jmp 0x1549c ; 0x1549c 13ed4: 8d 3d cpi r24, 0xDD ; 221 13ed6: 91 05 cpc r25, r1 13ed8: 11 f4 brne .+4 ; 0x13ede 13eda: 0c 94 8d aa jmp 0x1551a ; 0x1551a 13ede: 86 3d cpi r24, 0xD6 ; 214 13ee0: 91 05 cpc r25, r1 13ee2: 09 f0 breq .+2 ; 0x13ee6 13ee4: 0f cc rjmp .-2018 ; 0x13704 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; 13ee6: 80 e5 ldi r24, 0x50 ; 80 13ee8: 0e 94 80 56 call 0xad00 ; 0xad00 13eec: 88 23 and r24, r24 13eee: 11 f4 brne .+4 ; 0x13ef4 13ef0: 0c 94 3a aa jmp 0x15474 ; 0x15474 13ef4: 0e 94 10 5b call 0xb620 ; 0xb620 13ef8: 2b 01 movw r4, r22 13efa: 3c 01 movw r6, r24 float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 13efc: 83 e5 ldi r24, 0x53 ; 83 13efe: 0e 94 80 56 call 0xad00 ; 0xad00 13f02: 88 23 and r24, r24 13f04: 11 f4 brne .+4 ; 0x13f0a 13f06: 0c 94 44 aa jmp 0x15488 ; 0x15488 13f0a: 0e 94 10 5b call 0xb620 ; 0xb620 13f0e: 4b 01 movw r8, r22 13f10: 5c 01 movw r10, r24 unsigned char n = code_seen('N') ? code_value() : cs.n_arc_correction; 13f12: 8e e4 ldi r24, 0x4E ; 78 13f14: 0e 94 80 56 call 0xad00 ; 0xad00 13f18: d0 90 33 0e lds r13, 0x0E33 ; 0x800e33 13f1c: 88 23 and r24, r24 13f1e: 29 f0 breq .+10 ; 0x13f2a 13f20: 0e 94 10 5b call 0xb620 ; 0xb620 13f24: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 13f28: d6 2e mov r13, r22 unsigned short r = code_seen('R') ? code_value() : cs.min_arc_segments; 13f2a: 82 e5 ldi r24, 0x52 ; 82 13f2c: 0e 94 80 56 call 0xad00 ; 0xad00 13f30: e0 90 34 0e lds r14, 0x0E34 ; 0x800e34 13f34: f0 90 35 0e lds r15, 0x0E35 ; 0x800e35 13f38: 88 23 and r24, r24 13f3a: 29 f0 breq .+10 ; 0x13f46 13f3c: 0e 94 10 5b call 0xb620 ; 0xb620 13f40: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 13f44: 7b 01 movw r14, r22 unsigned short f = code_seen('F') ? code_value() : cs.arc_segments_per_sec; 13f46: 86 e4 ldi r24, 0x46 ; 70 13f48: 0e 94 80 56 call 0xad00 ; 0xad00 13f4c: 00 91 36 0e lds r16, 0x0E36 ; 0x800e36 13f50: 10 91 37 0e lds r17, 0x0E37 ; 0x800e37 13f54: 88 23 and r24, r24 13f56: 29 f0 breq .+10 ; 0x13f62 13f58: 0e 94 10 5b call 0xb620 ; 0xb620 13f5c: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 13f60: 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) 13f62: 20 e0 ldi r18, 0x00 ; 0 13f64: 30 e0 ldi r19, 0x00 ; 0 13f66: a9 01 movw r20, r18 13f68: c3 01 movw r24, r6 13f6a: b2 01 movw r22, r4 13f6c: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 13f70: 18 16 cp r1, r24 13f72: 0c f0 brlt .+2 ; 0x13f76 13f74: 87 c2 rjmp .+1294 ; 0x14484 13f76: 20 e0 ldi r18, 0x00 ; 0 13f78: 30 e0 ldi r19, 0x00 ; 0 13f7a: a9 01 movw r20, r18 13f7c: c5 01 movw r24, r10 13f7e: b4 01 movw r22, r8 13f80: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 13f84: 87 fd sbrc r24, 7 13f86: 7e c2 rjmp .+1276 ; 0x14484 13f88: a5 01 movw r20, r10 13f8a: 94 01 movw r18, r8 13f8c: c3 01 movw r24, r6 13f8e: b2 01 movw r22, r4 13f90: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 13f94: 87 fd sbrc r24, 7 13f96: 76 c2 rjmp .+1260 ; 0x14484 { // Should we display some error here? break; } cs.mm_per_arc_segment = p; 13f98: 40 92 2b 0e sts 0x0E2B, r4 ; 0x800e2b 13f9c: 50 92 2c 0e sts 0x0E2C, r5 ; 0x800e2c 13fa0: 60 92 2d 0e sts 0x0E2D, r6 ; 0x800e2d 13fa4: 70 92 2e 0e sts 0x0E2E, r7 ; 0x800e2e cs.min_mm_per_arc_segment = s; 13fa8: 80 92 2f 0e sts 0x0E2F, r8 ; 0x800e2f 13fac: 90 92 30 0e sts 0x0E30, r9 ; 0x800e30 13fb0: a0 92 31 0e sts 0x0E31, r10 ; 0x800e31 13fb4: b0 92 32 0e sts 0x0E32, r11 ; 0x800e32 cs.n_arc_correction = n; 13fb8: d0 92 33 0e sts 0x0E33, r13 ; 0x800e33 cs.min_arc_segments = r; 13fbc: f0 92 35 0e sts 0x0E35, r15 ; 0x800e35 13fc0: e0 92 34 0e sts 0x0E34, r14 ; 0x800e34 cs.arc_segments_per_sec = f; 13fc4: 10 93 37 0e sts 0x0E37, r17 ; 0x800e37 13fc8: 00 93 36 0e sts 0x0E36, r16 ; 0x800e36 13fcc: 5b c2 rjmp .+1206 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 13fce: 80 33 cpi r24, 0x30 ; 48 13fd0: a1 e0 ldi r26, 0x01 ; 1 13fd2: 9a 07 cpc r25, r26 13fd4: 11 f4 brne .+4 ; 0x13fda 13fd6: 0c 94 89 ab jmp 0x15712 ; 0x15712 13fda: 0c f0 brlt .+2 ; 0x13fde 13fdc: 6c c0 rjmp .+216 ; 0x140b6 13fde: 8d 32 cpi r24, 0x2D ; 45 13fe0: e1 e0 ldi r30, 0x01 ; 1 13fe2: 9e 07 cpc r25, r30 13fe4: 11 f4 brne .+4 ; 0x13fea 13fe6: 0c 94 10 ab jmp 0x15620 ; 0x15620 13fea: 54 f5 brge .+84 ; 0x14040 13fec: 80 3f cpi r24, 0xF0 ; 240 13fee: 91 05 cpc r25, r1 13ff0: 09 f4 brne .+2 ; 0x13ff4 13ff2: 48 c2 rjmp .+1168 ; 0x14484 13ff4: 8c 32 cpi r24, 0x2C ; 44 13ff6: 91 40 sbci r25, 0x01 ; 1 13ff8: 09 f0 breq .+2 ; 0x13ffc 13ffa: 84 cb rjmp .-2296 ; 0x13704 - `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; 13ffc: 80 e5 ldi r24, 0x50 ; 80 13ffe: 0e 94 80 56 call 0xad00 ; 0xad00 14002: 08 ee ldi r16, 0xE8 ; 232 14004: 13 e0 ldi r17, 0x03 ; 3 14006: 88 23 and r24, r24 14008: 29 f0 breq .+10 ; 0x14014 1400a: 0e 94 10 5b call 0xb620 ; 0xb620 1400e: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 14012: 8b 01 movw r16, r22 uint16_t beepS; if (!code_seen('S')) 14014: 83 e5 ldi r24, 0x53 ; 83 14016: 0e 94 80 56 call 0xad00 ; 0xad00 1401a: 88 23 and r24, r24 1401c: 11 f4 brne .+4 ; 0x14022 1401e: 0c 94 08 ab jmp 0x15610 ; 0x15610 beepS = 0; else { beepS = code_value(); 14022: 0e 94 10 5b call 0xb620 ; 0xb620 14026: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> if (!beepS) { 1402a: 61 15 cp r22, r1 1402c: 71 05 cpc r23, r1 1402e: 11 f0 breq .+4 ; 0x14034 14030: 0c 94 0a ab jmp 0x15614 ; 0x15614 // handle S0 as a pause _delay(beepP); 14034: b8 01 movw r22, r16 14036: 90 e0 ldi r25, 0x00 ; 0 14038: 80 e0 ldi r24, 0x00 ; 0 1403a: 0f 94 56 0b call 0x216ac ; 0x216ac 1403e: 22 c2 rjmp .+1092 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14040: 8e 32 cpi r24, 0x2E ; 46 14042: 31 e0 ldi r19, 0x01 ; 1 14044: 93 07 cpc r25, r19 14046: 11 f4 brne .+4 ; 0x1404c 14048: 0c 94 02 ac jmp 0x15804 ; 0x15804 1404c: 8f 32 cpi r24, 0x2F ; 47 1404e: 91 40 sbci r25, 0x01 ; 1 14050: 09 f0 breq .+2 ; 0x14054 14052: 58 cb rjmp .-2384 ; 0x13704 case 303: { float temp = 150.0; int e = 0; int c = 5; if (code_seen('E')) e = code_value_short(); 14054: 85 e4 ldi r24, 0x45 ; 69 14056: 0e 94 80 56 call 0xad00 ; 0xad00 - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; int e = 0; 1405a: 10 e0 ldi r17, 0x00 ; 0 1405c: 00 e0 ldi r16, 0x00 ; 0 int c = 5; if (code_seen('E')) e = code_value_short(); 1405e: 88 23 and r24, r24 14060: 59 f0 breq .+22 ; 0x14078 14062: 0e 94 a2 56 call 0xad44 ; 0xad44 14066: 8c 01 movw r16, r24 if (e < 0) temp = 70; 14068: c1 2c mov r12, r1 1406a: d1 2c mov r13, r1 1406c: 6c e8 ldi r22, 0x8C ; 140 1406e: e6 2e mov r14, r22 14070: 62 e4 ldi r22, 0x42 ; 66 14072: 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) 14074: 97 fd sbrc r25, 7 14076: 06 c0 rjmp .+12 ; 0x14084 - `S` - Target temperature, default `210°C` for hotend, 70 for bed - `C` - Cycles, default `5` */ case 303: { float temp = 150.0; 14078: c1 2c mov r12, r1 1407a: d1 2c mov r13, r1 1407c: 76 e1 ldi r23, 0x16 ; 22 1407e: e7 2e mov r14, r23 14080: 73 e4 ldi r23, 0x43 ; 67 14082: 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(); 14084: 83 e5 ldi r24, 0x53 ; 83 14086: 0e 94 80 56 call 0xad00 ; 0xad00 1408a: 88 23 and r24, r24 1408c: 21 f0 breq .+8 ; 0x14096 1408e: 0e 94 10 5b call 0xb620 ; 0xb620 14092: 6b 01 movw r12, r22 14094: 7c 01 movw r14, r24 if (code_seen('C')) c = code_value_short(); 14096: 83 e4 ldi r24, 0x43 ; 67 14098: 0e 94 80 56 call 0xad00 ; 0xad00 1409c: 88 23 and r24, r24 1409e: 11 f4 brne .+4 ; 0x140a4 140a0: 0c 94 12 ac jmp 0x15824 ; 0x15824 140a4: 0e 94 a2 56 call 0xad44 ; 0xad44 PID_autotune(temp, e, c); 140a8: 9c 01 movw r18, r24 140aa: a8 01 movw r20, r16 140ac: c7 01 movw r24, r14 140ae: b6 01 movw r22, r12 140b0: 0f 94 05 34 call 0x2680a ; 0x2680a 140b4: e7 c1 rjmp .+974 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 140b6: 80 39 cpi r24, 0x90 ; 144 140b8: 51 e0 ldi r21, 0x01 ; 1 140ba: 95 07 cpc r25, r21 140bc: 11 f4 brne .+4 ; 0x140c2 140be: 0c 94 16 ac jmp 0x1582c ; 0x1582c 140c2: 04 f5 brge .+64 ; 0x14104 140c4: 8e 35 cpi r24, 0x5E ; 94 140c6: b1 e0 ldi r27, 0x01 ; 1 140c8: 9b 07 cpc r25, r27 140ca: 11 f4 brne .+4 ; 0x140d0 140cc: 0c 94 37 b7 jmp 0x16e6e ; 0x16e6e 140d0: 8f 35 cpi r24, 0x5F ; 95 140d2: 91 40 sbci r25, 0x01 ; 1 140d4: 09 f0 breq .+2 ; 0x140d8 140d6: 16 cb rjmp .-2516 ; 0x13704 - `B` - new pin value */ case 351: { #if defined(X_MS1_PIN) && X_MS1_PIN > -1 if(code_seen('S')) switch((int)code_value()) 140d8: 83 e5 ldi r24, 0x53 ; 83 140da: 0e 94 80 56 call 0xad00 ; 0xad00 140de: 88 23 and r24, r24 140e0: 71 f0 breq .+28 ; 0x140fe 140e2: 0e 94 10 5b call 0xb620 ; 0xb620 140e6: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 140ea: 61 30 cpi r22, 0x01 ; 1 140ec: 71 05 cpc r23, r1 140ee: 11 f4 brne .+4 ; 0x140f4 140f0: 0c 94 6d b7 jmp 0x16eda ; 0x16eda 140f4: 62 30 cpi r22, 0x02 ; 2 140f6: 71 05 cpc r23, r1 140f8: 11 f4 brne .+4 ; 0x140fe 140fa: 0c 94 8f b7 jmp 0x16f1e ; 0x16f1e case 2: for(int i=0;i 14102: c0 c1 rjmp .+896 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14104: 85 39 cpi r24, 0x95 ; 149 14106: f1 e0 ldi r31, 0x01 ; 1 14108: 9f 07 cpc r25, r31 1410a: 11 f4 brne .+4 ; 0x14110 1410c: 0c 94 1a ac jmp 0x15834 ; 0x15834 14110: 86 39 cpi r24, 0x96 ; 150 14112: 21 e0 ldi r18, 0x01 ; 1 14114: 92 07 cpc r25, r18 14116: 11 f4 brne .+4 ; 0x1411c 14118: 0c 94 1f ac jmp 0x1583e ; 0x1583e 1411c: 83 39 cpi r24, 0x93 ; 147 1411e: 91 40 sbci r25, 0x01 ; 1 14120: 09 f0 breq .+2 ; 0x14124 14122: f0 ca rjmp .-2592 ; 0x13704 */ 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()) 14124: 80 91 01 13 lds r24, 0x1301 ; 0x801301 14128: 81 30 cpi r24, 0x01 ; 1 1412a: 09 f0 breq .+2 ; 0x1412e 1412c: ab c1 rjmp .+854 ; 0x14484 { uint8_t extruder = 255; uint8_t filament = FILAMENT_UNDEFINED; if(code_seen('E')) extruder = code_value_uint8(); 1412e: 85 e4 ldi r24, 0x45 ; 69 14130: 0e 94 80 56 call 0xad00 ; 0xad00 14134: 81 11 cpse r24, r1 14136: 0e 94 95 56 call 0xad2a ; 0xad2a if(code_seen('F')) filament = code_value_uint8(); 1413a: 86 e4 ldi r24, 0x46 ; 70 1413c: 0e 94 80 56 call 0xad00 ; 0xad00 14140: 81 11 cpse r24, r1 14142: 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()) { 14146: 0f 94 47 7a call 0x2f48e ; 0x2f48e 1414a: 88 23 and r24, r24 1414c: 09 f4 brne .+2 ; 0x14150 1414e: 9a c1 rjmp .+820 ; 0x14484 // slot = slot; // @@TODO // type = type; // @@TODO // cmd_arg = filamentType; // command(MMU_CMD_F0 + index); if (!manage_response(false, false)) { 14150: 60 e0 ldi r22, 0x00 ; 0 14152: 80 e0 ldi r24, 0x00 ; 0 14154: 0f 94 4b 9d call 0x33a96 ; 0x33a96 14158: 95 c1 rjmp .+810 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 1415a: 80 3c cpi r24, 0xC0 ; 192 1415c: 42 e0 ldi r20, 0x02 ; 2 1415e: 94 07 cpc r25, r20 14160: 11 f4 brne .+4 ; 0x14166 14162: 0c 94 79 b8 jmp 0x170f2 ; 0x170f2 14166: 0c f0 brlt .+2 ; 0x1416a 14168: 57 c0 rjmp .+174 ; 0x14218 1416a: 88 32 cpi r24, 0x28 ; 40 1416c: a2 e0 ldi r26, 0x02 ; 2 1416e: 9a 07 cpc r25, r26 14170: 11 f4 brne .+4 ; 0x14176 14172: 0c 94 c5 ae jmp 0x15d8a ; 0x15d8a 14176: 4c f5 brge .+82 ; 0x141ca 14178: 86 3f cpi r24, 0xF6 ; 246 1417a: e1 e0 ldi r30, 0x01 ; 1 1417c: 9e 07 cpc r25, r30 1417e: 11 f4 brne .+4 ; 0x14184 14180: 0c 94 2c ac jmp 0x15858 ; 0x15858 14184: 6c f4 brge .+26 ; 0x141a0 14186: 84 3f cpi r24, 0xF4 ; 244 14188: 21 e0 ldi r18, 0x01 ; 1 1418a: 92 07 cpc r25, r18 1418c: 11 f4 brne .+4 ; 0x14192 1418e: 0c 94 28 ac jmp 0x15850 ; 0x15850 14192: 85 3f cpi r24, 0xF5 ; 245 14194: 91 40 sbci r25, 0x01 ; 1 14196: 09 f0 breq .+2 ; 0x1419a 14198: b5 ca rjmp .-2710 ; 0x13704 M501 */ case 501: { Config_RetrieveSettings(); 1419a: 0e 94 7d 85 call 0x10afa ; 0x10afa 1419e: 72 c1 rjmp .+740 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 141a0: 87 3f cpi r24, 0xF7 ; 247 141a2: 41 e0 ldi r20, 0x01 ; 1 141a4: 94 07 cpc r25, r20 141a6: 11 f4 brne .+4 ; 0x141ac 141a8: 0c 94 30 ac jmp 0x15860 ; 0x15860 141ac: 8d 3f cpi r24, 0xFD ; 253 141ae: 91 40 sbci r25, 0x01 ; 1 141b0: 09 f0 breq .+2 ; 0x141b4 141b2: a8 ca rjmp .-2736 ; 0x13704 M509 */ case 509: { lang_reset(); 141b4: 0e 94 8e 74 call 0xe91c ; 0xe91c SERIAL_ECHO_START; 141b8: 84 ee ldi r24, 0xE4 ; 228 141ba: 92 ea ldi r25, 0xA2 ; 162 141bc: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOLPGM("LANG SEL FORCED"); 141c0: 8d ed ldi r24, 0xDD ; 221 141c2: 9f e7 ldi r25, 0x7F ; 127 141c4: 0e 94 15 7b call 0xf62a ; 0xf62a 141c8: 5d c1 rjmp .+698 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 141ca: 8a 35 cpi r24, 0x5A ; 90 141cc: a2 e0 ldi r26, 0x02 ; 2 141ce: 9a 07 cpc r25, r26 141d0: 11 f4 brne .+4 ; 0x141d6 141d2: 0c 94 f0 b2 jmp 0x165e0 ; 0x165e0 141d6: 5c f4 brge .+22 ; 0x141ee 141d8: 88 35 cpi r24, 0x58 ; 88 141da: e2 e0 ldi r30, 0x02 ; 2 141dc: 9e 07 cpc r25, r30 141de: 11 f4 brne .+4 ; 0x141e4 141e0: 0c 94 fa ae jmp 0x15df4 ; 0x15df4 141e4: 89 35 cpi r24, 0x59 ; 89 141e6: 92 40 sbci r25, 0x02 ; 2 141e8: 09 f4 brne .+2 ; 0x141ec 141ea: f9 ca rjmp .-2574 ; 0x137de 141ec: 8b ca rjmp .-2794 ; 0x13704 141ee: 8d 3b cpi r24, 0xBD ; 189 141f0: 22 e0 ldi r18, 0x02 ; 2 141f2: 92 07 cpc r25, r18 141f4: 11 f4 brne .+4 ; 0x141fa 141f6: 0c 94 a8 b7 jmp 0x16f50 ; 0x16f50 141fa: 8e 3b cpi r24, 0xBE ; 190 141fc: 32 e0 ldi r19, 0x02 ; 2 141fe: 93 07 cpc r25, r19 14200: 11 f4 brne .+4 ; 0x14206 14202: 0c 94 45 b8 jmp 0x1708a ; 0x1708a 14206: 8b 35 cpi r24, 0x5B ; 91 14208: 92 40 sbci r25, 0x02 ; 2 1420a: 09 f0 breq .+2 ; 0x1420e 1420c: 7b ca rjmp .-2826 ; 0x13704 /*! ### M603 - Stop print M603: Stop print */ case 603: { print_stop(); 1420e: 60 e0 ldi r22, 0x00 ; 0 14210: 80 e0 ldi r24, 0x00 ; 0 14212: 0e 94 e1 dc call 0x1b9c2 ; 0x1b9c2 14216: 36 c1 rjmp .+620 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14218: 8c 35 cpi r24, 0x5C ; 92 1421a: 53 e0 ldi r21, 0x03 ; 3 1421c: 95 07 cpc r25, r21 1421e: 11 f4 brne .+4 ; 0x14224 14220: 0c 94 12 b4 jmp 0x16824 ; 0x16824 14224: 0c f0 brlt .+2 ; 0x14228 14226: 42 c0 rjmp .+132 ; 0x142ac 14228: 83 3c cpi r24, 0xC3 ; 195 1422a: b2 e0 ldi r27, 0x02 ; 2 1422c: 9b 07 cpc r25, r27 1422e: 11 f4 brne .+4 ; 0x14234 14230: 0c 94 85 b8 jmp 0x1710a ; 0x1710a 14234: 7c f4 brge .+30 ; 0x14254 14236: 81 3c cpi r24, 0xC1 ; 193 14238: f2 e0 ldi r31, 0x02 ; 2 1423a: 9f 07 cpc r25, r31 1423c: 11 f4 brne .+4 ; 0x14242 1423e: 0c 94 7f b8 jmp 0x170fe ; 0x170fe 14242: 82 3c cpi r24, 0xC2 ; 194 14244: 92 40 sbci r25, 0x02 ; 2 14246: 09 f0 breq .+2 ; 0x1424a 14248: 5d ca rjmp .-2886 ; 0x13704 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 706: { gcodes_M704_M705_M706(706); 1424a: 82 ec ldi r24, 0xC2 ; 194 1424c: 92 e0 ldi r25, 0x02 ; 2 1424e: 0e 94 d6 5a call 0xb5ac ; 0xb5ac 14252: 18 c1 rjmp .+560 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14254: 85 3c cpi r24, 0xC5 ; 197 14256: 32 e0 ldi r19, 0x02 ; 2 14258: 93 07 cpc r25, r19 1425a: 11 f4 brne .+4 ; 0x14260 1425c: 0c 94 ce b8 jmp 0x1719c ; 0x1719c 14260: 14 f4 brge .+4 ; 0x14266 14262: 0c 94 a2 b8 jmp 0x17144 ; 0x17144 14266: 82 35 cpi r24, 0x52 ; 82 14268: 93 40 sbci r25, 0x03 ; 3 1426a: 09 f0 breq .+2 ; 0x1426e 1426c: 4b ca rjmp .-2922 ; 0x13704 float z_val = 0; char strLabel[8]; uint8_t iBedC = 0; uint8_t iPindaC = 0; bool bIsActive=false; strLabel[7] = '\0'; // null terminate. 1426e: 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')) { 14270: 83 e5 ldi r24, 0x53 ; 83 14272: 0e 94 80 56 call 0xad00 ; 0xad00 14276: 88 23 and r24, r24 14278: 11 f4 brne .+4 ; 0x1427e 1427a: 0c 94 f8 b2 jmp 0x165f0 ; 0x165f0 iSel = code_value_uint8(); 1427e: 0e 94 95 56 call 0xad2a ; 0xad2a 14282: 18 2f mov r17, r24 if (iSel>=max_sheets) 14284: 88 30 cpi r24, 0x08 ; 8 14286: 10 f4 brcc .+4 ; 0x1428c 14288: 0c 94 fd b2 jmp 0x165fa ; 0x165fa { SERIAL_PROTOCOLPGM("Invalid sheet ID. Allowed: 0.."); 1428c: 89 eb ldi r24, 0xB9 ; 185 1428e: 9f e7 ldi r25, 0x7F ; 127 14290: 0e 94 15 7b call 0xf62a ; 0xf62a 14294: 4a e0 ldi r20, 0x0A ; 10 14296: 67 e0 ldi r22, 0x07 ; 7 14298: 70 e0 ldi r23, 0x00 ; 0 1429a: 80 e0 ldi r24, 0x00 ; 0 1429c: 90 e0 ldi r25, 0x00 ; 0 1429e: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); 142a2: 8f ed ldi r24, 0xDF ; 223 142a4: 92 e0 ldi r25, 0x02 ; 2 142a6: 0e 94 1a 86 call 0x10c34 ; 0x10c34 142aa: ec c0 rjmp .+472 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 142ac: 84 38 cpi r24, 0x84 ; 132 142ae: a3 e0 ldi r26, 0x03 ; 3 142b0: 9a 07 cpc r25, r26 142b2: 11 f4 brne .+4 ; 0x142b8 142b4: 0c 94 88 b6 jmp 0x16d10 ; 0x16d10 142b8: 0c f0 brlt .+2 ; 0x142bc 142ba: 4d c0 rjmp .+154 ; 0x14356 142bc: 8d 35 cpi r24, 0x5D ; 93 142be: e3 e0 ldi r30, 0x03 ; 3 142c0: 9e 07 cpc r25, r30 142c2: 11 f4 brne .+4 ; 0x142c8 142c4: 0c 94 9c b4 jmp 0x16938 ; 0x16938 142c8: 8e 35 cpi r24, 0x5E ; 94 142ca: 93 40 sbci r25, 0x03 ; 3 142cc: 09 f0 breq .+2 ; 0x142d0 142ce: 1a ca rjmp .-3020 ; 0x13704 */ 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); 142d0: 0e 94 10 5b call 0xb620 ; 0xb620 142d4: 20 e0 ldi r18, 0x00 ; 0 142d6: 30 e0 ldi r19, 0x00 ; 0 142d8: 40 e2 ldi r20, 0x20 ; 32 142da: 51 e4 ldi r21, 0x41 ; 65 142dc: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 142e0: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 142e4: 6c 5a subi r22, 0xAC ; 172 switch(nCommand) 142e6: 63 30 cpi r22, 0x03 ; 3 142e8: 11 f4 brne .+4 ; 0x142ee 142ea: 0c 94 a2 b5 jmp 0x16b44 ; 0x16b44 142ee: 10 f0 brcs .+4 ; 0x142f4 142f0: 0c 94 34 b5 jmp 0x16a68 ; 0x16a68 142f4: 61 30 cpi r22, 0x01 ; 1 142f6: 11 f4 brne .+4 ; 0x142fc 142f8: 0c 94 5d b5 jmp 0x16aba ; 0x16aba 142fc: 62 30 cpi r22, 0x02 ; 2 142fe: 09 f0 breq .+2 ; 0x14302 14300: c1 c0 rjmp .+386 ; 0x14484 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 14302: 80 91 01 13 lds r24, 0x1301 ; 0x801301 return pgm_read_word(&_nPrinterMmuType); 14306: ee ee ldi r30, 0xEE ; 238 14308: f9 e7 ldi r31, 0x79 ; 121 ,(uint8_t)oCheckModel ); } uint16_t nPrinterType(bool bMMu) { if (bMMu) { 1430a: 81 30 cpi r24, 0x01 ; 1 1430c: 11 f0 breq .+4 ; 0x14312 return pgm_read_word(&_nPrinterMmuType); } else { return pgm_read_word(&_nPrinterType); 1430e: e0 ef ldi r30, 0xF0 ; 240 14310: f9 e7 ldi r31, 0x79 ; 121 14312: 05 91 lpm r16, Z+ 14314: 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')) 14316: 80 e5 ldi r24, 0x50 ; 80 14318: 0e 94 80 56 call 0xad00 ; 0xad00 1431c: 88 23 and r24, r24 1431e: 11 f4 brne .+4 ; 0x14324 14320: 0c 94 91 b5 jmp 0x16b22 ; 0x16b22 { uint16_t nPrinterModel; nPrinterModel=(uint16_t)code_value_long(); 14324: 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) 14328: f0 90 ea 03 lds r15, 0x03EA ; 0x8003ea 1432c: ff 20 and r15, r15 1432e: 09 f4 brne .+2 ; 0x14332 14330: a9 c0 rjmp .+338 ; 0x14484 return; if (nPrinterModel == actualPrinterModel) 14332: 60 17 cp r22, r16 14334: 71 07 cpc r23, r17 14336: 09 f4 brne .+2 ; 0x1433a 14338: a5 c0 rjmp .+330 ; 0x14484 // SERIAL_ECHOLNPGM("Printer model differs from the G-code ..."); // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(actualPrinterModel); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nPrinterModel); render_M862_warnings( 1433a: 89 ec ldi r24, 0xC9 ; 201 1433c: 97 e3 ldi r25, 0x37 ; 55 1433e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 14342: 8c 01 movw r16, r24 14344: 81 e9 ldi r24, 0x91 ; 145 14346: 97 e3 ldi r25, 0x37 ; 55 14348: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1434c: 4f 2d mov r20, r15 1434e: b8 01 movw r22, r16 14350: 0e 94 a0 e8 call 0x1d140 ; 0x1d140 14354: 97 c0 rjmp .+302 ; 0x14484 } else { mcode_in_progress = code_value_short(); // printf_P(_N("BEGIN M-CODE=%u\n"), mcode_in_progress); switch(mcode_in_progress) 14356: 8c 38 cpi r24, 0x8C ; 140 14358: 23 e0 ldi r18, 0x03 ; 3 1435a: 92 07 cpc r25, r18 1435c: 09 f4 brne .+2 ; 0x14360 1435e: 92 c0 rjmp .+292 ; 0x14484 14360: 80 3a cpi r24, 0xA0 ; 160 14362: 33 e0 ldi r19, 0x03 ; 3 14364: 93 07 cpc r25, r19 14366: 09 f4 brne .+2 ; 0x1436a 14368: 50 c2 rjmp .+1184 ; 0x1480a 1436a: 8b 38 cpi r24, 0x8B ; 139 1436c: 93 40 sbci r25, 0x03 ; 3 1436e: 09 f0 breq .+2 ; 0x14372 14370: c9 c9 rjmp .-3182 ; 0x13704 for(int i=0;i 14378: 88 23 and r24, r24 1437a: 39 f0 breq .+14 ; 0x1438a 1437c: 0e 94 10 5b call 0xb620 ; 0xb620 14380: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 14384: 80 e0 ldi r24, 0x00 ; 0 14386: 0f 94 f7 17 call 0x22fee ; 0x22fee #endif #ifdef MOTOR_CURRENT_PWM_Z_PIN if(code_seen('Z')) st_current_set(1, code_value()); 1438a: 8a e5 ldi r24, 0x5A ; 90 1438c: 0e 94 80 56 call 0xad00 ; 0xad00 14390: 88 23 and r24, r24 14392: 39 f0 breq .+14 ; 0x143a2 14394: 0e 94 10 5b call 0xb620 ; 0xb620 14398: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1439c: 81 e0 ldi r24, 0x01 ; 1 1439e: 0f 94 f7 17 call 0x22fee ; 0x22fee #endif #ifdef MOTOR_CURRENT_PWM_E_PIN if(code_seen('E')) st_current_set(2, code_value()); 143a2: 85 e4 ldi r24, 0x45 ; 69 143a4: 0e 94 80 56 call 0xad00 ; 0xad00 143a8: 88 23 and r24, r24 143aa: 09 f4 brne .+2 ; 0x143ae 143ac: 6b c0 rjmp .+214 ; 0x14484 143ae: 0e 94 10 5b call 0xb620 ; 0xb620 143b2: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 143b6: cb 01 movw r24, r22 143b8: 0f 94 f7 16 call 0x22dee ; 0x22dee 143bc: 63 c0 rjmp .+198 ; 0x14484 - `string` - Must for M1 and optional for M0 message to display on the LCD */ case 0: case 1: { const char *src = strchr_pointer + 2; 143be: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 143c2: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 143c6: 0e 5f subi r16, 0xFE ; 254 143c8: 1f 4f sbci r17, 0xFF ; 255 codenum = 0; if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 143ca: 80 e5 ldi r24, 0x50 ; 80 143cc: 0e 94 80 56 call 0xad00 ; 0xad00 */ case 0: case 1: { const char *src = strchr_pointer + 2; codenum = 0; 143d0: c1 2c mov r12, r1 143d2: d1 2c mov r13, r1 143d4: 76 01 movw r14, r12 if (code_seen('P')) codenum = code_value_long(); // milliseconds to wait 143d6: 88 23 and r24, r24 143d8: 21 f0 breq .+8 ; 0x143e2 143da: 0e 94 e8 56 call 0xadd0 ; 0xadd0 143de: 6b 01 movw r12, r22 143e0: 7c 01 movw r14, r24 if (code_seen('S')) codenum = code_value_long() * 1000; // seconds to wait 143e2: 83 e5 ldi r24, 0x53 ; 83 143e4: 0e 94 80 56 call 0xad00 ; 0xad00 143e8: 88 23 and r24, r24 143ea: 51 f0 breq .+20 ; 0x14400 143ec: 0e 94 e8 56 call 0xadd0 ; 0xadd0 143f0: 9b 01 movw r18, r22 143f2: ac 01 movw r20, r24 143f4: a8 ee ldi r26, 0xE8 ; 232 143f6: b3 e0 ldi r27, 0x03 ; 3 143f8: 0f 94 16 a5 call 0x34a2c ; 0x34a2c <__muluhisi3> 143fc: 6b 01 movw r12, r22 143fe: 7c 01 movw r14, r24 14400: c8 01 movw r24, r16 14402: 0f 5f subi r16, 0xFF ; 255 14404: 1f 4f sbci r17, 0xFF ; 255 bool expiration_time_set = bool(codenum); while (*src == ' ') ++src; 14406: dc 01 movw r26, r24 14408: 4c 91 ld r20, X 1440a: 40 32 cpi r20, 0x20 ; 32 1440c: c9 f3 breq .-14 ; 0x14400 custom_message_type = CustomMsg::M0Wait; 1440e: 26 e0 ldi r18, 0x06 ; 6 14410: 20 93 5d 06 sts 0x065D, r18 ; 0x80065d if (!expiration_time_set && *src != '\0') { 14414: c1 14 cp r12, r1 14416: d1 04 cpc r13, r1 14418: e1 04 cpc r14, r1 1441a: f1 04 cpc r15, r1 1441c: c9 f5 brne .+114 ; 0x14490 1441e: 2c 91 ld r18, X 14420: 22 23 and r18, r18 14422: b1 f1 breq .+108 ; 0x14490 lcd_setstatus(src); 14424: 0e 94 d0 dc call 0x1b9a0 ; 0x1b9a0 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(); 14428: 0f 94 94 18 call 0x23128 ; 0x23128 menu_set_block(MENU_BLOCK_STATUS_SCREEN_M0); 1442c: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 14430: 84 60 ori r24, 0x04 ; 4 14432: 80 93 3a 12 sts 0x123A, r24 ; 0x80123a previous_millis_cmd.start(); 14436: 88 e4 ldi r24, 0x48 ; 72 14438: 93 e0 ldi r25, 0x03 ; 3 1443a: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> if (expiration_time_set) { 1443e: c1 14 cp r12, r1 14440: d1 04 cpc r13, r1 14442: e1 04 cpc r14, r1 14444: f1 04 cpc r15, r1 14446: d9 f1 breq .+118 ; 0x144be codenum += _millis(); // keep track of when we started waiting 14448: 0f 94 89 0b call 0x21712 ; 0x21712 1444c: c6 0e add r12, r22 1444e: d7 1e adc r13, r23 14450: e8 1e adc r14, r24 14452: f9 1e adc r15, r25 KEEPALIVE_STATE(PAUSED_FOR_USER); 14454: 84 e0 ldi r24, 0x04 ; 4 14456: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(_millis() < codenum && !lcd_clicked()) { 1445a: 0f 94 89 0b call 0x21712 ; 0x21712 1445e: 6c 15 cp r22, r12 14460: 7d 05 cpc r23, r13 14462: 8e 05 cpc r24, r14 14464: 9f 05 cpc r25, r15 14466: 10 f1 brcs .+68 ; 0x144ac delay_keep_alive(0); } KEEPALIVE_STATE(IN_HANDLER); 14468: 82 e0 ldi r24, 0x02 ; 2 1446a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } else { marlin_wait_for_click(); } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); 1446e: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 14472: 8b 7f andi r24, 0xFB ; 251 14474: 80 93 3a 12 sts 0x123A, r24 ; 0x80123a if (IS_SD_PRINTING) 14478: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 1447c: 88 23 and r24, r24 1447e: 91 f1 breq .+100 ; 0x144e4 custom_message_type = CustomMsg::Status; 14480: 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; 14484: 10 92 41 0d sts 0x0D41, r1 ; 0x800d41 <_ZL17mcode_in_progress.lto_priv.486+0x1> 14488: 10 92 40 0d sts 0x0D40, r1 ; 0x800d40 <_ZL17mcode_in_progress.lto_priv.486> 1448c: 0c 94 9d 8e jmp 0x11d3a ; 0x11d3a 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){ 14490: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 14494: 81 11 cpse r24, r1 14496: 07 c0 rjmp .+14 ; 0x144a6 LCD_MESSAGERPGM(_T(MSG_USERWAIT)); 14498: 8f ec ldi r24, 0xCF ; 207 1449a: 99 e3 ldi r25, 0x39 ; 57 1449c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 144a0: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 144a4: c1 cf rjmp .-126 ; 0x14428 } else { custom_message_type = CustomMsg::Status; // let the lcd display the name of the printed G-code file in farm mode 144a6: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 144aa: be cf rjmp .-132 ; 0x14428 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()) { 144ac: 0e 94 c6 73 call 0xe78c ; 0xe78c 144b0: 81 11 cpse r24, r1 144b2: da cf rjmp .-76 ; 0x14468 delay_keep_alive(0); 144b4: 90 e0 ldi r25, 0x00 ; 0 144b6: 80 e0 ldi r24, 0x00 ; 0 144b8: 0e 94 07 8d call 0x11a0e ; 0x11a0e 144bc: ce cf rjmp .-100 ; 0x1445a //! @brief Wait for click //! //! Set void marlin_wait_for_click() { int8_t busy_state_backup = busy_state; 144be: 10 91 78 02 lds r17, 0x0278 ; 0x800278 KEEPALIVE_STATE(PAUSED_FOR_USER); 144c2: 84 e0 ldi r24, 0x04 ; 4 144c4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 144c8: 0e 94 c1 73 call 0xe782 ; 0xe782 while(!lcd_clicked()) 144cc: 0e 94 c6 73 call 0xe78c ; 0xe78c 144d0: 81 11 cpse r24, r1 144d2: 05 c0 rjmp .+10 ; 0x144de { delay_keep_alive(0); 144d4: 90 e0 ldi r25, 0x00 ; 0 144d6: 80 e0 ldi r24, 0x00 ; 0 144d8: 0e 94 07 8d call 0x11a0e ; 0x11a0e 144dc: f7 cf rjmp .-18 ; 0x144cc } KEEPALIVE_STATE(busy_state_backup); 144de: 10 93 78 02 sts 0x0278, r17 ; 0x800278 144e2: c5 cf rjmp .-118 ; 0x1446e } menu_unset_block(MENU_BLOCK_STATUS_SCREEN_M0); if (IS_SD_PRINTING) custom_message_type = CustomMsg::Status; else LCD_MESSAGERPGM(MSG_WELCOME); 144e4: 8a e8 ldi r24, 0x8A ; 138 144e6: 9c e6 ldi r25, 0x6C ; 108 144e8: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 144ec: cb cf rjmp .-106 ; 0x14484 /*! ### M17 - Enable all axes M17: Enable/Power all stepper motors */ case 17: LCD_MESSAGERPGM(_T(MSG_NO_MOVE)); 144ee: 84 ec ldi r24, 0xC4 ; 196 144f0: 99 e3 ldi r25, 0x39 ; 57 144f2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 144f6: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 enable_x(); 144fa: 17 98 cbi 0x02, 7 ; 2 enable_y(); 144fc: 16 98 cbi 0x02, 6 ; 2 enable_z(); 144fe: 15 98 cbi 0x02, 5 ; 2 enable_e0(); 14500: 14 98 cbi 0x02, 4 ; 2 14502: c0 cf rjmp .-128 ; 0x14484 /*! ### M21 - Init SD card M21: Initialize SD card */ case 21: card.mount(); 14504: 81 e0 ldi r24, 0x01 ; 1 14506: 0f 94 08 73 call 0x2e610 ; 0x2e610 1450a: bc cf rjmp .-136 ; 0x14484 presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 1450c: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 mounted = false; 14510: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 SERIAL_ECHO_START; 14514: 84 ee ldi r24, 0xE4 ; 228 14516: 92 ea ldi r25, 0xA2 ; 162 14518: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 1451c: 88 e4 ldi r24, 0x48 ; 72 1451e: 99 e6 ldi r25, 0x69 ; 105 14520: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 14524: af cf rjmp .-162 ; 0x14484 /*! ### M24 - Start SD print M24: Start/resume SD print */ case 24: if (printingIsPaused()) 14526: 0e 94 86 66 call 0xcd0c ; 0xcd0c 1452a: 88 23 and r24, r24 1452c: 19 f0 breq .+6 ; 0x14534 lcd_resume_print(); 1452e: 0e 94 a1 dc call 0x1b942 ; 0x1b942 14532: a8 cf rjmp .-176 ; 0x14484 else { if (!filament_presence_check()) { 14534: 0e 94 b1 e8 call 0x1d162 ; 0x1d162 14538: 88 23 and r24, r24 1453a: 09 f4 brne .+2 ; 0x1453e 1453c: a3 cf rjmp .-186 ; 0x14484 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); }; 1453e: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 14542: 88 23 and r24, r24 14544: 61 f0 breq .+24 ; 0x1455e // Print was aborted break; } if (!card.get_sdpos()) 14546: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 1454a: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 1454e: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 14552: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee 14556: 89 2b or r24, r25 14558: 8a 2b or r24, r26 1455a: 8b 2b or r24, r27 1455c: 69 f4 brne .+26 ; 0x14578 { // A new print has started from scratch, reset stats failstats_reset_print(); 1455e: 0e 94 f3 56 call 0xade6 ; 0xade6 sdpos_atomic = 0; 14562: 10 92 49 12 sts 0x1249, r1 ; 0x801249 14566: 10 92 4a 12 sts 0x124A, r1 ; 0x80124a 1456a: 10 92 4b 12 sts 0x124B, r1 ; 0x80124b 1456e: 10 92 4c 12 sts 0x124C, r1 ; 0x80124c 14572: 80 e0 ldi r24, 0x00 ; 0 14574: 0e 94 7d 84 call 0x108fa ; 0x108fa } void CardReader::startFileprint() { if(mounted) 14578: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1457c: 88 23 and r24, r24 1457e: 31 f0 breq .+12 ; 0x1458c { sdprinting = true; 14580: 81 e0 ldi r24, 0x01 ; 1 14582: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 14586: 85 e0 ldi r24, 0x05 ; 5 14588: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.384> la10c_reset(); #endif } card.startFileprint(); print_job_timer.start(); 1458c: 0f 94 be 16 call 0x22d7c ; 0x22d7c if (MMU2::mmu2.Enabled()) 14590: 80 91 01 13 lds r24, 0x1301 ; 0x801301 14594: 81 30 cpi r24, 0x01 ; 1 14596: 09 f0 breq .+2 ; 0x1459a 14598: 75 cf rjmp .-278 ; 0x14484 { if (MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) 1459a: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 1459e: 88 23 and r24, r24 145a0: 09 f4 brne .+2 ; 0x145a4 145a2: 70 cf rjmp .-288 ; 0x14484 145a4: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 145a8: 81 11 cpse r24, r1 145aa: 6c cf rjmp .-296 ; 0x14484 { // Filament only half way into the PTFE. Unload the filament. MMU2::mmu2.unload(); 145ac: 0f 94 12 9e call 0x33c24 ; 0x33c24 145b0: 69 cf rjmp .-302 ; 0x14484 #### Parameters - `S` - Index in bytes */ case 26: if(card.mounted && code_seen('S')) { 145b2: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 145b6: 88 23 and r24, r24 145b8: 09 f4 brne .+2 ; 0x145bc 145ba: 64 cf rjmp .-312 ; 0x14484 145bc: 83 e5 ldi r24, 0x53 ; 83 145be: 0e 94 80 56 call 0xad00 ; 0xad00 145c2: 88 23 and r24, r24 145c4: 09 f4 brne .+2 ; 0x145c8 145c6: 5e cf rjmp .-324 ; 0x14484 long index = code_value_long(); 145c8: 0e 94 e8 56 call 0xadd0 ; 0xadd0 145cc: 6b 01 movw r12, r22 145ce: 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);}; 145d0: c0 92 eb 16 sts 0x16EB, r12 ; 0x8016eb 145d4: d0 92 ec 16 sts 0x16EC, r13 ; 0x8016ec 145d8: e0 92 ed 16 sts 0x16ED, r14 ; 0x8016ed 145dc: f0 92 ee 16 sts 0x16EE, r15 ; 0x8016ee 145e0: 0f 94 b5 67 call 0x2cf6a ; 0x2cf6a 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; 145e4: c0 92 49 12 sts 0x1249, r12 ; 0x801249 145e8: d0 92 4a 12 sts 0x124A, r13 ; 0x80124a 145ec: e0 92 4b 12 sts 0x124B, r14 ; 0x80124b 145f0: f0 92 4c 12 sts 0x124C, r15 ; 0x80124c 145f4: 47 cf rjmp .-370 ; 0x14484 #### Parameters - `P` - Show full SFN path instead of LFN only. */ case 27: card.getStatus(code_seen('P')); 145f6: 80 e5 ldi r24, 0x50 ; 80 145f8: 0e 94 80 56 call 0xad00 ; 0xad00 145fc: 18 2f mov r17, r24 return filesize; } void CardReader::getStatus(bool arg_P) { if (printingIsPaused()) 145fe: 0e 94 86 66 call 0xcd0c ; 0xcd0c 14602: 88 23 and r24, r24 14604: 91 f0 breq .+36 ; 0x1462a { if (saved_printing && (saved_printing_type == PowerPanic::PRINT_TYPE_SD)) 14606: 80 91 73 12 lds r24, 0x1273 ; 0x801273 1460a: 88 23 and r24, r24 1460c: 49 f0 breq .+18 ; 0x14620 1460e: 80 91 79 02 lds r24, 0x0279 ; 0x800279 14612: 81 11 cpse r24, r1 14614: 05 c0 rjmp .+10 ; 0x14620 SERIAL_PROTOCOLLNPGM("SD print paused"); 14616: 85 ed ldi r24, 0xD5 ; 213 14618: 9e e7 ldi r25, 0x7E ; 126 1461a: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 1461e: 32 cf rjmp .-412 ; 0x14484 else SERIAL_PROTOCOLLNPGM("Print saved"); 14620: 89 ec ldi r24, 0xC9 ; 201 14622: 9e e7 ldi r25, 0x7E ; 126 14624: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 14628: 2d cf rjmp .-422 ; 0x14484 } else if (sdprinting) 1462a: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 1462e: 88 23 and r24, r24 14630: 09 f4 brne .+2 ; 0x14634 14632: 4a c0 rjmp .+148 ; 0x146c8 { if (arg_P) 14634: 11 23 and r17, r17 14636: e1 f1 breq .+120 ; 0x146b0 { printAbsFilenameFast(); 14638: 0f 94 3a 6c call 0x2d874 ; 0x2d874 SERIAL_PROTOCOLLN(); 1463c: 0e 94 0d 7b call 0xf61a ; 0xf61a } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); SERIAL_PROTOCOLRPGM(_N("SD printing byte "));////MSG_SD_PRINTING_BYTE 14640: 82 eb ldi r24, 0xB2 ; 178 14642: 95 e6 ldi r25, 0x65 ; 101 14644: 0e 94 15 7b call 0xf62a ; 0xf62a 14648: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 1464c: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 14650: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 14654: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 14658: 4a e0 ldi r20, 0x0A ; 10 1465a: 0e 94 16 7a call 0xf42c ; 0xf42c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 1465e: 8f e2 ldi r24, 0x2F ; 47 14660: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 14664: 60 91 e4 16 lds r22, 0x16E4 ; 0x8016e4 14668: 70 91 e5 16 lds r23, 0x16E5 ; 0x8016e5 1466c: 80 91 e6 16 lds r24, 0x16E6 ; 0x8016e6 14670: 90 91 e7 16 lds r25, 0x16E7 ; 0x8016e7 14674: 4a e0 ldi r20, 0x0A ; 10 14676: 0e 94 16 7a call 0xf42c ; 0xf42c } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 1467a: 0e 94 0d 7b call 0xf61a ; 0xf61a SERIAL_PROTOCOL(sdpos); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(filesize); uint16_t time = print_job_timer.duration() / 60; 1467e: 0f 94 06 15 call 0x22a0c ; 0x22a0c 14682: 2c e3 ldi r18, 0x3C ; 60 14684: 30 e0 ldi r19, 0x00 ; 0 14686: 40 e0 ldi r20, 0x00 ; 0 14688: 50 e0 ldi r21, 0x00 ; 0 1468a: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> SERIAL_PROTOCOL((int)(time / 60)); 1468e: c9 01 movw r24, r18 14690: 6c e3 ldi r22, 0x3C ; 60 14692: 70 e0 ldi r23, 0x00 ; 0 14694: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> 14698: 8c 01 movw r16, r24 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1469a: 90 e0 ldi r25, 0x00 ; 0 1469c: 80 e0 ldi r24, 0x00 ; 0 1469e: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 146a2: 8a e3 ldi r24, 0x3A ; 58 146a4: 0e 94 02 7a call 0xf404 ; 0xf404 SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); 146a8: c8 01 movw r24, r16 146aa: 0f 94 5d 65 call 0x2caba ; 0x2caba 146ae: ea ce rjmp .-556 ; 0x14484 { printAbsFilenameFast(); SERIAL_PROTOCOLLN(); } else SERIAL_PROTOCOLLN(LONGEST_FILENAME); 146b0: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 146b4: 88 23 and r24, r24 146b6: 29 f0 breq .+10 ; 0x146c2 146b8: 8e ee ldi r24, 0xEE ; 238 146ba: 93 e1 ldi r25, 0x13 ; 19 146bc: 0e 94 1a 86 call 0x10c34 ; 0x10c34 146c0: bf cf rjmp .-130 ; 0x14640 146c2: 89 ed ldi r24, 0xD9 ; 217 146c4: 93 e1 ldi r25, 0x13 ; 19 146c6: fa cf rjmp .-12 ; 0x146bc SERIAL_PROTOCOL((int)(time / 60)); SERIAL_PROTOCOL(':'); SERIAL_PROTOCOLLN((int)(time % 60)); } else SERIAL_PROTOCOLLNPGM("Not SD printing"); 146c8: 89 eb ldi r24, 0xB9 ; 185 146ca: 9e e7 ldi r25, 0x7E ; 126 146cc: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 146d0: d9 ce rjmp .-590 ; 0x14484 /*! ### M28 - Start SD write M28: Begin write to SD card */ case 28: card.openFileWrite(strchr_pointer+4); 146d2: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 146d6: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 146da: 04 96 adiw r24, 0x04 ; 4 146dc: 0f 94 ad 77 call 0x2ef5a ; 0x2ef5a 146e0: d1 ce rjmp .-606 ; 0x14484 * 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; 146e2: ce 01 movw r24, r28 146e4: 01 96 adiw r24, 0x01 ; 1 146e6: 0f 94 96 68 call 0x2d12c ; 0x2d12c 146ea: 88 23 and r24, r24 146ec: 09 f4 brne .+2 ; 0x146f0 146ee: 33 c9 rjmp .-3482 ; 0x13956 // cache directory entry d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 146f0: 61 e0 ldi r22, 0x01 ; 1 146f2: ce 01 movw r24, r28 146f4: 01 96 adiw r24, 0x01 ; 1 146f6: 0f 94 26 2c call 0x2584c ; 0x2584c if (!d) goto fail; 146fa: 00 97 sbiw r24, 0x00 ; 0 146fc: 09 f4 brne .+2 ; 0x14700 146fe: 2b c9 rjmp .-3498 ; 0x13956 // mark entry deleted d->name[0] = DIR_NAME_DELETED; 14700: 25 ee ldi r18, 0xE5 ; 229 14702: fc 01 movw r30, r24 14704: 20 83 st Z, r18 // set this file closed type_ = FAT_FILE_TYPE_CLOSED; 14706: 1c 82 std Y+4, r1 ; 0x04 // write entry to SD return vol_->cacheFlush(); 14708: 0f 94 1a 27 call 0x24e34 ; 0x24e34 1470c: 18 2f mov r17, r24 1470e: 24 c9 rjmp .-3512 ; 0x13958 presort(); #endif } else { SERIAL_PROTOCOLPGM("Deletion failed, File: "); 14710: 83 e9 ldi r24, 0x93 ; 147 14712: 9e e7 ldi r25, 0x7E ; 126 14714: 0e 94 15 7b call 0xf62a ; 0xf62a 14718: 8c a1 ldd r24, Y+36 ; 0x24 1471a: 9d a1 ldd r25, Y+37 ; 0x25 1471c: 0e 94 0e 86 call 0x10c1c ; 0x10c1c 14720: 8e e2 ldi r24, 0x2E ; 46 14722: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 14726: 0e 94 0d 7b call 0xf61a ; 0xf61a 1472a: ac ce rjmp .-680 ; 0x14484 - `S` - Starting file offset */ case 32: { if(card.sdprinting) { 1472c: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 14730: 81 11 cpse r24, r1 st_synchronize(); 14732: 0f 94 94 18 call 0x23128 ; 0x23128 } const char* namestartpos = (strchr(strchr_pointer + 4,'!')); //find ! to indicate filename string start. 14736: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 1473a: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 1473e: 0c 5f subi r16, 0xFC ; 252 14740: 1f 4f sbci r17, 0xFF ; 255 14742: 61 e2 ldi r22, 0x21 ; 33 14744: 70 e0 ldi r23, 0x00 ; 0 14746: c8 01 movw r24, r16 14748: 0f 94 d8 aa call 0x355b0 ; 0x355b0 if(namestartpos==NULL) 1474c: 00 97 sbiw r24, 0x00 ; 0 1474e: 19 f0 breq .+6 ; 0x14756 { namestartpos=strchr_pointer + 4; //default name position, 4 letters after the M } else namestartpos++; //to skip the '!' 14750: 8c 01 movw r16, r24 14752: 0f 5f subi r16, 0xFF ; 255 14754: 1f 4f sbci r17, 0xFF ; 255 bool call_procedure=(code_seen('P')); 14756: 80 e5 ldi r24, 0x50 ; 80 14758: 0e 94 80 56 call 0xad00 ; 0xad00 1475c: f8 2e mov r15, r24 if(strchr_pointer>namestartpos) 1475e: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 14762: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 14766: 08 17 cp r16, r24 14768: 19 07 cpc r17, r25 1476a: 08 f4 brcc .+2 ; 0x1476e call_procedure=false; //false alert, 'P' found within filename 1476c: f1 2c mov r15, r1 if( card.mounted ) 1476e: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 14772: 88 23 and r24, r24 14774: 09 f4 brne .+2 ; 0x14778 14776: 86 ce rjmp .-756 ; 0x14484 { card.openFileReadFilteredGcode(namestartpos,!call_procedure); 14778: 61 e0 ldi r22, 0x01 ; 1 1477a: 6f 25 eor r22, r15 1477c: c8 01 movw r24, r16 1477e: 0f 94 91 71 call 0x2e322 ; 0x2e322 if(code_seen('S')) 14782: 83 e5 ldi r24, 0x53 ; 83 14784: 0e 94 80 56 call 0xad00 ; 0xad00 14788: 88 23 and r24, r24 1478a: 99 f0 breq .+38 ; 0x147b2 if(strchr_pointer 14790: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 14794: 80 17 cp r24, r16 14796: 91 07 cpc r25, r17 14798: 60 f4 brcc .+24 ; 0x147b2 card.setIndex(code_value_long()); 1479a: 0e 94 e8 56 call 0xadd0 ; 0xadd0 1479e: 60 93 eb 16 sts 0x16EB, r22 ; 0x8016eb 147a2: 70 93 ec 16 sts 0x16EC, r23 ; 0x8016ec 147a6: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed 147aa: 90 93 ee 16 sts 0x16EE, r25 ; 0x8016ee 147ae: 0f 94 b5 67 call 0x2cf6a ; 0x2cf6a SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 147b2: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 147b6: 88 23 and r24, r24 147b8: 31 f0 breq .+12 ; 0x147c6 { sdprinting = true; 147ba: 81 e0 ldi r24, 0x01 ; 1 147bc: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 147c0: 85 e0 ldi r24, 0x05 ; 5 147c2: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.384> card.startFileprint(); if(!call_procedure) 147c6: f1 10 cpse r15, r1 147c8: 5d ce rjmp .-838 ; 0x14484 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); }; 147ca: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 147ce: 88 23 and r24, r24 147d0: 61 f0 breq .+24 ; 0x147ea { if(!card.get_sdpos()) 147d2: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 147d6: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 147da: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 147de: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee 147e2: 89 2b or r24, r25 147e4: 8a 2b or r24, r26 147e6: 8b 2b or r24, r27 147e8: 69 f4 brne .+26 ; 0x14804 { // A new print has started from scratch, reset stats failstats_reset_print(); 147ea: 0e 94 f3 56 call 0xade6 ; 0xade6 sdpos_atomic = 0; 147ee: 10 92 49 12 sts 0x1249, r1 ; 0x801249 147f2: 10 92 4a 12 sts 0x124A, r1 ; 0x80124a 147f6: 10 92 4b 12 sts 0x124B, r1 ; 0x80124b 147fa: 10 92 4c 12 sts 0x124C, r1 ; 0x80124c 147fe: 80 e0 ldi r24, 0x00 ; 0 14800: 0e 94 7d 84 call 0x108fa ; 0x108fa #ifndef LA_NOCOMPAT la10c_reset(); #endif } print_job_timer.start(); // procedure calls count as normal print time. 14804: 0f 94 be 16 call 0x22d7c ; 0x22d7c 14808: 3d ce rjmp .-902 ; 0x14484 M928 [filename] */ case 928: card.openLogFile(strchr_pointer+5); 1480a: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 1480e: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc } } void CardReader::openLogFile(const char* name) { logging = true; 14812: 21 e0 ldi r18, 0x01 ; 1 14814: 20 93 d6 13 sts 0x13D6, r18 ; 0x8013d6 openFileWrite(name); 14818: 05 96 adiw r24, 0x05 ; 5 1481a: 0f 94 ad 77 call 0x2ef5a ; 0x2ef5a 1481e: 32 ce rjmp .-924 ; 0x14484 ### 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(); 14820: 0f 94 06 15 call 0x22a0c ; 0x22a0c int16_t sec, min; min = t / 60; sec = t % 60; 14824: 2c e3 ldi r18, 0x3C ; 60 14826: 30 e0 ldi r19, 0x00 ; 0 14828: 40 e0 ldi r20, 0x00 ; 0 1482a: 50 e0 ldi r21, 0x00 ; 0 1482c: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> sprintf_P(time, PSTR("%i min, %i sec"), min, sec); 14830: 7f 93 push r23 14832: 6f 93 push r22 14834: 3f 93 push r19 14836: 2f 93 push r18 14838: 87 e2 ldi r24, 0x27 ; 39 1483a: 91 e8 ldi r25, 0x81 ; 129 1483c: 9f 93 push r25 1483e: 8f 93 push r24 14840: 8e 01 movw r16, r28 14842: 0f 5f subi r16, 0xFF ; 255 14844: 1f 4f sbci r17, 0xFF ; 255 14846: 1f 93 push r17 14848: 0f 93 push r16 1484a: 0f 94 98 a3 call 0x34730 ; 0x34730 SERIAL_ECHO_START; 1484e: 84 ee ldi r24, 0xE4 ; 228 14850: 92 ea ldi r25, 0xA2 ; 162 14852: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN(time); 14856: c8 01 movw r24, r16 14858: 0e 94 1a 86 call 0x10c34 ; 0x10c34 lcd_setstatus(time); 1485c: c8 01 movw r24, r16 1485e: 0e 94 d0 dc call 0x1b9a0 ; 0x1b9a0 autotempShutdown(); 14862: 0f b6 in r0, 0x3f ; 63 14864: f8 94 cli 14866: de bf out 0x3e, r29 ; 62 14868: 0f be out 0x3f, r0 ; 63 1486a: cd bf out 0x3d, r28 ; 61 1486c: 0b ce rjmp .-1002 ; 0x14484 } #if defined(FAN_PIN) && FAN_PIN > -1 if (pin_number == FAN_PIN) fanSpeed = pin_status; #endif if (pin_number > -1) 1486e: 17 fd sbrc r17, 7 14870: 09 ce rjmp .-1006 ; 0x14484 14872: b5 c8 rjmp .-3734 ; 0x139de ### 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); 14874: 80 e1 ldi r24, 0x10 ; 16 14876: 0e 94 e1 d4 call 0x1a9c2 ; 0x1a9c2 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 1487a: 81 ea ldi r24, 0xA1 ; 161 1487c: 9d e0 ldi r25, 0x0D ; 13 1487e: 0f 94 81 a4 call 0x34902 ; 0x34902 14882: 4b e0 ldi r20, 0x0B ; 11 14884: 84 9f mul r24, r20 14886: c0 01 movw r24, r0 14888: 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); 1488a: 70 e0 ldi r23, 0x00 ; 0 1488c: 60 e0 ldi r22, 0x00 ; 0 1488e: 80 5b subi r24, 0xB0 ; 176 14890: 92 4f sbci r25, 0xF2 ; 242 14892: 0f 94 c3 a4 call 0x34986 ; 0x34986 // Reset the skew and offset in both RAM and EEPROM. calibration_status_clear(CALIBRATION_STATUS_XYZ); 14896: 82 e0 ldi r24, 0x02 ; 2 14898: 0e 94 e1 d4 call 0x1a9c2 ; 0x1a9c2 reset_bed_offset_and_skew(); 1489c: 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(); 148a0: 0e 94 7e 62 call 0xc4fc ; 0xc4fc 148a4: ef cd rjmp .-1058 ; 0x14484 */ case 45: // M45: Prusa3D: bed skew and offset with manual Z up { int8_t verbosity_level = 0; bool only_Z = code_seen('Z'); 148a6: 8a e5 ldi r24, 0x5A ; 90 148a8: 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); 148ac: 0f 94 bf 7d call 0x2fb7e ; 0x2fb7e 148b0: e9 cd rjmp .-1070 ; 0x14484 SERIAL_PROTOCOL('.'); SERIAL_PROTOCOL(uint8_t(ip[2])); SERIAL_PROTOCOL('.'); SERIAL_PROTOCOLLN(uint8_t(ip[3])); } else { SERIAL_PROTOCOLPGM("?Toshiba FlashAir GetIP failed\n"); 148b2: 8b ee ldi r24, 0xEB ; 235 148b4: 90 e8 ldi r25, 0x80 ; 128 148b6: 0e 94 15 7b call 0xf62a ; 0xf62a 148ba: e4 cd rjmp .-1080 ; 0x14484 } } else { SERIAL_PROTOCOLLNPGM("n/a"); 148bc: 87 ee ldi r24, 0xE7 ; 231 148be: 90 e8 ldi r25, 0x80 ; 128 148c0: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 148c4: df cd rjmp .-1090 ; 0x14484 /*! ### 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); 148c6: 84 e0 ldi r24, 0x04 ; 4 148c8: 80 93 78 02 sts 0x0278, r24 ; 0x800278 menu_back_if_clicked(); } void lcd_diag_show_end_stops() { lcd_clear(); 148cc: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_consume_click(); 148d0: 0e 94 c1 73 call 0xe782 ; 0xe782 for (;;) { manage_heater(); 148d4: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 148d8: 81 e0 ldi r24, 0x01 ; 1 148da: 0e 94 ad 8a call 0x1155a ; 0x1155a lcd_show_end_stops(); 148de: 0e 94 2e dd call 0x1ba5c ; 0x1ba5c if (lcd_clicked()) { 148e2: 0e 94 c6 73 call 0xe78c ; 0xe78c 148e6: 88 23 and r24, r24 148e8: a9 f3 breq .-22 ; 0x148d4 break; } } lcd_clear(); 148ea: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_return_to_status(); 148ee: 0f 94 6e 05 call 0x20adc ; 0x20adc 148f2: c8 cd rjmp .-1136 ; 0x14484 148f4: 10 92 61 0d sts 0x0D61, r1 ; 0x800d61 <_ZL13printer_state.lto_priv.384> 148f8: c5 cd rjmp .-1142 ; 0x14484 break; default: break; } } else { printf_P(_N("PrinterState: %d\n"),uint8_t(GetPrinterState())); 148fa: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.384> 148fe: 1f 92 push r1 14900: 8f 93 push r24 14902: 84 ed ldi r24, 0xD4 ; 212 14904: 96 e6 ldi r25, 0x66 ; 102 14906: 9f 93 push r25 14908: 8f 93 push r24 1490a: 0f 94 43 a3 call 0x34686 ; 0x34686 1490e: 0f 90 pop r0 14910: 0f 90 pop r0 14912: 0f 90 pop r0 14914: 0f 90 pop r0 14916: b6 cd rjmp .-1172 ; 0x14484 - `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(); 14918: 80 e5 ldi r24, 0x50 ; 80 1491a: 0e 94 80 56 call 0xad00 ; 0xad00 1491e: 88 23 and r24, r24 14920: 21 f0 breq .+8 ; 0x1492a 14922: 0e 94 95 56 call 0xad2a ; 0xad2a 14926: 80 93 6f 02 sts 0x026F, r24 ; 0x80026f if(code_seen('R')) print_time_remaining_normal = code_value(); 1492a: 82 e5 ldi r24, 0x52 ; 82 1492c: 0e 94 80 56 call 0xad00 ; 0xad00 14930: 88 23 and r24, r24 14932: 41 f0 breq .+16 ; 0x14944 14934: 0e 94 10 5b call 0xb620 ; 0xb620 14938: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 1493c: 70 93 73 02 sts 0x0273, r23 ; 0x800273 14940: 60 93 72 02 sts 0x0272, r22 ; 0x800272 if(code_seen('Q')) print_percent_done_silent = code_value_uint8(); 14944: 81 e5 ldi r24, 0x51 ; 81 14946: 0e 94 80 56 call 0xad00 ; 0xad00 1494a: 88 23 and r24, r24 1494c: 21 f0 breq .+8 ; 0x14956 1494e: 0e 94 95 56 call 0xad2a ; 0xad2a 14952: 80 93 3f 02 sts 0x023F, r24 ; 0x80023f if(code_seen('S')) print_time_remaining_silent = code_value(); 14956: 83 e5 ldi r24, 0x53 ; 83 14958: 0e 94 80 56 call 0xad00 ; 0xad00 1495c: 88 23 and r24, r24 1495e: 41 f0 breq .+16 ; 0x14970 14960: 0e 94 10 5b call 0xb620 ; 0xb620 14964: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 14968: 70 93 3e 02 sts 0x023E, r23 ; 0x80023e 1496c: 60 93 3d 02 sts 0x023D, r22 ; 0x80023d if(code_seen('C')){ 14970: 83 e4 ldi r24, 0x43 ; 67 14972: 0e 94 80 56 call 0xad00 ; 0xad00 14976: 88 23 and r24, r24 14978: a9 f0 breq .+42 ; 0x149a4 float print_time_to_change_normal_f = code_value(); 1497a: 0e 94 10 5b call 0xb620 ; 0xb620 1497e: 6b 01 movw r12, r22 14980: 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; 14982: 20 e0 ldi r18, 0x00 ; 0 14984: 30 e0 ldi r19, 0x00 ; 0 14986: a9 01 movw r20, r18 14988: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1498c: 6f ef ldi r22, 0xFF ; 255 1498e: 7f ef ldi r23, 0xFF ; 255 14990: 18 16 cp r1, r24 14992: 24 f4 brge .+8 ; 0x1499c 14994: c7 01 movw r24, r14 14996: b6 01 movw r22, r12 14998: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 1499c: 70 93 71 02 sts 0x0271, r23 ; 0x800271 149a0: 60 93 70 02 sts 0x0270, r22 ; 0x800270 } if(code_seen('D')){ 149a4: 84 e4 ldi r24, 0x44 ; 68 149a6: 0e 94 80 56 call 0xad00 ; 0xad00 149aa: 88 23 and r24, r24 149ac: a9 f0 breq .+42 ; 0x149d8 float print_time_to_change_silent_f = code_value(); 149ae: 0e 94 10 5b call 0xb620 ; 0xb620 149b2: 6b 01 movw r12, r22 149b4: 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; 149b6: 20 e0 ldi r18, 0x00 ; 0 149b8: 30 e0 ldi r19, 0x00 ; 0 149ba: a9 01 movw r20, r18 149bc: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 149c0: 6f ef ldi r22, 0xFF ; 255 149c2: 7f ef ldi r23, 0xFF ; 255 149c4: 18 16 cp r1, r24 149c6: 24 f4 brge .+8 ; 0x149d0 149c8: c7 01 movw r24, r14 149ca: b6 01 movw r22, r12 149cc: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 149d0: 70 93 3c 02 sts 0x023C, r23 ; 0x80023c 149d4: 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); 149d8: 80 91 71 02 lds r24, 0x0271 ; 0x800271 149dc: 8f 93 push r24 149de: 80 91 70 02 lds r24, 0x0270 ; 0x800270 149e2: 8f 93 push r24 149e4: 80 91 73 02 lds r24, 0x0273 ; 0x800273 149e8: 8f 93 push r24 149ea: 80 91 72 02 lds r24, 0x0272 ; 0x800272 149ee: 8f 93 push r24 149f0: 80 91 6f 02 lds r24, 0x026F ; 0x80026f 149f4: 28 2f mov r18, r24 149f6: 08 2e mov r0, r24 149f8: 00 0c add r0, r0 149fa: 33 0b sbc r19, r19 149fc: 3f 93 push r19 149fe: 8f 93 push r24 14a00: 8a e7 ldi r24, 0x7A ; 122 14a02: 96 e6 ldi r25, 0x66 ; 102 14a04: 9f 93 push r25 14a06: 8f 93 push r24 14a08: 01 e8 ldi r16, 0x81 ; 129 14a0a: 16 e6 ldi r17, 0x66 ; 102 14a0c: 1f 93 push r17 14a0e: 0f 93 push r16 14a10: 0f 94 43 a3 call 0x34686 ; 0x34686 printf_P(_msg_mode_done_remain, _N("SILENT"), int8_t(print_percent_done_silent), print_time_remaining_silent, print_time_to_change_silent); 14a14: 80 91 3c 02 lds r24, 0x023C ; 0x80023c 14a18: 8f 93 push r24 14a1a: 80 91 3b 02 lds r24, 0x023B ; 0x80023b 14a1e: 8f 93 push r24 14a20: 80 91 3e 02 lds r24, 0x023E ; 0x80023e 14a24: 8f 93 push r24 14a26: 80 91 3d 02 lds r24, 0x023D ; 0x80023d 14a2a: 8f 93 push r24 14a2c: 80 91 3f 02 lds r24, 0x023F ; 0x80023f 14a30: 28 2f mov r18, r24 14a32: 08 2e mov r0, r24 14a34: 00 0c add r0, r0 14a36: 33 0b sbc r19, r19 14a38: 3f 93 push r19 14a3a: 8f 93 push r24 14a3c: 83 e7 ldi r24, 0x73 ; 115 14a3e: 96 e6 ldi r25, 0x66 ; 102 14a40: 9f 93 push r25 14a42: 8f 93 push r24 14a44: 1f 93 push r17 14a46: 0f 93 push r16 14a48: 0f 94 43 a3 call 0x34686 ; 0x34686 14a4c: 0f b6 in r0, 0x3f ; 63 14a4e: f8 94 cli 14a50: de bf out 0x3e, r29 ; 62 14a52: 0f be out 0x3f, r0 ; 63 14a54: cd bf out 0x3d, r28 ; 61 14a56: 16 cd rjmp .-1492 ; 0x14484 /*! ### M75 - Start the print job timer M75: Start the print job timer */ case 75: { if (!filament_presence_check()) { 14a58: 0e 94 b1 e8 call 0x1d162 ; 0x1d162 14a5c: 88 23 and r24, r24 14a5e: 09 f4 brne .+2 ; 0x14a62 14a60: 11 cd rjmp .-1502 ; 0x14484 14a62: d0 ce rjmp .-608 ; 0x14804 } else return false; } bool Stopwatch::pause() { if (isRunning()) { 14a64: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 14a68: 81 30 cpi r24, 0x01 ; 1 14a6a: 09 f0 breq .+2 ; 0x14a6e 14a6c: 0b cd rjmp .-1514 ; 0x14484 state = PAUSED; 14a6e: 82 e0 ldi r24, 0x02 ; 2 14a70: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b stopTimestamp = _millis(); 14a74: 0f 94 89 0b call 0x21712 ; 0x21712 14a78: 60 93 0b 06 sts 0x060B, r22 ; 0x80060b 14a7c: 70 93 0c 06 sts 0x060C, r23 ; 0x80060c 14a80: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d 14a84: 90 93 0e 06 sts 0x060E, r25 ; 0x80060e 14a88: fd cc rjmp .-1542 ; 0x14484 /*! ### M77 - Stop the print job timer M77: Stop the print job timer */ case 77: { print_job_timer.stop(); 14a8a: 0f 94 e2 16 call 0x22dc4 ; 0x22dc4 save_statistics(); 14a8e: 0e 94 01 65 call 0xca02 ; 0xca02 14a92: f8 cc rjmp .-1552 ; 0x14484 void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); } void M79_timer_restart() { M79_timer.start(); 14a94: 8c e8 ldi r24, 0x8C ; 140 14a96: 93 e0 ldi r25, 0x03 ; 3 14a98: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> - `S` - Quoted string containing two characters e.g. "PL" */ case 79: M79_timer_restart(); if (code_seen('S')) 14a9c: 83 e5 ldi r24, 0x53 ; 83 14a9e: 0e 94 80 56 call 0xad00 ; 0xad00 14aa2: 88 23 and r24, r24 14aa4: 09 f1 breq .+66 ; 0x14ae8 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 14aa6: 62 e2 ldi r22, 0x22 ; 34 14aa8: 70 e0 ldi r23, 0x00 ; 0 14aaa: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 14aae: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 14ab2: 0f 94 d8 aa call 0x355b0 ; 0x355b0 14ab6: 8c 01 movw r16, r24 if (!this->ptr) { 14ab8: 89 2b or r24, r25 14aba: b1 f0 breq .+44 ; 0x14ae8 // First quote not found return; } // Skip the leading quote this->ptr++; 14abc: 0f 5f subi r16, 0xFF ; 255 14abe: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 14ac0: 62 e2 ldi r22, 0x22 ; 34 14ac2: 70 e0 ldi r23, 0x00 ; 0 14ac4: c8 01 movw r24, r16 14ac6: 0f 94 d8 aa call 0x355b0 ; 0x355b0 if(!pStrEnd) { 14aca: 89 2b or r24, r25 14acc: 69 f0 breq .+26 ; 0x14ae8 char * GetHostStatusScreenName() { return host_status_screen_name; } void ResetHostStatusScreenName() { memset(host_status_screen_name, 0, sizeof(host_status_screen_name)); 14ace: e5 e0 ldi r30, 0x05 ; 5 14ad0: f6 e0 ldi r31, 0x06 ; 6 14ad2: 83 e0 ldi r24, 0x03 ; 3 14ad4: df 01 movw r26, r30 14ad6: 1d 92 st X+, r1 14ad8: 8a 95 dec r24 14ada: e9 f7 brne .-6 ; 0x14ad6 static LongTimer M79_timer; static char host_status_screen_name[3]; void SetHostStatusScreenName(const char * name) { strncpy(host_status_screen_name, name, 2); 14adc: 42 e0 ldi r20, 0x02 ; 2 14ade: 50 e0 ldi r21, 0x00 ; 0 14ae0: b8 01 movw r22, r16 14ae2: cf 01 movw r24, r30 14ae4: 0f 94 01 ab call 0x35602 ; 0x35602 } #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 14ae8: 8c e8 ldi r24, 0x8C ; 140 14aea: 9f e0 ldi r25, 0x0F ; 15 14aec: 0f 94 81 a4 call 0x34902 ; 0x34902 && printer_recovering() && printingIsPaused()) { 14af0: 81 30 cpi r24, 0x01 ; 1 14af2: 09 f0 breq .+2 ; 0x14af6 14af4: c7 cc rjmp .-1650 ; 0x14484 #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() 14af6: 0e 94 7c 66 call 0xccf8 ; 0xccf8 14afa: 88 23 and r24, r24 14afc: 09 f4 brne .+2 ; 0x14b00 14afe: c2 cc rjmp .-1660 ; 0x14484 && printingIsPaused()) { 14b00: 0e 94 86 66 call 0xcd0c ; 0xcd0c 14b04: 88 23 and r24, r24 14b06: 09 f4 brne .+2 ; 0x14b0a 14b08: bd cc rjmp .-1670 ; 0x14484 // 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); 14b0a: 86 e5 ldi r24, 0x56 ; 86 14b0c: 96 e6 ldi r25, 0x66 ; 102 14b0e: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 14b12: b8 cc rjmp .-1680 ; 0x14484 /*! ### M112 - Emergency stop M112: Full (Emergency) Stop It is processed much earlier as to bypass the cmdqueue. */ case 112: kill(MSG_M112_KILL); 14b14: 89 e3 ldi r24, 0x39 ; 57 14b16: 96 e6 ldi r25, 0x66 ; 102 14b18: 0e 94 74 83 call 0x106e8 ; 0x106e8 #### Parameters - `S` - Target temperature */ case 140: if (code_seen('S')) setTargetBed(code_value()); 14b1c: 83 e5 ldi r24, 0x53 ; 83 14b1e: 0e 94 80 56 call 0xad00 ; 0xad00 14b22: 88 23 and r24, r24 14b24: 09 f4 brne .+2 ; 0x14b28 14b26: ae cc rjmp .-1700 ; 0x14484 14b28: 0e 94 10 5b call 0xb620 ; 0xb620 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 14b2c: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 14b30: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 14b34: 60 93 59 12 sts 0x1259, r22 ; 0x801259 14b38: a5 cc rjmp .-1718 ; 0x14484 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 "); 14b3a: 81 ed ldi r24, 0xD1 ; 209 14b3c: 90 e8 ldi r25, 0x80 ; 128 14b3e: 0e 94 15 7b call 0xf62a ; 0xf62a gcode_M105(); 14b42: 0e 94 87 7c call 0xf90e ; 0xf90e cmdqueue_pop_front(); //prevent an ok after the command since this command uses an ok at the beginning. 14b46: 0e 94 94 79 call 0xf328 ; 0xf328 cmdbuffer_front_already_processed = true; 14b4a: 81 e0 ldi r24, 0x01 ; 1 14b4c: 80 93 53 12 sts 0x1253, r24 ; 0x801253 14b50: 99 cc rjmp .-1742 ; 0x14484 bit 6 = free bit 7 = free */ case 155: { if (code_seen('S')){ 14b52: 83 e5 ldi r24, 0x53 ; 83 14b54: 0e 94 80 56 call 0xad00 ; 0xad00 14b58: 88 23 and r24, r24 14b5a: 51 f0 breq .+20 ; 0x14b70 autoReportFeatures.SetPeriod( code_value_uint8() ); 14b5c: 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; 14b60: 80 93 cf 13 sts 0x13CF, r24 ; 0x8013cf if (auto_report_period != 0){ 14b64: 88 23 and r24, r24 14b66: 71 f0 breq .+28 ; 0x14b84 auto_report_timer.start(); 14b68: 80 ed ldi r24, 0xD0 ; 208 14b6a: 93 e1 ldi r25, 0x13 ; 19 14b6c: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> case 155: { if (code_seen('S')){ autoReportFeatures.SetPeriod( code_value_uint8() ); } if (code_seen('C')){ 14b70: 83 e4 ldi r24, 0x43 ; 67 14b72: 0e 94 80 56 call 0xad00 ; 0xad00 14b76: 88 23 and r24, r24 14b78: 41 f0 breq .+16 ; 0x14b8a autoReportFeatures.SetMask(code_value_uint8()); 14b7a: 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; } 14b7e: 80 93 ce 13 sts 0x13CE, r24 ; 0x8013ce 14b82: 80 cc rjmp .-1792 ; 0x14484 14b84: 10 92 d0 13 sts 0x13D0, r1 ; 0x8013d0 14b88: f3 cf rjmp .-26 ; 0x14b70 14b8a: 81 e0 ldi r24, 0x01 ; 1 14b8c: 80 93 ce 13 sts 0x13CE, r24 ; 0x8013ce 14b90: 79 cc rjmp .-1806 ; 0x14484 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)); 14b92: 87 e3 ldi r24, 0x37 ; 55 14b94: 97 e5 ldi r25, 0x57 ; 87 14b96: 0e 94 8b 75 call 0xeb16 ; 0xeb16 14b9a: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 heating_status = HeatingStatus::EXTRUDER_HEATING; 14b9e: 81 e0 ldi r24, 0x01 ; 1 14ba0: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb prusa_statistics(1); 14ba4: 0f 94 05 30 call 0x2600a ; 0x2600a #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { 14ba8: 83 e5 ldi r24, 0x53 ; 83 14baa: 0e 94 80 56 call 0xad00 ; 0xad00 14bae: 88 23 and r24, r24 14bb0: 49 f0 breq .+18 ; 0x14bc4 setTargetHotend(code_value()); } else if (code_seen('R')) { setTargetHotend(code_value()); 14bb2: 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; 14bb6: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 14bba: 70 93 5e 12 sts 0x125E, r23 ; 0x80125e 14bbe: 60 93 5d 12 sts 0x125D, r22 ; 0x80125d 14bc2: 05 c0 rjmp .+10 ; 0x14bce #ifdef AUTOTEMP autotemp_enabled=false; #endif if (code_seen('S')) { setTargetHotend(code_value()); } else if (code_seen('R')) { 14bc4: 82 e5 ldi r24, 0x52 ; 82 14bc6: 0e 94 80 56 call 0xad00 ; 0xad00 14bca: 81 11 cpse r24, r1 14bcc: f2 cf rjmp .-28 ; 0x14bb2 autotemp_factor=code_value(); autotemp_enabled=true; } #endif codenum = _millis(); 14bce: 0f 94 89 0b call 0x21712 ; 0x21712 14bd2: 6b 01 movw r12, r22 14bd4: 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]; 14bd6: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 14bda: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 14bde: 07 2e mov r0, r23 14be0: 00 0c add r0, r0 14be2: 88 0b sbc r24, r24 14be4: 99 0b sbc r25, r25 14be6: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 14bea: 11 e0 ldi r17, 0x01 ; 1 14bec: 20 91 5a 0d lds r18, 0x0D5A ; 0x800d5a 14bf0: 30 91 5b 0d lds r19, 0x0D5B ; 0x800d5b 14bf4: 40 91 5c 0d lds r20, 0x0D5C ; 0x800d5c 14bf8: 50 91 5d 0d lds r21, 0x0D5D ; 0x800d5d 14bfc: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 14c00: 18 16 cp r1, r24 14c02: 0c f0 brlt .+2 ; 0x14c06 14c04: 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 14c06: 10 93 59 0d sts 0x0D59, r17 ; 0x800d59 <_ZL16target_direction.lto_priv.487> wait_for_heater(codenum, active_extruder); //loops until target temperature is reached 14c0a: c7 01 movw r24, r14 14c0c: b6 01 movw r22, r12 14c0e: 0f 94 23 74 call 0x2e846 ; 0x2e846 LCD_MESSAGERPGM(_T(MSG_HEATING_COMPLETE)); 14c12: 87 e2 ldi r24, 0x27 ; 39 14c14: 97 e5 ldi r25, 0x57 ; 87 14c16: 0e 94 8b 75 call 0xeb16 ; 0xeb16 14c1a: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; 14c1e: 82 e0 ldi r24, 0x02 ; 2 14c20: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb prusa_statistics(2); 14c24: 0f 94 05 30 call 0x2600a ; 0x2600a previous_millis_cmd.start(); 14c28: 88 e4 ldi r24, 0x48 ; 72 14c2a: 93 e0 ldi r25, 0x03 ; 3 14c2c: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> 14c30: 29 cc rjmp .-1966 ; 0x14484 */ case 190: #if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1 { bool CooldownNoWait = false; LCD_MESSAGERPGM(_T(MSG_BED_HEATING)); 14c32: 89 e1 ldi r24, 0x19 ; 25 14c34: 97 e5 ldi r25, 0x57 ; 87 14c36: 0e 94 8b 75 call 0xeb16 ; 0xeb16 14c3a: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 heating_status = HeatingStatus::BED_HEATING; 14c3e: 83 e0 ldi r24, 0x03 ; 3 14c40: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb prusa_statistics(1); 14c44: 81 e0 ldi r24, 0x01 ; 1 14c46: 0f 94 05 30 call 0x2600a ; 0x2600a if (code_seen('S')) 14c4a: 83 e5 ldi r24, 0x53 ; 83 14c4c: 0e 94 80 56 call 0xad00 ; 0xad00 14c50: 18 2f mov r17, r24 14c52: 88 23 and r24, r24 14c54: 49 f0 breq .+18 ; 0x14c68 setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) { setTargetBed(code_value()); 14c56: 0e 94 10 5b call 0xb620 ; 0xb620 target_temperature[0] = celsius; resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 14c5a: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 14c5e: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 14c62: 60 93 59 12 sts 0x1259, r22 ; 0x801259 14c66: 05 c0 rjmp .+10 ; 0x14c72 if (code_seen('S')) { setTargetBed(code_value()); CooldownNoWait = true; } else if (code_seen('R')) 14c68: 82 e5 ldi r24, 0x52 ; 82 14c6a: 0e 94 80 56 call 0xad00 ; 0xad00 14c6e: 81 11 cpse r24, r1 14c70: f2 cf rjmp .-28 ; 0x14c56 { setTargetBed(code_value()); } codenum = _millis(); 14c72: 0f 94 89 0b call 0x21712 ; 0x21712 14c76: 6b 01 movw r12, r22 14c78: 7c 01 movw r14, r24 cancel_heatup = false; 14c7a: 10 92 5f 0d sts 0x0D5F, r1 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.389> 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; 14c7e: 60 91 59 12 lds r22, 0x1259 ; 0x801259 14c82: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 14c86: 07 2e mov r0, r23 14c88: 00 0c add r0, r0 14c8a: 88 0b sbc r24, r24 14c8c: 99 0b sbc r25, r25 14c8e: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 14c92: 01 e0 ldi r16, 0x01 ; 1 14c94: 20 91 bc 03 lds r18, 0x03BC ; 0x8003bc 14c98: 30 91 bd 03 lds r19, 0x03BD ; 0x8003bd 14c9c: 40 91 be 03 lds r20, 0x03BE ; 0x8003be 14ca0: 50 91 bf 03 lds r21, 0x03BF ; 0x8003bf 14ca4: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 14ca8: 18 16 cp r1, r24 14caa: 0c f0 brlt .+2 ; 0x14cae 14cac: 00 e0 ldi r16, 0x00 ; 0 target_direction = isHeatingBed(); // true if heating, false if cooling 14cae: 00 93 59 0d sts 0x0D59, r16 ; 0x800d59 <_ZL16target_direction.lto_priv.487> while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 14cb2: 80 91 5f 0d lds r24, 0x0D5F ; 0x800d5f <_ZL13cancel_heatup.lto_priv.389> 14cb6: 81 11 cpse r24, r1 14cb8: 1a c0 rjmp .+52 ; 0x14cee 14cba: 60 91 59 12 lds r22, 0x1259 ; 0x801259 14cbe: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 14cc2: 07 2e mov r0, r23 14cc4: 00 0c add r0, r0 14cc6: 88 0b sbc r24, r24 14cc8: 99 0b sbc r25, r25 14cca: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 14cce: 20 91 bc 03 lds r18, 0x03BC ; 0x8003bc 14cd2: 30 91 bd 03 lds r19, 0x03BD ; 0x8003bd 14cd6: 40 91 be 03 lds r20, 0x03BE ; 0x8003be 14cda: 50 91 bf 03 lds r21, 0x03BF ; 0x8003bf 14cde: e0 91 59 0d lds r30, 0x0D59 ; 0x800d59 <_ZL16target_direction.lto_priv.487> 14ce2: ee 23 and r30, r30 14ce4: 91 f0 breq .+36 ; 0x14d0a 14ce6: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 14cea: 18 16 cp r1, r24 14cec: a4 f0 brlt .+40 ; 0x14d16 } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(_T(MSG_BED_DONE)); 14cee: 8e e0 ldi r24, 0x0E ; 14 14cf0: 97 e5 ldi r25, 0x57 ; 87 14cf2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 14cf6: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 heating_status = HeatingStatus::BED_HEATING_COMPLETE; 14cfa: 84 e0 ldi r24, 0x04 ; 4 14cfc: 80 93 cb 03 sts 0x03CB, r24 ; 0x8003cb previous_millis_cmd.start(); 14d00: 88 e4 ldi r24, 0x48 ; 72 14d02: 93 e0 ldi r25, 0x03 ; 3 14d04: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> 14d08: bd cb rjmp .-2182 ; 0x14484 codenum = _millis(); cancel_heatup = false; target_direction = isHeatingBed(); // true if heating, false if cooling while ( (!cancel_heatup) && (target_direction ? (isHeatingBed()) : (isCoolingBed()&&(CooldownNoWait==false))) ) 14d0a: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 14d0e: 87 ff sbrs r24, 7 14d10: ee cf rjmp .-36 ; 0x14cee 14d12: 11 11 cpse r17, r1 14d14: ec cf rjmp .-40 ; 0x14cee { if (lcd_commands_type == LcdCommands::LongPause) { 14d16: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 14d1a: 82 30 cpi r24, 0x02 ; 2 14d1c: 41 f3 breq .-48 ; 0x14cee // 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. 14d1e: 0f 94 89 0b call 0x21712 ; 0x21712 14d22: 6c 19 sub r22, r12 14d24: 7d 09 sbc r23, r13 14d26: 8e 09 sbc r24, r14 14d28: 9f 09 sbc r25, r15 14d2a: 69 3e cpi r22, 0xE9 ; 233 14d2c: 73 40 sbci r23, 0x03 ; 3 14d2e: 81 05 cpc r24, r1 14d30: 91 05 cpc r25, r1 14d32: 50 f0 brcs .+20 ; 0x14d48 { if (!farm_mode) { 14d34: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 14d38: 81 11 cpse r24, r1 14d3a: 02 c0 rjmp .+4 ; 0x14d40 serialecho_temperatures(); 14d3c: 0e 94 23 7b call 0xf646 ; 0xf646 } codenum = _millis(); 14d40: 0f 94 89 0b call 0x21712 ; 0x21712 14d44: 6b 01 movw r12, r22 14d46: 7c 01 movw r14, r24 } manage_heater(); 14d48: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(); 14d4c: 80 e0 ldi r24, 0x00 ; 0 14d4e: 0e 94 ad 8a call 0x1155a ; 0x1155a lcd_update(0); 14d52: 80 e0 ldi r24, 0x00 ; 0 14d54: 0e 94 4a 6f call 0xde94 ; 0xde94 14d58: ac cf rjmp .-168 ; 0x14cb2 #### 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')){ 14d5a: 83 e5 ldi r24, 0x53 ; 83 14d5c: 0e 94 80 56 call 0xad00 ; 0xad00 14d60: 88 23 and r24, r24 14d62: 29 f0 breq .+10 ; 0x14d6e fanSpeed = code_value_uint8(); 14d64: 0e 94 95 56 call 0xad2a ; 0xad2a 14d68: 80 93 55 12 sts 0x1255, r24 ; 0x801255 14d6c: 8b cb rjmp .-2282 ; 0x14484 } else { fanSpeed = 255; 14d6e: 8f ef ldi r24, 0xFF ; 255 14d70: 80 93 55 12 sts 0x1255, r24 ; 0x801255 14d74: 87 cb rjmp .-2290 ; 0x14484 /*! ### M107 - Fan off M107: Fan Off */ case 107: fanSpeed = 0; 14d76: 10 92 55 12 sts 0x1255, r1 ; 0x801255 14d7a: 84 cb rjmp .-2296 ; 0x14484 /*! ### 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; 14d7c: 80 91 57 12 lds r24, 0x1257 ; 0x801257 14d80: 87 7f andi r24, 0xF7 ; 247 14d82: 80 93 57 12 sts 0x1257, r24 ; 0x801257 14d86: 7e cb rjmp .-2308 ; 0x14484 ### M18 - Disable steppers M18: Disable all stepper motors Equal to M84 (compatibility) */ case 18: //compatibility case 84: // M84 if(code_seen('S')){ 14d88: 83 e5 ldi r24, 0x53 ; 83 14d8a: 0e 94 80 56 call 0xad00 ; 0xad00 14d8e: 88 23 and r24, r24 14d90: 99 f0 breq .+38 ; 0x14db8 stepper_inactive_time = code_value() * 1000; 14d92: 0e 94 10 5b call 0xb620 ; 0xb620 14d96: 20 e0 ldi r18, 0x00 ; 0 14d98: 30 e0 ldi r19, 0x00 ; 0 14d9a: 4a e7 ldi r20, 0x7A ; 122 14d9c: 54 e4 ldi r21, 0x44 ; 68 14d9e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 14da2: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 14da6: 60 93 37 02 sts 0x0237, r22 ; 0x800237 14daa: 70 93 38 02 sts 0x0238, r23 ; 0x800238 14dae: 80 93 39 02 sts 0x0239, r24 ; 0x800239 14db2: 90 93 3a 02 sts 0x023A, r25 ; 0x80023a 14db6: 66 cb rjmp .-2356 ; 0x14484 } 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]))); 14db8: 88 e5 ldi r24, 0x58 ; 88 14dba: 0e 94 80 56 call 0xad00 ; 0xad00 14dbe: 88 23 and r24, r24 14dc0: d1 f0 breq .+52 ; 0x14df6 disable_e0(); finishAndDisableSteppers(); } else { st_synchronize(); 14dc2: 0f 94 94 18 call 0x23128 ; 0x23128 if (code_seen('X')) disable_x(); 14dc6: 88 e5 ldi r24, 0x58 ; 88 14dc8: 0e 94 80 56 call 0xad00 ; 0xad00 14dcc: 81 11 cpse r24, r1 14dce: 28 c0 rjmp .+80 ; 0x14e20 if (code_seen('Y')) disable_y(); 14dd0: 89 e5 ldi r24, 0x59 ; 89 14dd2: 0e 94 80 56 call 0xad00 ; 0xad00 14dd6: 88 23 and r24, r24 14dd8: 19 f0 breq .+6 ; 0x14de0 14dda: 16 9a sbi 0x02, 6 ; 2 14ddc: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a if (code_seen('Z')) disable_z(); 14de0: 8a e5 ldi r24, 0x5A ; 90 14de2: 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(); 14de6: 85 e4 ldi r24, 0x45 ; 69 14de8: 0e 94 80 56 call 0xad00 ; 0xad00 14dec: 88 23 and r24, r24 14dee: 09 f4 brne .+2 ; 0x14df2 14df0: 49 cb rjmp .-2414 ; 0x14484 14df2: 14 9a sbi 0x02, 4 ; 2 14df4: 47 cb rjmp .-2418 ; 0x14484 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]))); 14df6: 89 e5 ldi r24, 0x59 ; 89 14df8: 0e 94 80 56 call 0xad00 ; 0xad00 14dfc: 81 11 cpse r24, r1 14dfe: e1 cf rjmp .-62 ; 0x14dc2 14e00: 8a e5 ldi r24, 0x5A ; 90 14e02: 0e 94 80 56 call 0xad00 ; 0xad00 14e06: 81 11 cpse r24, r1 14e08: dc cf rjmp .-72 ; 0x14dc2 14e0a: 85 e4 ldi r24, 0x45 ; 69 14e0c: 0e 94 80 56 call 0xad00 ; 0xad00 14e10: 81 11 cpse r24, r1 14e12: d7 cf rjmp .-82 ; 0x14dc2 if(all_axis) { st_synchronize(); 14e14: 0f 94 94 18 call 0x23128 ; 0x23128 disable_e0(); 14e18: 14 9a sbi 0x02, 4 ; 2 finishAndDisableSteppers(); 14e1a: 0e 94 ce 84 call 0x1099c ; 0x1099c 14e1e: 32 cb rjmp .-2460 ; 0x14484 } else { st_synchronize(); if (code_seen('X')) disable_x(); 14e20: 17 9a sbi 0x02, 7 ; 2 14e22: 10 92 39 06 sts 0x0639, r1 ; 0x800639 14e26: d4 cf rjmp .-88 ; 0x14dd0 #### 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')) { 14e28: 83 e5 ldi r24, 0x53 ; 83 14e2a: 0e 94 80 56 call 0xad00 ; 0xad00 14e2e: 88 23 and r24, r24 14e30: 09 f4 brne .+2 ; 0x14e34 14e32: 28 cb rjmp .-2480 ; 0x14484 max_inactive_time = code_value() * 1000; 14e34: 0e 94 10 5b call 0xb620 ; 0xb620 14e38: 20 e0 ldi r18, 0x00 ; 0 14e3a: 30 e0 ldi r19, 0x00 ; 0 14e3c: 4a e7 ldi r20, 0x7A ; 122 14e3e: 54 e4 ldi r21, 0x44 ; 68 14e40: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 14e44: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 14e48: 60 93 44 03 sts 0x0344, r22 ; 0x800344 14e4c: 70 93 45 03 sts 0x0345, r23 ; 0x800345 14e50: 80 93 46 03 sts 0x0346, r24 ; 0x800346 14e54: 90 93 47 03 sts 0x0347, r25 ; 0x800347 14e58: 15 cb rjmp .-2518 ; 0x14484 14e5a: 34 ec ldi r19, 0xC4 ; 196 14e5c: 83 2e mov r8, r19 14e5e: 32 e0 ldi r19, 0x02 ; 2 14e60: 93 2e mov r9, r19 14e62: 47 e6 ldi r20, 0x67 ; 103 14e64: a4 2e mov r10, r20 14e66: 4d e0 ldi r20, 0x0D ; 13 14e68: 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++) 14e6a: 10 e0 ldi r17, 0x00 ; 0 { if(code_seen(axis_codes[i])) 14e6c: f4 01 movw r30, r8 14e6e: 81 91 ld r24, Z+ 14e70: 4f 01 movw r8, r30 14e72: 0e 94 80 56 call 0xad00 ; 0xad00 14e76: 88 23 and r24, r24 14e78: 09 f4 brne .+2 ; 0x14e7c 14e7a: 67 c0 rjmp .+206 ; 0x14f4a { float value = code_value(); 14e7c: 0e 94 10 5b call 0xb620 ; 0xb620 14e80: 6b 01 movw r12, r22 14e82: 7c 01 movw r14, r24 if(i == E_AXIS) { // E 14e84: 13 30 cpi r17, 0x03 ; 3 14e86: 09 f0 breq .+2 ; 0x14e8a 14e88: 6a c0 rjmp .+212 ; 0x14f5e if(value < 20.0) { 14e8a: 20 e0 ldi r18, 0x00 ; 0 14e8c: 30 e0 ldi r19, 0x00 ; 0 14e8e: 40 ea ldi r20, 0xA0 ; 160 14e90: 51 e4 ldi r21, 0x41 ; 65 14e92: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 14e96: 87 ff sbrs r24, 7 14e98: 4e c0 rjmp .+156 ; 0x14f36 const float factor = cs.axis_steps_per_mm[E_AXIS] / value; // increase e constants if M92 E14 is given for netfab. 14e9a: a7 01 movw r20, r14 14e9c: 96 01 movw r18, r12 14e9e: 60 91 77 0d lds r22, 0x0D77 ; 0x800d77 14ea2: 70 91 78 0d lds r23, 0x0D78 ; 0x800d78 14ea6: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 14eaa: 90 91 7a 0d lds r25, 0x0D7A ; 0x800d7a 14eae: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 14eb2: 2b 01 movw r4, r22 14eb4: 3c 01 movw r6, r24 cs.max_jerk[E_AXIS] *= factor; 14eb6: ac 01 movw r20, r24 14eb8: 9b 01 movw r18, r22 14eba: 60 91 bb 0d lds r22, 0x0DBB ; 0x800dbb 14ebe: 70 91 bc 0d lds r23, 0x0DBC ; 0x800dbc 14ec2: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 14ec6: 90 91 be 0d lds r25, 0x0DBE ; 0x800dbe 14eca: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 14ece: 60 93 bb 0d sts 0x0DBB, r22 ; 0x800dbb 14ed2: 70 93 bc 0d sts 0x0DBC, r23 ; 0x800dbc 14ed6: 80 93 bd 0d sts 0x0DBD, r24 ; 0x800dbd 14eda: 90 93 be 0d sts 0x0DBE, r25 ; 0x800dbe max_feedrate[E_AXIS] *= factor; 14ede: a3 01 movw r20, r6 14ee0: 92 01 movw r18, r4 14ee2: 60 91 87 0d lds r22, 0x0D87 ; 0x800d87 14ee6: 70 91 88 0d lds r23, 0x0D88 ; 0x800d88 14eea: 80 91 89 0d lds r24, 0x0D89 ; 0x800d89 14eee: 90 91 8a 0d lds r25, 0x0D8A ; 0x800d8a 14ef2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 14ef6: 60 93 87 0d sts 0x0D87, r22 ; 0x800d87 14efa: 70 93 88 0d sts 0x0D88, r23 ; 0x800d88 14efe: 80 93 89 0d sts 0x0D89, r24 ; 0x800d89 14f02: 90 93 8a 0d sts 0x0D8A, r25 ; 0x800d8a max_acceleration_steps_per_s2[E_AXIS] *= factor; 14f06: 60 91 b7 04 lds r22, 0x04B7 ; 0x8004b7 14f0a: 70 91 b8 04 lds r23, 0x04B8 ; 0x8004b8 14f0e: 80 91 b9 04 lds r24, 0x04B9 ; 0x8004b9 14f12: 90 91 ba 04 lds r25, 0x04BA ; 0x8004ba 14f16: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 14f1a: a3 01 movw r20, r6 14f1c: 92 01 movw r18, r4 14f1e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 14f22: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 14f26: 60 93 b7 04 sts 0x04B7, r22 ; 0x8004b7 14f2a: 70 93 b8 04 sts 0x04B8, r23 ; 0x8004b8 14f2e: 80 93 b9 04 sts 0x04B9, r24 ; 0x8004b9 14f32: 90 93 ba 04 sts 0x04BA, r25 ; 0x8004ba } cs.axis_steps_per_mm[E_AXIS] = value; 14f36: c0 92 77 0d sts 0x0D77, r12 ; 0x800d77 14f3a: d0 92 78 0d sts 0x0D78, r13 ; 0x800d78 14f3e: e0 92 79 0d sts 0x0D79, r14 ; 0x800d79 14f42: f0 92 7a 0d sts 0x0D7A, r15 ; 0x800d7a #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) fsensor.init(); 14f46: 0f 94 7a 6d call 0x2daf4 ; 0x2daf4 14f4a: b4 e0 ldi r27, 0x04 ; 4 14f4c: ab 0e add r10, r27 14f4e: b1 1c adc r11, r1 14f50: 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++) 14f52: 14 30 cpi r17, 0x04 ; 4 14f54: 09 f0 breq .+2 ; 0x14f58 14f56: 8a cf rjmp .-236 ; 0x14e6c } else { cs.axis_steps_per_mm[i] = value; } } } reset_acceleration_rates(); 14f58: 0f 94 32 3a call 0x27464 ; 0x27464 14f5c: 93 ca rjmp .-2778 ; 0x14484 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; 14f5e: d5 01 movw r26, r10 14f60: 14 96 adiw r26, 0x04 ; 4 14f62: cd 92 st X+, r12 14f64: dd 92 st X+, r13 14f66: ed 92 st X+, r14 14f68: fc 92 st X, r15 14f6a: 17 97 sbiw r26, 0x07 ; 7 14f6c: ee cf rjmp .-36 ; 0x14f4a #### Parameters - `S` - Seconds. Default is 2 seconds between "busy" messages */ case 113: if (code_seen('S')) { 14f6e: 83 e5 ldi r24, 0x53 ; 83 14f70: 0e 94 80 56 call 0xad00 ; 0xad00 14f74: 88 23 and r24, r24 14f76: 29 f0 breq .+10 ; 0x14f82 host_keepalive_interval = code_value_uint8(); 14f78: 0e 94 95 56 call 0xad2a ; 0xad2a 14f7c: 80 93 32 02 sts 0x0232, r24 ; 0x800232 14f80: 81 ca rjmp .-2814 ; 0x14484 } else { SERIAL_ECHO_START; 14f82: 84 ee ldi r24, 0xE4 ; 228 14f84: 92 ea ldi r25, 0xA2 ; 162 14f86: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); 14f8a: c0 90 32 02 lds r12, 0x0232 ; 0x800232 14f8e: d1 2c mov r13, r1 14f90: f1 2c mov r15, r1 14f92: 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); } 14f94: 8a ec ldi r24, 0xCA ; 202 14f96: 90 e8 ldi r25, 0x80 ; 128 14f98: 0e 94 15 7b call 0xf62a ; 0xf62a } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 14f9c: 4a e0 ldi r20, 0x0A ; 10 14f9e: c7 01 movw r24, r14 14fa0: b6 01 movw r22, r12 14fa2: 0e 94 16 7a call 0xf42c ; 0xf42c host_keepalive_interval = code_value_uint8(); } else { SERIAL_ECHO_START; SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval); SERIAL_PROTOCOLLN(); 14fa6: 0e 94 0d 7b call 0xf61a ; 0xf61a 14faa: 6c ca rjmp .-2856 ; 0x14484 */ case 115: // M115 if (code_seen('V')) { // Report the Prusa version number. SERIAL_PROTOCOLLNRPGM(FW_VERSION_STR_P()); } else if (code_seen('U')) { 14fac: 85 e5 ldi r24, 0x55 ; 85 14fae: 0e 94 80 56 call 0xad00 ; 0xad00 14fb2: 88 23 and r24, r24 14fb4: 09 f4 brne .+2 ; 0x14fb8 14fb6: 5a c0 rjmp .+180 ; 0x1506c // 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); 14fb8: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 14fbc: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 14fc0: 0f 5f subi r16, 0xFF ; 255 14fc2: 1f 4f sbci r17, 0xFF ; 255 14fc4: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 14fc8: 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) 14fcc: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 14fd0: 88 23 and r24, r24 14fd2: 09 f4 brne .+2 ; 0x14fd6 14fd4: 57 ca rjmp .-2898 ; 0x14484 // 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)) 14fd6: be 01 movw r22, r28 14fd8: 6f 5f subi r22, 0xFF ; 255 14fda: 7f 4f sbci r23, 0xFF ; 255 14fdc: c8 01 movw r24, r16 14fde: 0e 94 83 d7 call 0x1af06 ; 0x1af06 14fe2: 88 23 and r24, r24 14fe4: 09 f4 brne .+2 ; 0x14fe8 14fe6: 4e ca rjmp .-2916 ; 0x14484 14fe8: 86 e1 ldi r24, 0x16 ; 22 14fea: 98 e8 ldi r25, 0x88 ; 136 14fec: de 01 movw r26, r28 14fee: 11 96 adiw r26, 0x01 ; 1 14ff0: be 01 movw r22, r28 14ff2: 67 5f subi r22, 0xF7 ; 247 14ff4: 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]); 14ff6: fc 01 movw r30, r24 14ff8: 45 91 lpm r20, Z+ 14ffa: 54 91 lpm r21, Z if (ver_gcode[i] > v) 14ffc: 2d 91 ld r18, X+ 14ffe: 3d 91 ld r19, X+ 15000: 42 17 cp r20, r18 15002: 53 07 cpc r21, r19 15004: 10 f4 brcc .+4 ; 0x1500a 15006: 0c 94 19 ba jmp 0x17432 ; 0x17432 return 1; else if (ver_gcode[i] < v) 1500a: 24 17 cp r18, r20 1500c: 35 07 cpc r19, r21 1500e: 08 f4 brcc .+2 ; 0x15012 15010: 39 ca rjmp .-2958 ; 0x14484 15012: 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) 15014: a6 17 cp r26, r22 15016: b7 07 cpc r27, r23 15018: 71 f7 brne .-36 ; 0x14ff6 1501a: 34 ca rjmp .-2968 ; 0x14484 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)); 1501c: 80 e6 ldi r24, 0x60 ; 96 1501e: 99 e3 ldi r25, 0x39 ; 57 15020: 0e 94 8b 75 call 0xeb16 ; 0xeb16 15024: ac 01 movw r20, r24 15026: 63 e0 ldi r22, 0x03 ; 3 15028: 80 e0 ldi r24, 0x00 ; 0 1502a: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 Sound_MakeCustom(50,1000,false); 1502e: 40 e0 ldi r20, 0x00 ; 0 15030: 68 ee ldi r22, 0xE8 ; 232 15032: 73 e0 ldi r23, 0x03 ; 3 15034: 82 e3 ldi r24, 0x32 ; 50 15036: 90 e0 ldi r25, 0x00 ; 0 15038: 0f 94 4a 25 call 0x24a94 ; 0x24a94 delay_keep_alive(500); 1503c: 84 ef ldi r24, 0xF4 ; 244 1503e: 91 e0 ldi r25, 0x01 ; 1 15040: 0e 94 07 8d call 0x11a0e ; 0x11a0e Sound_MakeCustom(50,1000,false); 15044: 40 e0 ldi r20, 0x00 ; 0 15046: 68 ee ldi r22, 0xE8 ; 232 15048: 73 e0 ldi r23, 0x03 ; 3 1504a: 82 e3 ldi r24, 0x32 ; 50 1504c: 90 e0 ldi r25, 0x00 ; 0 1504e: 0f 94 4a 25 call 0x24a94 ; 0x24a94 lcd_wait_for_click_delay(30); 15052: 8e e1 ldi r24, 0x1E ; 30 15054: 90 e0 ldi r25, 0x00 ; 0 15056: 0e 94 aa dd call 0x1bb54 ; 0x1bb54 lcd_update_enable(true); 1505a: 81 e0 ldi r24, 0x01 ; 1 1505c: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_clear(); 15060: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_update(0); 15064: 80 e0 ldi r24, 0x00 ; 0 15066: 0e 94 4a 6f call 0xde94 ; 0xde94 1506a: 0c ca rjmp .-3048 ; 0x14484 } 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); 1506c: 41 e1 ldi r20, 0x11 ; 17 1506e: 50 e0 ldi r21, 0x00 ; 0 15070: 60 e8 ldi r22, 0x80 ; 128 15072: 7c e0 ldi r23, 0x0C ; 12 15074: ce 01 movw r24, r28 15076: 01 96 adiw r24, 0x01 ; 1 15078: 0f 94 71 a4 call 0x348e2 ; 0x348e2 SERIAL_ECHOPGM("FIRMWARE_NAME:Prusa-Firmware "); 1507c: 8c ea ldi r24, 0xAC ; 172 1507e: 90 e8 ldi r25, 0x80 ; 128 15080: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(FW_VERSION_STR_P()); 15084: 8f ee ldi r24, 0xEF ; 239 15086: 99 e8 ldi r25, 0x89 ; 137 15088: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPGM("+"); 1508c: 8a ea ldi r24, 0xAA ; 170 1508e: 90 e8 ldi r25, 0x80 ; 128 15090: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPGM(STR(FW_COMMITNR)); 15094: 85 ea ldi r24, 0xA5 ; 165 15096: 90 e8 ldi r25, 0x80 ; 128 15098: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPGM("_"); 1509c: 83 ea ldi r24, 0xA3 ; 163 1509e: 90 e8 ldi r25, 0x80 ; 128 150a0: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPGM(FW_COMMIT_HASH); 150a4: 89 e9 ldi r24, 0x99 ; 153 150a6: 90 e8 ldi r25, 0x80 ; 128 150a8: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPGM(" based on Marlin FIRMWARE_URL:https://github.com/prusa3d/Prusa-Firmware PROTOCOL_VERSION:"); 150ac: 8f e3 ldi r24, 0x3F ; 63 150ae: 90 e8 ldi r25, 0x80 ; 128 150b0: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPGM(PROTOCOL_VERSION); 150b4: 8b e3 ldi r24, 0x3B ; 59 150b6: 90 e8 ldi r25, 0x80 ; 128 150b8: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPGM(" MACHINE_TYPE:"); 150bc: 8c e2 ldi r24, 0x2C ; 44 150be: 90 e8 ldi r25, 0x80 ; 128 150c0: 0e 94 15 7b call 0xf62a ; 0xf62a 150c4: ce 01 movw r24, r28 150c6: 01 96 adiw r24, 0x01 ; 1 150c8: 0e 94 0e 86 call 0x10c1c ; 0x10c1c SERIAL_PROTOCOL(custom_mendel_name); SERIAL_ECHOPGM(" EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS)); 150cc: 8a e1 ldi r24, 0x1A ; 26 150ce: 90 e8 ldi r25, 0x80 ; 128 150d0: 0e 94 15 7b call 0xf62a ; 0xf62a #ifdef MACHINE_UUID SERIAL_ECHOPGM(" UUID:"); SERIAL_ECHOPGM(MACHINE_UUID); #endif //MACHINE_UUID SERIAL_ECHOLNPGM(""); 150d4: 89 e1 ldi r24, 0x19 ; 25 150d6: 90 e8 ldi r25, 0x80 ; 128 150d8: 0e 94 0e 7d call 0xfa1c ; 0xfa1c } #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'); 150dc: 1f 92 push r1 150de: 21 e3 ldi r18, 0x31 ; 49 150e0: f2 2e mov r15, r18 150e2: ff 92 push r15 150e4: 82 e8 ldi r24, 0x82 ; 130 150e6: 9e e7 ldi r25, 0x7E ; 126 150e8: 9f 93 push r25 150ea: 8f 93 push r24 150ec: 0b e3 ldi r16, 0x3B ; 59 150ee: 1e e7 ldi r17, 0x7E ; 126 150f0: 1f 93 push r17 150f2: 0f 93 push r16 150f4: 0f 94 43 a3 call 0x34686 ; 0x34686 150f8: 1f 92 push r1 150fa: ff 92 push r15 150fc: 82 e7 ldi r24, 0x72 ; 114 150fe: 9e e7 ldi r25, 0x7E ; 126 15100: 9f 93 push r25 15102: 8f 93 push r24 15104: 1f 93 push r17 15106: 0f 93 push r16 15108: 0f 94 43 a3 call 0x34686 ; 0x34686 1510c: 1f 92 push r1 1510e: ff 92 push r15 15110: 8e e5 ldi r24, 0x5E ; 94 15112: 9e e7 ldi r25, 0x7E ; 126 15114: 9f 93 push r25 15116: 8f 93 push r24 15118: 1f 93 push r17 1511a: 0f 93 push r16 1511c: 0f 94 43 a3 call 0x34686 ; 0x34686 15120: 1f 92 push r1 15122: ff 92 push r15 15124: 81 e5 ldi r24, 0x51 ; 81 15126: 9e e7 ldi r25, 0x7E ; 126 15128: 9f 93 push r25 1512a: 8f 93 push r24 1512c: 1f 93 push r17 1512e: 0f 93 push r16 15130: 0f 94 43 a3 call 0x34686 ; 0x34686 15134: 1f 92 push r1 15136: ff 92 push r15 15138: 86 e4 ldi r24, 0x46 ; 70 1513a: 9e e7 ldi r25, 0x7E ; 126 1513c: 9f 93 push r25 1513e: 8f 93 push r24 15140: 1f 93 push r17 15142: 0f 93 push r16 15144: 0f 94 43 a3 call 0x34686 ; 0x34686 15148: 0f b6 in r0, 0x3f ; 63 1514a: f8 94 cli 1514c: de bf out 0x3e, r29 ; 62 1514e: 0f be out 0x3f, r0 ; 63 15150: cd bf out 0x3d, r28 ; 61 15152: 98 c9 rjmp .-3280 ; 0x14484 /*! ### M114 - Get current position M114: Get Current Position */ case 114: gcode_M114(); 15154: 0e 94 0c 7c call 0xf818 ; 0xf818 15158: 95 c9 rjmp .-3286 ; 0x14484 /*! ### M117 - Display Message M117: Display Message */ case 117: { const char *src = strchr_pointer + 4; // "M117" 1515a: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 1515e: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 15162: cf 01 movw r24, r30 15164: 04 96 adiw r24, 0x04 ; 4 lcd_setstatus(*src == ' '? src + 1: src); 15166: 24 81 ldd r18, Z+4 ; 0x04 15168: 20 32 cpi r18, 0x20 ; 32 1516a: 09 f4 brne .+2 ; 0x1516e 1516c: 01 96 adiw r24, 0x01 ; 1 1516e: 0e 94 d0 dc call 0x1b9a0 ; 0x1b9a0 custom_message_type = CustomMsg::M117; 15172: 87 e0 ldi r24, 0x07 ; 7 15174: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d 15178: 85 c9 rjmp .-3318 ; 0x14484 - `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; 1517a: 00 91 bb 04 lds r16, 0x04BB ; 0x8004bb 1517e: 10 91 bc 04 lds r17, 0x04BC ; 0x8004bc 15182: 0b 5f subi r16, 0xFB ; 251 15184: 1f 4f sbci r17, 0xFF ; 255 15186: 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; 15188: f1 2c mov r15, r1 1518a: 40 e0 ldi r20, 0x00 ; 0 1518c: 81 50 subi r24, 0x01 ; 1 char *p = strchr_pointer + 5; for (uint8_t i = 2; i--;) { 1518e: e9 f0 breq .+58 ; 0x151ca // A1, E1, and Pn are always parsed out if (!((p[0] == 'A' || p[0] == 'E') && p[1] == '1')) break; 15190: d8 01 movw r26, r16 15192: 9c 91 ld r25, X 15194: 29 2f mov r18, r25 15196: 2b 7f andi r18, 0xFB ; 251 15198: 21 34 cpi r18, 0x41 ; 65 1519a: b9 f4 brne .+46 ; 0x151ca 1519c: 11 96 adiw r26, 0x01 ; 1 1519e: 2c 91 ld r18, X 151a0: 21 33 cpi r18, 0x31 ; 49 151a2: 99 f4 brne .+38 ; 0x151ca switch (p[0]) { 151a4: 91 34 cpi r25, 0x41 ; 65 151a6: 71 f0 breq .+28 ; 0x151c4 151a8: 95 34 cpi r25, 0x45 ; 69 151aa: 09 f4 brne .+2 ; 0x151ae case 'A': hasA = true; break; case 'E': hasE = true; break; 151ac: 41 e0 ldi r20, 0x01 ; 1 } p += 2; 151ae: 98 01 movw r18, r16 151b0: 2e 5f subi r18, 0xFE ; 254 151b2: 3f 4f sbci r19, 0xFF ; 255 151b4: 89 01 movw r16, r18 151b6: 2f 5f subi r18, 0xFF ; 255 151b8: 3f 4f sbci r19, 0xFF ; 255 while (*p == ' ') ++p; 151ba: f8 01 movw r30, r16 151bc: 90 81 ld r25, Z 151be: 90 32 cpi r25, 0x20 ; 32 151c0: c9 f3 breq .-14 ; 0x151b4 151c2: e4 cf rjmp .-56 ; 0x1518c 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; 151c4: ff 24 eor r15, r15 151c6: f3 94 inc r15 151c8: f2 cf rjmp .-28 ; 0x151ae } p += 2; while (*p == ' ') ++p; } if (hasE) SERIAL_ECHO_START; 151ca: 44 23 and r20, r20 151cc: 21 f0 breq .+8 ; 0x151d6 151ce: 84 ee ldi r24, 0xE4 ; 228 151d0: 92 ea ldi r25, 0xA2 ; 162 151d2: 0e 94 15 7b call 0xf62a ; 0xf62a if (hasA) SERIAL_ECHOPGM("//"); 151d6: ff 20 and r15, r15 151d8: 21 f0 breq .+8 ; 0x151e2 151da: 86 e1 ldi r24, 0x16 ; 22 151dc: 90 e8 ldi r25, 0x80 ; 128 151de: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN(p); 151e2: c8 01 movw r24, r16 151e4: 0e 94 1a 86 call 0x10c34 ; 0x10c34 151e8: 4d c9 rjmp .-3430 ; 0x14484 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); 151ea: 89 e0 ldi r24, 0x09 ; 9 151ec: 96 e6 ldi r25, 0x66 ; 102 151ee: 0c 94 31 9e jmp 0x13c62 ; 0x13c62 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); 151f2: 89 e0 ldi r24, 0x09 ; 9 151f4: 96 e6 ldi r25, 0x66 ; 102 151f6: 0c 94 3f 9e jmp 0x13c7e ; 0x13c7e 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); 151fa: 89 e0 ldi r24, 0x09 ; 9 151fc: 96 e6 ldi r25, 0x66 ; 102 151fe: 0c 94 4d 9e jmp 0x13c9a ; 0x13c9a 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); 15202: 89 e0 ldi r24, 0x09 ; 9 15204: 96 e6 ldi r25, 0x66 ; 102 15206: 0c 94 5b 9e jmp 0x13cb6 ; 0x13cb6 E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255 */ case 123: gcode_M123(); 1520a: 0e 94 66 65 call 0xcacc ; 0xcacc 1520e: 3a c9 rjmp .-3468 ; 0x14484 */ 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')) { 15210: 84 e5 ldi r24, 0x54 ; 84 15212: 0e 94 80 56 call 0xad00 ; 0xad00 15216: 88 23 and r24, r24 15218: 69 f0 breq .+26 ; 0x15234 extruder = code_value_uint8(); 1521a: 0e 94 95 56 call 0xad2a ; 0xad2a if(extruder >= EXTRUDERS) { 1521e: 88 23 and r24, r24 15220: 49 f0 breq .+18 ; 0x15234 SERIAL_ECHO_START; 15222: 84 ee ldi r24, 0xE4 ; 228 15224: 92 ea ldi r25, 0xA2 ; 162 15226: 0e 94 15 7b call 0xf62a ; 0xf62a 1522a: 8a ed ldi r24, 0xDA ; 218 1522c: 95 e6 ldi r25, 0x65 ; 101 1522e: 0e 94 0e 86 call 0x10c1c ; 0x10c1c 15232: 28 c9 rjmp .-3504 ; 0x14484 SERIAL_ECHO(_n("M200 Invalid extruder "));////MSG_M200_INVALID_EXTRUDER break; } } if(code_seen('D')) { 15234: 84 e4 ldi r24, 0x44 ; 68 15236: 0e 94 80 56 call 0xad00 ; 0xad00 1523a: 88 23 and r24, r24 1523c: 09 f4 brne .+2 ; 0x15240 1523e: 22 c9 rjmp .-3516 ; 0x14484 float diameter = code_value(); 15240: 0e 94 10 5b call 0xb620 ; 0xb620 if (diameter == 0.0) { 15244: 20 e0 ldi r18, 0x00 ; 0 15246: 30 e0 ldi r19, 0x00 ; 0 15248: a9 01 movw r20, r18 1524a: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1524e: 81 11 cpse r24, r1 15250: 05 c0 rjmp .+10 ; 0x1525c // 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; 15252: 10 92 fe 0d sts 0x0DFE, r1 ; 0x800dfe } } else { //reserved for setting filament diameter via UFID or filament measuring device break; } calculate_extruder_multipliers(); 15256: 0e 94 9b 64 call 0xc936 ; 0xc936 1525a: 14 c9 rjmp .-3544 ; 0x14484 // 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(); 1525c: 0e 94 10 5b call 0xb620 ; 0xb620 15260: 6b 01 movw r12, r22 15262: 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]); 15264: 20 e0 ldi r18, 0x00 ; 0 15266: 30 e0 ldi r19, 0x00 ; 0 15268: a9 01 movw r20, r18 1526a: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1526e: 81 11 cpse r24, r1 15270: 06 c0 rjmp .+12 ; 0x1527e 15272: c1 2c mov r12, r1 15274: d1 2c mov r13, r1 15276: 90 ee ldi r25, 0xE0 ; 224 15278: e9 2e mov r14, r25 1527a: 9f e3 ldi r25, 0x3F ; 63 1527c: f9 2e mov r15, r25 1527e: c0 92 ff 0d sts 0x0DFF, r12 ; 0x800dff 15282: d0 92 00 0e sts 0x0E00, r13 ; 0x800e00 15286: e0 92 01 0e sts 0x0E01, r14 ; 0x800e01 1528a: 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; 1528e: 81 e0 ldi r24, 0x01 ; 1 15290: 80 93 fe 0d sts 0x0DFE, r24 ; 0x800dfe 15294: e0 cf rjmp .-64 ; 0x15256 15296: 04 ec ldi r16, 0xC4 ; 196 15298: 12 e0 ldi r17, 0x02 ; 2 1529a: f7 e6 ldi r31, 0x67 ; 103 1529c: ef 2e mov r14, r31 1529e: fd e0 ldi r31, 0x0D ; 13 152a0: ff 2e mov r15, r31 152a2: a8 ec ldi r26, 0xC8 ; 200 152a4: ca 2e mov r12, r26 152a6: a2 e0 ldi r26, 0x02 ; 2 152a8: 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])) 152aa: d8 01 movw r26, r16 152ac: 8d 91 ld r24, X+ 152ae: 8d 01 movw r16, r26 152b0: 0e 94 80 56 call 0xad00 ; 0xad00 152b4: 88 23 and r24, r24 152b6: 39 f0 breq .+14 ; 0x152c6 { float val = code_value(); 152b8: 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; 152bc: f7 01 movw r30, r14 152be: 64 8b std Z+20, r22 ; 0x14 152c0: 75 8b std Z+21, r23 ; 0x15 152c2: 86 8b std Z+22, r24 ; 0x16 152c4: 97 8b std Z+23, r25 ; 0x17 152c6: f4 e0 ldi r31, 0x04 ; 4 152c8: ef 0e add r14, r31 152ca: 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++) 152cc: c0 16 cp r12, r16 152ce: d1 06 cpc r13, r17 152d0: 61 f7 brne .-40 ; 0x152aa 152d2: d8 c8 rjmp .-3664 ; 0x14484 - `R` - filmanent only moves - `T` - travel moves (as of now T is ignored) */ case 204: { if(code_seen('S')) { 152d4: 83 e5 ldi r24, 0x53 ; 83 152d6: 0e 94 80 56 call 0xad00 ; 0xad00 152da: 88 23 and r24, r24 152dc: 19 f1 breq .+70 ; 0x15324 // 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(); 152de: 0e 94 10 5b call 0xb620 ; 0xb620 152e2: 60 93 27 0e sts 0x0E27, r22 ; 0x800e27 152e6: 70 93 28 0e sts 0x0E28, r23 ; 0x800e28 152ea: 80 93 29 0e sts 0x0E29, r24 ; 0x800e29 152ee: 90 93 2a 0e sts 0x0E2A, r25 ; 0x800e2a 152f2: 60 93 9b 0d sts 0x0D9B, r22 ; 0x800d9b 152f6: 70 93 9c 0d sts 0x0D9C, r23 ; 0x800d9c 152fa: 80 93 9d 0d sts 0x0D9D, r24 ; 0x800d9d 152fe: 90 93 9e 0d sts 0x0D9E, r25 ; 0x800d9e // Interpret the T value as retract acceleration in the old Marlin format. if(code_seen('T')) 15302: 84 e5 ldi r24, 0x54 ; 84 15304: 0e 94 80 56 call 0xad00 ; 0xad00 15308: 88 23 and r24, r24 1530a: 09 f4 brne .+2 ; 0x1530e 1530c: bb c8 rjmp .-3722 ; 0x14484 cs.retract_acceleration = code_value(); 1530e: 0e 94 10 5b call 0xb620 ; 0xb620 15312: 60 93 9f 0d sts 0x0D9F, r22 ; 0x800d9f 15316: 70 93 a0 0d sts 0x0DA0, r23 ; 0x800da0 1531a: 80 93 a1 0d sts 0x0DA1, r24 ; 0x800da1 1531e: 90 93 a2 0d sts 0x0DA2, r25 ; 0x800da2 15322: b0 c8 rjmp .-3744 ; 0x14484 } else { // New acceleration format, compatible with the upstream Marlin. if(code_seen('P')) 15324: 80 e5 ldi r24, 0x50 ; 80 15326: 0e 94 80 56 call 0xad00 ; 0xad00 1532a: 88 23 and r24, r24 1532c: 51 f0 breq .+20 ; 0x15342 cs.acceleration = code_value(); 1532e: 0e 94 10 5b call 0xb620 ; 0xb620 15332: 60 93 9b 0d sts 0x0D9B, r22 ; 0x800d9b 15336: 70 93 9c 0d sts 0x0D9C, r23 ; 0x800d9c 1533a: 80 93 9d 0d sts 0x0D9D, r24 ; 0x800d9d 1533e: 90 93 9e 0d sts 0x0D9E, r25 ; 0x800d9e if(code_seen('R')) 15342: 82 e5 ldi r24, 0x52 ; 82 15344: 0e 94 80 56 call 0xad00 ; 0xad00 15348: 88 23 and r24, r24 1534a: 51 f0 breq .+20 ; 0x15360 cs.retract_acceleration = code_value(); 1534c: 0e 94 10 5b call 0xb620 ; 0xb620 15350: 60 93 9f 0d sts 0x0D9F, r22 ; 0x800d9f 15354: 70 93 a0 0d sts 0x0DA0, r23 ; 0x800da0 15358: 80 93 a1 0d sts 0x0DA1, r24 ; 0x800da1 1535c: 90 93 a2 0d sts 0x0DA2, r25 ; 0x800da2 if(code_seen('T')) 15360: 84 e5 ldi r24, 0x54 ; 84 15362: 0e 94 80 56 call 0xad00 ; 0xad00 15366: 88 23 and r24, r24 15368: 09 f4 brne .+2 ; 0x1536c 1536a: 8c c8 rjmp .-3816 ; 0x14484 cs.travel_acceleration = code_value(); 1536c: 0e 94 10 5b call 0xb620 ; 0xb620 15370: 60 93 27 0e sts 0x0E27, r22 ; 0x800e27 15374: 70 93 28 0e sts 0x0E28, r23 ; 0x800e28 15378: 80 93 29 0e sts 0x0E29, r24 ; 0x800e29 1537c: 90 93 2a 0e sts 0x0E2A, r25 ; 0x800e2a 15380: 81 c8 rjmp .-3838 ; 0x14484 15382: 04 ec ldi r16, 0xC4 ; 196 15384: 12 e0 ldi r17, 0x02 ; 2 15386: ef eb ldi r30, 0xBF ; 191 15388: ee 2e mov r14, r30 1538a: ed e0 ldi r30, 0x0D ; 13 1538c: 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(); 1538e: d8 01 movw r26, r16 15390: 8d 91 ld r24, X+ 15392: 8d 01 movw r16, r26 15394: 0e 94 80 56 call 0xad00 ; 0xad00 15398: 88 23 and r24, r24 1539a: 39 f0 breq .+14 ; 0x153aa 1539c: 0e 94 10 5b call 0xb620 ; 0xb620 153a0: f7 01 movw r30, r14 153a2: 60 83 st Z, r22 153a4: 71 83 std Z+1, r23 ; 0x01 153a6: 82 83 std Z+2, r24 ; 0x02 153a8: 93 83 std Z+3, r25 ; 0x03 153aa: f4 e0 ldi r31, 0x04 ; 4 153ac: ef 0e add r14, r31 153ae: 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++) 153b0: 22 e0 ldi r18, 0x02 ; 2 153b2: 07 3c cpi r16, 0xC7 ; 199 153b4: 12 07 cpc r17, r18 153b6: 59 f7 brne .-42 ; 0x1538e 153b8: 65 c8 rjmp .-3894 ; 0x14484 - `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')) 153ba: 83 e5 ldi r24, 0x53 ; 83 153bc: 0e 94 80 56 call 0xad00 ; 0xad00 153c0: 88 23 and r24, r24 153c2: 51 f0 breq .+20 ; 0x153d8 { cs.retract_length = code_value() ; 153c4: 0e 94 10 5b call 0xb620 ; 0xb620 153c8: 60 93 ea 0d sts 0x0DEA, r22 ; 0x800dea 153cc: 70 93 eb 0d sts 0x0DEB, r23 ; 0x800deb 153d0: 80 93 ec 0d sts 0x0DEC, r24 ; 0x800dec 153d4: 90 93 ed 0d sts 0x0DED, r25 ; 0x800ded } if(code_seen('F')) 153d8: 86 e4 ldi r24, 0x46 ; 70 153da: 0e 94 80 56 call 0xad00 ; 0xad00 153de: 88 23 and r24, r24 153e0: 61 f0 breq .+24 ; 0x153fa { cs.retract_feedrate = get_feedrate_mm_s(code_value()); 153e2: 0e 94 10 5b call 0xb620 ; 0xb620 153e6: 0e 94 96 65 call 0xcb2c ; 0xcb2c 153ea: 60 93 ee 0d sts 0x0DEE, r22 ; 0x800dee 153ee: 70 93 ef 0d sts 0x0DEF, r23 ; 0x800def 153f2: 80 93 f0 0d sts 0x0DF0, r24 ; 0x800df0 153f6: 90 93 f1 0d sts 0x0DF1, r25 ; 0x800df1 } if(code_seen('Z')) 153fa: 8a e5 ldi r24, 0x5A ; 90 153fc: 0e 94 80 56 call 0xad00 ; 0xad00 15400: 88 23 and r24, r24 15402: 09 f4 brne .+2 ; 0x15406 15404: 3f c8 rjmp .-3970 ; 0x14484 { cs.retract_zlift = code_value() ; 15406: 0e 94 10 5b call 0xb620 ; 0xb620 1540a: 60 93 f2 0d sts 0x0DF2, r22 ; 0x800df2 1540e: 70 93 f3 0d sts 0x0DF3, r23 ; 0x800df3 15412: 80 93 f4 0d sts 0x0DF4, r24 ; 0x800df4 15416: 90 93 f5 0d sts 0x0DF5, r25 ; 0x800df5 1541a: 34 c8 rjmp .-3992 ; 0x14484 #### 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')) 1541c: 83 e5 ldi r24, 0x53 ; 83 1541e: 0e 94 80 56 call 0xad00 ; 0xad00 15422: 88 23 and r24, r24 15424: 09 f4 brne .+2 ; 0x15428 15426: 2e c8 rjmp .-4004 ; 0x14484 { switch(code_value_uint8()) 15428: 0e 94 95 56 call 0xad2a ; 0xad2a 1542c: 88 23 and r24, r24 1542e: b9 f0 breq .+46 ; 0x1545e 15430: 81 30 cpi r24, 0x01 ; 1 15432: d1 f0 breq .+52 ; 0x15468 #if EXTRUDERS > 2 retracted[2]=false; #endif }break; default: SERIAL_ECHO_START; 15434: 84 ee ldi r24, 0xE4 ; 228 15436: 92 ea ldi r25, 0xA2 ; 162 15438: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 1543c: 87 ec ldi r24, 0xC7 ; 199 1543e: 95 e6 ldi r25, 0x65 ; 101 15440: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 15444: 80 91 38 12 lds r24, 0x1238 ; 0x801238 15448: 90 91 39 12 lds r25, 0x1239 ; 0x801239 1544c: 82 5b subi r24, 0xB2 ; 178 1544e: 9f 4e sbci r25, 0xEF ; 239 15450: 0e 94 0e 86 call 0x10c1c ; 0x10c1c SERIAL_ECHOLNPGM("\"(1)"); 15454: 81 e1 ldi r24, 0x11 ; 17 15456: 90 e8 ldi r25, 0x80 ; 128 15458: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 1545c: 13 c8 rjmp .-4058 ; 0x14484 { switch(code_value_uint8()) { case 0: { cs.autoretract_enabled=false; 1545e: 10 92 e9 0d sts 0x0DE9, r1 ; 0x800de9 retracted[0]=false; 15462: 10 92 1b 06 sts 0x061B, r1 ; 0x80061b 15466: 0e c8 rjmp .-4068 ; 0x14484 retracted[2]=false; #endif }break; case 1: { cs.autoretract_enabled=true; 15468: 80 93 e9 0d sts 0x0DE9, r24 ; 0x800de9 retracted[0]=false; 1546c: 10 92 1b 06 sts 0x061B, r1 ; 0x80061b 15470: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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; 15474: 40 90 2b 0e lds r4, 0x0E2B ; 0x800e2b 15478: 50 90 2c 0e lds r5, 0x0E2C ; 0x800e2c 1547c: 60 90 2d 0e lds r6, 0x0E2D ; 0x800e2d 15480: 70 90 2e 0e lds r7, 0x0E2E ; 0x800e2e 15484: 0c 94 7e 9f jmp 0x13efc ; 0x13efc float s = code_seen('S') ? code_value() : cs.min_mm_per_arc_segment; 15488: 80 90 2f 0e lds r8, 0x0E2F ; 0x800e2f 1548c: 90 90 30 0e lds r9, 0x0E30 ; 0x800e30 15490: a0 90 31 0e lds r10, 0x0E31 ; 0x800e31 15494: b0 90 32 0e lds r11, 0x0E32 ; 0x800e32 15498: 0c 94 89 9f jmp 0x13f12 ; 0x13f12 - `R` - Restore previous speed factor */ case 220: { bool codesWereSeen = false; if (code_seen('B')) //backup current speed factor 1549c: 82 e4 ldi r24, 0x42 ; 66 1549e: 0e 94 80 56 call 0xad00 ; 0xad00 154a2: 18 2f mov r17, r24 154a4: 88 23 and r24, r24 154a6: 41 f0 breq .+16 ; 0x154b8 { saved_feedmultiply_mm = feedmultiply; 154a8: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 154ac: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 154b0: 90 93 31 02 sts 0x0231, r25 ; 0x800231 154b4: 80 93 30 02 sts 0x0230, r24 ; 0x800230 codesWereSeen = true; } if (code_seen('S')) 154b8: 83 e5 ldi r24, 0x53 ; 83 154ba: 0e 94 80 56 call 0xad00 ; 0xad00 154be: 08 2f mov r16, r24 154c0: 88 23 and r24, r24 154c2: 39 f0 breq .+14 ; 0x154d2 { feedmultiply = code_value_short(); 154c4: 0e 94 a2 56 call 0xad44 ; 0xad44 154c8: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 154cc: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e codesWereSeen = true; 154d0: 10 2f mov r17, r16 } if (code_seen('R')) //restore previous feedmultiply 154d2: 82 e5 ldi r24, 0x52 ; 82 154d4: 0e 94 80 56 call 0xad00 ; 0xad00 154d8: 88 23 and r24, r24 154da: 51 f0 breq .+20 ; 0x154f0 { feedmultiply = saved_feedmultiply_mm; 154dc: 80 91 30 02 lds r24, 0x0230 ; 0x800230 154e0: 90 91 31 02 lds r25, 0x0231 ; 0x800231 154e4: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 154e8: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 154ec: 0c 94 42 a2 jmp 0x14484 ; 0x14484 codesWereSeen = true; } if (!codesWereSeen) 154f0: 11 11 cpse r17, r1 154f2: 0c 94 42 a2 jmp 0x14484 ; 0x14484 { printf_P(PSTR("%i%%\n"), feedmultiply); 154f6: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 154fa: 8f 93 push r24 154fc: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 15500: 8f 93 push r24 15502: 8b e0 ldi r24, 0x0B ; 11 15504: 90 e8 ldi r25, 0x80 ; 128 15506: 9f 93 push r25 15508: 8f 93 push r24 1550a: 0f 94 43 a3 call 0x34686 ; 0x34686 1550e: 0f 90 pop r0 15510: 0f 90 pop r0 15512: 0f 90 pop r0 15514: 0f 90 pop r0 15516: 0c 94 42 a2 jmp 0x14484 ; 0x14484 #### Parameters - `S` - Extrude factor override percentage (0..100 or higher), default 100% */ case 221: { if (code_seen('S')) 1551a: 83 e5 ldi r24, 0x53 ; 83 1551c: 0e 94 80 56 call 0xad00 ; 0xad00 15520: 88 23 and r24, r24 15522: 51 f0 breq .+20 ; 0x15538 { extrudemultiply = code_value_short(); 15524: 0e 94 a2 56 call 0xad44 ; 0xad44 15528: 90 93 76 02 sts 0x0276, r25 ; 0x800276 1552c: 80 93 75 02 sts 0x0275, r24 ; 0x800275 calculate_extruder_multipliers(); 15530: 0e 94 9b 64 call 0xc936 ; 0xc936 15534: 0c 94 42 a2 jmp 0x14484 ; 0x14484 } else { printf_P(PSTR("%i%%\n"), extrudemultiply); 15538: 80 91 76 02 lds r24, 0x0276 ; 0x800276 1553c: 8f 93 push r24 1553e: 80 91 75 02 lds r24, 0x0275 ; 0x800275 15542: 8f 93 push r24 15544: 85 e0 ldi r24, 0x05 ; 5 15546: 90 e8 ldi r25, 0x80 ; 128 15548: 9f 93 push r25 1554a: 8f 93 push r24 1554c: 0f 94 43 a3 call 0x34686 ; 0x34686 15550: 0f 90 pop r0 15552: 0f 90 pop r0 15554: 0f 90 pop r0 15556: 0f 90 pop r0 15558: 0c 94 42 a2 jmp 0x14484 ; 0x14484 - `P` - pin number - `S` - pin state */ case 226: { if(code_seen('P')){ 1555c: 80 e5 ldi r24, 0x50 ; 80 1555e: 0e 94 80 56 call 0xad00 ; 0xad00 15562: 88 23 and r24, r24 15564: 11 f4 brne .+4 ; 0x1556a 15566: 0c 94 42 a2 jmp 0x14484 ; 0x14484 int pin_number = code_value_short(); // pin number 1556a: 0e 94 a2 56 call 0xad44 ; 0xad44 1556e: 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 15570: 83 e5 ldi r24, 0x53 ; 83 15572: 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 15576: 0f ef ldi r16, 0xFF ; 255 15578: 1f ef ldi r17, 0xFF ; 255 if(code_seen('S')) pin_state = code_value_short(); // required pin state 1557a: 88 23 and r24, r24 1557c: 19 f0 breq .+6 ; 0x15584 1557e: 0e 94 a2 56 call 0xad44 ; 0xad44 15582: 8c 01 movw r16, r24 if(pin_state >= -1 && pin_state <= 1){ 15584: c8 01 movw r24, r16 15586: 01 96 adiw r24, 0x01 ; 1 15588: 03 97 sbiw r24, 0x03 ; 3 1558a: 10 f0 brcs .+4 ; 0x15590 1558c: 0c 94 42 a2 jmp 0x14484 ; 0x14484 15590: eb e0 ldi r30, 0x0B ; 11 15592: f1 e8 ldi r31, 0x81 ; 129 15594: 27 e2 ldi r18, 0x27 ; 39 15596: 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)) 15598: 84 91 lpm r24, Z 1559a: 08 2e mov r0, r24 1559c: 00 0c add r0, r0 1559e: 99 0b sbc r25, r25 155a0: e8 16 cp r14, r24 155a2: f9 06 cpc r15, r25 155a4: 11 f4 brne .+4 ; 0x155aa 155a6: 0c 94 42 a2 jmp 0x14484 ; 0x14484 155aa: 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++) 155ac: 2e 17 cp r18, r30 155ae: 3f 07 cpc r19, r31 155b0: 99 f7 brne .-26 ; 0x15598 pin_number = -1; break; } } if (pin_number > -1) 155b2: f7 fe sbrs r15, 7 155b4: 02 c0 rjmp .+4 ; 0x155ba 155b6: 0c 94 42 a2 jmp 0x14484 ; 0x14484 { int target = LOW; st_synchronize(); 155ba: 0f 94 94 18 call 0x23128 ; 0x23128 pinMode(pin_number, INPUT); 155be: de 2c mov r13, r14 155c0: 60 e0 ldi r22, 0x00 ; 0 155c2: 8e 2d mov r24, r14 155c4: 0e 94 25 d1 call 0x1a24a ; 0x1a24a switch(pin_state){ 155c8: 0f 3f cpi r16, 0xFF ; 255 155ca: 10 07 cpc r17, r16 155cc: b1 f0 breq .+44 ; 0x155fa 155ce: 01 30 cpi r16, 0x01 ; 1 155d0: 11 05 cpc r17, r1 155d2: 11 f0 breq .+4 ; 0x155d8 } } if (pin_number > -1) { int target = LOW; 155d4: 10 e0 ldi r17, 0x00 ; 0 155d6: 00 e0 ldi r16, 0x00 ; 0 case -1: target = !digitalRead(pin_number); break; } while(digitalRead(pin_number) != target){ 155d8: 8d 2d mov r24, r13 155da: 0e 94 ce d0 call 0x1a19c ; 0x1a19c 155de: 80 17 cp r24, r16 155e0: 91 07 cpc r25, r17 155e2: 11 f4 brne .+4 ; 0x155e8 155e4: 0c 94 42 a2 jmp 0x14484 ; 0x14484 manage_heater(); 155e8: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(); 155ec: 80 e0 ldi r24, 0x00 ; 0 155ee: 0e 94 ad 8a call 0x1155a ; 0x1155a lcd_update(0); 155f2: 80 e0 ldi r24, 0x00 ; 0 155f4: 0e 94 4a 6f call 0xde94 ; 0xde94 155f8: ef cf rjmp .-34 ; 0x155d8 case 0: target = LOW; break; case -1: target = !digitalRead(pin_number); 155fa: 8e 2d mov r24, r14 155fc: 0e 94 ce d0 call 0x1a19c ; 0x1a19c 15600: 31 e0 ldi r19, 0x01 ; 1 15602: 20 e0 ldi r18, 0x00 ; 0 15604: 89 2b or r24, r25 15606: 09 f0 breq .+2 ; 0x1560a 15608: 30 e0 ldi r19, 0x00 ; 0 1560a: 03 2f mov r16, r19 1560c: 12 2f mov r17, r18 1560e: e4 cf rjmp .-56 ; 0x155d8 case 300: // M300 { uint16_t beepP = code_seen('P') ? code_value() : 1000; uint16_t beepS; if (!code_seen('S')) beepS = 0; 15610: 70 e0 ldi r23, 0x00 ; 0 15612: 60 e0 ldi r22, 0x00 ; 0 // handle S0 as a pause _delay(beepP); break; } } Sound_MakeCustom(beepP, beepS, false); 15614: 40 e0 ldi r20, 0x00 ; 0 15616: c8 01 movw r24, r16 15618: 0f 94 4a 25 call 0x24a94 ; 0x24a94 1561c: 0c 94 42 a2 jmp 0x14484 ; 0x14484 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 301: { if(code_seen('P')) cs.Kp = code_value(); 15620: 80 e5 ldi r24, 0x50 ; 80 15622: 0e 94 80 56 call 0xad00 ; 0xad00 15626: 88 23 and r24, r24 15628: 51 f0 breq .+20 ; 0x1563e 1562a: 0e 94 10 5b call 0xb620 ; 0xb620 1562e: 60 93 cf 0d sts 0x0DCF, r22 ; 0x800dcf 15632: 70 93 d0 0d sts 0x0DD0, r23 ; 0x800dd0 15636: 80 93 d1 0d sts 0x0DD1, r24 ; 0x800dd1 1563a: 90 93 d2 0d sts 0x0DD2, r25 ; 0x800dd2 if(code_seen('I')) cs.Ki = scalePID_i(code_value()); 1563e: 89 e4 ldi r24, 0x49 ; 73 15640: 0e 94 80 56 call 0xad00 ; 0xad00 15644: 88 23 and r24, r24 15646: 81 f0 breq .+32 ; 0x15668 15648: 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; 1564c: 2c ea ldi r18, 0xAC ; 172 1564e: 35 ec ldi r19, 0xC5 ; 197 15650: 47 e2 ldi r20, 0x27 ; 39 15652: 5e e3 ldi r21, 0x3E ; 62 15654: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 15658: 60 93 d3 0d sts 0x0DD3, r22 ; 0x800dd3 1565c: 70 93 d4 0d sts 0x0DD4, r23 ; 0x800dd4 15660: 80 93 d5 0d sts 0x0DD5, r24 ; 0x800dd5 15664: 90 93 d6 0d sts 0x0DD6, r25 ; 0x800dd6 if(code_seen('D')) cs.Kd = scalePID_d(code_value()); 15668: 84 e4 ldi r24, 0x44 ; 68 1566a: 0e 94 80 56 call 0xad00 ; 0xad00 1566e: 88 23 and r24, r24 15670: 81 f0 breq .+32 ; 0x15692 15672: 0e 94 10 5b call 0xb620 ; 0xb620 } float unscalePID_i(float i) { return i/PID_dT; 15676: 2c ea ldi r18, 0xAC ; 172 15678: 35 ec ldi r19, 0xC5 ; 197 1567a: 47 e2 ldi r20, 0x27 ; 39 1567c: 5e e3 ldi r21, 0x3E ; 62 1567e: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 15682: 60 93 d7 0d sts 0x0DD7, r22 ; 0x800dd7 15686: 70 93 d8 0d sts 0x0DD8, r23 ; 0x800dd8 1568a: 80 93 d9 0d sts 0x0DD9, r24 ; 0x800dd9 1568e: 90 93 da 0d sts 0x0DDA, r25 ; 0x800dda updatePID(); 15692: 0f 94 d9 14 call 0x229b2 ; 0x229b2 SERIAL_PROTOCOLRPGM(MSG_OK); 15696: 80 e9 ldi r24, 0x90 ; 144 15698: 9a e6 ldi r25, 0x6A ; 106 1569a: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOLPGM(" p:"); 1569e: 81 e0 ldi r24, 0x01 ; 1 156a0: 90 e8 ldi r25, 0x80 ; 128 156a2: 0e 94 15 7b call 0xf62a ; 0xf62a } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 156a6: 60 91 cf 0d lds r22, 0x0DCF ; 0x800dcf 156aa: 70 91 d0 0d lds r23, 0x0DD0 ; 0x800dd0 156ae: 80 91 d1 0d lds r24, 0x0DD1 ; 0x800dd1 156b2: 90 91 d2 0d lds r25, 0x0DD2 ; 0x800dd2 156b6: 42 e0 ldi r20, 0x02 ; 2 156b8: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL(cs.Kp); SERIAL_PROTOCOLPGM(" i:"); 156bc: 8d ef ldi r24, 0xFD ; 253 156be: 9f e7 ldi r25, 0x7F ; 127 156c0: 0e 94 15 7b call 0xf62a ; 0xf62a 156c4: 2c ea ldi r18, 0xAC ; 172 156c6: 35 ec ldi r19, 0xC5 ; 197 156c8: 47 e2 ldi r20, 0x27 ; 39 156ca: 5e e3 ldi r21, 0x3E ; 62 156cc: 60 91 d3 0d lds r22, 0x0DD3 ; 0x800dd3 156d0: 70 91 d4 0d lds r23, 0x0DD4 ; 0x800dd4 156d4: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 156d8: 90 91 d6 0d lds r25, 0x0DD6 ; 0x800dd6 156dc: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 156e0: 42 e0 ldi r20, 0x02 ; 2 156e2: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL(unscalePID_i(cs.Ki)); SERIAL_PROTOCOLPGM(" d:"); 156e6: 89 ef ldi r24, 0xF9 ; 249 156e8: 9f e7 ldi r25, 0x7F ; 127 156ea: 0e 94 15 7b call 0xf62a ; 0xf62a #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 156ee: 2c ea ldi r18, 0xAC ; 172 156f0: 35 ec ldi r19, 0xC5 ; 197 156f2: 47 e2 ldi r20, 0x27 ; 39 156f4: 5e e3 ldi r21, 0x3E ; 62 156f6: 60 91 d7 0d lds r22, 0x0DD7 ; 0x800dd7 156fa: 70 91 d8 0d lds r23, 0x0DD8 ; 0x800dd8 156fe: 80 91 d9 0d lds r24, 0x0DD9 ; 0x800dd9 15702: 90 91 da 0d lds r25, 0x0DDA ; 0x800dda 15706: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.Kd)); 1570a: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 1570e: 0c 94 42 a2 jmp 0x14484 ; 0x14484 - `I` - integral (Ki) - `D` - derivative (Kd) */ case 304: { if(code_seen('P')) cs.bedKp = code_value(); 15712: 80 e5 ldi r24, 0x50 ; 80 15714: 0e 94 80 56 call 0xad00 ; 0xad00 15718: 88 23 and r24, r24 1571a: 51 f0 breq .+20 ; 0x15730 1571c: 0e 94 10 5b call 0xb620 ; 0xb620 15720: 60 93 db 0d sts 0x0DDB, r22 ; 0x800ddb 15724: 70 93 dc 0d sts 0x0DDC, r23 ; 0x800ddc 15728: 80 93 dd 0d sts 0x0DDD, r24 ; 0x800ddd 1572c: 90 93 de 0d sts 0x0DDE, r25 ; 0x800dde if(code_seen('I')) cs.bedKi = scalePID_i(code_value()); 15730: 89 e4 ldi r24, 0x49 ; 73 15732: 0e 94 80 56 call 0xad00 ; 0xad00 15736: 88 23 and r24, r24 15738: 81 f0 breq .+32 ; 0x1575a 1573a: 0e 94 10 5b call 0xb620 ; 0xb620 1573e: 2c ea ldi r18, 0xAC ; 172 15740: 35 ec ldi r19, 0xC5 ; 197 15742: 47 e2 ldi r20, 0x27 ; 39 15744: 5e e3 ldi r21, 0x3E ; 62 15746: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1574a: 60 93 df 0d sts 0x0DDF, r22 ; 0x800ddf 1574e: 70 93 e0 0d sts 0x0DE0, r23 ; 0x800de0 15752: 80 93 e1 0d sts 0x0DE1, r24 ; 0x800de1 15756: 90 93 e2 0d sts 0x0DE2, r25 ; 0x800de2 if(code_seen('D')) cs.bedKd = scalePID_d(code_value()); 1575a: 84 e4 ldi r24, 0x44 ; 68 1575c: 0e 94 80 56 call 0xad00 ; 0xad00 15760: 88 23 and r24, r24 15762: 81 f0 breq .+32 ; 0x15784 15764: 0e 94 10 5b call 0xb620 ; 0xb620 } float unscalePID_i(float i) { return i/PID_dT; 15768: 2c ea ldi r18, 0xAC ; 172 1576a: 35 ec ldi r19, 0xC5 ; 197 1576c: 47 e2 ldi r20, 0x27 ; 39 1576e: 5e e3 ldi r21, 0x3E ; 62 15770: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 15774: 60 93 e3 0d sts 0x0DE3, r22 ; 0x800de3 15778: 70 93 e4 0d sts 0x0DE4, r23 ; 0x800de4 1577c: 80 93 e5 0d sts 0x0DE5, r24 ; 0x800de5 15780: 90 93 e6 0d sts 0x0DE6, r25 ; 0x800de6 updatePID(); 15784: 0f 94 d9 14 call 0x229b2 ; 0x229b2 SERIAL_PROTOCOLRPGM(MSG_OK); 15788: 80 e9 ldi r24, 0x90 ; 144 1578a: 9a e6 ldi r25, 0x6A ; 106 1578c: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOLPGM(" p:"); 15790: 85 ef ldi r24, 0xF5 ; 245 15792: 9f e7 ldi r25, 0x7F ; 127 15794: 0e 94 15 7b call 0xf62a ; 0xf62a 15798: 60 91 db 0d lds r22, 0x0DDB ; 0x800ddb 1579c: 70 91 dc 0d lds r23, 0x0DDC ; 0x800ddc 157a0: 80 91 dd 0d lds r24, 0x0DDD ; 0x800ddd 157a4: 90 91 de 0d lds r25, 0x0DDE ; 0x800dde 157a8: 42 e0 ldi r20, 0x02 ; 2 157aa: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL(cs.bedKp); SERIAL_PROTOCOLPGM(" i:"); 157ae: 81 ef ldi r24, 0xF1 ; 241 157b0: 9f e7 ldi r25, 0x7F ; 127 157b2: 0e 94 15 7b call 0xf62a ; 0xf62a 157b6: 2c ea ldi r18, 0xAC ; 172 157b8: 35 ec ldi r19, 0xC5 ; 197 157ba: 47 e2 ldi r20, 0x27 ; 39 157bc: 5e e3 ldi r21, 0x3E ; 62 157be: 60 91 df 0d lds r22, 0x0DDF ; 0x800ddf 157c2: 70 91 e0 0d lds r23, 0x0DE0 ; 0x800de0 157c6: 80 91 e1 0d lds r24, 0x0DE1 ; 0x800de1 157ca: 90 91 e2 0d lds r25, 0x0DE2 ; 0x800de2 157ce: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 157d2: 42 e0 ldi r20, 0x02 ; 2 157d4: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL(unscalePID_i(cs.bedKi)); SERIAL_PROTOCOLPGM(" d:"); 157d8: 8d ee ldi r24, 0xED ; 237 157da: 9f e7 ldi r25, 0x7F ; 127 157dc: 0e 94 15 7b call 0xf62a ; 0xf62a #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 157e0: 2c ea ldi r18, 0xAC ; 172 157e2: 35 ec ldi r19, 0xC5 ; 197 157e4: 47 e2 ldi r20, 0x27 ; 39 157e6: 5e e3 ldi r21, 0x3E ; 62 157e8: 60 91 e3 0d lds r22, 0x0DE3 ; 0x800de3 157ec: 70 91 e4 0d lds r23, 0x0DE4 ; 0x800de4 157f0: 80 91 e5 0d lds r24, 0x0DE5 ; 0x800de5 157f4: 90 91 e6 0d lds r25, 0x0DE6 ; 0x800de6 157f8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> SERIAL_PROTOCOLLN(unscalePID_d(cs.bedKd)); 157fc: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 15800: 0c 94 42 a2 jmp 0x14484 ; 0x14484 - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; if (code_seen('S')) temp=code_value_short(); 15804: 83 e5 ldi r24, 0x53 ; 83 15806: 0e 94 80 56 call 0xad00 ; 0xad00 1580a: 88 23 and r24, r24 1580c: 41 f0 breq .+16 ; 0x1581e 1580e: 0e 94 a2 56 call 0xad44 ; 0xad44 } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 15812: 90 93 58 02 sts 0x0258, r25 ; 0x800258 15816: 80 93 57 02 sts 0x0257, r24 ; 0x800257 1581a: 0c 94 42 a2 jmp 0x14484 ; 0x14484 #### Parameters - `S` - Cold extrude minimum temperature */ case 302: { int temp = 0; 1581e: 90 e0 ldi r25, 0x00 ; 0 15820: 80 e0 ldi r24, 0x00 ; 0 15822: f7 cf rjmp .-18 ; 0x15812 */ case 303: { float temp = 150.0; int e = 0; int c = 5; 15824: 85 e0 ldi r24, 0x05 ; 5 15826: 90 e0 ldi r25, 0x00 ; 0 15828: 0c 94 54 a0 jmp 0x140a8 ; 0x140a8 M400 */ case 400: { st_synchronize(); 1582c: 0f 94 94 18 call 0x23128 ; 0x23128 15830: 0c 94 42 a2 jmp 0x14484 ; 0x14484 */ case 405: // M405 Enable Filament Sensor { fsensor.setEnabled(1); 15834: 81 e0 ldi r24, 0x01 ; 1 15836: 0e 94 e1 77 call 0xefc2 ; 0xefc2 1583a: 0c 94 42 a2 jmp 0x14484 ; 0x14484 */ case 406: // M406 Disable Filament Sensor { fsensor.setEnabled(0); 1583e: 80 e0 ldi r24, 0x00 ; 0 15840: 0e 94 e1 77 call 0xefc2 ; 0xefc2 15844: 0c 94 42 a2 jmp 0x14484 ; 0x14484 M420 */ case 420: // M420 Mesh bed leveling status { gcode_G81_M420(); 15848: 0e 94 cc 83 call 0x10798 ; 0x10798 1584c: 0c 94 42 a2 jmp 0x14484 ; 0x14484 M500 */ case 500: { Config_StoreSettings(); 15850: 0e 94 f8 85 call 0x10bf0 ; 0x10bf0 15854: 0c 94 42 a2 jmp 0x14484 ; 0x14484 M502 */ case 502: { Config_ResetDefault(); 15858: 0e 94 67 85 call 0x10ace ; 0x10ace 1585c: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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( 15860: 80 91 ca 0d lds r24, 0x0DCA ; 0x800dca 15864: 8f 93 push r24 15866: 80 91 c9 0d lds r24, 0x0DC9 ; 0x800dc9 1586a: 8f 93 push r24 1586c: 80 91 c8 0d lds r24, 0x0DC8 ; 0x800dc8 15870: 8f 93 push r24 15872: 80 91 c7 0d lds r24, 0x0DC7 ; 0x800dc7 15876: 8f 93 push r24 15878: 80 91 c6 0d lds r24, 0x0DC6 ; 0x800dc6 1587c: 8f 93 push r24 1587e: 80 91 c5 0d lds r24, 0x0DC5 ; 0x800dc5 15882: 8f 93 push r24 15884: 80 91 c4 0d lds r24, 0x0DC4 ; 0x800dc4 15888: 8f 93 push r24 1588a: 80 91 c3 0d lds r24, 0x0DC3 ; 0x800dc3 1588e: 8f 93 push r24 15890: 80 91 c2 0d lds r24, 0x0DC2 ; 0x800dc2 15894: 8f 93 push r24 15896: 80 91 c1 0d lds r24, 0x0DC1 ; 0x800dc1 1589a: 8f 93 push r24 1589c: 80 91 c0 0d lds r24, 0x0DC0 ; 0x800dc0 158a0: 8f 93 push r24 158a2: 80 91 bf 0d lds r24, 0x0DBF ; 0x800dbf 158a6: 8f 93 push r24 158a8: 04 ee ldi r16, 0xE4 ; 228 158aa: 12 ea ldi r17, 0xA2 ; 162 158ac: 1f 93 push r17 158ae: 0f 93 push r16 158b0: 1f 93 push r17 158b2: 0f 93 push r16 158b4: 80 91 be 0d lds r24, 0x0DBE ; 0x800dbe 158b8: 8f 93 push r24 158ba: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 158be: 8f 93 push r24 158c0: 80 91 bc 0d lds r24, 0x0DBC ; 0x800dbc 158c4: 8f 93 push r24 158c6: 80 91 bb 0d lds r24, 0x0DBB ; 0x800dbb 158ca: 8f 93 push r24 158cc: 80 91 ba 0d lds r24, 0x0DBA ; 0x800dba 158d0: 8f 93 push r24 158d2: 80 91 b9 0d lds r24, 0x0DB9 ; 0x800db9 158d6: 8f 93 push r24 158d8: 80 91 b8 0d lds r24, 0x0DB8 ; 0x800db8 158dc: 8f 93 push r24 158de: 80 91 b7 0d lds r24, 0x0DB7 ; 0x800db7 158e2: 8f 93 push r24 158e4: 80 91 b6 0d lds r24, 0x0DB6 ; 0x800db6 158e8: 8f 93 push r24 158ea: 80 91 b5 0d lds r24, 0x0DB5 ; 0x800db5 158ee: 8f 93 push r24 158f0: 80 91 b4 0d lds r24, 0x0DB4 ; 0x800db4 158f4: 8f 93 push r24 158f6: 80 91 b3 0d lds r24, 0x0DB3 ; 0x800db3 158fa: 8f 93 push r24 158fc: 80 91 b2 0d lds r24, 0x0DB2 ; 0x800db2 15900: 8f 93 push r24 15902: 80 91 b1 0d lds r24, 0x0DB1 ; 0x800db1 15906: 8f 93 push r24 15908: 80 91 b0 0d lds r24, 0x0DB0 ; 0x800db0 1590c: 8f 93 push r24 1590e: 80 91 af 0d lds r24, 0x0DAF ; 0x800daf 15912: 8f 93 push r24 15914: 80 91 ae 0d lds r24, 0x0DAE ; 0x800dae 15918: 8f 93 push r24 1591a: 80 91 ad 0d lds r24, 0x0DAD ; 0x800dad 1591e: 8f 93 push r24 15920: 80 91 ac 0d lds r24, 0x0DAC ; 0x800dac 15924: 8f 93 push r24 15926: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 1592a: 8f 93 push r24 1592c: 80 91 aa 0d lds r24, 0x0DAA ; 0x800daa 15930: 8f 93 push r24 15932: 80 91 a9 0d lds r24, 0x0DA9 ; 0x800da9 15936: 8f 93 push r24 15938: 80 91 a8 0d lds r24, 0x0DA8 ; 0x800da8 1593c: 8f 93 push r24 1593e: 80 91 a7 0d lds r24, 0x0DA7 ; 0x800da7 15942: 8f 93 push r24 15944: 80 91 a6 0d lds r24, 0x0DA6 ; 0x800da6 15948: 8f 93 push r24 1594a: 80 91 a5 0d lds r24, 0x0DA5 ; 0x800da5 1594e: 8f 93 push r24 15950: 80 91 a4 0d lds r24, 0x0DA4 ; 0x800da4 15954: 8f 93 push r24 15956: 80 91 a3 0d lds r24, 0x0DA3 ; 0x800da3 1595a: 8f 93 push r24 1595c: 1f 93 push r17 1595e: 0f 93 push r16 15960: 1f 93 push r17 15962: 0f 93 push r16 15964: 80 91 2a 0e lds r24, 0x0E2A ; 0x800e2a 15968: 8f 93 push r24 1596a: 80 91 29 0e lds r24, 0x0E29 ; 0x800e29 1596e: 8f 93 push r24 15970: 80 91 28 0e lds r24, 0x0E28 ; 0x800e28 15974: 8f 93 push r24 15976: 80 91 27 0e lds r24, 0x0E27 ; 0x800e27 1597a: 8f 93 push r24 1597c: 80 91 a2 0d lds r24, 0x0DA2 ; 0x800da2 15980: 8f 93 push r24 15982: 80 91 a1 0d lds r24, 0x0DA1 ; 0x800da1 15986: 8f 93 push r24 15988: 80 91 a0 0d lds r24, 0x0DA0 ; 0x800da0 1598c: 8f 93 push r24 1598e: 80 91 9f 0d lds r24, 0x0D9F ; 0x800d9f 15992: 8f 93 push r24 15994: 80 91 9e 0d lds r24, 0x0D9E ; 0x800d9e 15998: 8f 93 push r24 1599a: 80 91 9d 0d lds r24, 0x0D9D ; 0x800d9d 1599e: 8f 93 push r24 159a0: 80 91 9c 0d lds r24, 0x0D9C ; 0x800d9c 159a4: 8f 93 push r24 159a6: 80 91 9b 0d lds r24, 0x0D9B ; 0x800d9b 159aa: 8f 93 push r24 159ac: 1f 93 push r17 159ae: 0f 93 push r16 159b0: 1f 93 push r17 159b2: 0f 93 push r16 159b4: 80 91 9a 0d lds r24, 0x0D9A ; 0x800d9a 159b8: 8f 93 push r24 159ba: 80 91 99 0d lds r24, 0x0D99 ; 0x800d99 159be: 8f 93 push r24 159c0: 80 91 98 0d lds r24, 0x0D98 ; 0x800d98 159c4: 8f 93 push r24 159c6: 80 91 97 0d lds r24, 0x0D97 ; 0x800d97 159ca: 8f 93 push r24 159cc: 80 91 96 0d lds r24, 0x0D96 ; 0x800d96 159d0: 8f 93 push r24 159d2: 80 91 95 0d lds r24, 0x0D95 ; 0x800d95 159d6: 8f 93 push r24 159d8: 80 91 94 0d lds r24, 0x0D94 ; 0x800d94 159dc: 8f 93 push r24 159de: 80 91 93 0d lds r24, 0x0D93 ; 0x800d93 159e2: 8f 93 push r24 159e4: 80 91 92 0d lds r24, 0x0D92 ; 0x800d92 159e8: 8f 93 push r24 159ea: 80 91 91 0d lds r24, 0x0D91 ; 0x800d91 159ee: 8f 93 push r24 159f0: 80 91 90 0d lds r24, 0x0D90 ; 0x800d90 159f4: 8f 93 push r24 159f6: 80 91 8f 0d lds r24, 0x0D8F ; 0x800d8f 159fa: 8f 93 push r24 159fc: 80 91 8e 0d lds r24, 0x0D8E ; 0x800d8e 15a00: 8f 93 push r24 15a02: 80 91 8d 0d lds r24, 0x0D8D ; 0x800d8d 15a06: 8f 93 push r24 15a08: 80 91 8c 0d lds r24, 0x0D8C ; 0x800d8c 15a0c: 8f 93 push r24 15a0e: 80 91 8b 0d lds r24, 0x0D8B ; 0x800d8b 15a12: 8f 93 push r24 15a14: 1f 93 push r17 15a16: 0f 93 push r16 15a18: 1f 93 push r17 15a1a: 0f 93 push r16 15a1c: 80 91 8a 0d lds r24, 0x0D8A ; 0x800d8a 15a20: 8f 93 push r24 15a22: 80 91 89 0d lds r24, 0x0D89 ; 0x800d89 15a26: 8f 93 push r24 15a28: 80 91 88 0d lds r24, 0x0D88 ; 0x800d88 15a2c: 8f 93 push r24 15a2e: 80 91 87 0d lds r24, 0x0D87 ; 0x800d87 15a32: 8f 93 push r24 15a34: 80 91 86 0d lds r24, 0x0D86 ; 0x800d86 15a38: 8f 93 push r24 15a3a: 80 91 85 0d lds r24, 0x0D85 ; 0x800d85 15a3e: 8f 93 push r24 15a40: 80 91 84 0d lds r24, 0x0D84 ; 0x800d84 15a44: 8f 93 push r24 15a46: 80 91 83 0d lds r24, 0x0D83 ; 0x800d83 15a4a: 8f 93 push r24 15a4c: 80 91 82 0d lds r24, 0x0D82 ; 0x800d82 15a50: 8f 93 push r24 15a52: 80 91 81 0d lds r24, 0x0D81 ; 0x800d81 15a56: 8f 93 push r24 15a58: 80 91 80 0d lds r24, 0x0D80 ; 0x800d80 15a5c: 8f 93 push r24 15a5e: 80 91 7f 0d lds r24, 0x0D7F ; 0x800d7f 15a62: 8f 93 push r24 15a64: 80 91 7e 0d lds r24, 0x0D7E ; 0x800d7e 15a68: 8f 93 push r24 15a6a: 80 91 7d 0d lds r24, 0x0D7D ; 0x800d7d 15a6e: 8f 93 push r24 15a70: 80 91 7c 0d lds r24, 0x0D7C ; 0x800d7c 15a74: 8f 93 push r24 15a76: 80 91 7b 0d lds r24, 0x0D7B ; 0x800d7b 15a7a: 8f 93 push r24 15a7c: 1f 93 push r17 15a7e: 0f 93 push r16 15a80: 1f 93 push r17 15a82: 0f 93 push r16 15a84: 80 91 7a 0d lds r24, 0x0D7A ; 0x800d7a 15a88: 8f 93 push r24 15a8a: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 15a8e: 8f 93 push r24 15a90: 80 91 78 0d lds r24, 0x0D78 ; 0x800d78 15a94: 8f 93 push r24 15a96: 80 91 77 0d lds r24, 0x0D77 ; 0x800d77 15a9a: 8f 93 push r24 15a9c: 80 91 76 0d lds r24, 0x0D76 ; 0x800d76 15aa0: 8f 93 push r24 15aa2: 80 91 75 0d lds r24, 0x0D75 ; 0x800d75 15aa6: 8f 93 push r24 15aa8: 80 91 74 0d lds r24, 0x0D74 ; 0x800d74 15aac: 8f 93 push r24 15aae: 80 91 73 0d lds r24, 0x0D73 ; 0x800d73 15ab2: 8f 93 push r24 15ab4: 80 91 72 0d lds r24, 0x0D72 ; 0x800d72 15ab8: 8f 93 push r24 15aba: 80 91 71 0d lds r24, 0x0D71 ; 0x800d71 15abe: 8f 93 push r24 15ac0: 80 91 70 0d lds r24, 0x0D70 ; 0x800d70 15ac4: 8f 93 push r24 15ac6: 80 91 6f 0d lds r24, 0x0D6F ; 0x800d6f 15aca: 8f 93 push r24 15acc: 80 91 6e 0d lds r24, 0x0D6E ; 0x800d6e 15ad0: 8f 93 push r24 15ad2: 80 91 6d 0d lds r24, 0x0D6D ; 0x800d6d 15ad6: 8f 93 push r24 15ad8: 80 91 6c 0d lds r24, 0x0D6C ; 0x800d6c 15adc: 8f 93 push r24 15ade: 80 91 6b 0d lds r24, 0x0D6B ; 0x800d6b 15ae2: 8f 93 push r24 15ae4: 1f 93 push r17 15ae6: 0f 93 push r16 15ae8: 1f 93 push r17 15aea: 0f 93 push r16 15aec: 80 e3 ldi r24, 0x30 ; 48 15aee: 9c e7 ldi r25, 0x7C ; 124 15af0: 9f 93 push r25 15af2: 8f 93 push r24 15af4: 0f 94 43 a3 call 0x34686 ; 0x34686 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"), 15af8: 0f b6 in r0, 0x3f ; 63 15afa: f8 94 cli 15afc: de bf out 0x3e, r29 ; 62 15afe: 0f be out 0x3f, r0 ; 63 15b00: cd bf out 0x3d, r28 ; 61 15b02: 2c ea ldi r18, 0xAC ; 172 15b04: 35 ec ldi r19, 0xC5 ; 197 15b06: 47 e2 ldi r20, 0x27 ; 39 15b08: 5e e3 ldi r21, 0x3E ; 62 15b0a: 60 91 d7 0d lds r22, 0x0DD7 ; 0x800dd7 15b0e: 70 91 d8 0d lds r23, 0x0DD8 ; 0x800dd8 15b12: 80 91 d9 0d lds r24, 0x0DD9 ; 0x800dd9 15b16: 90 91 da 0d lds r25, 0x0DDA ; 0x800dda 15b1a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 15b1e: 9f 93 push r25 15b20: 8f 93 push r24 15b22: 7f 93 push r23 15b24: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 15b26: 2c ea ldi r18, 0xAC ; 172 15b28: 35 ec ldi r19, 0xC5 ; 197 15b2a: 47 e2 ldi r20, 0x27 ; 39 15b2c: 5e e3 ldi r21, 0x3E ; 62 15b2e: 60 91 d3 0d lds r22, 0x0DD3 ; 0x800dd3 15b32: 70 91 d4 0d lds r23, 0x0DD4 ; 0x800dd4 15b36: 80 91 d5 0d lds r24, 0x0DD5 ; 0x800dd5 15b3a: 90 91 d6 0d lds r25, 0x0DD6 ; 0x800dd6 15b3e: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 15b42: 9f 93 push r25 15b44: 8f 93 push r24 15b46: 7f 93 push r23 15b48: 6f 93 push r22 15b4a: 80 91 d2 0d lds r24, 0x0DD2 ; 0x800dd2 15b4e: 8f 93 push r24 15b50: 80 91 d1 0d lds r24, 0x0DD1 ; 0x800dd1 15b54: 8f 93 push r24 15b56: 80 91 d0 0d lds r24, 0x0DD0 ; 0x800dd0 15b5a: 8f 93 push r24 15b5c: 80 91 cf 0d lds r24, 0x0DCF ; 0x800dcf 15b60: 8f 93 push r24 15b62: 1f 93 push r17 15b64: 0f 93 push r16 15b66: 1f 93 push r17 15b68: 0f 93 push r16 15b6a: 83 e0 ldi r24, 0x03 ; 3 15b6c: 9c e7 ldi r25, 0x7C ; 124 15b6e: 9f 93 push r25 15b70: 8f 93 push r24 15b72: 0f 94 43 a3 call 0x34686 ; 0x34686 #ifdef PIDTEMP // Apply the scale factors to the PID values float scalePID_i(float i) { return i*PID_dT; 15b76: 2c ea ldi r18, 0xAC ; 172 15b78: 35 ec ldi r19, 0xC5 ; 197 15b7a: 47 e2 ldi r20, 0x27 ; 39 15b7c: 5e e3 ldi r21, 0x3E ; 62 15b7e: 60 91 e3 0d lds r22, 0x0DE3 ; 0x800de3 15b82: 70 91 e4 0d lds r23, 0x0DE4 ; 0x800de4 15b86: 80 91 e5 0d lds r24, 0x0DE5 ; 0x800de5 15b8a: 90 91 e6 0d lds r25, 0x0DE6 ; 0x800de6 15b8e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__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"), 15b92: 9f 93 push r25 15b94: 8f 93 push r24 15b96: 7f 93 push r23 15b98: 6f 93 push r22 } float unscalePID_i(float i) { return i/PID_dT; 15b9a: 2c ea ldi r18, 0xAC ; 172 15b9c: 35 ec ldi r19, 0xC5 ; 197 15b9e: 47 e2 ldi r20, 0x27 ; 39 15ba0: 5e e3 ldi r21, 0x3E ; 62 15ba2: 60 91 df 0d lds r22, 0x0DDF ; 0x800ddf 15ba6: 70 91 e0 0d lds r23, 0x0DE0 ; 0x800de0 15baa: 80 91 e1 0d lds r24, 0x0DE1 ; 0x800de1 15bae: 90 91 e2 0d lds r25, 0x0DE2 ; 0x800de2 15bb2: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 15bb6: 9f 93 push r25 15bb8: 8f 93 push r24 15bba: 7f 93 push r23 15bbc: 6f 93 push r22 15bbe: 80 91 de 0d lds r24, 0x0DDE ; 0x800dde 15bc2: 8f 93 push r24 15bc4: 80 91 dd 0d lds r24, 0x0DDD ; 0x800ddd 15bc8: 8f 93 push r24 15bca: 80 91 dc 0d lds r24, 0x0DDC ; 0x800ddc 15bce: 8f 93 push r24 15bd0: 80 91 db 0d lds r24, 0x0DDB ; 0x800ddb 15bd4: 8f 93 push r24 15bd6: 1f 93 push r17 15bd8: 0f 93 push r16 15bda: 1f 93 push r17 15bdc: 0f 93 push r16 15bde: 8e ec ldi r24, 0xCE ; 206 15be0: 9b e7 ldi r25, 0x7B ; 123 15be2: 9f 93 push r25 15be4: 8f 93 push r24 15be6: 0f 94 43 a3 call 0x34686 ; 0x34686 echomagic, echomagic, cs.bedKp, unscalePID_i(cs.bedKi), unscalePID_d(cs.bedKd)); #endif #ifdef FWRETRACT printf_P(PSTR( 15bea: 0f b6 in r0, 0x3f ; 63 15bec: f8 94 cli 15bee: de bf out 0x3e, r29 ; 62 15bf0: 0f be out 0x3f, r0 ; 63 15bf2: cd bf out 0x3d, r28 ; 61 15bf4: 80 91 e9 0d lds r24, 0x0DE9 ; 0x800de9 15bf8: 1f 92 push r1 15bfa: 8f 93 push r24 15bfc: 1f 93 push r17 15bfe: 0f 93 push r16 15c00: 1f 93 push r17 15c02: 0f 93 push r16 15c04: 20 e0 ldi r18, 0x00 ; 0 15c06: 30 e0 ldi r19, 0x00 ; 0 15c08: 40 e7 ldi r20, 0x70 ; 112 15c0a: 52 e4 ldi r21, 0x42 ; 66 15c0c: 60 91 fa 0d lds r22, 0x0DFA ; 0x800dfa 15c10: 70 91 fb 0d lds r23, 0x0DFB ; 0x800dfb 15c14: 80 91 fc 0d lds r24, 0x0DFC ; 0x800dfc 15c18: 90 91 fd 0d lds r25, 0x0DFD ; 0x800dfd 15c1c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 15c20: 9f 93 push r25 15c22: 8f 93 push r24 15c24: 7f 93 push r23 15c26: 6f 93 push r22 15c28: 80 91 f9 0d lds r24, 0x0DF9 ; 0x800df9 15c2c: 8f 93 push r24 15c2e: 80 91 f8 0d lds r24, 0x0DF8 ; 0x800df8 15c32: 8f 93 push r24 15c34: 80 91 f7 0d lds r24, 0x0DF7 ; 0x800df7 15c38: 8f 93 push r24 15c3a: 80 91 f6 0d lds r24, 0x0DF6 ; 0x800df6 15c3e: 8f 93 push r24 15c40: 1f 93 push r17 15c42: 0f 93 push r16 15c44: 1f 93 push r17 15c46: 0f 93 push r16 15c48: 80 91 f5 0d lds r24, 0x0DF5 ; 0x800df5 15c4c: 8f 93 push r24 15c4e: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 15c52: 8f 93 push r24 15c54: 80 91 f3 0d lds r24, 0x0DF3 ; 0x800df3 15c58: 8f 93 push r24 15c5a: 80 91 f2 0d lds r24, 0x0DF2 ; 0x800df2 15c5e: 8f 93 push r24 15c60: 20 e0 ldi r18, 0x00 ; 0 15c62: 30 e0 ldi r19, 0x00 ; 0 15c64: 40 e7 ldi r20, 0x70 ; 112 15c66: 52 e4 ldi r21, 0x42 ; 66 15c68: 60 91 ee 0d lds r22, 0x0DEE ; 0x800dee 15c6c: 70 91 ef 0d lds r23, 0x0DEF ; 0x800def 15c70: 80 91 f0 0d lds r24, 0x0DF0 ; 0x800df0 15c74: 90 91 f1 0d lds r25, 0x0DF1 ; 0x800df1 15c78: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 15c7c: 9f 93 push r25 15c7e: 8f 93 push r24 15c80: 7f 93 push r23 15c82: 6f 93 push r22 15c84: 80 91 ed 0d lds r24, 0x0DED ; 0x800ded 15c88: 8f 93 push r24 15c8a: 80 91 ec 0d lds r24, 0x0DEC ; 0x800dec 15c8e: 8f 93 push r24 15c90: 80 91 eb 0d lds r24, 0x0DEB ; 0x800deb 15c94: 8f 93 push r24 15c96: 80 91 ea 0d lds r24, 0x0DEA ; 0x800dea 15c9a: 8f 93 push r24 15c9c: 1f 93 push r17 15c9e: 0f 93 push r16 15ca0: 1f 93 push r17 15ca2: 0f 93 push r16 15ca4: 8d ec ldi r24, 0xCD ; 205 15ca6: 9a e7 ldi r25, 0x7A ; 122 15ca8: 9f 93 push r25 15caa: 8f 93 push r24 15cac: 0f 94 43 a3 call 0x34686 ; 0x34686 ); #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) { 15cb0: 0f b6 in r0, 0x3f ; 63 15cb2: f8 94 cli 15cb4: de bf out 0x3e, r29 ; 62 15cb6: 0f be out 0x3f, r0 ; 63 15cb8: cd bf out 0x3d, r28 ; 61 15cba: 80 91 fe 0d lds r24, 0x0DFE ; 0x800dfe 15cbe: 88 23 and r24, r24 15cc0: 09 f4 brne .+2 ; 0x15cc4 15cc2: 56 c0 rjmp .+172 ; 0x15d70 printf_P(PSTR("%SFilament settings:\n%S M200 D%.2f\n"), 15cc4: 80 91 02 0e lds r24, 0x0E02 ; 0x800e02 15cc8: 8f 93 push r24 15cca: 80 91 01 0e lds r24, 0x0E01 ; 0x800e01 15cce: 8f 93 push r24 15cd0: 80 91 00 0e lds r24, 0x0E00 ; 0x800e00 15cd4: 8f 93 push r24 15cd6: 80 91 ff 0d lds r24, 0x0DFF ; 0x800dff 15cda: 8f 93 push r24 15cdc: 1f 93 push r17 15cde: 0f 93 push r16 15ce0: 1f 93 push r17 15ce2: 0f 93 push r16 15ce4: 87 ea ldi r24, 0xA7 ; 167 15ce6: 9a e7 ldi r25, 0x7A ; 122 15ce8: 9f 93 push r25 15cea: 8f 93 push r24 15cec: 0f 94 43 a3 call 0x34686 ; 0x34686 15cf0: 0f b6 in r0, 0x3f ; 63 15cf2: f8 94 cli 15cf4: de bf out 0x3e, r29 ; 62 15cf6: 0f be out 0x3f, r0 ; 63 15cf8: 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( 15cfa: 80 91 37 0e lds r24, 0x0E37 ; 0x800e37 15cfe: 8f 93 push r24 15d00: 80 91 36 0e lds r24, 0x0E36 ; 0x800e36 15d04: 8f 93 push r24 15d06: 80 91 35 0e lds r24, 0x0E35 ; 0x800e35 15d0a: 8f 93 push r24 15d0c: 80 91 34 0e lds r24, 0x0E34 ; 0x800e34 15d10: 8f 93 push r24 15d12: 80 91 33 0e lds r24, 0x0E33 ; 0x800e33 15d16: 1f 92 push r1 15d18: 8f 93 push r24 15d1a: 80 91 32 0e lds r24, 0x0E32 ; 0x800e32 15d1e: 8f 93 push r24 15d20: 80 91 31 0e lds r24, 0x0E31 ; 0x800e31 15d24: 8f 93 push r24 15d26: 80 91 30 0e lds r24, 0x0E30 ; 0x800e30 15d2a: 8f 93 push r24 15d2c: 80 91 2f 0e lds r24, 0x0E2F ; 0x800e2f 15d30: 8f 93 push r24 15d32: 80 91 2e 0e lds r24, 0x0E2E ; 0x800e2e 15d36: 8f 93 push r24 15d38: 80 91 2d 0e lds r24, 0x0E2D ; 0x800e2d 15d3c: 8f 93 push r24 15d3e: 80 91 2c 0e lds r24, 0x0E2C ; 0x800e2c 15d42: 8f 93 push r24 15d44: 80 91 2b 0e lds r24, 0x0E2B ; 0x800e2b 15d48: 8f 93 push r24 15d4a: 84 ee ldi r24, 0xE4 ; 228 15d4c: 92 ea ldi r25, 0xA2 ; 162 15d4e: 9f 93 push r25 15d50: 8f 93 push r24 15d52: 9f 93 push r25 15d54: 8f 93 push r24 15d56: 86 e0 ldi r24, 0x06 ; 6 15d58: 9a e7 ldi r25, 0x7A ; 122 15d5a: 9f 93 push r25 15d5c: 8f 93 push r24 15d5e: 0f 94 43 a3 call 0x34686 ; 0x34686 15d62: 0f b6 in r0, 0x3f ; 63 15d64: f8 94 cli 15d66: de bf out 0x3e, r29 ; 62 15d68: 0f be out 0x3f, r0 ; 63 15d6a: cd bf out 0x3d, r28 ; 61 15d6c: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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); 15d70: 1f 93 push r17 15d72: 0f 93 push r16 15d74: 88 e8 ldi r24, 0x88 ; 136 15d76: 9a e7 ldi r25, 0x7A ; 122 15d78: 9f 93 push r25 15d7a: 8f 93 push r24 15d7c: 0f 94 43 a3 call 0x34686 ; 0x34686 15d80: 0f 90 pop r0 15d82: 0f 90 pop r0 15d84: 0f 90 pop r0 15d86: 0f 90 pop r0 15d88: b8 cf rjmp .-144 ; 0x15cfa #### Parameters - `P` - The IP address in xxx.xxx.xxx.xxx format. Eg: P192.168.1.14 */ case 552: { if (code_seen('P')) 15d8a: 80 e5 ldi r24, 0x50 ; 80 15d8c: 0e 94 80 56 call 0xad00 ; 0xad00 15d90: 88 23 and r24, r24 15d92: 11 f4 brne .+4 ; 0x15d98 15d94: 0c 94 42 a2 jmp 0x14484 ; 0x14484 { uint8_t valCnt = 0; IP_address = 0; 15d98: 10 92 10 06 sts 0x0610, r1 ; 0x800610 15d9c: 10 92 11 06 sts 0x0611, r1 ; 0x800611 15da0: 10 92 12 06 sts 0x0612, r1 ; 0x800612 15da4: 10 92 13 06 sts 0x0613, r1 ; 0x800613 15da8: 00 e1 ldi r16, 0x10 ; 16 15daa: 16 e0 ldi r17, 0x06 ; 6 15dac: 44 e1 ldi r20, 0x14 ; 20 15dae: e4 2e mov r14, r20 15db0: 46 e0 ldi r20, 0x06 ; 6 15db2: f4 2e mov r15, r20 do { *strchr_pointer = '*'; 15db4: 5a e2 ldi r21, 0x2A ; 42 15db6: d5 2e mov r13, r21 15db8: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 15dbc: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 15dc0: d0 82 st Z, r13 ((uint8_t*)&IP_address)[valCnt] = code_value_short(); 15dc2: 0e 94 a2 56 call 0xad44 ; 0xad44 15dc6: d8 01 movw r26, r16 15dc8: 8d 93 st X+, r24 15dca: 8d 01 movw r16, r26 valCnt++; } while ((valCnt < 4) && code_seen('.')); 15dcc: ea 16 cp r14, r26 15dce: fb 06 cpc r15, r27 15dd0: 11 f4 brne .+4 ; 0x15dd6 15dd2: 0c 94 42 a2 jmp 0x14484 ; 0x14484 15dd6: 8e e2 ldi r24, 0x2E ; 46 15dd8: 0e 94 80 56 call 0xad00 ; 0xad00 15ddc: 81 11 cpse r24, r1 15dde: ec cf rjmp .-40 ; 0x15db8 if (valCnt != 4) IP_address = 0; 15de0: 10 92 10 06 sts 0x0610, r1 ; 0x800610 15de4: 10 92 11 06 sts 0x0611, r1 ; 0x800611 15de8: 10 92 12 06 sts 0x0612, r1 ; 0x800612 15dec: 10 92 13 06 sts 0x0613, r1 ; 0x800613 15df0: 0c 94 42 a2 jmp 0x14484 ; 0x14484 - `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(); 15df4: 0f 94 94 18 call 0x23128 ; 0x23128 /// 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; 15df8: 80 91 73 12 lds r24, 0x1273 ; 0x801273 15dfc: 81 11 cpse r24, r1 15dfe: 02 c0 rjmp .+4 ; 0x15e04 15e00: 0e 94 f7 63 call 0xc7ee ; 0xc7ee 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(); 15e04: 85 e4 ldi r24, 0x45 ; 69 15e06: 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; 15e0a: 81 2c mov r8, r1 15e0c: 91 2c mov r9, r1 15e0e: a1 2c mov r10, r1 15e10: 30 ec ldi r19, 0xC0 ; 192 15e12: 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(); 15e14: 88 23 and r24, r24 15e16: 21 f0 breq .+8 ; 0x15e20 15e18: 0e 94 10 5b call 0xb620 ; 0xb620 15e1c: 4b 01 movw r8, r22 15e1e: 5c 01 movw r10, r24 if (code_seen('L')) e_shift_late = code_value(); 15e20: 8c e4 ldi r24, 0x4C ; 76 15e22: 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; 15e26: c1 2c mov r12, r1 15e28: d1 2c mov r13, r1 15e2a: 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(); 15e2c: 88 23 and r24, r24 15e2e: 21 f0 breq .+8 ; 0x15e38 15e30: 0e 94 10 5b call 0xb620 ; 0xb620 15e34: 6b 01 movw r12, r22 15e36: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_shift = fabs(code_value()); 15e38: 8a e5 ldi r24, 0x5A ; 90 15e3a: 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; 15e3e: 41 2c mov r4, r1 15e40: 51 2c mov r5, r1 15e42: 28 ed ldi r18, 0xD8 ; 216 15e44: 62 2e mov r6, r18 15e46: 21 e4 ldi r18, 0x41 ; 65 15e48: 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()); 15e4a: 88 23 and r24, r24 15e4c: 31 f0 breq .+12 ; 0x15e5a 15e4e: 0e 94 10 5b call 0xb620 ; 0xb620 15e52: 2b 01 movw r4, r22 15e54: 3c 01 movw r6, r24 15e56: e8 94 clt 15e58: 77 f8 bld r7, 7 //Move XY to side if (code_seen('X')) x_position = code_value(); 15e5a: 88 e5 ldi r24, 0x58 ; 88 15e5c: 0e 94 80 56 call 0xad00 ; 0xad00 15e60: 88 23 and r24, r24 15e62: 09 f4 brne .+2 ; 0x15e66 15e64: 40 c1 rjmp .+640 ; 0x160e6 15e66: 0e 94 10 5b call 0xb620 ; 0xb620 15e6a: 68 a7 std Y+40, r22 ; 0x28 15e6c: 79 a7 std Y+41, r23 ; 0x29 15e6e: 8a a7 std Y+42, r24 ; 0x2a 15e70: 9b a7 std Y+43, r25 ; 0x2b if (code_seen('Y')) y_position = code_value(); 15e72: 89 e5 ldi r24, 0x59 ; 89 15e74: 0e 94 80 56 call 0xad00 ; 0xad00 15e78: 88 23 and r24, r24 15e7a: 09 f4 brne .+2 ; 0x15e7e 15e7c: 3d c1 rjmp .+634 ; 0x160f8 15e7e: 0e 94 10 5b call 0xb620 ; 0xb620 15e82: 6c a7 std Y+44, r22 ; 0x2c 15e84: 7d a7 std Y+45, r23 ; 0x2d 15e86: 8e a7 std Y+46, r24 ; 0x2e 15e88: 9f a7 std Y+47, r25 ; 0x2f // Filament name to show during the loading char filament_name[LCD_WIDTH + 1] = ""; 15e8a: 1a 82 std Y+2, r1 ; 0x02 15e8c: 19 82 std Y+1, r1 ; 0x01 15e8e: fe 01 movw r30, r28 15e90: 33 96 adiw r30, 0x03 ; 3 15e92: 83 e1 ldi r24, 0x13 ; 19 15e94: df 01 movw r26, r30 15e96: 1d 92 st X+, r1 15e98: 8a 95 dec r24 15e9a: e9 f7 brne .-6 ; 0x15e96 if (code_seen('C')) { 15e9c: 83 e4 ldi r24, 0x43 ; 67 15e9e: 0e 94 80 56 call 0xad00 ; 0xad00 15ea2: 88 23 and r24, r24 15ea4: f9 f0 breq .+62 ; 0x15ee4 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 15ea6: 62 e2 ldi r22, 0x22 ; 34 15ea8: 70 e0 ldi r23, 0x00 ; 0 15eaa: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 15eae: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 15eb2: 0f 94 d8 aa call 0x355b0 ; 0x355b0 15eb6: 8c 01 movw r16, r24 if (!this->ptr) { 15eb8: 89 2b or r24, r25 15eba: a1 f0 breq .+40 ; 0x15ee4 // First quote not found return; } // Skip the leading quote this->ptr++; 15ebc: 0f 5f subi r16, 0xFF ; 255 15ebe: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 15ec0: 62 e2 ldi r22, 0x22 ; 34 15ec2: 70 e0 ldi r23, 0x00 ; 0 15ec4: c8 01 movw r24, r16 15ec6: 0f 94 d8 aa call 0x355b0 ; 0x355b0 if(!pStrEnd) { 15eca: 00 97 sbiw r24, 0x00 ; 0 15ecc: 59 f0 breq .+22 ; 0x15ee4 // Second quote not found return; } this->len = pStrEnd - this->ptr; 15ece: 80 1b sub r24, r16 unquoted_string str = unquoted_string(strchr_pointer); if (str.WasFound()) { const uint8_t len = min(str.GetLength(), LCD_WIDTH); 15ed0: 84 31 cpi r24, 0x14 ; 20 15ed2: 08 f0 brcs .+2 ; 0x15ed6 15ed4: 84 e1 ldi r24, 0x14 ; 20 memcpy(filament_name, str.GetUnquotedString(), len); 15ed6: 48 2f mov r20, r24 15ed8: 50 e0 ldi r21, 0x00 ; 0 15eda: b8 01 movw r22, r16 15edc: ce 01 movw r24, r28 15ede: 01 96 adiw r24, 0x01 ; 1 15ee0: 0f 94 aa aa call 0x35554 ; 0x35554 } } if (MMU2::mmu2.Enabled() && code_seen_P(PSTR("AUTO"))) 15ee4: 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; 15ee8: 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"))) 15eea: 81 30 cpi r24, 0x01 ; 1 15eec: 29 f4 brne .+10 ; 0x15ef8 15eee: 88 ed ldi r24, 0xD8 ; 216 15ef0: 9f e7 ldi r25, 0x7F ; 127 15ef2: 0f 94 ee 39 call 0x273dc ; 0x273dc 15ef6: 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(); 15ef8: 0f 94 94 18 call 0x23128 ; 0x23128 // 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); 15efc: 86 e1 ldi r24, 0x16 ; 22 15efe: 0f 94 05 30 call 0x2600a ; 0x2600a // Turn off the fan fanSpeed = 0; 15f02: 10 92 55 12 sts 0x1255, r1 ; 0x801255 // Retract E if (!printingIsPaused()) 15f06: 0e 94 86 66 call 0xcd0c ; 0xcd0c 15f0a: 81 11 cpse r24, r1 15f0c: fa c0 rjmp .+500 ; 0x16102 { current_position[E_AXIS] += e_shift; 15f0e: a5 01 movw r20, r10 15f10: 94 01 movw r18, r8 15f12: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 15f16: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 15f1a: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 15f1e: 90 91 70 12 lds r25, 0x1270 ; 0x801270 15f22: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 15f26: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 15f2a: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 15f2e: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 15f32: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 15f36: 60 e0 ldi r22, 0x00 ; 0 15f38: 70 e0 ldi r23, 0x00 ; 0 15f3a: 88 ee ldi r24, 0xE8 ; 232 15f3c: 92 e4 ldi r25, 0x42 ; 66 15f3e: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 15f42: 0f 94 94 18 call 0x23128 ; 0x23128 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 15f46: 8f e5 ldi r24, 0x5F ; 95 15f48: 9b e6 ldi r25, 0x6B ; 107 15f4a: 0e 94 0e 7d call 0xfa1c ; 0xfa1c // Filament change can be issued via the Tune menu restore_extruder_temperature_from_ram(); } // Raise the Z axis raise_z(z_shift); 15f4e: c3 01 movw r24, r6 15f50: b2 01 movw r22, r4 15f52: 0e 94 e5 6c call 0xd9ca ; 0xd9ca // Move XY to side current_position[X_AXIS] = x_position; 15f56: 28 a5 ldd r18, Y+40 ; 0x28 15f58: 39 a5 ldd r19, Y+41 ; 0x29 15f5a: 4a a5 ldd r20, Y+42 ; 0x2a 15f5c: 5b a5 ldd r21, Y+43 ; 0x2b 15f5e: 20 93 61 12 sts 0x1261, r18 ; 0x801261 15f62: 30 93 62 12 sts 0x1262, r19 ; 0x801262 15f66: 40 93 63 12 sts 0x1263, r20 ; 0x801263 15f6a: 50 93 64 12 sts 0x1264, r21 ; 0x801264 current_position[Y_AXIS] = y_position; 15f6e: 8c a5 ldd r24, Y+44 ; 0x2c 15f70: 9d a5 ldd r25, Y+45 ; 0x2d 15f72: ae a5 ldd r26, Y+46 ; 0x2e 15f74: bf a5 ldd r27, Y+47 ; 0x2f 15f76: 80 93 65 12 sts 0x1265, r24 ; 0x801265 15f7a: 90 93 66 12 sts 0x1266, r25 ; 0x801266 15f7e: a0 93 67 12 sts 0x1267, r26 ; 0x801267 15f82: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 15f86: 60 e0 ldi r22, 0x00 ; 0 15f88: 70 e0 ldi r23, 0x00 ; 0 15f8a: 88 e4 ldi r24, 0x48 ; 72 15f8c: 92 e4 ldi r25, 0x42 ; 66 15f8e: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 15f92: 0f 94 94 18 call 0x23128 ; 0x23128 bool repeat = false; 15f96: 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; 15f98: 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)); 15f9a: 02 ef ldi r16, 0xF2 ; 242 15f9c: 20 2e mov r2, r16 15f9e: 09 e7 ldi r16, 0x79 ; 121 15fa0: 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; 15fa2: 82 e0 ldi r24, 0x02 ; 2 15fa4: 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)); 15fa6: 9a ef ldi r25, 0xFA ; 250 15fa8: 89 2e mov r8, r25 15faa: 99 e7 ldi r25, 0x79 ; 121 15fac: 99 2e mov r9, r25 st_synchronize(); bool repeat = false; do { // Unload filament if (MMU2::mmu2.Enabled()) { 15fae: 80 91 01 13 lds r24, 0x1301 ; 0x801301 15fb2: 81 30 cpi r24, 0x01 ; 1 15fb4: 09 f0 breq .+2 ; 0x15fb8 15fb6: a8 c0 rjmp .+336 ; 0x16108 eject_slot = MMU2::mmu2.get_current_tool(); 15fb8: 0f 94 45 65 call 0x2ca8a ; 0x2ca8a 15fbc: b8 2e mov r11, r24 mmu_M600_unload_filament(); 15fbe: 0e 94 0d 77 call 0xee1a ; 0xee1a } 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 15fc2: 0f 94 94 18 call 0x23128 ; 0x23128 FSensorBlockRunout fsBlockRunout; 15fc6: 0f 94 c9 78 call 0x2f192 ; 0x2f192 if (!MMU2::mmu2.Enabled()) 15fca: 80 91 01 13 lds r24, 0x1301 ; 0x801301 15fce: 81 30 cpi r24, 0x01 ; 1 15fd0: 09 f4 brne .+2 ; 0x15fd4 15fd2: 64 c1 rjmp .+712 ; 0x1629c { KEEPALIVE_STATE(PAUSED_FOR_USER); 15fd4: 84 e0 ldi r24, 0x04 ; 4 15fd6: 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); 15fda: 8e e3 ldi r24, 0x3E ; 62 15fdc: 99 e3 ldi r25, 0x39 ; 57 15fde: 0e 94 8b 75 call 0xeb16 ; 0xeb16 15fe2: 40 e0 ldi r20, 0x00 ; 0 15fe4: 60 e0 ldi r22, 0x00 ; 0 15fe6: 0e 94 5f e3 call 0x1c6be ; 0x1c6be 15fea: 08 2f mov r16, r24 lcd_update_enable(false); 15fec: 80 e0 ldi r24, 0x00 ; 0 15fee: 0e 94 89 70 call 0xe112 ; 0xe112 if (choice == LCD_MIDDLE_BUTTON_CHOICE) { 15ff2: 01 30 cpi r16, 0x01 ; 1 15ff4: 29 f5 brne .+74 ; 0x16040 lcd_clear(); 15ff6: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 15ffa: 86 eb ldi r24, 0xB6 ; 182 15ffc: 99 e3 ldi r25, 0x39 ; 57 15ffe: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16002: ac 01 movw r20, r24 16004: 62 e0 ldi r22, 0x02 ; 2 16006: 80 e0 ldi r24, 0x00 ; 0 16008: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 current_position[X_AXIS] = 100; 1600c: 80 e0 ldi r24, 0x00 ; 0 1600e: 90 e0 ldi r25, 0x00 ; 0 16010: a8 ec ldi r26, 0xC8 ; 200 16012: b2 e4 ldi r27, 0x42 ; 66 16014: 80 93 61 12 sts 0x1261, r24 ; 0x801261 16018: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1601c: a0 93 63 12 sts 0x1263, r26 ; 0x801263 16020: b0 93 64 12 sts 0x1264, r27 ; 0x801264 plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); 16024: 60 e0 ldi r22, 0x00 ; 0 16026: 70 e0 ldi r23, 0x00 ; 0 16028: 88 e4 ldi r24, 0x48 ; 72 1602a: 92 e4 ldi r25, 0x42 ; 66 1602c: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 16030: 0f 94 94 18 call 0x23128 ; 0x23128 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CHECK_IDLER)); 16034: 8c e0 ldi r24, 0x0C ; 12 16036: 99 e3 ldi r25, 0x39 ; 57 16038: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1603c: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa preheat_or_continue(FilamentAction::UnLoad); } void lcd_wait_interact(const char* filament_name) { lcd_clear(); 16040: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 0, _T(MSG_INSERT_FILAMENT)); 16044: 8a e9 ldi r24, 0x9A ; 154 16046: 98 e3 ldi r25, 0x38 ; 56 16048: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1604c: ac 01 movw r20, r24 1604e: 60 e0 ldi r22, 0x00 ; 0 16050: 80 e0 ldi r24, 0x00 ; 0 16052: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(0, 1); 16056: 61 e0 ldi r22, 0x01 ; 1 16058: 80 e0 ldi r24, 0x00 ; 0 1605a: 0e 94 ab 6f call 0xdf56 ; 0xdf56 if (filament_name[0]) { 1605e: 89 81 ldd r24, Y+1 ; 0x01 16060: 88 23 and r24, r24 16062: 41 f0 breq .+16 ; 0x16074 lcd_print(filament_name); 16064: ce 01 movw r24, r28 16066: 01 96 adiw r24, 0x01 ; 1 16068: 0e 94 b0 73 call 0xe760 ; 0xe760 lcd_set_cursor(0, 2); 1606c: 62 e0 ldi r22, 0x02 ; 2 1606e: 80 e0 ldi r24, 0x00 ; 0 16070: 0e 94 ab 6f call 0xdf56 ; 0xdf56 } #ifdef FILAMENT_SENSOR if (!fsensor.getAutoLoadEnabled()) 16074: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 16078: 81 11 cpse r24, r1 1607a: 06 c0 rjmp .+12 ; 0x16088 #endif //FILAMENT_SENSOR { lcd_puts_P(_T(MSG_PRESS)); 1607c: 85 e8 ldi r24, 0x85 ; 133 1607e: 98 e3 ldi r25, 0x38 ; 56 16080: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16084: 0e 94 6e 6f call 0xdedc ; 0xdedc 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); 16088: 84 e0 ldi r24, 0x04 ; 4 1608a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 while(!lcd_clicked()) 1608e: 0e 94 c6 73 call 0xe78c ; 0xe78c 16092: 81 11 cpse r24, r1 16094: 10 c0 rjmp .+32 ; 0x160b6 { manage_heater(); 16096: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 1609a: 81 e0 ldi r24, 0x01 ; 1 1609c: 0e 94 ad 8a call 0x1155a ; 0x1155a #ifdef FILAMENT_SENSOR if (fsensor.getFilamentLoadEvent()) { 160a0: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 160a4: 88 23 and r24, r24 160a6: 99 f3 breq .-26 ; 0x1608e Sound_MakeCustom(50,1000,false); 160a8: 40 e0 ldi r20, 0x00 ; 0 160aa: 68 ee ldi r22, 0xE8 ; 232 160ac: 73 e0 ldi r23, 0x03 ; 3 160ae: 82 e3 ldi r24, 0x32 ; 50 160b0: 90 e0 ldi r25, 0x00 ; 0 160b2: 0f 94 4a 25 call 0x24a94 ; 0x24a94 break; } #endif //FILAMENT_SENSOR } KEEPALIVE_STATE(IN_HANDLER); 160b6: a0 92 78 02 sts 0x0278, r10 ; 0x800278 M600_load_filament_movements(filament_name); 160ba: ce 01 movw r24, r28 160bc: 01 96 adiw r24, 0x01 ; 1 160be: 0e 94 c6 76 call 0xed8c ; 0xed8c Sound_MakeCustom(50,1000,false); 160c2: 40 e0 ldi r20, 0x00 ; 0 160c4: 68 ee ldi r22, 0xE8 ; 232 160c6: 73 e0 ldi r23, 0x03 ; 3 160c8: 82 e3 ldi r24, 0x32 ; 50 160ca: 90 e0 ldi r25, 0x00 ; 0 160cc: 0f 94 4a 25 call 0x24a94 ; 0x24a94 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); 160d0: b4 e0 ldi r27, 0x04 ; 4 160d2: 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) 160d4: 11 23 and r17, r17 160d6: 09 f4 brne .+2 ; 0x160da 160d8: f6 c0 rjmp .+492 ; 0x162c6 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 160da: 0f 94 33 6d call 0x2da66 ; 0x2da66 current_position[Y_AXIS] = y_position; plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED); st_synchronize(); bool repeat = false; do { 160de: 48 a5 ldd r20, Y+40 ; 0x28 160e0: 41 11 cpse r20, r1 160e2: 65 cf rjmp .-310 ; 0x15fae 160e4: 99 c1 rjmp .+818 ; 0x16418 // 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; 160e6: 20 e0 ldi r18, 0x00 ; 0 160e8: 30 e0 ldi r19, 0x00 ; 0 160ea: 43 e5 ldi r20, 0x53 ; 83 160ec: 53 e4 ldi r21, 0x43 ; 67 160ee: 28 a7 std Y+40, r18 ; 0x28 160f0: 39 a7 std Y+41, r19 ; 0x29 160f2: 4a a7 std Y+42, r20 ; 0x2a 160f4: 5b a7 std Y+43, r21 ; 0x2b 160f6: bd ce rjmp .-646 ; 0x15e72 float y_position = FILAMENTCHANGE_YPOS; 160f8: 1c a6 std Y+44, r1 ; 0x2c 160fa: 1d a6 std Y+45, r1 ; 0x2d 160fc: 1e a6 std Y+46, r1 ; 0x2e 160fe: 1f a6 std Y+47, r1 ; 0x2f 16100: c4 ce rjmp .-632 ; 0x15e8a 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(); 16102: 0e 94 74 64 call 0xc8e8 ; 0xc8e8 16106: 23 cf rjmp .-442 ; 0x15f4e //! //! 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); 16108: 84 e0 ldi r24, 0x04 ; 4 1610a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 unsigned long waiting_start_time = _millis(); 1610e: 0f 94 89 0b call 0x21712 ; 0x21712 16112: 2b 01 movw r4, r22 16114: 3c 01 movw r6, r24 uint8_t wait_for_user_state = 0; lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 16116: 8a e5 ldi r24, 0x5A ; 90 16118: 98 e3 ldi r25, 0x38 ; 56 1611a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1611e: 0e 94 91 de call 0x1bd22 ; 0x1bd22 while (!(wait_for_user_state == 0 && lcd_clicked())){ 16122: 0e 94 c6 73 call 0xe78c ; 0xe78c 16126: 08 2f mov r16, r24 16128: 81 11 cpse r24, r1 1612a: 34 c0 rjmp .+104 ; 0x16194 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) { 1612c: a3 01 movw r20, r6 1612e: 92 01 movw r18, r4 16130: 20 54 subi r18, 0x40 ; 64 16132: 38 4d sbci r19, 0xD8 ; 216 16134: 46 4f sbci r20, 0xF6 ; 246 16136: 5f 4f sbci r21, 0xFF ; 255 16138: 2c a7 std Y+44, r18 ; 0x2c 1613a: 3d a7 std Y+45, r19 ; 0x2d 1613c: 4e a7 std Y+46, r20 ; 0x2e 1613e: 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(); 16140: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 16144: 81 e0 ldi r24, 0x01 ; 1 16146: 0e 94 ad 8a call 0x1155a ; 0x1155a if (wait_for_user_state != 2) sound_wait_for_user(); 1614a: 02 30 cpi r16, 0x02 ; 2 1614c: 09 f4 brne .+2 ; 0x16150 1614e: 65 c0 rjmp .+202 ; 0x1621a 16150: 0f 94 ee 25 call 0x24bdc ; 0x24bdc 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); 16154: 84 e0 ldi r24, 0x04 ; 4 16156: 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) { 16158: 01 30 cpi r16, 0x01 ; 1 1615a: 29 f1 breq .+74 ; 0x161a6 case 0: //nozzle is hot, waiting for user to press the knob to unload filament delay_keep_alive(4); 1615c: 0e 94 07 8d call 0x11a0e ; 0x11a0e if (_millis() > waiting_start_time + (unsigned long)M600_TIMEOUT * 1000) { 16160: 0f 94 89 0b call 0x21712 ; 0x21712 16164: 2c a5 ldd r18, Y+44 ; 0x2c 16166: 3d a5 ldd r19, Y+45 ; 0x2d 16168: 4e a5 ldd r20, Y+46 ; 0x2e 1616a: 5f a5 ldd r21, Y+47 ; 0x2f 1616c: 26 17 cp r18, r22 1616e: 37 07 cpc r19, r23 16170: 48 07 cpc r20, r24 16172: 59 07 cpc r21, r25 16174: b0 f6 brcc .-84 ; 0x16122 lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_PREHEAT)); 16176: 89 e2 ldi r24, 0x29 ; 41 16178: 98 e3 ldi r25, 0x38 ; 56 1617a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1617e: 0e 94 91 de call 0x1bd22 ; 0x1bd22 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 16182: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 16186: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d wait_for_user_state = 1; setTargetHotend(0); st_synchronize(); 1618a: 0f 94 94 18 call 0x23128 ; 0x23128 disable_e0(); 1618e: 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; 16190: 01 e0 ldi r16, 0x01 ; 1 16192: d6 cf rjmp .-84 ; 0x16140 16194: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL10beep_timer.lto_priv.496> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 16198: 10 92 c1 04 sts 0x04C1, r1 ; 0x8004c1 <_ZL6bFirst.lto_priv.497> eject_slot = MMU2::mmu2.get_current_tool(); mmu_M600_unload_filament(); } else { // Beep, manage nozzle heater and wait for user to start unload filament M600_wait_for_user(); unload_filament(e_shift_late); 1619c: c7 01 movw r24, r14 1619e: b6 01 movw r22, r12 161a0: 0e 94 66 e1 call 0x1c2cc ; 0x1c2cc 161a4: 0e cf rjmp .-484 ; 0x15fc2 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); 161a6: 0e 94 07 8d call 0x11a0e ; 0x11a0e if (lcd_clicked()) { 161aa: 0e 94 c6 73 call 0xe78c ; 0xe78c 161ae: 88 23 and r24, r24 161b0: 39 f2 breq .-114 ; 0x16140 161b2: 80 91 5b 12 lds r24, 0x125B ; 0x80125b 161b6: 90 91 5c 12 lds r25, 0x125C ; 0x80125c 161ba: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 161be: 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)); 161c2: 82 e9 ldi r24, 0x92 ; 146 161c4: 9d e3 ldi r25, 0x3D ; 61 161c6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 161ca: 0e 94 91 de call 0x1bd22 ; 0x1bd22 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 161ce: 42 e8 ldi r20, 0x82 ; 130 161d0: 64 e0 ldi r22, 0x04 ; 4 161d2: 80 e0 ldi r24, 0x00 ; 0 161d4: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_printf_P(PSTR("%3d/%3d"), (int16_t)degHotend(active_extruder), (int16_t) degTargetHotend(active_extruder)); 161d8: 80 91 5e 12 lds r24, 0x125E ; 0x80125e 161dc: 8f 93 push r24 161de: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 161e2: 8f 93 push r24 161e4: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 161e8: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 161ec: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 161f0: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 161f4: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 161f8: 7f 93 push r23 161fa: 6f 93 push r22 161fc: 3f 92 push r3 161fe: 2f 92 push r2 16200: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 lcd_putc(LCD_STR_DEGREE[0]); 16204: 81 e8 ldi r24, 0x81 ; 129 16206: 0e 94 72 6f call 0xdee4 ; 0xdee4 1620a: 0f 90 pop r0 1620c: 0f 90 pop r0 1620e: 0f 90 pop r0 16210: 0f 90 pop r0 16212: 0f 90 pop r0 16214: 0f 90 pop r0 setTargetHotend(saved_extruder_temperature); lcd_wait_for_heater(); wait_for_user_state = 2; 16216: 02 e0 ldi r16, 0x02 ; 2 16218: 93 cf rjmp .-218 ; 0x16140 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 1621a: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 1621e: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 16222: 07 2e mov r0, r23 16224: 00 0c add r0, r0 16226: 88 0b sbc r24, r24 16228: 99 0b sbc r25, r25 1622a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> } break; case 2: //waiting for nozzle to reach target temperature if (fabs(degTargetHotend(active_extruder) - degHotend(active_extruder)) < TEMP_HYSTERESIS) { 1622e: 20 91 5a 0d lds r18, 0x0D5A ; 0x800d5a 16232: 30 91 5b 0d lds r19, 0x0D5B ; 0x800d5b 16236: 40 91 5c 0d lds r20, 0x0D5C ; 0x800d5c 1623a: 50 91 5d 0d lds r21, 0x0D5D ; 0x800d5d 1623e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 16242: 9f 77 andi r25, 0x7F ; 127 16244: 20 e0 ldi r18, 0x00 ; 0 16246: 30 e0 ldi r19, 0x00 ; 0 16248: 40 ea ldi r20, 0xA0 ; 160 1624a: 50 e4 ldi r21, 0x40 ; 64 1624c: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 16250: 87 ff sbrs r24, 7 16252: 0b c0 rjmp .+22 ; 0x1626a lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD)); 16254: 8a e5 ldi r24, 0x5A ; 90 16256: 98 e3 ldi r25, 0x38 ; 56 16258: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1625c: 0e 94 91 de call 0x1bd22 ; 0x1bd22 waiting_start_time = _millis(); 16260: 0f 94 89 0b call 0x21712 ; 0x21712 16264: 2b 01 movw r4, r22 16266: 3c 01 movw r6, r24 16268: 5c cf rjmp .-328 ; 0x16122 wait_for_user_state = 0; } else { lcd_set_cursor(1, 4); 1626a: 64 e0 ldi r22, 0x04 ; 4 1626c: 81 e0 ldi r24, 0x01 ; 1 1626e: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(PSTR("%3d"), (int16_t)degHotend(active_extruder)); 16272: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 16276: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1627a: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1627e: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 16282: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 16286: 7f 93 push r23 16288: 6f 93 push r22 1628a: 9f 92 push r9 1628c: 8f 92 push r8 1628e: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 16292: 0f 90 pop r0 16294: 0f 90 pop r0 16296: 0f 90 pop r0 16298: 0f 90 pop r0 1629a: 52 cf rjmp .-348 ; 0x16140 } M600_load_filament(filament_name); } else // MMU is enabled { if (!automatic) mmu_M600_filament_change_screen(eject_slot); 1629c: 11 11 cpse r17, r1 1629e: 03 c0 rjmp .+6 ; 0x162a6 162a0: 8b 2d mov r24, r11 162a2: 0e 94 2a 8d call 0x11a54 ; 0x11a54 mmu_M600_load_filament(automatic); 162a6: 81 2f mov r24, r17 162a8: 0e 94 d3 7b call 0xf7a6 ; 0xf7a6 162ac: 11 cf rjmp .-478 ; 0x160d0 cursor_pos--; else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); } else if (lcd_encoder > 0) { // Rotating knob clockwise if (cursor_pos < 3) 162ae: 03 30 cpi r16, 0x03 ; 3 162b0: 10 f4 brcc .+4 ; 0x162b6 cursor_pos++; 162b2: 0f 5f subi r16, 0xFF ; 255 162b4: 49 c0 rjmp .+146 ; 0x16348 else Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 162b6: 87 e0 ldi r24, 0x07 ; 7 162b8: 0f 94 3f 23 call 0x2467e ; 0x2467e 162bc: 45 c0 rjmp .+138 ; 0x16348 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); 162be: ce 01 movw r24, r28 162c0: 01 96 adiw r24, 0x01 ; 1 162c2: 0e 94 c6 76 call 0xed8c ; 0xed8c 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); 162c6: 70 92 78 02 sts 0x0278, r7 ; 0x800278 uint8_t lcd_alright() { uint8_t cursor_pos = 0; lcd_clear(); 162ca: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(1, 0, _T(MSG_CORRECTLY)); 162ce: 86 ed ldi r24, 0xD6 ; 214 162d0: 98 e3 ldi r25, 0x38 ; 56 162d2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 162d6: ac 01 movw r20, r24 162d8: 60 e0 ldi r22, 0x00 ; 0 162da: 81 e0 ldi r24, 0x01 ; 1 162dc: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(1, 1, _T(MSG_NOT_LOADED)); 162e0: 80 ec ldi r24, 0xC0 ; 192 162e2: 98 e3 ldi r25, 0x38 ; 56 162e4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 162e8: ac 01 movw r20, r24 162ea: 61 e0 ldi r22, 0x01 ; 1 162ec: 81 e0 ldi r24, 0x01 ; 1 162ee: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(1, 2, _T(MSG_NOT_COLOR)); 162f2: 8c ea ldi r24, 0xAC ; 172 162f4: 98 e3 ldi r25, 0x38 ; 56 162f6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 162fa: ac 01 movw r20, r24 162fc: 62 e0 ldi r22, 0x02 ; 2 162fe: 81 e0 ldi r24, 0x01 ; 1 16300: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(1, 3, _T(MSG_UNLOAD_FILAMENT)); 16304: 8b e5 ldi r24, 0x5B ; 91 16306: 97 e4 ldi r25, 0x47 ; 71 16308: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1630c: ac 01 movw r20, r24 1630e: 63 e0 ldi r22, 0x03 ; 3 16310: 81 e0 ldi r24, 0x01 ; 1 16312: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_putc_at(0, cursor_pos, '>'); 16316: 4e e3 ldi r20, 0x3E ; 62 16318: 60 e0 ldi r22, 0x00 ; 0 1631a: 80 e0 ldi r24, 0x00 ; 0 1631c: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_consume_click(); 16320: 0e 94 c1 73 call 0xe782 ; 0xe782 uint8_t lcd_alright() { uint8_t cursor_pos = 0; 16324: 00 e0 ldi r16, 0x00 ; 0 lcd_putc_at(0, cursor_pos, '>'); lcd_consume_click(); while (1) { manage_heater(); 16326: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 1632a: 81 e0 ldi r24, 0x01 ; 1 1632c: 0e 94 ad 8a call 0x1155a ; 0x1155a if (lcd_encoder) 16330: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 16334: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 16338: 00 97 sbiw r24, 0x00 ; 0 1633a: d9 f0 breq .+54 ; 0x16372 { if (lcd_encoder < 0 ) { 1633c: 97 ff sbrs r25, 7 1633e: b7 cf rjmp .-146 ; 0x162ae // Rotating knob counter clockwise if (cursor_pos > 0) 16340: 00 23 and r16, r16 16342: 09 f4 brne .+2 ; 0x16346 16344: b8 cf rjmp .-144 ; 0x162b6 cursor_pos--; 16346: 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 ")); 16348: 4e ef ldi r20, 0xFE ; 254 1634a: 59 e7 ldi r21, 0x79 ; 121 1634c: 60 e0 ldi r22, 0x00 ; 0 1634e: 80 e0 ldi r24, 0x00 ; 0 16350: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_putc_at(0, cursor_pos, '>'); 16354: 4e e3 ldi r20, 0x3E ; 62 16356: 60 2f mov r22, r16 16358: 80 e0 ldi r24, 0x00 ; 0 1635a: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 // Consume rotation event and make feedback sound lcd_encoder = 0; 1635e: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 16362: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e _delay(100); 16366: 64 e6 ldi r22, 0x64 ; 100 16368: 70 e0 ldi r23, 0x00 ; 0 1636a: 80 e0 ldi r24, 0x00 ; 0 1636c: 90 e0 ldi r25, 0x00 ; 0 1636e: 0f 94 56 0b call 0x216ac ; 0x216ac } if (lcd_clicked()) 16372: 0e 94 c6 73 call 0xe78c ; 0xe78c 16376: 88 23 and r24, r24 16378: b1 f2 breq .-84 ; 0x16326 { lcd_clear(); 1637a: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_return_to_status(); 1637e: 0f 94 6e 05 call 0x20adc ; 0x20adc lcd_change_filament_state = lcd_alright(); KEEPALIVE_STATE(IN_HANDLER); 16382: a0 92 78 02 sts 0x0278, r10 ; 0x800278 switch(lcd_change_filament_state) 16386: 02 30 cpi r16, 0x02 ; 2 16388: b1 f0 breq .+44 ; 0x163b6 1638a: 03 30 cpi r16, 0x03 ; 3 1638c: 09 f4 brne .+2 ; 0x16390 1638e: f6 c0 rjmp .+492 ; 0x1657c 16390: 01 30 cpi r16, 0x01 ; 1 16392: 81 f5 brne .+96 ; 0x163f4 { // Filament failed to load so load it again case 1: if (MMU2::mmu2.Enabled()) { 16394: 80 91 01 13 lds r24, 0x1301 ; 0x801301 16398: 81 30 cpi r24, 0x01 ; 1 1639a: 09 f0 breq .+2 ; 0x1639e 1639c: 90 cf rjmp .-224 ; 0x162be uint8_t eject_slot = MMU2::mmu2.get_current_tool(); 1639e: 0f 94 45 65 call 0x2ca8a ; 0x2ca8a 163a2: 08 2f mov r16, r24 // Unload filament mmu_M600_unload_filament(); 163a4: 0e 94 0d 77 call 0xee1a ; 0xee1a // Ask to remove any old filament and load new mmu_M600_filament_change_screen(eject_slot); 163a8: 80 2f mov r24, r16 163aa: 0e 94 2a 8d call 0x11a54 ; 0x11a54 // After user clicks knob, MMU will load the filament mmu_M600_load_filament(false); 163ae: 80 e0 ldi r24, 0x00 ; 0 163b0: 0e 94 d3 7b call 0xf7a6 ; 0xf7a6 163b4: 88 cf rjmp .-240 ; 0x162c6 } break; // Filament loaded properly but color is not clear case 2: st_synchronize(); 163b6: 0f 94 94 18 call 0x23128 ; 0x23128 load_filament_final_feed(); 163ba: 0e 94 3e 64 call 0xc87c ; 0xc87c 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(); 163be: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 0, _T(MSG_LOADING_COLOR)); 163c2: 8a ee ldi r24, 0xEA ; 234 163c4: 98 e3 ldi r25, 0x38 ; 56 163c6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 163ca: ac 01 movw r20, r24 163cc: 60 e0 ldi r22, 0x00 ; 0 163ce: 80 e0 ldi r24, 0x00 ; 0 163d0: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 2, _T(MSG_PLEASE_WAIT)); 163d4: 86 eb ldi r24, 0xB6 ; 182 163d6: 99 e3 ldi r25, 0x39 ; 57 163d8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 163dc: ac 01 movw r20, r24 163de: 62 e0 ldi r22, 0x02 ; 2 163e0: 80 e0 ldi r24, 0x00 ; 0 163e2: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_loading_progress_bar((FILAMENTCHANGE_FINALFEED * 1000ul) / FILAMENTCHANGE_EFEED_FINAL); //show progress bar during filament loading slow sequence 163e6: 87 e9 ldi r24, 0x97 ; 151 163e8: 9d e1 ldi r25, 0x1D ; 29 163ea: 0f 94 4b 09 call 0x21296 ; 0x21296 lcd_loading_color(); st_synchronize(); 163ee: 0f 94 94 18 call 0x23128 ; 0x23128 163f2: 69 cf rjmp .-302 ; 0x162c6 } void lcd_change_success() { lcd_clear(); 163f4: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); 163f8: 8a ef ldi r24, 0xFA ; 250 163fa: 98 e3 ldi r25, 0x38 ; 56 163fc: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16400: ac 01 movw r20, r24 16402: 62 e0 ldi r22, 0x02 ; 2 16404: 80 e0 ldi r24, 0x00 ; 0 16406: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 //! @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) 1640a: 00 23 and r16, r16 1640c: 19 f0 breq .+6 ; 0x16414 1640e: 03 30 cpi r16, 0x03 ; 3 16410: 09 f0 breq .+2 ; 0x16414 16412: 59 cf rjmp .-334 ; 0x162c6 16414: 0f 94 33 6d call 0x2da66 ; 0x2da66 if (!automatic) repeat = M600_check_state_and_repeat(filament_name); } while (repeat); lcd_update_enable(true); 16418: 81 e0 ldi r24, 0x01 ; 1 1641a: 0e 94 89 70 call 0xe112 ; 0xe112 // Not let's go back to print fanSpeed = saved_fan_speed; 1641e: 80 91 54 12 lds r24, 0x1254 ; 0x801254 16422: 80 93 55 12 sts 0x1255, r24 ; 0x801255 // Feed a little of filament to stabilize pressure if (!automatic) { 16426: 11 11 cpse r17, r1 16428: 27 c0 rjmp .+78 ; 0x16478 if (printingIsPaused()) 1642a: 0e 94 86 66 call 0xcd0c ; 0xcd0c 1642e: c0 90 6d 12 lds r12, 0x126D ; 0x80126d 16432: d0 90 6e 12 lds r13, 0x126E ; 0x80126e 16436: e0 90 6f 12 lds r14, 0x126F ; 0x80126f 1643a: f0 90 70 12 lds r15, 0x1270 ; 0x801270 1643e: 88 23 and r24, r24 16440: 09 f4 brne .+2 ; 0x16444 16442: 9f c0 rjmp .+318 ; 0x16582 { // 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; 16444: 20 e0 ldi r18, 0x00 ; 0 16446: 30 e0 ldi r19, 0x00 ; 0 16448: 40 e8 ldi r20, 0x80 ; 128 1644a: 5f e3 ldi r21, 0x3F ; 63 1644c: c7 01 movw r24, r14 1644e: b6 01 movw r22, r12 16450: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 16454: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 16458: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1645c: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 16460: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_RFEED); 16464: 60 e0 ldi r22, 0x00 ; 0 16466: 70 e0 ldi r23, 0x00 ; 0 16468: 88 ee ldi r24, 0xE8 ; 232 1646a: 92 e4 ldi r25, 0x42 ; 66 1646c: 0f 94 0d 4a call 0x2941a ; 0x2941a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 16470: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 16474: 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); 16478: e0 90 69 12 lds r14, 0x1269 ; 0x801269 1647c: f0 90 6a 12 lds r15, 0x126A ; 0x80126a 16480: 00 91 6b 12 lds r16, 0x126B ; 0x80126b 16484: 10 91 6c 12 lds r17, 0x126C ; 0x80126c 16488: 20 91 94 02 lds r18, 0x0294 ; 0x800294 1648c: 30 91 95 02 lds r19, 0x0295 ; 0x800295 16490: 40 91 96 02 lds r20, 0x0296 ; 0x800296 16494: 50 91 97 02 lds r21, 0x0297 ; 0x800297 16498: 60 91 90 02 lds r22, 0x0290 ; 0x800290 1649c: 70 91 91 02 lds r23, 0x0291 ; 0x800291 164a0: 80 91 92 02 lds r24, 0x0292 ; 0x800292 164a4: 90 91 93 02 lds r25, 0x0293 ; 0x800293 164a8: 1f 92 push r1 164aa: 1f 92 push r1 164ac: 1f 92 push r1 164ae: 1f 92 push r1 164b0: 81 2c mov r8, r1 164b2: 91 2c mov r9, r1 164b4: e8 e4 ldi r30, 0x48 ; 72 164b6: ae 2e mov r10, r30 164b8: e2 e4 ldi r30, 0x42 ; 66 164ba: be 2e mov r11, r30 164bc: fd e6 ldi r31, 0x6D ; 109 164be: cf 2e mov r12, r31 164c0: f2 e1 ldi r31, 0x12 ; 18 164c2: df 2e mov r13, r31 164c4: 0f 94 bf 3a call 0x2757e ; 0x2757e st_synchronize(); 164c8: 0f 94 94 18 call 0x23128 ; 0x23128 // Move Z back plan_buffer_line(saved_pos[X_AXIS], saved_pos[Y_AXIS], saved_pos[Z_AXIS], current_position[E_AXIS], FILAMENTCHANGE_ZFEED); 164cc: e0 90 98 02 lds r14, 0x0298 ; 0x800298 164d0: f0 90 99 02 lds r15, 0x0299 ; 0x800299 164d4: 00 91 9a 02 lds r16, 0x029A ; 0x80029a 164d8: 10 91 9b 02 lds r17, 0x029B ; 0x80029b 164dc: 20 91 94 02 lds r18, 0x0294 ; 0x800294 164e0: 30 91 95 02 lds r19, 0x0295 ; 0x800295 164e4: 40 91 96 02 lds r20, 0x0296 ; 0x800296 164e8: 50 91 97 02 lds r21, 0x0297 ; 0x800297 164ec: 60 91 90 02 lds r22, 0x0290 ; 0x800290 164f0: 70 91 91 02 lds r23, 0x0291 ; 0x800291 164f4: 80 91 92 02 lds r24, 0x0292 ; 0x800292 164f8: 90 91 93 02 lds r25, 0x0293 ; 0x800293 164fc: 1f 92 push r1 164fe: 1f 92 push r1 16500: 1f 92 push r1 16502: 1f 92 push r1 16504: 81 2c mov r8, r1 16506: 91 2c mov r9, r1 16508: a0 e7 ldi r26, 0x70 ; 112 1650a: aa 2e mov r10, r26 1650c: a1 e4 ldi r26, 0x41 ; 65 1650e: ba 2e mov r11, r26 16510: 0f 94 bf 3a call 0x2757e ; 0x2757e st_synchronize(); 16514: 0f 94 94 18 call 0x23128 ; 0x23128 // Set E position to original plan_set_e_position(saved_pos[E_AXIS]); 16518: 8c e9 ldi r24, 0x9C ; 156 1651a: 92 e0 ldi r25, 0x02 ; 2 1651c: 0f 94 65 3a call 0x274ca ; 0x274ca memcpy(current_position, saved_pos, sizeof(saved_pos)); 16520: 80 e1 ldi r24, 0x10 ; 16 16522: e0 e9 ldi r30, 0x90 ; 144 16524: f2 e0 ldi r31, 0x02 ; 2 16526: a1 e6 ldi r26, 0x61 ; 97 16528: b2 e1 ldi r27, 0x12 ; 18 1652a: 01 90 ld r0, Z+ 1652c: 0d 92 st X+, r0 1652e: 8a 95 dec r24 16530: e1 f7 brne .-8 ; 0x1652a set_destination_to_current(); 16532: 0e 94 ff 66 call 0xcdfe ; 0xcdfe // Recover feed rate feedmultiply = saved_feedmultiply2; 16536: 80 91 5f 12 lds r24, 0x125F ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.495> 1653a: 90 91 60 12 lds r25, 0x1260 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.495+0x1> 1653e: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e 16542: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f enquecommandf_P(MSG_M220, saved_feedmultiply2); 16546: 9f 93 push r25 16548: 8f 93 push r24 1654a: 89 ea ldi r24, 0xA9 ; 169 1654c: 95 e6 ldi r25, 0x65 ; 101 1654e: 9f 93 push r25 16550: 8f 93 push r24 16552: 0e 94 28 8e call 0x11c50 ; 0x11c50 if (printingIsPaused()) { 16556: 0e 94 86 66 call 0xcd0c ; 0xcd0c 1655a: 0f b6 in r0, 0x3f ; 63 1655c: f8 94 cli 1655e: de bf out 0x3e, r29 ; 62 16560: 0f be out 0x3f, r0 ; 63 16562: cd bf out 0x3d, r28 ; 61 16564: 88 23 and r24, r24 16566: 21 f1 breq .+72 ; 0x165b0 lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 16568: 89 ed ldi r24, 0xD9 ; 217 1656a: 9b e4 ldi r25, 0x4B ; 75 1656c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16570: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 } else { lcd_setstatuspgm(MSG_WELCOME); SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); } custom_message_type = CustomMsg::Status; 16574: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 16578: 0c 94 42 a2 jmp 0x14484 ; 0x14484 st_synchronize(); break; // Unload filament case 3: return true; 1657c: 31 e0 ldi r19, 0x01 ; 1 1657e: 38 a7 std Y+40, r19 ; 0x28 16580: ac cd rjmp .-1192 ; 0x160da setTargetHotend(0); } else { // Feed a little of filament to stabilize pressure current_position[E_AXIS] += FILAMENTCHANGE_RECFEED; 16582: 20 e0 ldi r18, 0x00 ; 0 16584: 30 e0 ldi r19, 0x00 ; 0 16586: 40 ea ldi r20, 0xA0 ; 160 16588: 50 e4 ldi r21, 0x40 ; 64 1658a: c7 01 movw r24, r14 1658c: b6 01 movw r22, r12 1658e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 16592: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 16596: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1659a: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1659e: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EXFEED); 165a2: 60 e0 ldi r22, 0x00 ; 0 165a4: 70 e0 ldi r23, 0x00 ; 0 165a6: 80 e0 ldi r24, 0x00 ; 0 165a8: 90 e4 ldi r25, 0x40 ; 64 165aa: 0f 94 0d 4a call 0x2941a ; 0x2941a 165ae: 64 cf rjmp .-312 ; 0x16478 if (printingIsPaused()) { lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); } else { lcd_setstatuspgm(MSG_WELCOME); 165b0: 8a e8 ldi r24, 0x8A ; 138 165b2: 9c e6 ldi r25, 0x6C ; 108 165b4: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_RESUMED); 165b8: 8f ed ldi r24, 0xDF ; 223 165ba: 98 e6 ldi r25, 0x68 ; 104 165bc: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 165c0: d9 cf rjmp .-78 ; 0x16574 SERIAL_ECHOPGM("Y:"); SERIAL_ECHOLN(pause_position[Y_AXIS]); SERIAL_ECHOPGM("Z:"); SERIAL_ECHOLN(pause_position[Z_AXIS]); */ if (!printingIsPaused()) { 165c2: 0e 94 86 66 call 0xcd0c ; 0xcd0c 165c6: 81 11 cpse r24, r1 165c8: 0c 94 42 a2 jmp 0x14484 ; 0x14484 st_synchronize(); 165cc: 0f 94 94 18 call 0x23128 ; 0x23128 ClearToSend(); //send OK even before the command finishes executing because we want to make sure it is not skipped because of cmdqueue_pop_front(); 165d0: 0e 94 9b 83 call 0x10736 ; 0x10736 cmdqueue_pop_front(); //trick because we want skip this command (M601) after restore 165d4: 0e 94 94 79 call 0xf328 ; 0xf328 lcd_pause_print(); 165d8: 0f 94 95 0b call 0x2172a ; 0x2172a 165dc: 0c 94 42 a2 jmp 0x14484 ; 0x14484 /*! ### M602 - Resume print M602: Resume print */ case 602: { if (printingIsPaused()) lcd_resume_print(); 165e0: 0e 94 86 66 call 0xcd0c ; 0xcd0c 165e4: 88 23 and r24, r24 165e6: 11 f4 brne .+4 ; 0x165ec 165e8: 0c 94 42 a2 jmp 0x14484 ; 0x14484 165ec: 0c 94 97 a2 jmp 0x1452e ; 0x1452e SERIAL_PROTOCOL(max_sheets-1); SERIAL_PROTOCOLLN(""); break; // invalid sheet ID } } else { iSel = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 165f0: 81 ea ldi r24, 0xA1 ; 161 165f2: 9d e0 ldi r25, 0x0D ; 13 165f4: 0f 94 81 a4 call 0x34902 ; 0x34902 165f8: 18 2f mov r17, r24 } if (code_seen('Z')){ 165fa: 8a e5 ldi r24, 0x5A ; 90 165fc: 0e 94 80 56 call 0xad00 ; 0xad00 16600: 88 23 and r24, r24 16602: 09 f4 brne .+2 ; 0x16606 16604: d7 c0 rjmp .+430 ; 0x167b4 z_val = code_value(); 16606: 0e 94 10 5b call 0xb620 ; 0xb620 1660a: 2b 01 movw r4, r22 1660c: 3c 01 movw r6, r24 zraw = z_val*cs.axis_steps_per_mm[Z_AXIS]; 1660e: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 16612: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 16616: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1661a: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1661e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 16622: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 16626: 6b 01 movw r12, r22 if ((zraw < Z_BABYSTEP_MIN) || (zraw > Z_BABYSTEP_MAX)) 16628: 9b 01 movw r18, r22 1662a: 21 56 subi r18, 0x61 ; 97 1662c: 30 4f sbci r19, 0xF0 ; 240 1662e: 20 3a cpi r18, 0xA0 ; 160 16630: 3f 40 sbci r19, 0x0F ; 15 16632: 30 f0 brcs .+12 ; 0x16640 { SERIAL_PROTOCOLLNPGM(" Z VALUE OUT OF RANGE"); 16634: 83 ea ldi r24, 0xA3 ; 163 16636: 9f e7 ldi r25, 0x7F ; 127 16638: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 1663c: 0c 94 42 a2 jmp 0x14484 ; 0x14484 break; } eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[iSel].z_offset)),zraw); 16640: 5b e0 ldi r21, 0x0B ; 11 16642: 15 9f mul r17, r21 16644: 90 01 movw r18, r0 16646: 11 24 eor r1, r1 16648: c9 01 movw r24, r18 1664a: 80 5b subi r24, 0xB0 ; 176 1664c: 92 4f sbci r25, 0xF2 ; 242 1664e: 0f 94 c3 a4 call 0x34986 ; 0x34986 { 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')) 16652: 8c e4 ldi r24, 0x4C ; 76 16654: 0e 94 80 56 call 0xad00 ; 0xad00 16658: bb e0 ldi r27, 0x0B ; 11 1665a: 1b 9f mul r17, r27 1665c: 70 01 movw r14, r0 1665e: 11 24 eor r1, r1 16660: 57 01 movw r10, r14 16662: e7 eb ldi r30, 0xB7 ; 183 16664: ae 1a sub r10, r30 16666: e2 ef ldi r30, 0xF2 ; 242 16668: be 0a sbc r11, r30 1666a: 88 23 and r24, r24 1666c: 09 f4 brne .+2 ; 0x16670 1666e: be c0 rjmp .+380 ; 0x167ec { char *src = strchr_pointer + 1; 16670: e0 91 bb 04 lds r30, 0x04BB ; 0x8004bb 16674: f0 91 bc 04 lds r31, 0x04BC ; 0x8004bc 16678: 31 96 adiw r30, 0x01 ; 1 1667a: bf 01 movw r22, r30 while (*src == ' ') ++src; 1667c: 81 91 ld r24, Z+ 1667e: 80 32 cpi r24, 0x20 ; 32 16680: e1 f3 breq .-8 ; 0x1667a if (*src != '\0') 16682: 88 23 and r24, r24 16684: 31 f0 breq .+12 ; 0x16692 { strncpy(strLabel,src,7); 16686: 47 e0 ldi r20, 0x07 ; 7 16688: 50 e0 ldi r21, 0x00 ; 0 1668a: ce 01 movw r24, r28 1668c: 01 96 adiw r24, 0x01 ; 1 1668e: 0f 94 01 ab call 0x35602 ; 0x35602 #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); 16692: 47 e0 ldi r20, 0x07 ; 7 16694: 50 e0 ldi r21, 0x00 ; 0 16696: b5 01 movw r22, r10 16698: ce 01 movw r24, r28 1669a: 01 96 adiw r24, 0x01 ; 1 1669c: 0f 94 95 a4 call 0x3492a ; 0x3492a else { eeprom_read_block(strLabel, EEPROM_Sheets_base->s[iSel].name, sizeof(Sheet::name)); } if (code_seen('B')) 166a0: 82 e4 ldi r24, 0x42 ; 66 166a2: 0e 94 80 56 call 0xad00 ; 0xad00 166a6: 57 01 movw r10, r14 166a8: fe ea ldi r31, 0xAE ; 174 166aa: af 1a sub r10, r31 166ac: f2 ef ldi r31, 0xF2 ; 242 166ae: bf 0a sbc r11, r31 166b0: 88 23 and r24, r24 166b2: 09 f4 brne .+2 ; 0x166b6 166b4: a3 c0 rjmp .+326 ; 0x167fc { iBedC = code_value_uint8(); 166b6: 0e 94 95 56 call 0xad2a ; 0xad2a 166ba: 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); 166bc: 68 2f mov r22, r24 166be: c5 01 movw r24, r10 166c0: 0f 94 a5 a4 call 0x3494a ; 0x3494a else { iBedC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].bed_temp); } if (code_seen('P')) 166c4: 80 e5 ldi r24, 0x50 ; 80 166c6: 0e 94 80 56 call 0xad00 ; 0xad00 166ca: 2d ea ldi r18, 0xAD ; 173 166cc: e2 1a sub r14, r18 166ce: 22 ef ldi r18, 0xF2 ; 242 166d0: f2 0a sbc r15, r18 166d2: 88 23 and r24, r24 166d4: 09 f4 brne .+2 ; 0x166d8 166d6: 97 c0 rjmp .+302 ; 0x16806 { iPindaC = code_value_uint8(); 166d8: 0e 94 95 56 call 0xad2a ; 0xad2a 166dc: b8 2e mov r11, r24 166de: 68 2f mov r22, r24 166e0: c7 01 movw r24, r14 166e2: 0f 94 a5 a4 call 0x3494a ; 0x3494a else { iPindaC = eeprom_read_byte(&EEPROM_Sheets_base->s[iSel].pinda_temp); } if (code_seen('A')) 166e6: 81 e4 ldi r24, 0x41 ; 65 166e8: 0e 94 80 56 call 0xad00 ; 0xad00 166ec: 88 23 and r24, r24 166ee: 09 f4 brne .+2 ; 0x166f2 166f0: 8f c0 rjmp .+286 ; 0x16810 { bIsActive |= code_value_uint8() || (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 166f2: 0e 94 95 56 call 0xad2a ; 0xad2a 166f6: 81 11 cpse r24, r1 166f8: 06 c0 rjmp .+12 ; 0x16706 166fa: 81 ea ldi r24, 0xA1 ; 161 166fc: 9d e0 ldi r25, 0x0D ; 13 166fe: 0f 94 81 a4 call 0x34902 ; 0x34902 16702: 18 13 cpse r17, r24 16704: 8d c0 rjmp .+282 ; 0x16820 if(bIsActive && eeprom_is_sheet_initialized(iSel)) { 16706: 81 2f mov r24, r17 16708: 0e 94 d9 78 call 0xf1b2 ; 0xf1b2 1670c: 08 2f mov r16, r24 1670e: 88 23 and r24, r24 16710: 29 f0 breq .+10 ; 0x1671c 16712: 61 2f mov r22, r17 16714: 81 ea ldi r24, 0xA1 ; 161 16716: 9d e0 ldi r25, 0x0D ; 13 16718: 0f 94 a5 a4 call 0x3494a ; 0x3494a else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); } SERIAL_PROTOCOLPGM("Sheet "); 1671c: 8c e9 ldi r24, 0x9C ; 156 1671e: 9f e7 ldi r25, 0x7F ; 127 16720: 0e 94 15 7b call 0xf62a ; 0xf62a print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 16724: 61 2f mov r22, r17 16726: 70 e0 ldi r23, 0x00 ; 0 16728: 90 e0 ldi r25, 0x00 ; 0 1672a: 80 e0 ldi r24, 0x00 ; 0 1672c: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOL((int)iSel); if (!eeprom_is_sheet_initialized(iSel)) 16730: 81 2f mov r24, r17 16732: 0e 94 d9 78 call 0xf1b2 ; 0xf1b2 16736: 81 11 cpse r24, r1 16738: 04 c0 rjmp .+8 ; 0x16742 SERIAL_PROTOCOLLNPGM(" NOT INITIALIZED"); 1673a: 8b e8 ldi r24, 0x8B ; 139 1673c: 9f e7 ldi r25, 0x7F ; 127 1673e: 0e 94 0e 7d call 0xfa1c ; 0xfa1c SERIAL_PROTOCOLPGM(" Z"); 16742: 88 e8 ldi r24, 0x88 ; 136 16744: 9f e7 ldi r25, 0x7F ; 127 16746: 0e 94 15 7b call 0xf62a ; 0xf62a else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 1674a: 44 e0 ldi r20, 0x04 ; 4 1674c: c3 01 movw r24, r6 1674e: b2 01 movw r22, r4 16750: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL_F(z_val,4); SERIAL_PROTOCOLPGM(" R"); 16754: 85 e8 ldi r24, 0x85 ; 133 16756: 9f e7 ldi r25, 0x7F ; 127 16758: 0e 94 15 7b call 0xf62a ; 0xf62a print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1675c: b6 01 movw r22, r12 1675e: dd 0c add r13, r13 16760: 88 0b sbc r24, r24 16762: 99 0b sbc r25, r25 16764: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOL((int)zraw); SERIAL_PROTOCOLPGM(" L"); 16768: 82 e8 ldi r24, 0x82 ; 130 1676a: 9f e7 ldi r25, 0x7F ; 127 1676c: 0e 94 15 7b call 0xf62a ; 0xf62a 16770: ce 01 movw r24, r28 16772: 01 96 adiw r24, 0x01 ; 1 16774: 0e 94 0e 86 call 0x10c1c ; 0x10c1c SERIAL_PROTOCOL(strLabel); SERIAL_PROTOCOLPGM(" B"); 16778: 8f e7 ldi r24, 0x7F ; 127 1677a: 9f e7 ldi r25, 0x7F ; 127 1677c: 0e 94 15 7b call 0xf62a ; 0xf62a 16780: 69 2d mov r22, r9 16782: 70 e0 ldi r23, 0x00 ; 0 16784: 90 e0 ldi r25, 0x00 ; 0 16786: 80 e0 ldi r24, 0x00 ; 0 16788: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOL((int)iBedC); SERIAL_PROTOCOLPGM(" P"); 1678c: 8c e7 ldi r24, 0x7C ; 124 1678e: 9f e7 ldi r25, 0x7F ; 127 16790: 0e 94 15 7b call 0xf62a ; 0xf62a 16794: 6b 2d mov r22, r11 16796: 70 e0 ldi r23, 0x00 ; 0 16798: 90 e0 ldi r25, 0x00 ; 0 1679a: 80 e0 ldi r24, 0x00 ; 0 1679c: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOL((int)iPindaC); SERIAL_PROTOCOLPGM(" A"); 167a0: 89 e7 ldi r24, 0x79 ; 121 167a2: 9f e7 ldi r25, 0x7F ; 127 167a4: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOLLN((int)bIsActive); 167a8: 80 2f mov r24, r16 167aa: 90 e0 ldi r25, 0x00 ; 0 167ac: 0f 94 5d 65 call 0x2caba ; 0x2caba 167b0: 0c 94 42 a2 jmp 0x14484 ; 0x14484 } 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))); 167b4: ab e0 ldi r26, 0x0B ; 11 167b6: 1a 9f mul r17, r26 167b8: c0 01 movw r24, r0 167ba: 11 24 eor r1, r1 167bc: 80 5b subi r24, 0xB0 ; 176 167be: 92 4f sbci r25, 0xF2 ; 242 167c0: 0f 94 8f a4 call 0x3491e ; 0x3491e 167c4: 6c 01 movw r12, r24 z_val = ((float)zraw/cs.axis_steps_per_mm[Z_AXIS]); 167c6: bc 01 movw r22, r24 167c8: 99 0f add r25, r25 167ca: 88 0b sbc r24, r24 167cc: 99 0b sbc r25, r25 167ce: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 167d2: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 167d6: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 167da: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 167de: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 167e2: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 167e6: 2b 01 movw r4, r22 167e8: 3c 01 movw r6, r24 167ea: 33 cf rjmp .-410 ; 0x16652 } 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)); 167ec: 47 e0 ldi r20, 0x07 ; 7 167ee: 50 e0 ldi r21, 0x00 ; 0 167f0: b5 01 movw r22, r10 167f2: ce 01 movw r24, r28 167f4: 01 96 adiw r24, 0x01 ; 1 167f6: 0f 94 71 a4 call 0x348e2 ; 0x348e2 167fa: 52 cf rjmp .-348 ; 0x166a0 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); 167fc: c5 01 movw r24, r10 167fe: 0f 94 81 a4 call 0x34902 ; 0x34902 16802: 98 2e mov r9, r24 16804: 5f cf rjmp .-322 ; 0x166c4 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); 16806: c7 01 movw r24, r14 16808: 0f 94 81 a4 call 0x34902 ; 0x34902 1680c: b8 2e mov r11, r24 1680e: 6b cf rjmp .-298 ; 0x166e6 bIsActive = 0; } } else { bIsActive = (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == iSel); 16810: 81 ea ldi r24, 0xA1 ; 161 16812: 9d e0 ldi r25, 0x0D ; 13 16814: 0f 94 81 a4 call 0x34902 ; 0x34902 16818: 01 e0 ldi r16, 0x01 ; 1 1681a: 18 17 cp r17, r24 1681c: 09 f4 brne .+2 ; 0x16820 1681e: 7e cf rjmp .-260 ; 0x1671c { 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; 16820: 00 e0 ldi r16, 0x00 ; 0 16822: 7c cf rjmp .-264 ; 0x1671c */ case 860: { int set_target_pinda = 0; if (code_seen('S')) { 16824: 83 e5 ldi r24, 0x53 ; 83 16826: 0e 94 80 56 call 0xad00 ; 0xad00 1682a: 88 23 and r24, r24 1682c: 11 f4 brne .+4 ; 0x16832 1682e: 0c 94 42 a2 jmp 0x14484 ; 0x14484 set_target_pinda = code_value_short(); 16832: 0e 94 a2 56 call 0xad44 ; 0xad44 16836: 8c 01 movw r16, r24 } else { break; } LCD_MESSAGERPGM(_T(MSG_PLEASE_WAIT)); 16838: 86 eb ldi r24, 0xB6 ; 182 1683a: 99 e3 ldi r25, 0x39 ; 57 1683c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16840: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 SERIAL_PROTOCOLPGM("Wait for PINDA target temperature:"); 16844: 86 e5 ldi r24, 0x56 ; 86 16846: 9f e7 ldi r25, 0x7F ; 127 16848: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOLLN(set_target_pinda); 1684c: c8 01 movw r24, r16 1684e: 0f 94 5d 65 call 0x2caba ; 0x2caba codenum = _millis(); 16852: 0f 94 89 0b call 0x21712 ; 0x21712 16856: 4b 01 movw r8, r22 16858: 5c 01 movw r10, r24 cancel_heatup = false; 1685a: 10 92 5f 0d sts 0x0D5F, r1 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.389> bool is_pinda_cooling = false; if (!(CHECK_ALL_HEATERS)) is_pinda_cooling = true; 1685e: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 16862: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 16866: 89 2b or r24, r25 16868: 41 f4 brne .+16 ; 0x1687a 1686a: ff 24 eor r15, r15 1686c: f3 94 inc r15 1686e: 80 91 59 12 lds r24, 0x1259 ; 0x801259 16872: 90 91 5a 12 lds r25, 0x125A ; 0x80125a 16876: 89 2b or r24, r25 16878: 09 f0 breq .+2 ; 0x1687c SERIAL_PROTOCOLLN(set_target_pinda); codenum = _millis(); cancel_heatup = false; bool is_pinda_cooling = false; 1687a: 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)) ) { 1687c: 28 01 movw r4, r16 1687e: 01 2e mov r0, r17 16880: 00 0c add r0, r0 16882: 66 08 sbc r6, r6 16884: 77 08 sbc r7, r7 16886: f1 10 cpse r15, r1 16888: 1a c0 rjmp .+52 ; 0x168be 1688a: 80 91 5f 0d lds r24, 0x0D5F ; 0x800d5f <_ZL13cancel_heatup.lto_priv.389> 1688e: 81 11 cpse r24, r1 16890: 10 c0 rjmp .+32 ; 0x168b2 16892: c3 01 movw r24, r6 16894: b2 01 movw r22, r4 16896: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1689a: 20 91 85 03 lds r18, 0x0385 ; 0x800385 1689e: 30 91 86 03 lds r19, 0x0386 ; 0x800386 168a2: 40 91 87 03 lds r20, 0x0387 ; 0x800387 168a6: 50 91 88 03 lds r21, 0x0388 ; 0x800388 168aa: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 168ae: 18 16 cp r1, r24 168b0: b4 f0 brlt .+44 ; 0x168de } manage_heater(); manage_inactivity(); lcd_update(0); } LCD_MESSAGERPGM(MSG_OK); 168b2: 80 e9 ldi r24, 0x90 ; 144 168b4: 9a e6 ldi r25, 0x6A ; 106 168b6: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 168ba: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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)) ) { 168be: c3 01 movw r24, r6 168c0: b2 01 movw r22, r4 168c2: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 168c6: 20 91 85 03 lds r18, 0x0385 ; 0x800385 168ca: 30 91 86 03 lds r19, 0x0386 ; 0x800386 168ce: 40 91 87 03 lds r20, 0x0387 ; 0x800387 168d2: 50 91 88 03 lds r21, 0x0388 ; 0x800388 168d6: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 168da: 87 ff sbrs r24, 7 168dc: ea cf rjmp .-44 ; 0x168b2 if ((_millis() - codenum) > 1000) //Print Temp Reading every 1 second while waiting. 168de: 0f 94 89 0b call 0x21712 ; 0x21712 168e2: 68 19 sub r22, r8 168e4: 79 09 sbc r23, r9 168e6: 8a 09 sbc r24, r10 168e8: 9b 09 sbc r25, r11 168ea: 69 3e cpi r22, 0xE9 ; 233 168ec: 73 40 sbci r23, 0x03 ; 3 168ee: 81 05 cpc r24, r1 168f0: 91 05 cpc r25, r1 168f2: c8 f0 brcs .+50 ; 0x16926 { SERIAL_PROTOCOLPGM("P:"); 168f4: 83 e5 ldi r24, 0x53 ; 83 168f6: 9f e7 ldi r25, 0x7F ; 127 168f8: 0e 94 15 7b call 0xf62a ; 0xf62a else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 168fc: 60 91 85 03 lds r22, 0x0385 ; 0x800385 16900: 70 91 86 03 lds r23, 0x0386 ; 0x800386 16904: 80 91 87 03 lds r24, 0x0387 ; 0x800387 16908: 90 91 88 03 lds r25, 0x0388 ; 0x800388 1690c: 41 e0 ldi r20, 0x01 ; 1 1690e: 0e 94 97 7a call 0xf52e ; 0xf52e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 16912: 8f e2 ldi r24, 0x2F ; 47 16914: 0e 94 02 7a call 0xf404 ; 0xf404 SERIAL_PROTOCOL_F(current_temperature_pinda, 1); SERIAL_PROTOCOL('/'); SERIAL_PROTOCOLLN(set_target_pinda); 16918: c8 01 movw r24, r16 1691a: 0f 94 5d 65 call 0x2caba ; 0x2caba codenum = _millis(); 1691e: 0f 94 89 0b call 0x21712 ; 0x21712 16922: 4b 01 movw r8, r22 16924: 5c 01 movw r10, r24 } manage_heater(); 16926: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(); 1692a: 80 e0 ldi r24, 0x00 ; 0 1692c: 0e 94 ad 8a call 0x1155a ; 0x1155a lcd_update(0); 16930: 80 e0 ldi r24, 0x00 ; 0 16932: 0e 94 4a 6f call 0xde94 ; 0xde94 16936: a7 cf rjmp .-178 ; 0x16886 - `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 16938: 8f e3 ldi r24, 0x3F ; 63 1693a: 0e 94 80 56 call 0xad00 ; 0xad00 1693e: 88 23 and r24, r24 16940: c9 f0 breq .+50 ; 0x16974 SERIAL_PROTOCOLPGM("PINDA cal status: "); 16942: 80 e4 ldi r24, 0x40 ; 64 16944: 9f e7 ldi r25, 0x7F ; 127 16946: 0e 94 15 7b call 0xf62a ; 0xf62a 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); } 1694a: 86 ea ldi r24, 0xA6 ; 166 1694c: 9f e0 ldi r25, 0x0F ; 15 1694e: 0f 94 81 a4 call 0x34902 ; 0x34902 16952: 21 e0 ldi r18, 0x01 ; 1 16954: 30 e0 ldi r19, 0x00 ; 0 16956: 81 11 cpse r24, r1 16958: 02 c0 rjmp .+4 ; 0x1695e 1695a: 30 e0 ldi r19, 0x00 ; 0 1695c: 20 e0 ldi r18, 0x00 ; 0 SERIAL_PROTOCOLLN(calibration_status_pinda()); 1695e: c9 01 movw r24, r18 16960: 0f 94 5d 65 call 0x2caba ; 0x2caba SERIAL_PROTOCOLLNRPGM(_header); 16964: 89 e2 ldi r24, 0x29 ; 41 16966: 9f e7 ldi r25, 0x7F ; 127 16968: 0e 94 0e 7d call 0xfa1c ; 0xfa1c gcode_M861_print_pinda_cal_eeprom(); 1696c: 0e 94 4d 7b call 0xf69a ; 0xf69a 16970: 0c 94 42 a2 jmp 0x14484 ; 0x14484 } else if (code_seen('!')) { // ! - Set factory default values 16974: 81 e2 ldi r24, 0x21 ; 33 16976: 0e 94 80 56 call 0xad00 ; 0xad00 1697a: 88 23 and r24, r24 1697c: 49 f1 breq .+82 ; 0x169d0 1697e: 61 e0 ldi r22, 0x01 ; 1 16980: 86 ea ldi r24, 0xA6 ; 166 16982: 9f e0 ldi r25, 0x0F ; 15 16984: 0f 94 a5 a4 call 0x3494a ; 0x3494a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 16988: 68 e0 ldi r22, 0x08 ; 8 1698a: 70 e0 ldi r23, 0x00 ; 0 1698c: 80 eb ldi r24, 0xB0 ; 176 1698e: 9f e0 ldi r25, 0x0F ; 15 16990: 0f 94 c3 a4 call 0x34986 ; 0x34986 16994: 68 e1 ldi r22, 0x18 ; 24 16996: 70 e0 ldi r23, 0x00 ; 0 16998: 82 eb ldi r24, 0xB2 ; 178 1699a: 9f e0 ldi r25, 0x0F ; 15 1699c: 0f 94 c3 a4 call 0x34986 ; 0x34986 169a0: 60 e3 ldi r22, 0x30 ; 48 169a2: 70 e0 ldi r23, 0x00 ; 0 169a4: 84 eb ldi r24, 0xB4 ; 180 169a6: 9f e0 ldi r25, 0x0F ; 15 169a8: 0f 94 c3 a4 call 0x34986 ; 0x34986 169ac: 60 e5 ldi r22, 0x50 ; 80 169ae: 70 e0 ldi r23, 0x00 ; 0 169b0: 86 eb ldi r24, 0xB6 ; 182 169b2: 9f e0 ldi r25, 0x0F ; 15 169b4: 0f 94 c3 a4 call 0x34986 ; 0x34986 169b8: 68 e7 ldi r22, 0x78 ; 120 169ba: 70 e0 ldi r23, 0x00 ; 0 169bc: 88 eb ldi r24, 0xB8 ; 184 169be: 9f e0 ldi r25, 0x0F ; 15 169c0: 0f 94 c3 a4 call 0x34986 ; 0x34986 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"); 169c4: 88 e1 ldi r24, 0x18 ; 24 169c6: 9f e7 ldi r25, 0x7F ; 127 169c8: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 169cc: 0c 94 42 a2 jmp 0x14484 ; 0x14484 } else if (code_seen('Z')) { // Z - Set all values to 0 (effectively disabling PINDA temperature compensation) 169d0: 8a e5 ldi r24, 0x5A ; 90 169d2: 0e 94 80 56 call 0xad00 ; 0xad00 169d6: 88 23 and r24, r24 169d8: c1 f0 breq .+48 ; 0x16a0a if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 169da: 61 e0 ldi r22, 0x01 ; 1 169dc: 86 ea ldi r24, 0xA6 ; 166 169de: 9f e0 ldi r25, 0x0F ; 15 169e0: 0f 94 a5 a4 call 0x3494a ; 0x3494a 169e4: 00 eb ldi r16, 0xB0 ; 176 169e6: 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); 169e8: 70 e0 ldi r23, 0x00 ; 0 169ea: 60 e0 ldi r22, 0x00 ; 0 169ec: c8 01 movw r24, r16 169ee: 0f 94 c3 a4 call 0x34986 ; 0x34986 169f2: 0e 5f subi r16, 0xFE ; 254 169f4: 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++) { 169f6: 0a 3b cpi r16, 0xBA ; 186 169f8: 4f e0 ldi r20, 0x0F ; 15 169fa: 14 07 cpc r17, r20 169fc: a9 f7 brne .-22 ; 0x169e8 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + i, z_shift); } SERIAL_PROTOCOLLNPGM("zerorized"); 169fe: 8e e0 ldi r24, 0x0E ; 14 16a00: 9f e7 ldi r25, 0x7F ; 127 16a02: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 16a06: 0c 94 42 a2 jmp 0x14484 ; 0x14484 } else if (code_seen('S')) { // Sxxx Iyyy - Set compensation ustep value S for compensation table index I 16a0a: 83 e5 ldi r24, 0x53 ; 83 16a0c: 0e 94 80 56 call 0xad00 ; 0xad00 16a10: 88 23 and r24, r24 16a12: 21 f1 breq .+72 ; 0x16a5c int16_t usteps = code_value_short(); 16a14: 0e 94 a2 56 call 0xad44 ; 0xad44 16a18: 8c 01 movw r16, r24 if (code_seen('I')) { 16a1a: 89 e4 ldi r24, 0x49 ; 73 16a1c: 0e 94 80 56 call 0xad00 ; 0xad00 16a20: 88 23 and r24, r24 16a22: 11 f4 brne .+4 ; 0x16a28 16a24: 0c 94 42 a2 jmp 0x14484 ; 0x14484 uint8_t index = code_value_uint8(); 16a28: 0e 94 95 56 call 0xad2a ; 0xad2a if (index < 5) { 16a2c: 85 30 cpi r24, 0x05 ; 5 16a2e: 10 f0 brcs .+4 ; 0x16a34 16a30: 0c 94 42 a2 jmp 0x14484 ; 0x14484 eeprom_update_word_notify((uint16_t*)EEPROM_PROBE_TEMP_SHIFT + index, usteps); 16a34: 90 e0 ldi r25, 0x00 ; 0 16a36: 88 52 subi r24, 0x28 ; 40 16a38: 98 4f sbci r25, 0xF8 ; 248 16a3a: b8 01 movw r22, r16 16a3c: 88 0f add r24, r24 16a3e: 99 1f adc r25, r25 16a40: 0f 94 c3 a4 call 0x34986 ; 0x34986 SERIAL_PROTOCOLLNRPGM(MSG_OK); 16a44: 80 e9 ldi r24, 0x90 ; 144 16a46: 9a e6 ldi r25, 0x6A ; 106 16a48: 0e 94 0e 7d call 0xfa1c ; 0xfa1c SERIAL_PROTOCOLLNRPGM(_header); 16a4c: 89 e2 ldi r24, 0x29 ; 41 16a4e: 9f e7 ldi r25, 0x7F ; 127 16a50: 0e 94 0e 7d call 0xfa1c ; 0xfa1c gcode_M861_print_pinda_cal_eeprom(); 16a54: 0e 94 4d 7b call 0xf69a ; 0xf69a 16a58: 0c 94 42 a2 jmp 0x14484 ; 0x14484 } } } else { SERIAL_PROTOCOLLNPGM("no valid command"); 16a5c: 8d ef ldi r24, 0xFD ; 253 16a5e: 9e e7 ldi r25, 0x7E ; 126 16a60: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 16a64: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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) 16a68: 64 30 cpi r22, 0x04 ; 4 16a6a: 09 f4 brne .+2 ; 0x16a6e 16a6c: be c0 rjmp .+380 ; 0x16bea 16a6e: 65 30 cpi r22, 0x05 ; 5 16a70: 11 f0 breq .+4 ; 0x16a76 16a72: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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')) 16a76: 80 e5 ldi r24, 0x50 ; 80 16a78: 0e 94 80 56 call 0xad00 ; 0xad00 16a7c: 88 23 and r24, r24 16a7e: 09 f4 brne .+2 ; 0x16a82 16a80: 3a c1 rjmp .+628 ; 0x16cf6 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); 16a82: 0e 94 e8 56 call 0xadd0 ; 0xadd0 done: return true; } void gcode_level_check(uint16_t nGcodeLevel) { if (oCheckGcode == ClCheckMode::_None) 16a86: 10 91 e8 03 lds r17, 0x03E8 ; 0x8003e8 16a8a: 11 23 and r17, r17 16a8c: 11 f4 brne .+4 ; 0x16a92 16a8e: 0c 94 42 a2 jmp 0x14484 ; 0x14484 return; if (nGcodeLevel <= (uint16_t)GCODE_LEVEL) 16a92: 62 30 cpi r22, 0x02 ; 2 16a94: 71 05 cpc r23, r1 16a96: 10 f4 brcc .+4 ; 0x16a9c 16a98: 0c 94 42 a2 jmp 0x14484 ; 0x14484 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN(GCODE_LEVEL); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN(nGcodeLevel); render_M862_warnings( 16a9c: 85 eb ldi r24, 0xB5 ; 181 16a9e: 96 e3 ldi r25, 0x36 ; 54 16aa0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16aa4: 7c 01 movw r14, r24 16aa6: 84 e8 ldi r24, 0x84 ; 132 16aa8: 96 e3 ldi r25, 0x36 ; 54 16aaa: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16aae: 41 2f mov r20, r17 16ab0: b7 01 movw r22, r14 16ab2: 0e 94 a0 e8 call 0x1d140 ; 0x1d140 16ab6: 0c 94 42 a2 jmp 0x14484 ; 0x14484 ClPrintChecking nCommand = static_cast((uint16_t)(code_value()*10) - 8620u); switch(nCommand) { case ClPrintChecking::_Nozzle: // ~ .1 uint16_t nDiameter; if(code_seen('P')) 16aba: 80 e5 ldi r24, 0x50 ; 80 16abc: 0e 94 80 56 call 0xad00 ; 0xad00 16ac0: 88 23 and r24, r24 16ac2: a9 f0 breq .+42 ; 0x16aee { nDiameter=(uint16_t)(code_value()*1000.0+0.5); // [,um] 16ac4: 0e 94 10 5b call 0xb620 ; 0xb620 16ac8: 20 e0 ldi r18, 0x00 ; 0 16aca: 30 e0 ldi r19, 0x00 ; 0 16acc: 4a e7 ldi r20, 0x7A ; 122 16ace: 54 e4 ldi r21, 0x44 ; 68 16ad0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 16ad4: 20 e0 ldi r18, 0x00 ; 0 16ad6: 30 e0 ldi r19, 0x00 ; 0 16ad8: 40 e0 ldi r20, 0x00 ; 0 16ada: 5f e3 ldi r21, 0x3F ; 63 16adc: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 16ae0: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> nozzle_diameter_check(nDiameter); 16ae4: cb 01 movw r24, r22 16ae6: 0e 94 df e8 call 0x1d1be ; 0x1d1be 16aea: 0c 94 42 a2 jmp 0x14484 ; 0x14484 } else if(code_seen('Q')) 16aee: 81 e5 ldi r24, 0x51 ; 81 16af0: 0e 94 80 56 call 0xad00 ; 0xad00 16af4: 88 23 and r24, r24 16af6: 11 f4 brne .+4 ; 0x16afc 16af8: 0c 94 42 a2 jmp 0x14484 ; 0x14484 SERIAL_PROTOCOLLN((float)eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)/1000.0); 16afc: 85 ea ldi r24, 0xA5 ; 165 16afe: 9d e0 ldi r25, 0x0D ; 13 16b00: 0f 94 8f a4 call 0x3491e ; 0x3491e 16b04: bc 01 movw r22, r24 16b06: 90 e0 ldi r25, 0x00 ; 0 16b08: 80 e0 ldi r24, 0x00 ; 0 16b0a: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 16b0e: 20 e0 ldi r18, 0x00 ; 0 16b10: 30 e0 ldi r19, 0x00 ; 0 16b12: 4a e7 ldi r20, 0x7A ; 122 16b14: 54 e4 ldi r21, 0x44 ; 68 16b16: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 16b1a: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 16b1e: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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')) 16b22: 81 e5 ldi r24, 0x51 ; 81 16b24: 0e 94 80 56 call 0xad00 ; 0xad00 16b28: 88 23 and r24, r24 16b2a: 11 f4 brne .+4 ; 0x16b30 16b2c: 0c 94 42 a2 jmp 0x14484 ; 0x14484 print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 16b30: b8 01 movw r22, r16 16b32: 90 e0 ldi r25, 0x00 ; 0 16b34: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 16b36: 4a e0 ldi r20, 0x0A ; 10 16b38: 0e 94 16 7a call 0xf42c ; 0xf42c } void MarlinSerial::println(unsigned int n, int base) { print(n, base); println(); 16b3c: 0e 94 0d 7b call 0xf61a ; 0xf61a 16b40: 0c 94 42 a2 jmp 0x14484 ; 0x14484 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 16b44: 80 91 01 13 lds r24, 0x1301 ; 0x801301 return _sPrinterMmuName; 16b48: 74 ee ldi r23, 0xE4 ; 228 16b4a: e7 2e mov r14, r23 16b4c: 79 e7 ldi r23, 0x79 ; 121 16b4e: f7 2e mov r15, r23 return pgm_read_word(&_nPrinterType); } } const char *sPrinterType(bool bMMu) { if (bMMu) { 16b50: 81 30 cpi r24, 0x01 ; 1 16b52: 21 f0 breq .+8 ; 0x16b5c return _sPrinterMmuName; } else { return _sPrinterName; 16b54: 6e ed ldi r22, 0xDE ; 222 16b56: e6 2e mov r14, r22 16b58: 69 e7 ldi r22, 0x79 ; 121 16b5a: f6 2e mov r15, r22 SERIAL_PROTOCOLLN(type); } break; case ClPrintChecking::_Smodel: { // ~ .3 const char *type = sPrinterType(MMU2::mmu2.Enabled()); if(code_seen('P')) 16b5c: 80 e5 ldi r24, 0x50 ; 80 16b5e: 0e 94 80 56 call 0xad00 ; 0xad00 16b62: 88 23 and r24, r24 16b64: b1 f1 breq .+108 ; 0x16bd2 , found(false) { const char * pStrEnd = NULL; // Start of the string this->ptr = strchr(pStr, '"'); 16b66: 62 e2 ldi r22, 0x22 ; 34 16b68: 70 e0 ldi r23, 0x00 ; 0 16b6a: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 16b6e: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 16b72: 0f 94 d8 aa call 0x355b0 ; 0x355b0 16b76: 8c 01 movw r16, r24 if (!this->ptr) { 16b78: 89 2b or r24, r25 16b7a: d1 f0 breq .+52 ; 0x16bb0 // First quote not found return; } // Skip the leading quote this->ptr++; 16b7c: 0f 5f subi r16, 0xFF ; 255 16b7e: 1f 4f sbci r17, 0xFF ; 255 // End of the string pStrEnd = strchr(this->ptr, '"'); 16b80: 62 e2 ldi r22, 0x22 ; 34 16b82: 70 e0 ldi r23, 0x00 ; 0 16b84: c8 01 movw r24, r16 16b86: 0f 94 d8 aa call 0x355b0 ; 0x355b0 if(!pStrEnd) { 16b8a: 00 97 sbiw r24, 0x00 ; 0 16b8c: 89 f0 breq .+34 ; 0x16bb0 // Second quote not found return; } this->len = pStrEnd - this->ptr; 16b8e: d8 2e mov r13, r24 16b90: d0 1a sub r13, r16 16b92: c7 01 movw r24, r14 16b94: 0f 94 3f a2 call 0x3447e ; 0x3447e <__strlen_P> unquoted_string smodel = unquoted_string(pStrPos); if(smodel.WasFound()) { const uint8_t compareLength = strlen_P(actualPrinterSModel); if(compareLength == smodel.GetLength()) { 16b98: d8 12 cpse r13, r24 16b9a: 0a c0 rjmp .+20 ; 0x16bb0 if (strncmp_P(smodel.GetUnquotedString(), actualPrinterSModel, compareLength) == 0) return; 16b9c: ac 01 movw r20, r24 16b9e: 55 27 eor r21, r21 16ba0: b7 01 movw r22, r14 16ba2: c8 01 movw r24, r16 16ba4: 0f 94 60 a2 call 0x344c0 ; 0x344c0 16ba8: 89 2b or r24, r25 16baa: 11 f4 brne .+4 ; 0x16bb0 16bac: 0c 94 42 a2 jmp 0x14484 ; 0x14484 } } render_M862_warnings( 16bb0: f0 90 ea 03 lds r15, 0x03EA ; 0x8003ea 16bb4: 89 ec ldi r24, 0xC9 ; 201 16bb6: 97 e3 ldi r25, 0x37 ; 55 16bb8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16bbc: 8c 01 movw r16, r24 16bbe: 81 e9 ldi r24, 0x91 ; 145 16bc0: 97 e3 ldi r25, 0x37 ; 55 16bc2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16bc6: 4f 2d mov r20, r15 16bc8: b8 01 movw r22, r16 16bca: 0e 94 a0 e8 call 0x1d140 ; 0x1d140 16bce: 0c 94 42 a2 jmp 0x14484 ; 0x14484 { printer_smodel_check(strchr_pointer, type); } else if(code_seen('Q')) 16bd2: 81 e5 ldi r24, 0x51 ; 81 16bd4: 0e 94 80 56 call 0xad00 ; 0xad00 16bd8: 88 23 and r24, r24 16bda: 11 f4 brne .+4 ; 0x16be0 16bdc: 0c 94 42 a2 jmp 0x14484 ; 0x14484 SERIAL_PROTOCOLLNRPGM(type); 16be0: c7 01 movw r24, r14 16be2: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 16be6: 0c 94 42 a2 jmp 0x14484 ; 0x14484 } break; case ClPrintChecking::_Version: // ~ .4 if(code_seen('P')) 16bea: 80 e5 ldi r24, 0x50 ; 80 16bec: 0e 94 80 56 call 0xad00 ; 0xad00 16bf0: 88 23 and r24, r24 16bf2: 09 f4 brne .+2 ; 0x16bf6 16bf4: 77 c0 rjmp .+238 ; 0x16ce4 fw_version_check(++strchr_pointer); 16bf6: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 16bfa: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 16bfe: 01 96 adiw r24, 0x01 ; 1 16c00: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 16c04: 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) 16c08: 20 91 e9 03 lds r18, 0x03E9 ; 0x8003e9 16c0c: 22 23 and r18, r18 16c0e: 11 f4 brne .+4 ; 0x16c14 16c10: 0c 94 42 a2 jmp 0x14484 ; 0x14484 return; uint16_t aVersion[4]; uint8_t nCompareValueResult; parse_version(pVersion, aVersion); 16c14: be 01 movw r22, r28 16c16: 6f 5f subi r22, 0xFF ; 255 16c18: 7f 4f sbci r23, 0xFF ; 255 16c1a: 0e 94 83 d7 call 0x1af06 ; 0x1af06 nCompareValueResult = mCompareValue(aVersion[0], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MAJOR)) << 6; 16c1e: 8a e0 ldi r24, 0x0A ; 10 16c20: 90 e0 ldi r25, 0x00 ; 0 16c22: 0f 94 8f a4 call 0x3491e ; 0x3491e 16c26: 29 81 ldd r18, Y+1 ; 0x01 16c28: 3a 81 ldd r19, Y+2 ; 0x02 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16c2a: 12 e0 ldi r17, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16c2c: 82 17 cp r24, r18 16c2e: 93 07 cpc r25, r19 16c30: 28 f0 brcs .+10 ; 0x16c3c return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16c32: 11 e0 ldi r17, 0x01 ; 1 16c34: 28 17 cp r18, r24 16c36: 39 07 cpc r19, r25 16c38: 08 f4 brcc .+2 ; 0x16c3c 16c3a: 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; 16c3c: 12 95 swap r17 16c3e: 11 0f add r17, r17 16c40: 11 0f add r17, r17 16c42: 10 7c andi r17, 0xC0 ; 192 nCompareValueResult += mCompareValue(aVersion[1], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_MINOR)) << 4; 16c44: 8c e0 ldi r24, 0x0C ; 12 16c46: 90 e0 ldi r25, 0x00 ; 0 16c48: 0f 94 8f a4 call 0x3491e ; 0x3491e 16c4c: ac 01 movw r20, r24 16c4e: 2b 81 ldd r18, Y+3 ; 0x03 16c50: 3c 81 ldd r19, Y+4 ; 0x04 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16c52: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16c54: 42 17 cp r20, r18 16c56: 53 07 cpc r21, r19 16c58: 28 f0 brcs .+10 ; 0x16c64 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16c5a: 81 e0 ldi r24, 0x01 ; 1 16c5c: 24 17 cp r18, r20 16c5e: 35 07 cpc r19, r21 16c60: 08 f4 brcc .+2 ; 0x16c64 16c62: 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; 16c64: 50 e1 ldi r21, 0x10 ; 16 16c66: 85 9f mul r24, r21 16c68: c0 01 movw r24, r0 16c6a: 11 24 eor r1, r1 16c6c: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[2], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_REVISION)) << 2; 16c6e: 8e e0 ldi r24, 0x0E ; 14 16c70: 90 e0 ldi r25, 0x00 ; 0 16c72: 0f 94 8f a4 call 0x3491e ; 0x3491e 16c76: ac 01 movw r20, r24 16c78: 2d 81 ldd r18, Y+5 ; 0x05 16c7a: 3e 81 ldd r19, Y+6 ; 0x06 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16c7c: 82 e0 ldi r24, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16c7e: 42 17 cp r20, r18 16c80: 53 07 cpc r21, r19 16c82: 28 f0 brcs .+10 ; 0x16c8e return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16c84: 81 e0 ldi r24, 0x01 ; 1 16c86: 24 17 cp r18, r20 16c88: 35 07 cpc r19, r21 16c8a: 08 f4 brcc .+2 ; 0x16c8e 16c8c: 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; 16c8e: a4 e0 ldi r26, 0x04 ; 4 16c90: 8a 9f mul r24, r26 16c92: c0 01 movw r24, r0 16c94: 11 24 eor r1, r1 16c96: 18 0f add r17, r24 nCompareValueResult += mCompareValue(aVersion[3], eeprom_read_word((uint16_t *)EEPROM_FIRMWARE_VERSION_FLAVOR)); 16c98: 80 e1 ldi r24, 0x10 ; 16 16c9a: 90 e0 ldi r25, 0x00 ; 0 16c9c: 0f 94 8f a4 call 0x3491e ; 0x3491e 16ca0: ac 01 movw r20, r24 16ca2: 2f 81 ldd r18, Y+7 ; 0x07 16ca4: 38 85 ldd r19, Y+8 ; 0x08 ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) return ((uint8_t)ClCompareValue::_Greater); 16ca6: 92 e0 ldi r25, 0x02 ; 2 ,(uint8_t)oCheckModel ); } uint8_t mCompareValue(uint16_t nX, uint16_t nY) { if (nX > nY) 16ca8: 42 17 cp r20, r18 16caa: 53 07 cpc r21, r19 16cac: 28 f0 brcs .+10 ; 0x16cb8 return ((uint8_t)ClCompareValue::_Greater); if (nX < nY) 16cae: 91 e0 ldi r25, 0x01 ; 1 16cb0: 24 17 cp r18, r20 16cb2: 35 07 cpc r19, r21 16cb4: 08 f4 brcc .+2 ; 0x16cb8 16cb6: 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)); 16cb8: 19 0f add r17, r25 if (nCompareValueResult <= COMPARE_VALUE_EQUAL) 16cba: 16 35 cpi r17, 0x56 ; 86 16cbc: 10 f4 brcc .+4 ; 0x16cc2 16cbe: 0c 94 42 a2 jmp 0x14484 ; 0x14484 SERIAL_ECHO(aVersion[2]); SERIAL_ECHO('.'); SERIAL_ECHOLN(aVersion[3]); */ render_M862_warnings( 16cc2: f0 90 e9 03 lds r15, 0x03E9 ; 0x8003e9 16cc6: 8e e3 ldi r24, 0x3E ; 62 16cc8: 97 e3 ldi r25, 0x37 ; 55 16cca: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16cce: 8c 01 movw r16, r24 16cd0: 8e e0 ldi r24, 0x0E ; 14 16cd2: 97 e3 ldi r25, 0x37 ; 55 16cd4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 16cd8: 4f 2d mov r20, r15 16cda: b8 01 movw r22, r16 16cdc: 0e 94 a0 e8 call 0x1d140 ; 0x1d140 16ce0: 0c 94 42 a2 jmp 0x14484 ; 0x14484 else if(code_seen('Q')) 16ce4: 81 e5 ldi r24, 0x51 ; 81 16ce6: 0e 94 80 56 call 0xad00 ; 0xad00 16cea: 88 23 and r24, r24 16cec: 11 f4 brne .+4 ; 0x16cf2 16cee: 0c 94 42 a2 jmp 0x14484 ; 0x14484 16cf2: 0c 94 0c 9e jmp 0x13c18 ; 0x13c18 { uint16_t nGcodeLevel; nGcodeLevel=(uint16_t)code_value_long(); gcode_level_check(nGcodeLevel); } else if(code_seen('Q')) 16cf6: 81 e5 ldi r24, 0x51 ; 81 16cf8: 0e 94 80 56 call 0xad00 ; 0xad00 16cfc: 88 23 and r24, r24 16cfe: 11 f4 brne .+4 ; 0x16d04 16d00: 0c 94 42 a2 jmp 0x14484 ; 0x14484 SERIAL_PROTOCOLLN(GCODE_LEVEL); 16d04: 81 e0 ldi r24, 0x01 ; 1 16d06: 90 e0 ldi r25, 0x00 ; 0 16d08: 0f 94 5d 65 call 0x2caba ; 0x2caba 16d0c: 0c 94 42 a2 jmp 0x14484 ; 0x14484 * 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; 16d10: 8b e4 ldi r24, 0x4B ; 75 16d12: 0e 94 80 56 call 0xad00 ; 0xad00 16d16: c1 2c mov r12, r1 16d18: d1 2c mov r13, r1 16d1a: e1 2c mov r14, r1 16d1c: 50 ec ldi r21, 0xC0 ; 192 16d1e: f5 2e mov r15, r21 16d20: 88 23 and r24, r24 16d22: 49 f1 breq .+82 ; 0x16d76 16d24: 0e 94 10 5b call 0xb620 ; 0xb620 16d28: 6b 01 movw r12, r22 16d2a: 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) 16d2c: 20 e0 ldi r18, 0x00 ; 0 16d2e: 30 e0 ldi r19, 0x00 ; 0 16d30: a9 01 movw r20, r18 16d32: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 16d36: 81 11 cpse r24, r1 16d38: 1e c0 rjmp .+60 ; 0x16d76 { extruder_advance_K = 0; 16d3a: 10 92 a7 04 sts 0x04A7, r1 ; 0x8004a7 16d3e: 10 92 a8 04 sts 0x04A8, r1 ; 0x8004a8 16d42: 10 92 a9 04 sts 0x04A9, r1 ; 0x8004a9 16d46: 10 92 aa 04 sts 0x04AA, r1 ; 0x8004aa 16d4a: 0e 94 7d 84 call 0x108fa ; 0x108fa else extruder_advance_K = newK; } #endif SERIAL_ECHO_START; 16d4e: 84 ee ldi r24, 0xE4 ; 228 16d50: 92 ea ldi r25, 0xA2 ; 162 16d52: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPGM("Advance K="); 16d56: 8b eb ldi r24, 0xBB ; 187 16d58: 99 e7 ldi r25, 0x79 ; 121 16d5a: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN(extruder_advance_K); 16d5e: 60 91 a7 04 lds r22, 0x04A7 ; 0x8004a7 16d62: 70 91 a8 04 lds r23, 0x04A8 ; 0x8004a8 16d66: 80 91 a9 04 lds r24, 0x04A9 ; 0x8004a9 16d6a: 90 91 aa 04 lds r25, 0x04AA ; 0x8004aa 16d6e: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 16d72: 0c 94 42 a2 jmp 0x14484 ; 0x14484 } float la10c_value(float k) { if(la10c_mode == LA10C_UNKNOWN) 16d76: 80 91 43 03 lds r24, 0x0343 ; 0x800343 16d7a: 81 11 cpse r24, r1 16d7c: 1b c0 rjmp .+54 ; 0x16db4 { // do not autodetect until a valid value is seen if(k == 0) return 0; else if(k < 0) 16d7e: 20 e0 ldi r18, 0x00 ; 0 16d80: 30 e0 ldi r19, 0x00 ; 0 16d82: a9 01 movw r20, r18 16d84: c7 01 movw r24, r14 16d86: b6 01 movw r22, r12 16d88: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 16d8c: 87 ff sbrs r24, 7 16d8e: 05 c0 rjmp .+10 ; 0x16d9a } else { newK = la10c_value(newK); if (newK < 0) SERIAL_ECHOLNPGM("K out of allowed range!"); 16d90: 86 ec ldi r24, 0xC6 ; 198 16d92: 99 e7 ldi r25, 0x79 ; 121 16d94: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 16d98: da cf rjmp .-76 ; 0x16d4e return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 16d9a: 20 e0 ldi r18, 0x00 ; 0 16d9c: 30 e0 ldi r19, 0x00 ; 0 16d9e: 40 e2 ldi r20, 0x20 ; 32 16da0: 51 e4 ldi r21, 0x41 ; 65 16da2: c7 01 movw r24, r14 16da4: b6 01 movw r22, r12 16da6: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 16daa: 87 ff sbrs r24, 7 16dac: 2c c0 rjmp .+88 ; 0x16e06 16dae: 81 e0 ldi r24, 0x01 ; 1 16db0: 0e 94 7d 84 call 0x108fa ; 0x108fa } if(la10c_mode == LA10C_LA15) 16db4: 80 91 43 03 lds r24, 0x0343 ; 0x800343 return (k >= 0 && k < LA_K_MAX? k: -1); 16db8: 20 e0 ldi r18, 0x00 ; 0 16dba: 30 e0 ldi r19, 0x00 ; 0 16dbc: a9 01 movw r20, r18 return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); } if(la10c_mode == LA10C_LA15) 16dbe: 81 30 cpi r24, 0x01 ; 1 16dc0: 21 f5 brne .+72 ; 0x16e0a return (k >= 0 && k < LA_K_MAX? k: -1); 16dc2: c7 01 movw r24, r14 16dc4: b6 01 movw r22, r12 16dc6: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 16dca: 87 fd sbrc r24, 7 16dcc: e1 cf rjmp .-62 ; 0x16d90 16dce: 20 e0 ldi r18, 0x00 ; 0 16dd0: 30 e0 ldi r19, 0x00 ; 0 16dd2: 40 e2 ldi r20, 0x20 ; 32 16dd4: 51 e4 ldi r21, 0x41 ; 65 16dd6: c7 01 movw r24, r14 16dd8: b6 01 movw r22, r12 16dda: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 16dde: 87 ff sbrs r24, 7 16de0: d7 cf rjmp .-82 ; 0x16d90 la10c_reset(); } else { newK = la10c_value(newK); if (newK < 0) 16de2: 20 e0 ldi r18, 0x00 ; 0 16de4: 30 e0 ldi r19, 0x00 ; 0 16de6: a9 01 movw r20, r18 16de8: c7 01 movw r24, r14 16dea: b6 01 movw r22, r12 16dec: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 16df0: 87 fd sbrc r24, 7 16df2: ce cf rjmp .-100 ; 0x16d90 SERIAL_ECHOLNPGM("K out of allowed range!"); else extruder_advance_K = newK; 16df4: c0 92 a7 04 sts 0x04A7, r12 ; 0x8004a7 16df8: d0 92 a8 04 sts 0x04A8, r13 ; 0x8004a8 16dfc: e0 92 a9 04 sts 0x04A9, r14 ; 0x8004a9 16e00: f0 92 aa 04 sts 0x04AA, r15 ; 0x8004aa 16e04: a4 cf rjmp .-184 ; 0x16d4e if(k == 0) return 0; else if(k < 0) return -1; la10c_mode_change(k < LA_LA10_MIN? LA10C_LA15: LA10C_LA10); 16e06: 82 e0 ldi r24, 0x02 ; 2 16e08: d3 cf rjmp .-90 ; 0x16db0 } if(la10c_mode == LA10C_LA15) return (k >= 0 && k < LA_K_MAX? k: -1); else return (k >= 0? la10c_convert(k): -1); 16e0a: c7 01 movw r24, r14 16e0c: b6 01 movw r22, r12 16e0e: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 16e12: 87 fd sbrc r24, 7 16e14: bd cf rjmp .-134 ; 0x16d90 // Approximate a LA10 value to a LA15 equivalent. static float la10c_convert(float k) { float new_K = k * 0.002 - 0.01; 16e16: 2f e6 ldi r18, 0x6F ; 111 16e18: 32 e1 ldi r19, 0x12 ; 18 16e1a: 43 e0 ldi r20, 0x03 ; 3 16e1c: 5b e3 ldi r21, 0x3B ; 59 16e1e: c7 01 movw r24, r14 16e20: b6 01 movw r22, r12 16e22: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 16e26: 2a e0 ldi r18, 0x0A ; 10 16e28: 37 ed ldi r19, 0xD7 ; 215 16e2a: 43 e2 ldi r20, 0x23 ; 35 16e2c: 5c e3 ldi r21, 0x3C ; 60 16e2e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 16e32: 6b 01 movw r12, r22 16e34: 7c 01 movw r14, r24 return new_K < 0? 0: 16e36: 20 e0 ldi r18, 0x00 ; 0 16e38: 30 e0 ldi r19, 0x00 ; 0 16e3a: a9 01 movw r20, r18 16e3c: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 16e40: 87 fd sbrc r24, 7 16e42: 11 c0 rjmp .+34 ; 0x16e66 new_K > (LA_K_MAX - FLT_EPSILON)? (LA_K_MAX - FLT_EPSILON): 16e44: 20 e0 ldi r18, 0x00 ; 0 16e46: 30 e0 ldi r19, 0x00 ; 0 16e48: 40 e2 ldi r20, 0x20 ; 32 16e4a: 51 e4 ldi r21, 0x41 ; 65 16e4c: c7 01 movw r24, r14 16e4e: b6 01 movw r22, r12 16e50: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 16e54: 18 16 cp r1, r24 16e56: 2c f6 brge .-118 ; 0x16de2 16e58: c1 2c mov r12, r1 16e5a: d1 2c mov r13, r1 16e5c: 40 e2 ldi r20, 0x20 ; 32 16e5e: e4 2e mov r14, r20 16e60: 41 e4 ldi r20, 0x41 ; 65 16e62: f4 2e mov r15, r20 16e64: c7 cf rjmp .-114 ; 0x16df4 // 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: 16e66: c1 2c mov r12, r1 16e68: d1 2c mov r13, r1 16e6a: 76 01 movw r14, r12 16e6c: c3 cf rjmp .-122 ; 0x16df4 } } 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()); 16e6e: 83 e5 ldi r24, 0x53 ; 83 16e70: 0e 94 80 56 call 0xad00 ; 0xad00 16e74: 88 23 and r24, r24 16e76: 59 f0 breq .+22 ; 0x16e8e 16e78: 10 e0 ldi r17, 0x00 ; 0 16e7a: 0e 94 10 5b call 0xb620 ; 0xb620 16e7e: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 16e82: 81 2f mov r24, r17 16e84: 0f 94 e0 17 call 0x22fc0 ; 0x22fc0 16e88: 1f 5f subi r17, 0xFF ; 255 16e8a: 15 30 cpi r17, 0x05 ; 5 16e8c: b1 f7 brne .-20 ; 0x16e7a 16e8e: 34 ec ldi r19, 0xC4 ; 196 16e90: e3 2e mov r14, r19 16e92: 32 e0 ldi r19, 0x02 ; 2 16e94: f3 2e mov r15, r19 16e96: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i 16ea2: 88 23 and r24, r24 16ea4: 39 f0 breq .+14 ; 0x16eb4 16ea6: 0e 94 10 5b call 0xb620 ; 0xb620 16eaa: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 16eae: 81 2f mov r24, r17 16eb0: 0f 94 e0 17 call 0x22fc0 ; 0x22fc0 16eb4: 1f 5f subi r17, 0xFF ; 255 16eb6: 14 30 cpi r17, 0x04 ; 4 16eb8: 79 f7 brne .-34 ; 0x16e98 if(code_seen('B')) microstep_mode(4,code_value()); 16eba: 82 e4 ldi r24, 0x42 ; 66 16ebc: 0e 94 80 56 call 0xad00 ; 0xad00 16ec0: 88 23 and r24, r24 16ec2: 39 f0 breq .+14 ; 0x16ed2 16ec4: 0e 94 10 5b call 0xb620 ; 0xb620 16ec8: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 16ecc: 84 e0 ldi r24, 0x04 ; 4 16ece: 0f 94 e0 17 call 0x22fc0 ; 0x22fc0 microstep_readings(); 16ed2: 0f 94 06 17 call 0x22e0c ; 0x22e0c 16ed6: 0c 94 42 a2 jmp 0x14484 ; 0x14484 16eda: 24 ec ldi r18, 0xC4 ; 196 16edc: e2 2e mov r14, r18 16ede: 22 e0 ldi r18, 0x02 ; 2 16ee0: 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()) 16ee2: 10 e0 ldi r17, 0x00 ; 0 { case 1: for(int i=0;i 16eee: 88 23 and r24, r24 16ef0: 41 f0 breq .+16 ; 0x16f02 16ef2: 0e 94 10 5b call 0xb620 ; 0xb620 16ef6: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 16efa: 4f ef ldi r20, 0xFF ; 255 16efc: 81 2f mov r24, r17 16efe: 0f 94 61 17 call 0x22ec2 ; 0x22ec2 16f02: 1f 5f subi r17, 0xFF ; 255 16f04: 14 30 cpi r17, 0x04 ; 4 16f06: 71 f7 brne .-36 ; 0x16ee4 if(code_seen('B')) microstep_ms(4,code_value(),-1); 16f08: 82 e4 ldi r24, 0x42 ; 66 16f0a: 0e 94 80 56 call 0xad00 ; 0xad00 16f0e: 88 23 and r24, r24 16f10: 11 f4 brne .+4 ; 0x16f16 16f12: 0c 94 7f a0 jmp 0x140fe ; 0x140fe 16f16: 0e 94 10 5b call 0xb620 ; 0xb620 16f1a: 0c 94 7f a0 jmp 0x140fe ; 0x140fe 16f1e: 94 ec ldi r25, 0xC4 ; 196 16f20: e9 2e mov r14, r25 16f22: 92 e0 ldi r25, 0x02 ; 2 16f24: 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()) 16f26: 10 e0 ldi r17, 0x00 ; 0 case 1: for(int i=0;i 16f32: 88 23 and r24, r24 16f34: 49 f0 breq .+18 ; 0x16f48 16f36: 0e 94 10 5b call 0xb620 ; 0xb620 16f3a: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 16f3e: 46 2f mov r20, r22 16f40: 6f ef ldi r22, 0xFF ; 255 16f42: 81 2f mov r24, r17 16f44: 0f 94 61 17 call 0x22ec2 ; 0x22ec2 16f48: 1f 5f subi r17, 0xFF ; 255 16f4a: 14 30 cpi r17, 0x04 ; 4 16f4c: 69 f7 brne .-38 ; 0x16f28 16f4e: dc cf rjmp .-72 ; 0x16f08 case 701: { uint8_t mmuSlotIndex = 0xffU; float fastLoadLength = FILAMENTCHANGE_FIRSTFEED; // Only used without MMU float z_target = 0; if( MMU2::mmu2.Enabled() ) 16f50: 80 91 01 13 lds r24, 0x1301 ; 0x801301 16f54: 81 30 cpi r24, 0x01 ; 1 16f56: 99 f1 breq .+102 ; 0x16fbe - `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; 16f58: 1f ef ldi r17, 0xFF ; 255 if( code_seen('P') || code_seen('T') ) { mmuSlotIndex = code_value_uint8(); } } if (code_seen('L')) fastLoadLength = code_value(); 16f5a: 8c e4 ldi r24, 0x4C ; 76 16f5c: 0e 94 80 56 call 0xad00 ; 0xad00 16f60: 88 23 and r24, r24 16f62: e1 f1 breq .+120 ; 0x16fdc 16f64: 0e 94 10 5b call 0xb620 ; 0xb620 16f68: 6b 01 movw r12, r22 16f6a: 7c 01 movw r14, r24 // Z lift. For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 16f6c: 8a e5 ldi r24, 0x5A ; 90 16f6e: 0e 94 80 56 call 0xad00 ; 0xad00 16f72: 88 23 and r24, r24 16f74: d1 f1 breq .+116 ; 0x16fea 16f76: 0e 94 10 5b call 0xb620 ; 0xb620 16f7a: 9f 77 andi r25, 0x7F ; 127 // Raise the Z axis float delta = raise_z(z_target); 16f7c: 0e 94 e5 6c call 0xd9ca ; 0xd9ca 16f80: 4b 01 movw r8, r22 16f82: 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 16f84: 8a e5 ldi r24, 0x5A ; 90 16f86: 0e 94 80 56 call 0xad00 ; 0xad00 16f8a: 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; 16f8c: 0f 94 c9 78 call 0x2f192 ; 0x2f192 prusa_statistics(22); 16f90: 86 e1 ldi r24, 0x16 ; 22 16f92: 0f 94 05 30 call 0x2600a ; 0x2600a if (MMU2::mmu2.Enabled()) { 16f96: 80 91 01 13 lds r24, 0x1301 ; 0x801301 16f9a: 81 30 cpi r24, 0x01 ; 1 16f9c: 51 f5 brne .+84 ; 0x16ff2 if (mmuSlotIndex < MMU_FILAMENT_COUNT) { 16f9e: 15 30 cpi r17, 0x05 ; 5 16fa0: 18 f4 brcc .+6 ; 0x16fa8 MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); 16fa2: 81 2f mov r24, r17 16fa4: 0e 94 d0 fb call 0x1f7a0 ; 0x1f7a0 lcd_update(2); lcd_setstatuspgm(MSG_WELCOME); custom_message_type = CustomMsg::Status; } eFilamentAction = FilamentAction::None; 16fa8: 10 92 94 03 sts 0x0394, r1 ; 0x800394 16fac: 0f 94 33 6d call 0x2da66 ; 0x2da66 // 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); 16fb0: c5 01 movw r24, r10 16fb2: b4 01 movw r22, r8 16fb4: 90 58 subi r25, 0x80 ; 128 16fb6: 0e 94 e5 6c call 0xd9ca ; 0xd9ca 16fba: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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') ) { 16fbe: 80 e5 ldi r24, 0x50 ; 80 16fc0: 0e 94 80 56 call 0xad00 ; 0xad00 16fc4: 88 23 and r24, r24 16fc6: 21 f0 breq .+8 ; 0x16fd0 mmuSlotIndex = code_value_uint8(); 16fc8: 0e 94 95 56 call 0xad2a ; 0xad2a 16fcc: 18 2f mov r17, r24 16fce: c5 cf rjmp .-118 ; 0x16f5a 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') ) { 16fd0: 84 e5 ldi r24, 0x54 ; 84 16fd2: 0e 94 80 56 call 0xad00 ; 0xad00 16fd6: 81 11 cpse r24, r1 16fd8: f7 cf rjmp .-18 ; 0x16fc8 16fda: be cf rjmp .-132 ; 0x16f58 - `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 16fdc: c1 2c mov r12, r1 16fde: d1 2c mov r13, r1 16fe0: 8c e8 ldi r24, 0x8C ; 140 16fe2: e8 2e mov r14, r24 16fe4: 82 e4 ldi r24, 0x42 ; 66 16fe6: f8 2e mov r15, r24 16fe8: c1 cf rjmp .-126 ; 0x16f6c float z_target = 0; 16fea: 60 e0 ldi r22, 0x00 ; 0 16fec: 70 e0 ldi r23, 0x00 ; 0 16fee: cb 01 movw r24, r22 16ff0: c5 cf rjmp .-118 ; 0x16f7c 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; 16ff2: 82 e0 ldi r24, 0x02 ; 2 16ff4: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT)); 16ff8: 8f ea ldi r24, 0xAF ; 175 16ffa: 92 e6 ldi r25, 0x62 ; 98 16ffc: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17000: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 current_position[E_AXIS] += fastLoadLength; 17004: a7 01 movw r20, r14 17006: 96 01 movw r18, r12 17008: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1700c: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 17010: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 17014: 90 91 70 12 lds r25, 0x1270 ; 0x801270 17018: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1701c: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 17020: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 17024: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 17028: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENTCHANGE_EFEED_FIRST); //fast sequence 1702c: 60 e0 ldi r22, 0x00 ; 0 1702e: 70 e0 ldi r23, 0x00 ; 0 17030: 80 ea ldi r24, 0xA0 ; 160 17032: 91 e4 ldi r25, 0x41 ; 65 17034: 0f 94 0d 4a call 0x2941a ; 0x2941a if (raise_z_axis) { // backwards compatibility for 3.12 and older FW 17038: 01 11 cpse r16, r1 1703a: 06 c0 rjmp .+12 ; 0x17048 raise_z_above(MIN_Z_FOR_LOAD); 1703c: 60 e0 ldi r22, 0x00 ; 0 1703e: 70 e0 ldi r23, 0x00 ; 0 17040: 88 e4 ldi r24, 0x48 ; 72 17042: 92 e4 ldi r25, 0x42 ; 66 17044: 0e 94 47 6d call 0xda8e ; 0xda8e } load_filament_final_feed(); // slow sequence 17048: 0e 94 3e 64 call 0xc87c ; 0xc87c st_synchronize(); 1704c: 0f 94 94 18 call 0x23128 ; 0x23128 Sound_MakeCustom(50, 500, false); 17050: 40 e0 ldi r20, 0x00 ; 0 17052: 64 ef ldi r22, 0xF4 ; 244 17054: 71 e0 ldi r23, 0x01 ; 1 17056: 82 e3 ldi r24, 0x32 ; 50 17058: 90 e0 ldi r25, 0x00 ; 0 1705a: 0f 94 4a 25 call 0x24a94 ; 0x24a94 if (!farm_mode && (eFilamentAction != FilamentAction::None)) { 1705e: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 17062: 81 11 cpse r24, r1 17064: 05 c0 rjmp .+10 ; 0x17070 17066: 80 91 94 03 lds r24, 0x0394 ; 0x800394 1706a: 81 11 cpse r24, r1 lcd_load_filament_color_check(); 1706c: 0f 94 a0 18 call 0x23140 ; 0x23140 #ifdef COMMUNITY_PREVENT_OOZE // Retract filament to prevent oozing retract_for_ooze_prevention(); #endif //COMMUNITY_PREVENT_OOZE lcd_update_enable(true); 17070: 81 e0 ldi r24, 0x01 ; 1 17072: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_update(2); 17076: 82 e0 ldi r24, 0x02 ; 2 17078: 0e 94 4a 6f call 0xde94 ; 0xde94 lcd_setstatuspgm(MSG_WELCOME); 1707c: 8a e8 ldi r24, 0x8A ; 138 1707e: 9c e6 ldi r25, 0x6C ; 108 17080: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 custom_message_type = CustomMsg::Status; 17084: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d 17088: 8f cf rjmp .-226 ; 0x16fa8 */ case 702: { float z_target = 0; float unloadLength = FILAMENTCHANGE_FINALRETRACT; if (code_seen('U')) unloadLength = code_value(); 1708a: 85 e5 ldi r24, 0x55 ; 85 1708c: 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; 17090: c1 2c mov r12, r1 17092: d1 2c mov r13, r1 17094: 76 01 movw r14, r12 if (code_seen('U')) unloadLength = code_value(); 17096: 88 23 and r24, r24 17098: 21 f0 breq .+8 ; 0x170a2 1709a: 0e 94 10 5b call 0xb620 ; 0xb620 1709e: 6b 01 movw r12, r22 170a0: 7c 01 movw r14, r24 // For safety only allow positive values if (code_seen('Z')) z_target = fabs(code_value()); 170a2: 8a e5 ldi r24, 0x5A ; 90 170a4: 0e 94 80 56 call 0xad00 ; 0xad00 170a8: 88 23 and r24, r24 170aa: a1 f0 breq .+40 ; 0x170d4 170ac: 0e 94 10 5b call 0xb620 ; 0xb620 170b0: 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); 170b2: 0e 94 e5 6c call 0xd9ca ; 0xd9ca 170b6: 4b 01 movw r8, r22 170b8: 5c 01 movw r10, r24 // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); 170ba: 80 91 01 13 lds r24, 0x1301 ; 0x801301 170be: 81 30 cpi r24, 0x01 ; 1 170c0: 99 f4 brne .+38 ; 0x170e8 170c2: 0f 94 12 9e call 0x33c24 ; 0x33c24 else unload_filament(unloadLength); // Restore Z axis raise_z(-delta); 170c6: c5 01 movw r24, r10 170c8: b4 01 movw r22, r8 170ca: 90 58 subi r25, 0x80 ; 128 170cc: 0e 94 e5 6c call 0xd9ca ; 0xd9ca 170d0: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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 170d4: 60 e0 ldi r22, 0x00 ; 0 170d6: 70 e0 ldi r23, 0x00 ; 0 170d8: 80 ea ldi r24, 0xA0 ; 160 170da: 91 e4 ldi r25, 0x41 ; 65 170dc: 0e 94 47 6d call 0xda8e ; 0xda8e - `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; 170e0: 60 e0 ldi r22, 0x00 ; 0 170e2: 70 e0 ldi r23, 0x00 ; 0 170e4: cb 01 movw r24, r22 170e6: e5 cf rjmp .-54 ; 0x170b2 // Raise the Z axis float delta = raise_z(z_target); // Unload filament if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); else unload_filament(unloadLength); 170e8: c7 01 movw r24, r14 170ea: b6 01 movw r22, r12 170ec: 0e 94 66 e1 call 0x1c2cc ; 0x1c2cc 170f0: ea cf rjmp .-44 ; 0x170c6 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 704: { gcodes_M704_M705_M706(704); 170f2: 80 ec ldi r24, 0xC0 ; 192 170f4: 92 e0 ldi r25, 0x02 ; 2 170f6: 0e 94 d6 5a call 0xb5ac ; 0xb5ac 170fa: 0c 94 42 a2 jmp 0x14484 ; 0x14484 #### Parameters - `P` - n index of slot (zero based, so 0-4 like T0 and T4) */ case 705: { gcodes_M704_M705_M706(705); 170fe: 81 ec ldi r24, 0xC1 ; 193 17100: 92 e0 ldi r25, 0x02 ; 2 17102: 0e 94 d6 5a call 0xb5ac ; 0xb5ac 17106: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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() ) { 1710a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1710e: 81 30 cpi r24, 0x01 ; 1 17110: 11 f0 breq .+4 ; 0x17116 17112: 0c 94 42 a2 jmp 0x14484 ; 0x14484 if( code_seen('A') ) { 17116: 81 e4 ldi r24, 0x41 ; 65 17118: 0e 94 80 56 call 0xad00 ; 0xad00 1711c: 88 23 and r24, r24 1711e: 11 f4 brne .+4 ; 0x17124 17120: 0c 94 42 a2 jmp 0x14484 ; 0x14484 MMU2::mmu2.ReadRegister(uint8_t(strtol(strchr_pointer+1, NULL, 16))); 17124: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 17128: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 1712c: 40 e1 ldi r20, 0x10 ; 16 1712e: 50 e0 ldi r21, 0x00 ; 0 17130: 70 e0 ldi r23, 0x00 ; 0 17132: 60 e0 ldi r22, 0x00 ; 0 17134: 01 96 adiw r24, 0x01 ; 1 17136: 0f 94 0c a0 call 0x34018 ; 0x34018 1713a: 86 2f mov r24, r22 1713c: 0e 94 9c fc call 0x1f938 ; 0x1f938 17140: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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() ){ 17144: 80 91 01 13 lds r24, 0x1301 ; 0x801301 17148: 81 30 cpi r24, 0x01 ; 1 1714a: 11 f0 breq .+4 ; 0x17150 1714c: 0c 94 42 a2 jmp 0x14484 ; 0x14484 uint8_t addr = 0; if( code_seen('A') ) { 17150: 81 e4 ldi r24, 0x41 ; 65 17152: 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; 17156: 10 e0 ldi r17, 0x00 ; 0 if( code_seen('A') ) { 17158: 88 23 and r24, r24 1715a: 61 f0 breq .+24 ; 0x17174 addr = uint8_t(strtol(strchr_pointer+1, NULL, 16)); 1715c: 80 91 bb 04 lds r24, 0x04BB ; 0x8004bb 17160: 90 91 bc 04 lds r25, 0x04BC ; 0x8004bc 17164: 40 e1 ldi r20, 0x10 ; 16 17166: 50 e0 ldi r21, 0x00 ; 0 17168: 70 e0 ldi r23, 0x00 ; 0 1716a: 60 e0 ldi r22, 0x00 ; 0 1716c: 01 96 adiw r24, 0x01 ; 1 1716e: 0f 94 0c a0 call 0x34018 ; 0x34018 17172: 16 2f mov r17, r22 } uint16_t data = 0; if( code_seen('X') ) { 17174: 88 e5 ldi r24, 0x58 ; 88 17176: 0e 94 80 56 call 0xad00 ; 0xad00 1717a: 88 23 and r24, r24 1717c: 61 f0 breq .+24 ; 0x17196 data = code_value_short(); 1717e: 0e 94 a2 56 call 0xad44 ; 0xad44 } if(addr){ 17182: 11 23 and r17, r17 17184: 11 f4 brne .+4 ; 0x1718a 17186: 0c 94 42 a2 jmp 0x14484 ; 0x14484 MMU2::mmu2.WriteRegister(addr, data); 1718a: bc 01 movw r22, r24 1718c: 81 2f mov r24, r17 1718e: 0e 94 84 d0 call 0x1a108 ; 0x1a108 17192: 0c 94 42 a2 jmp 0x14484 ; 0x14484 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; 17196: 90 e0 ldi r25, 0x00 ; 0 17198: 80 e0 ldi r24, 0x00 ; 0 1719a: f3 cf rjmp .-26 ; 0x17182 M709 - Serial message if en- or disabled */ case 709: { if (code_seen('S')) 1719c: 83 e5 ldi r24, 0x53 ; 83 1719e: 0e 94 80 56 call 0xad00 ; 0xad00 171a2: 88 23 and r24, r24 171a4: 31 f0 breq .+12 ; 0x171b2 { switch (code_value_uint8()) 171a6: 0e 94 95 56 call 0xad2a ; 0xad2a 171aa: 88 23 and r24, r24 171ac: a9 f0 breq .+42 ; 0x171d8 171ae: 81 30 cpi r24, 0x01 ; 1 171b0: f9 f0 breq .+62 ; 0x171f0 break; default: break; } } if (MMU2::mmu2.Enabled() && code_seen('X')) 171b2: 80 91 01 13 lds r24, 0x1301 ; 0x801301 171b6: 81 30 cpi r24, 0x01 ; 1 171b8: 59 f4 brne .+22 ; 0x171d0 171ba: 88 e5 ldi r24, 0x58 ; 88 171bc: 0e 94 80 56 call 0xad00 ; 0xad00 171c0: 88 23 and r24, r24 171c2: 31 f0 breq .+12 ; 0x171d0 { switch (code_value_uint8()) 171c4: 0e 94 95 56 call 0xad2a ; 0xad2a 171c8: 82 30 cpi r24, 0x02 ; 2 171ca: d0 f0 brcs .+52 ; 0x17200 171cc: 8a 32 cpi r24, 0x2A ; 42 171ce: e1 f0 breq .+56 ; 0x17208 break; default: break; } } MMU2::mmu2.Status(); 171d0: 0f 94 4b 65 call 0x2ca96 ; 0x2ca96 171d4: 0c 94 42 a2 jmp 0x14484 ; 0x14484 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 171d8: 60 e0 ldi r22, 0x00 ; 0 171da: 8c ea ldi r24, 0xAC ; 172 171dc: 9c e0 ldi r25, 0x0C ; 12 171de: 0f 94 a5 a4 call 0x3494a ; 0x3494a StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 171e2: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 171e6: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 171ea: 10 92 94 12 sts 0x1294, r1 ; 0x801294 171ee: e1 cf rjmp .-62 ; 0x171b2 171f0: 61 e0 ldi r22, 0x01 ; 1 171f2: 8c ea ldi r24, 0xAC ; 172 171f4: 9c e0 ldi r25, 0x0C ; 12 171f6: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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(); 171fa: 0f 94 21 96 call 0x32c42 ; 0x32c42 171fe: d9 cf rjmp .-78 ; 0x171b2 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 17200: 80 e0 ldi r24, 0x00 ; 0 } void MMU2::ResetX42() { logic.ResetMMU(42); 17202: 0f 94 e4 95 call 0x32bc8 ; 0x32bc8 17206: e4 cf rjmp .-56 ; 0x171d0 17208: 8a e2 ldi r24, 0x2A ; 42 1720a: fb cf rjmp .-10 ; 0x17202 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') { 1720c: 84 35 cpi r24, 0x54 ; 84 1720e: 09 f0 breq .+2 ; 0x17212 17210: 79 c0 rjmp .+242 ; 0x17304 strchr_pointer = CMDBUFFER_CURRENT_STRING; 17212: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 17216: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb processing_tcode = true; 1721a: 81 e0 ldi r24, 0x01 ; 1 1721c: 80 93 91 03 sts 0x0391, r24 ; 0x800391 TCodes(strchr_pointer, code_value_uint8()); 17220: 0e 94 95 56 call 0xad2a ; 0xad2a 17224: 18 2f mov r17, r24 17226: 20 91 bb 04 lds r18, 0x04BB ; 0x8004bb 1722a: 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; 1722e: 91 e0 ldi r25, 0x01 ; 1 for ( /*nothing*/ ; strchr_pointer[index] == ' ' || strchr_pointer[index] == '\t'; index++) 17230: 79 01 movw r14, r18 17232: e9 0e add r14, r25 17234: f1 1c adc r15, r1 17236: d7 01 movw r26, r14 17238: 8c 91 ld r24, X 1723a: 80 32 cpi r24, 0x20 ; 32 1723c: 11 f0 breq .+4 ; 0x17242 1723e: 89 30 cpi r24, 0x09 ; 9 17240: 11 f4 brne .+4 ; 0x17246 17242: 9f 5f subi r25, 0xFF ; 255 17244: f5 cf rjmp .-22 ; 0x17230 ; strchr_pointer[index] = tolower(strchr_pointer[index]); 17246: 08 2e mov r0, r24 17248: 00 0c add r0, r0 1724a: 99 0b sbc r25, r25 1724c: 0f 94 95 aa call 0x3552a ; 0x3552a 17250: f7 01 movw r30, r14 17252: 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'); 17254: 90 ed ldi r25, 0xD0 ; 208 17256: 98 0f add r25, r24 17258: 95 30 cpi r25, 0x05 ; 5 1725a: 58 f0 brcs .+22 ; 0x17272 1725c: 8f 33 cpi r24, 0x3F ; 63 1725e: 69 f0 breq .+26 ; 0x1727a 17260: 88 37 cpi r24, 0x78 ; 120 17262: 59 f0 breq .+22 ; 0x1727a 17264: 83 36 cpi r24, 0x63 ; 99 17266: 01 f1 breq .+64 ; 0x172a8 } inline void TCodeInvalid() { SERIAL_ECHOLNPGM("Invalid T code."); 17268: 81 e9 ldi r24, 0x91 ; 145 1726a: 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 1726c: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 17270: 15 c0 rjmp .+42 ; 0x1729c 17272: 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] == '?'){ 17276: 8f 33 cpi r24, 0x3F ; 63 17278: a9 f4 brne .+42 ; 0x172a4 // load to extruder gears; if mmu is not present do nothing if (MMU2::mmu2.Enabled()) { 1727a: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1727e: 81 30 cpi r24, 0x01 ; 1 17280: 69 f4 brne .+26 ; 0x1729c MMU2::mmu2.tool_change(strchr_pointer[index], choose_menu_P(_T(MSG_SELECT_FILAMENT), MSG_FILAMENT)); 17282: 84 e1 ldi r24, 0x14 ; 20 17284: 9d e3 ldi r25, 0x3D ; 61 17286: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1728a: 70 e0 ldi r23, 0x00 ; 0 1728c: 60 e0 ldi r22, 0x00 ; 0 1728e: 0e 94 b0 cf call 0x19f60 ; 0x19f60 17292: 68 2f mov r22, r24 17294: d7 01 movw r26, r14 17296: 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()); 17298: 0e 94 3a fc call 0x1f874 ; 0x1f874 processing_tcode = false; 1729c: 10 92 91 03 sts 0x0391, r1 ; 0x800391 172a0: 0c 94 9d 8e jmp 0x11d3a ; 0x11d3a } 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'){ 172a4: 83 36 cpi r24, 0x63 ; 99 172a6: 49 f4 brne .+18 ; 0x172ba // load from extruder gears to nozzle (nozzle should be preheated) if (MMU2::mmu2.Enabled()) { 172a8: 80 91 01 13 lds r24, 0x1301 ; 0x801301 172ac: 81 30 cpi r24, 0x01 ; 1 172ae: b1 f7 brne .-20 ; 0x1729c MMU2::mmu2.tool_change(strchr_pointer[index], MMU2::mmu2.get_current_tool()); 172b0: 0f 94 45 65 call 0x2ca8a ; 0x2ca8a 172b4: 68 2f mov r22, r24 172b6: 83 e6 ldi r24, 0x63 ; 99 172b8: ef cf rjmp .-34 ; 0x17298 } } else { // Process T0 ... T4 if (MMU2::mmu2.Enabled()) { 172ba: 91 30 cpi r25, 0x01 ; 1 172bc: 69 f4 brne .+26 ; 0x172d8 if (codeValue == MMU2::mmu2.get_current_tool()){ 172be: 0f 94 45 65 call 0x2ca8a ; 0x2ca8a 172c2: 18 13 cpse r17, r24 172c4: 05 c0 rjmp .+10 ; 0x172d0 // don't execute the same T-code twice in a row puts_P(duplicate_Tcode_ignored); 172c6: 81 ea ldi r24, 0xA1 ; 161 172c8: 99 e7 ldi r25, 0x79 ; 121 172ca: 0f 94 6a a3 call 0x346d4 ; 0x346d4 172ce: e6 cf rjmp .-52 ; 0x1729c #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); 172d0: 81 2f mov r24, r17 172d2: 0e 94 17 fc call 0x1f82e ; 0x1f82e 172d6: e2 cf rjmp .-60 ; 0x1729c } } else { SERIAL_ECHO_START; 172d8: 84 ee ldi r24, 0xE4 ; 228 172da: 92 ea ldi r25, 0xA2 ; 162 172dc: 0e 94 15 7b call 0xf62a ; 0xf62a if (codeValue >= EXTRUDERS) { 172e0: 11 23 and r17, r17 172e2: 59 f0 breq .+22 ; 0x172fa } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 172e4: 84 e5 ldi r24, 0x54 ; 84 172e6: 0e 94 02 7a call 0xf404 ; 0xf404 SERIAL_ECHO('T'); SERIAL_ECHOLN(codeValue + '0'); 172ea: 81 2f mov r24, r17 172ec: 90 e0 ldi r25, 0x00 ; 0 172ee: c0 96 adiw r24, 0x30 ; 48 172f0: 0f 94 5d 65 call 0x2caba ; 0x2caba SERIAL_ECHOLNRPGM(_n("Invalid extruder")); ////MSG_INVALID_EXTRUDER 172f4: 88 e9 ldi r24, 0x98 ; 152 172f6: 95 e6 ldi r25, 0x65 ; 101 172f8: b9 cf rjmp .-142 ; 0x1726c // next_feedrate = code_value(); // if (next_feedrate > 0.0) { // feedrate = next_feedrate; // } // } SERIAL_ECHORPGM(_n("Active Extruder: 0")); ////MSG_ACTIVE_EXTRUDER 172fa: 85 e8 ldi r24, 0x85 ; 133 172fc: 95 e6 ldi r25, 0x65 ; 101 172fe: 0e 94 15 7b call 0xf62a ; 0xf62a 17302: cc cf rjmp .-104 ; 0x1729c /** *--------------------------------------------------------------------------------- *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) 17304: 84 34 cpi r24, 0x44 ; 68 17306: 09 f0 breq .+2 ; 0x1730a 17308: 5d c0 rjmp .+186 ; 0x173c4 { strchr_pointer = CMDBUFFER_CURRENT_STRING; 1730a: 10 93 bc 04 sts 0x04BC, r17 ; 0x8004bc 1730e: 00 93 bb 04 sts 0x04BB, r16 ; 0x8004bb switch(code_value_short()) 17312: 0e 94 a2 56 call 0xad44 ; 0xad44 17316: 82 30 cpi r24, 0x02 ; 2 17318: 91 05 cpc r25, r1 1731a: 41 f1 breq .+80 ; 0x1736c 1731c: 8c f4 brge .+34 ; 0x17340 1731e: 01 96 adiw r24, 0x01 ; 1 17320: e1 f0 breq .+56 ; 0x1735a #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //DEBUG_DCODES default: printf_P(MSG_UNKNOWN_CODE, 'D', cmdbuffer + bufindr + CMDHDRSIZE); 17322: 80 91 38 12 lds r24, 0x1238 ; 0x801238 17326: 90 91 39 12 lds r25, 0x1239 ; 0x801239 1732a: 82 5b subi r24, 0xB2 ; 178 1732c: 9f 4e sbci r25, 0xEF ; 239 1732e: 9f 93 push r25 17330: 8f 93 push r24 17332: 1f 92 push r1 17334: 84 e4 ldi r24, 0x44 ; 68 17336: 8f 93 push r24 17338: 84 e0 ldi r24, 0x04 ; 4 1733a: 97 e6 ldi r25, 0x67 ; 103 1733c: 0c 94 f2 8e jmp 0x11de4 ; 0x11de4 *# D codes */ else if(*CMDBUFFER_CURRENT_STRING == 'D') // D codes (debug) { strchr_pointer = CMDBUFFER_CURRENT_STRING; switch(code_value_short()) 17340: 83 30 cpi r24, 0x03 ; 3 17342: 91 05 cpc r25, r1 17344: f9 f0 breq .+62 ; 0x17384 17346: 47 97 sbiw r24, 0x17 ; 23 17348: 61 f7 brne .-40 ; 0x17322 bool emergency_serial_dump = false; void dcode_23() { if(code_seen('E')) 1734a: 85 e4 ldi r24, 0x45 ; 69 1734c: 0e 94 80 56 call 0xad00 ; 0xad00 17350: 88 23 and r24, r24 17352: 09 f1 breq .+66 ; 0x17396 serial_dump_and_reset(dump_crash_reason::manual); 17354: 80 e0 ldi r24, 0x00 ; 0 17356: 0e 94 f2 84 call 0x109e4 ; 0x109e4 * */ void dcode__1() { DBG(_N("D-1 - Endless loop\n")); 1735a: 81 e7 ldi r24, 0x71 ; 113 1735c: 95 e6 ldi r25, 0x65 ; 101 1735e: 9f 93 push r25 17360: 8f 93 push r24 17362: 0f 94 43 a3 call 0x34686 ; 0x34686 17366: 0f 90 pop r0 17368: 0f 90 pop r0 1736a: ff cf rjmp .-2 ; 0x1736a - The hex data needs to be lowercase */ void dcode_2() { dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM")); 1736c: 0c e6 ldi r16, 0x6C ; 108 1736e: 15 e6 ldi r17, 0x65 ; 101 17370: 22 e0 ldi r18, 0x02 ; 2 17372: 40 e0 ldi r20, 0x00 ; 0 17374: 60 e0 ldi r22, 0x00 ; 0 17376: 72 e2 ldi r23, 0x22 ; 34 17378: 80 e0 ldi r24, 0x00 ; 0 1737a: 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")); 1737c: 0e 94 47 5e call 0xbc8e ; 0xbc8e 17380: 0c 94 9d 8e jmp 0x11d3a ; 0x11d3a 17384: 05 e6 ldi r16, 0x65 ; 101 17386: 15 e6 ldi r17, 0x65 ; 101 17388: 23 e0 ldi r18, 0x03 ; 3 1738a: 41 e0 ldi r20, 0x01 ; 1 1738c: 60 e0 ldi r22, 0x00 ; 0 1738e: 70 e1 ldi r23, 0x10 ; 16 17390: 90 e0 ldi r25, 0x00 ; 0 17392: 80 e0 ldi r24, 0x00 ; 0 17394: f3 cf rjmp .-26 ; 0x1737c { if(code_seen('E')) serial_dump_and_reset(dump_crash_reason::manual); else { emergency_serial_dump = !code_seen('R'); 17396: 82 e5 ldi r24, 0x52 ; 82 17398: 0e 94 80 56 call 0xad00 ; 0xad00 1739c: 91 e0 ldi r25, 0x01 ; 1 1739e: 89 27 eor r24, r25 173a0: 80 93 0f 06 sts 0x060F, r24 ; 0x80060f SERIAL_ECHOPGM("serial dump "); 173a4: 84 e8 ldi r24, 0x84 ; 132 173a6: 99 e7 ldi r25, 0x79 ; 121 173a8: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNRPGM(emergency_serial_dump? _N("enabled"): _N("disabled")); 173ac: 80 91 0f 06 lds r24, 0x060F ; 0x80060f 173b0: 88 23 and r24, r24 173b2: 21 f0 breq .+8 ; 0x173bc 173b4: 8d e5 ldi r24, 0x5D ; 93 173b6: 95 e6 ldi r25, 0x65 ; 101 173b8: 0c 94 59 8f jmp 0x11eb2 ; 0x11eb2 173bc: 84 e5 ldi r24, 0x54 ; 84 173be: 95 e6 ldi r25, 0x65 ; 101 173c0: 0c 94 59 8f jmp 0x11eb2 ; 0x11eb2 } } else { SERIAL_ECHO_START; 173c4: 84 ee ldi r24, 0xE4 ; 228 173c6: 92 ea ldi r25, 0xA2 ; 162 173c8: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(MSG_UNKNOWN_COMMAND); 173cc: 87 ec ldi r24, 0xC7 ; 199 173ce: 95 e6 ldi r25, 0x65 ; 101 173d0: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHO(CMDBUFFER_CURRENT_STRING); 173d4: 80 91 38 12 lds r24, 0x1238 ; 0x801238 173d8: 90 91 39 12 lds r25, 0x1239 ; 0x801239 173dc: 82 5b subi r24, 0xB2 ; 178 173de: 9f 4e sbci r25, 0xEF ; 239 173e0: 0e 94 0e 86 call 0x10c1c ; 0x10c1c SERIAL_ECHOLNPGM("\"(2)"); 173e4: 88 ef ldi r24, 0xF8 ; 248 173e6: 9e e7 ldi r25, 0x7E ; 126 173e8: 0c 94 59 8f jmp 0x11eb2 ; 0x11eb2 #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 173ec: 2d ec ldi r18, 0xCD ; 205 173ee: 3c ec ldi r19, 0xCC ; 204 173f0: 4c ec ldi r20, 0xCC ; 204 173f2: 5d e3 ldi r21, 0x3D ; 61 173f4: c7 01 movw r24, r14 173f6: b6 01 movw r22, r12 173f8: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 173fc: 18 16 cp r1, r24 173fe: 14 f4 brge .+4 ; 0x17404 17400: 0c 94 c1 90 jmp 0x12182 ; 0x12182 17404: 0c 94 d1 91 jmp 0x123a2 ; 0x123a2 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; 17408: a3 01 movw r20, r6 1740a: 92 01 movw r18, r4 1740c: 62 2d mov r22, r2 1740e: 73 2d mov r23, r3 17410: 8e 2d mov r24, r14 17412: 9f 2d mov r25, r15 17414: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 17418: 18 16 cp r1, r24 1741a: 14 f0 brlt .+4 ; 0x17420 1741c: 0c 94 43 99 jmp 0x13286 ; 0x13286 17420: e5 e0 ldi r30, 0x05 ; 5 17422: ce 0e add r12, r30 17424: d1 1c adc r13, r1 17426: f2 e0 ldi r31, 0x02 ; 2 17428: 8f 0e add r8, r31 1742a: 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; 1742c: 85 01 movw r16, r10 1742e: 0c 94 0a 99 jmp 0x13214 ; 0x13214 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)); 17432: 82 e7 ldi r24, 0x72 ; 114 17434: 99 e3 ldi r25, 0x39 ; 57 17436: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1743a: 0e 94 91 de call 0x1bd22 ; 0x1bd22 lcd_puts_at_P(0, 2, PSTR("")); 1743e: 42 e9 ldi r20, 0x92 ; 146 17440: 5e e7 ldi r21, 0x7E ; 126 17442: 62 e0 ldi r22, 0x02 ; 2 17444: 80 e0 ldi r24, 0x00 ; 0 17446: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 for (const char *c = version_string; ! is_whitespace_or_nl_or_eol(*c); ++ c) 1744a: f8 01 movw r30, r16 1744c: 81 91 ld r24, Z+ 1744e: 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'; 17450: 98 2f mov r25, r24 17452: 9f 7d andi r25, 0xDF ; 223 17454: 11 f4 brne .+4 ; 0x1745a 17456: 0c 94 0e a8 jmp 0x1501c ; 0x1501c 1745a: 97 ef ldi r25, 0xF7 ; 247 1745c: 98 0f add r25, r24 1745e: 92 30 cpi r25, 0x02 ; 2 17460: 10 f4 brcc .+4 ; 0x17466 17462: 0c 94 0e a8 jmp 0x1501c ; 0x1501c 17466: 8d 30 cpi r24, 0x0D ; 13 17468: 11 f4 brne .+4 ; 0x1746e 1746a: 0c 94 0e a8 jmp 0x1501c ; 0x1501c 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); 1746e: 0e 94 72 6f call 0xdee4 ; 0xdee4 17472: eb cf rjmp .-42 ; 0x1744a 00017474 <__vector_29>: #ifdef ADC_CALLBACK extern void ADC_CALLBACK(); #endif //ADC_CALLBACK ISR(ADC_vect) { 17474: 1f 92 push r1 17476: 0f 92 push r0 17478: 0f b6 in r0, 0x3f ; 63 1747a: 0f 92 push r0 1747c: 11 24 eor r1, r1 1747e: 0b b6 in r0, 0x3b ; 59 17480: 0f 92 push r0 17482: 2f 93 push r18 17484: 3f 93 push r19 17486: 4f 93 push r20 17488: 5f 93 push r21 1748a: 6f 93 push r22 1748c: 7f 93 push r23 1748e: 8f 93 push r24 17490: 9f 93 push r25 17492: af 93 push r26 17494: bf 93 push r27 17496: ef 93 push r30 17498: ff 93 push r31 adc_values[adc_channel] += ADC; 1749a: 20 91 78 00 lds r18, 0x0078 ; 0x800078 <__TEXT_REGION_LENGTH__+0x7c2078> 1749e: 30 91 79 00 lds r19, 0x0079 ; 0x800079 <__TEXT_REGION_LENGTH__+0x7c2079> 174a2: e0 91 14 03 lds r30, 0x0314 ; 0x800314 174a6: f0 e0 ldi r31, 0x00 ; 0 174a8: ee 0f add r30, r30 174aa: ff 1f adc r31, r31 174ac: ec 5f subi r30, 0xFC ; 252 174ae: fc 4f sbci r31, 0xFC ; 252 174b0: 80 81 ld r24, Z 174b2: 91 81 ldd r25, Z+1 ; 0x01 174b4: 82 0f add r24, r18 174b6: 93 1f adc r25, r19 174b8: 91 83 std Z+1, r25 ; 0x01 174ba: 80 83 st Z, r24 if (++adc_count == ADC_OVRSAMPL) 174bc: 80 91 03 03 lds r24, 0x0303 ; 0x800303 174c0: 8f 5f subi r24, 0xFF ; 255 174c2: 80 93 03 03 sts 0x0303, r24 ; 0x800303 174c6: 80 31 cpi r24, 0x10 ; 16 174c8: e9 f5 brne .+122 ; 0x17544 <__vector_29+0xd0> { // go to the next channel if (++adc_channel == ADC_CHAN_CNT) { 174ca: 80 91 14 03 lds r24, 0x0314 ; 0x800314 174ce: 8f 5f subi r24, 0xFF ; 255 174d0: 80 93 14 03 sts 0x0314, r24 ; 0x800314 174d4: 88 30 cpi r24, 0x08 ; 8 174d6: 71 f5 brne .+92 ; 0x17534 <__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 174d8: 80 91 04 03 lds r24, 0x0304 ; 0x800304 174dc: 90 91 05 03 lds r25, 0x0305 ; 0x800305 174e0: 90 93 dd 05 sts 0x05DD, r25 ; 0x8005dd 174e4: 80 93 dc 05 sts 0x05DC, r24 ; 0x8005dc current_temperature_bed_raw = adc_values[ADC_PIN_IDX(TEMP_BED_PIN)]; 174e8: 80 91 08 03 lds r24, 0x0308 ; 0x800308 174ec: 90 91 09 03 lds r25, 0x0309 ; 0x800309 174f0: 90 93 df 05 sts 0x05DF, r25 ; 0x8005df 174f4: 80 93 de 05 sts 0x05DE, r24 ; 0x8005de #ifdef PINDA_THERMISTOR current_temperature_raw_pinda = adc_values[ADC_PIN_IDX(TEMP_PINDA_PIN)]; 174f8: 80 91 06 03 lds r24, 0x0306 ; 0x800306 174fc: 90 91 07 03 lds r25, 0x0307 ; 0x800307 17500: 90 93 db 05 sts 0x05DB, r25 ; 0x8005db 17504: 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; 17508: 81 e0 ldi r24, 0x01 ; 1 1750a: 80 93 f6 05 sts 0x05F6, r24 ; 0x8005f6 <_ZL16adc_values_ready.lto_priv.514> break; } } } ADCSRA |= (1 << ADSC); //start conversion } 1750e: ff 91 pop r31 17510: ef 91 pop r30 17512: bf 91 pop r27 17514: af 91 pop r26 17516: 9f 91 pop r25 17518: 8f 91 pop r24 1751a: 7f 91 pop r23 1751c: 6f 91 pop r22 1751e: 5f 91 pop r21 17520: 4f 91 pop r20 17522: 3f 91 pop r19 17524: 2f 91 pop r18 17526: 0f 90 pop r0 17528: 0b be out 0x3b, r0 ; 59 1752a: 0f 90 pop r0 1752c: 0f be out 0x3f, r0 ; 63 1752e: 0f 90 pop r0 17530: 1f 90 pop r1 17532: 18 95 reti 17534: 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)) { 17538: 4f e5 ldi r20, 0x5F ; 95 1753a: 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) { 1753c: 8f 5f subi r24, 0xFF ; 255 1753e: 41 f4 brne .+16 ; 0x17550 <__vector_29+0xdc> 17540: 10 92 02 03 sts 0x0302, r1 ; 0x800302 <__data_end> adc_count = 0; break; } } } ADCSRA |= (1 << ADSC); //start conversion 17544: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 17548: 80 64 ori r24, 0x40 ; 64 1754a: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1754e: df cf rjmp .-66 ; 0x1750e <__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)) { 17550: 9a 01 movw r18, r20 17552: 08 2e mov r0, r24 17554: 02 c0 rjmp .+4 ; 0x1755a <__vector_29+0xe6> 17556: 35 95 asr r19 17558: 27 95 ror r18 1755a: 0a 94 dec r0 1755c: e2 f7 brpl .-8 ; 0x17556 <__vector_29+0xe2> 1755e: 20 ff sbrs r18, 0 17560: ed cf rjmp .-38 ; 0x1753c <__vector_29+0xc8> 17562: 80 93 02 03 sts 0x0302, r24 ; 0x800302 <__data_end> adc_setmux(adc_channel_idx); 17566: 0e 94 94 55 call 0xab28 ; 0xab28 adc_count = 0; 1756a: 10 92 03 03 sts 0x0303, r1 ; 0x800303 1756e: ea cf rjmp .-44 ; 0x17544 <__vector_29+0xd0> 00017570 : if (ch & 0x08) ADCSRB |= (1 << MUX5); else ADCSRB &= ~(1 << MUX5); ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { 17570: cf 93 push r28 17572: 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 17574: ca e7 ldi r28, 0x7A ; 122 17576: d0 e0 ldi r29, 0x00 ; 0 17578: 88 81 ld r24, Y 1757a: 8f 7b andi r24, 0xBF ; 191 1757c: 88 83 st Y, r24 adc_count = 0; 1757e: 10 92 03 03 sts 0x0303, r1 ; 0x800303 adc_channel = 0; 17582: 10 92 14 03 sts 0x0314, r1 ; 0x800314 adc_channel_idx = first_channel_idx; 17586: 10 92 02 03 sts 0x0302, r1 ; 0x800302 <__data_end> adc_setmux(adc_channel_idx); 1758a: 80 e0 ldi r24, 0x00 ; 0 1758c: 0e 94 94 55 call 0xab28 ; 0xab28 memset((void*)adc_values, 0, sizeof(adc_values)); 17590: e4 e0 ldi r30, 0x04 ; 4 17592: f3 e0 ldi r31, 0x03 ; 3 17594: 80 e1 ldi r24, 0x10 ; 16 17596: df 01 movw r26, r30 17598: 1d 92 st X+, r1 1759a: 8a 95 dec r24 1759c: e9 f7 brne .-6 ; 0x17598 ADMUX = (ADMUX & ~(0x07)) | (ch & 0x07); } void adc_start_cycle() { adc_reset(); ADCSRA |= (1 << ADSC); //start conversion 1759e: 88 81 ld r24, Y 175a0: 80 64 ori r24, 0x40 ; 64 175a2: 88 83 st Y, r24 } 175a4: df 91 pop r29 175a6: cf 91 pop r28 175a8: 08 95 ret 000175aa : uint8_t check_pinda_0() { return _PINDA?0:1; } 175aa: 81 50 subi r24, 0x01 ; 1 175ac: 82 31 cpi r24, 0x12 ; 18 175ae: 08 f0 brcs .+2 ; 0x175b2 175b0: 5a c0 rjmp .+180 ; 0x17666 175b2: e8 2f mov r30, r24 175b4: f0 e0 ldi r31, 0x00 ; 0 175b6: 88 27 eor r24, r24 175b8: ef 51 subi r30, 0x1F ; 31 175ba: f5 44 sbci r31, 0x45 ; 69 175bc: 8f 4f sbci r24, 0xFF ; 255 175be: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> 175c2: 01 bb out 0x11, r16 ; 17 175c4: 05 bb out 0x15, r16 ; 21 175c6: f3 ba out 0x13, r15 ; 19 175c8: f9 ba out 0x19, r15 ; 25 175ca: fd ba out 0x1d, r15 ; 29 175cc: 33 bb out 0x13, r19 ; 19 175ce: 08 bb out 0x18, r16 ; 24 175d0: 0e bb out 0x1e, r16 ; 30 175d2: 12 bb out 0x12, r17 ; 18 175d4: 18 bb out 0x18, r17 ; 24 175d6: 1c bb out 0x1c, r17 ; 28 175d8: 20 bb out 0x10, r18 ; 16 175da: 26 bb out 0x16, r18 ; 22 175dc: 2a bb out 0x1a, r18 ; 26 175de: 33 bb out 0x13, r19 ; 19 175e0: 2e bb out 0x1e, r18 ; 30 175e2: 34 bb out 0x14, r19 ; 20 175e4: 38 bb out 0x18, r19 ; 24 175e6: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 175ea: 8f 77 andi r24, 0x7F ; 127 175ec: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 175f0: 08 95 ret 175f2: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 175f6: 8f 7d andi r24, 0xDF ; 223 175f8: f9 cf rjmp .-14 ; 0x175ec 175fa: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 175fe: 87 7f andi r24, 0xF7 ; 247 17600: f5 cf rjmp .-22 ; 0x175ec 17602: 84 b5 in r24, 0x24 ; 36 17604: 8f 77 andi r24, 0x7F ; 127 17606: 84 bd out 0x24, r24 ; 36 17608: 08 95 ret 1760a: 84 b5 in r24, 0x24 ; 36 1760c: 8f 7d andi r24, 0xDF ; 223 1760e: fb cf rjmp .-10 ; 0x17606 17610: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 17614: 8f 77 andi r24, 0x7F ; 127 17616: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1761a: 08 95 ret 1761c: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 17620: 8f 7d andi r24, 0xDF ; 223 17622: f9 cf rjmp .-14 ; 0x17616 17624: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 17628: 8f 77 andi r24, 0x7F ; 127 1762a: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1762e: 08 95 ret 17630: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 17634: 8f 7d andi r24, 0xDF ; 223 17636: f9 cf rjmp .-14 ; 0x1762a 17638: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1763c: 87 7f andi r24, 0xF7 ; 247 1763e: f5 cf rjmp .-22 ; 0x1762a 17640: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 17644: 8f 77 andi r24, 0x7F ; 127 17646: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1764a: 08 95 ret 1764c: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 17650: 8f 7d andi r24, 0xDF ; 223 17652: f9 cf rjmp .-14 ; 0x17646 17654: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 17658: 87 7f andi r24, 0xF7 ; 247 1765a: f5 cf rjmp .-22 ; 0x17646 1765c: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 17660: 8f 77 andi r24, 0x7F ; 127 17662: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 17666: 08 95 ret 17668: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1766c: 8f 7d andi r24, 0xDF ; 223 1766e: f9 cf rjmp .-14 ; 0x17662 17670: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 17674: 87 7f andi r24, 0xF7 ; 247 17676: f5 cf rjmp .-22 ; 0x17662 00017678 : 17678: 83 b1 in r24, 0x03 ; 3 1767a: 82 95 swap r24 1767c: 81 70 andi r24, 0x01 ; 1 1767e: 08 95 ret 00017680 : } #else //SM4_ACCEL_TEST uint16_t xyzcal_calc_delay(uint16_t, uint16_t) { return xyzcal_sm4_delay; } 17680: 80 91 ef 03 lds r24, 0x03EF ; 0x8003ef 17684: 90 91 f0 03 lds r25, 0x03F0 ; 0x8003f0 17688: 08 95 ret 0001768a : } uint8_t xyzcal_dm = 0; void xyzcal_update_pos(uint16_t dx, uint16_t dy, uint16_t dz, uint16_t) { 1768a: cf 92 push r12 1768c: df 92 push r13 1768e: ef 92 push r14 17690: 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; 17692: 20 91 f1 03 lds r18, 0x03F1 ; 0x8003f1 17696: b0 e0 ldi r27, 0x00 ; 0 17698: a0 e0 ldi r26, 0x00 ; 0 1769a: c0 90 4c 06 lds r12, 0x064C ; 0x80064c 1769e: d0 90 4d 06 lds r13, 0x064D ; 0x80064d 176a2: e0 90 4e 06 lds r14, 0x064E ; 0x80064e 176a6: f0 90 4f 06 lds r15, 0x064F ; 0x80064f 176aa: 20 ff sbrs r18, 0 176ac: 42 c0 rjmp .+132 ; 0x17732 176ae: c8 1a sub r12, r24 176b0: d9 0a sbc r13, r25 176b2: ea 0a sbc r14, r26 176b4: fb 0a sbc r15, r27 176b6: c0 92 4c 06 sts 0x064C, r12 ; 0x80064c 176ba: d0 92 4d 06 sts 0x064D, r13 ; 0x80064d 176be: e0 92 4e 06 sts 0x064E, r14 ; 0x80064e 176c2: f0 92 4f 06 sts 0x064F, r15 ; 0x80064f 176c6: cb 01 movw r24, r22 176c8: b0 e0 ldi r27, 0x00 ; 0 176ca: a0 e0 ldi r26, 0x00 ; 0 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 176cc: c0 90 50 06 lds r12, 0x0650 ; 0x800650 176d0: d0 90 51 06 lds r13, 0x0651 ; 0x800651 176d4: e0 90 52 06 lds r14, 0x0652 ; 0x800652 176d8: f0 90 53 06 lds r15, 0x0653 ; 0x800653 176dc: 21 ff sbrs r18, 1 176de: 36 c0 rjmp .+108 ; 0x1774c 176e0: c8 1a sub r12, r24 176e2: d9 0a sbc r13, r25 176e4: ea 0a sbc r14, r26 176e6: fb 0a sbc r15, r27 176e8: c0 92 50 06 sts 0x0650, r12 ; 0x800650 176ec: d0 92 51 06 sts 0x0651, r13 ; 0x800651 176f0: e0 92 52 06 sts 0x0652, r14 ; 0x800652 176f4: f0 92 53 06 sts 0x0653, r15 ; 0x800653 176f8: 70 e0 ldi r23, 0x00 ; 0 176fa: 60 e0 ldi r22, 0x00 ; 0 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 176fc: 80 91 54 06 lds r24, 0x0654 ; 0x800654 17700: 90 91 55 06 lds r25, 0x0655 ; 0x800655 17704: a0 91 56 06 lds r26, 0x0656 ; 0x800656 17708: b0 91 57 06 lds r27, 0x0657 ; 0x800657 1770c: 22 ff sbrs r18, 2 1770e: 2b c0 rjmp .+86 ; 0x17766 17710: 84 1b sub r24, r20 17712: 95 0b sbc r25, r21 17714: a6 0b sbc r26, r22 17716: b7 0b sbc r27, r23 17718: 80 93 54 06 sts 0x0654, r24 ; 0x800654 1771c: 90 93 55 06 sts 0x0655, r25 ; 0x800655 17720: a0 93 56 06 sts 0x0656, r26 ; 0x800656 17724: 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]); } 17728: ff 90 pop r15 1772a: ef 90 pop r14 1772c: df 90 pop r13 1772e: cf 90 pop r12 17730: 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; 17732: 8c 0d add r24, r12 17734: 9d 1d adc r25, r13 17736: ae 1d adc r26, r14 17738: bf 1d adc r27, r15 1773a: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c 1773e: 90 93 4d 06 sts 0x064D, r25 ; 0x80064d 17742: a0 93 4e 06 sts 0x064E, r26 ; 0x80064e 17746: b0 93 4f 06 sts 0x064F, r27 ; 0x80064f 1774a: bd cf rjmp .-134 ; 0x176c6 if (xyzcal_dm&2) count_position[1] -= dy; else count_position[1] += dy; 1774c: 8c 0d add r24, r12 1774e: 9d 1d adc r25, r13 17750: ae 1d adc r26, r14 17752: bf 1d adc r27, r15 17754: 80 93 50 06 sts 0x0650, r24 ; 0x800650 17758: 90 93 51 06 sts 0x0651, r25 ; 0x800651 1775c: a0 93 52 06 sts 0x0652, r26 ; 0x800652 17760: b0 93 53 06 sts 0x0653, r27 ; 0x800653 17764: c9 cf rjmp .-110 ; 0x176f8 if (xyzcal_dm&4) count_position[2] -= dz; else count_position[2] += dz; 17766: 84 0f add r24, r20 17768: 95 1f adc r25, r21 1776a: a6 1f adc r26, r22 1776c: b7 1f adc r27, r23 1776e: d4 cf rjmp .-88 ; 0x17718 00017770 : inline bool is_digit(char c) { return c >= '0' && c <= '9'; } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ 17770: fb 01 movw r30, r22 *v = 0; 17772: 11 82 std Z+1, r1 ; 0x01 17774: 10 82 st Z, r1 while(is_digit(*str)){ *v *= 10; 17776: 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'; 17778: dc 01 movw r26, r24 1777a: 2c 91 ld r18, X 1777c: 20 53 subi r18, 0x30 ; 48 } char const * __attribute__((noinline)) Number(char const *str, uint16_t *v){ *v = 0; while(is_digit(*str)){ 1777e: 2a 30 cpi r18, 0x0A ; 10 17780: a0 f4 brcc .+40 ; 0x177aa *v *= 10; 17782: 40 81 ld r20, Z 17784: 51 81 ldd r21, Z+1 ; 0x01 17786: 64 9f mul r22, r20 17788: 90 01 movw r18, r0 1778a: 65 9f mul r22, r21 1778c: 30 0d add r19, r0 1778e: 11 24 eor r1, r1 17790: 31 83 std Z+1, r19 ; 0x01 17792: 20 83 st Z, r18 *v += *str - '0'; 17794: 4d 91 ld r20, X+ 17796: cd 01 movw r24, r26 17798: 20 53 subi r18, 0x30 ; 48 1779a: 31 09 sbc r19, r1 1779c: 24 0f add r18, r20 1779e: 31 1d adc r19, r1 177a0: 47 fd sbrc r20, 7 177a2: 3a 95 dec r19 177a4: 31 83 std Z+1, r19 ; 0x01 177a6: 20 83 st Z, r18 177a8: e7 cf rjmp .-50 ; 0x17778 ++str; } return str; } 177aa: 08 95 ret 000177ac : 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) { 177ac: fc 01 movw r30, r24 switch(*oCheckSetting) { 177ae: 80 81 ld r24, Z 177b0: 88 23 and r24, r24 177b2: 21 f0 breq .+8 ; 0x177bc 177b4: 81 30 cpi r24, 0x01 ; 1 177b6: 29 f4 brne .+10 ; 0x177c2 case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 177b8: 82 e0 ldi r24, 0x02 ; 2 177ba: 01 c0 rjmp .+2 ; 0x177be while (0) static void lcd_check_update_RAM(ClCheckMode * oCheckSetting) { switch(*oCheckSetting) { case ClCheckMode::_None: *oCheckSetting = ClCheckMode::_Warn; 177bc: 81 e0 ldi r24, 0x01 ; 1 break; case ClCheckMode::_Warn: *oCheckSetting = ClCheckMode::_Strict; 177be: 80 83 st Z, r24 177c0: 08 95 ret break; case ClCheckMode::_Strict: *oCheckSetting = ClCheckMode::_None; 177c2: 10 82 st Z, r1 break; default: *oCheckSetting = ClCheckMode::_None; } } 177c4: 08 95 ret 000177c6 : #endif // TMC2130 static inline bool pgm_is_whitespace(const char *c_addr) { const char c = pgm_read_byte(c_addr); 177c6: fc 01 movw r30, r24 177c8: 94 91 lpm r25, Z return c == ' ' || c == '\t' || c == '\r' || c == '\n'; 177ca: 90 32 cpi r25, 0x20 ; 32 177cc: 49 f0 breq .+18 ; 0x177e0 177ce: 87 ef ldi r24, 0xF7 ; 247 177d0: 89 0f add r24, r25 177d2: 82 30 cpi r24, 0x02 ; 2 177d4: 28 f0 brcs .+10 ; 0x177e0 177d6: 81 e0 ldi r24, 0x01 ; 1 177d8: 9d 30 cpi r25, 0x0D ; 13 177da: 19 f0 breq .+6 ; 0x177e2 177dc: 80 e0 ldi r24, 0x00 ; 0 177de: 08 95 ret 177e0: 81 e0 ldi r24, 0x01 ; 1 } 177e2: 08 95 ret 000177e4 : planner_synchronize(); Disable_E0(); } void MMU2::execute_load_to_nozzle_sequence() { 177e4: cf 93 push r28 177e6: df 93 push r29 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 177e8: 0f 94 94 18 call 0x23128 ; 0x23128 float planner_get_current_position_E() { return current_position[E_AXIS]; } void planner_set_current_position_E(float e) { current_position[E_AXIS] = e; 177ec: c1 e6 ldi r28, 0x61 ; 97 177ee: 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)); 177f0: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 177f4: 70 e0 ldi r23, 0x00 ; 0 177f6: 90 e0 ldi r25, 0x00 ; 0 177f8: 80 e0 ldi r24, 0x00 ; 0 177fa: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 177fe: 20 e0 ldi r18, 0x00 ; 0 17800: 30 e0 ldi r19, 0x00 ; 0 17802: 40 e8 ldi r20, 0x80 ; 128 17804: 51 e4 ldi r21, 0x41 ; 65 17806: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1780a: 9b 01 movw r18, r22 1780c: ac 01 movw r20, r24 1780e: 6c 85 ldd r22, Y+12 ; 0x0c 17810: 7d 85 ldd r23, Y+13 ; 0x0d 17812: 8e 85 ldd r24, Y+14 ; 0x0e 17814: 9f 85 ldd r25, Y+15 ; 0x0f 17816: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1781a: 6c 87 std Y+12, r22 ; 0x0c 1781c: 7d 87 std Y+13, r23 ; 0x0d 1781e: 8e 87 std Y+14, r24 ; 0x0e 17820: 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])); 17822: 62 e0 ldi r22, 0x02 ; 2 17824: 81 e7 ldi r24, 0x71 ; 113 17826: 98 e8 ldi r25, 0x88 ; 136 } 17828: df 91 pop r29 1782a: 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])); 1782c: 0d 94 1e 7a jmp 0x2f43c ; 0x2f43c 00017830 : } } menu_item++; } void __attribute__((noinline)) menu_item_function_E(const Sheet &sheet, menu_func_t func) 17830: df 92 push r13 17832: ef 92 push r14 17834: ff 92 push r15 17836: 0f 93 push r16 17838: 1f 93 push r17 1783a: cf 93 push r28 1783c: df 93 push r29 1783e: cd b7 in r28, 0x3d ; 61 17840: de b7 in r29, 0x3e ; 62 17842: 63 97 sbiw r28, 0x13 ; 19 17844: 0f b6 in r0, 0x3f ; 63 17846: f8 94 cli 17848: de bf out 0x3e, r29 ; 62 1784a: 0f be out 0x3f, r0 ; 63 1784c: cd bf out 0x3d, r28 ; 61 { if (menu_item == menu_line) 1784e: 30 91 63 04 lds r19, 0x0463 ; 0x800463 17852: 20 91 62 04 lds r18, 0x0462 ; 0x800462 17856: 32 13 cpse r19, r18 17858: 73 c0 rjmp .+230 ; 0x17940 1785a: 7c 01 movw r14, r24 { if (lcd_draw_update) menu_draw_item_select_sheet_E(' ', sheet); 1785c: 80 91 59 02 lds r24, 0x0259 ; 0x800259 17860: 88 23 and r24, r24 17862: 09 f4 brne .+2 ; 0x17866 17864: 45 c0 rjmp .+138 ; 0x178f0 //! //! @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)); 17866: 87 ee ldi r24, 0xE7 ; 231 17868: 9e e4 ldi r25, 0x4E ; 78 1786a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1786e: 9f 93 push r25 17870: 8f 93 push r24 17872: 83 e6 ldi r24, 0x63 ; 99 17874: 98 e8 ldi r25, 0x88 ; 136 17876: 9f 93 push r25 17878: 8f 93 push r24 1787a: 8e 01 movw r16, r28 1787c: 0f 5f subi r16, 0xFF ; 255 1787e: 1f 4f sbci r17, 0xFF ; 255 17880: 1f 93 push r17 17882: 0f 93 push r16 17884: 0f 94 98 a3 call 0x34730 ; 0x34730 17888: d8 2e mov r13, r24 eeprom_read_block(&(buffer.c[index]), sheet_E.name, sizeof(sheet_E.name)/sizeof(sheet_E.name[0])); 1788a: 47 e0 ldi r20, 0x07 ; 7 1788c: 50 e0 ldi r21, 0x00 ; 0 1788e: b7 01 movw r22, r14 17890: 80 0f add r24, r16 17892: 91 2f mov r25, r17 17894: 91 1d adc r25, r1 17896: 0f 94 71 a4 call 0x348e2 ; 0x348e2 1789a: 0f 90 pop r0 1789c: 0f 90 pop r0 1789e: 0f 90 pop r0 178a0: 0f 90 pop r0 178a2: 0f 90 pop r0 178a4: 0f 90 pop r0 178a6: 20 e0 ldi r18, 0x00 ; 0 178a8: 82 2f mov r24, r18 178aa: 8d 0d add r24, r13 178ac: 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) 178ae: 27 30 cpi r18, 0x07 ; 7 178b0: 39 f0 breq .+14 ; 0x178c0 178b2: 2f 5f subi r18, 0xFF ; 255 { if (buffer.c[index] == '\0') break; 178b4: f8 01 movw r30, r16 178b6: e8 0f add r30, r24 178b8: f9 1f adc r31, r25 178ba: 30 81 ld r19, Z 178bc: 31 11 cpse r19, r1 178be: f4 cf rjmp .-24 ; 0x178a8 } buffer.c[index] = ']'; 178c0: f8 01 movw r30, r16 178c2: e8 0f add r30, r24 178c4: f9 1f adc r31, r25 178c6: 2d e5 ldi r18, 0x5D ; 93 178c8: 20 83 st Z, r18 buffer.c[index + 1] = '\0'; 178ca: 8c 0f add r24, r28 178cc: 9d 1f adc r25, r29 178ce: fc 01 movw r30, r24 178d0: 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()); 178d2: 0e 94 b7 62 call 0xc56e ; 0xc56e 178d6: 48 2f mov r20, r24 178d8: 60 91 60 04 lds r22, 0x0460 ; 0x800460 178dc: 80 e0 ldi r24, 0x00 ; 0 178de: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_print_pad(buffer.c, LCD_WIDTH - 2); 178e2: 62 e1 ldi r22, 0x12 ; 18 178e4: c8 01 movw r24, r16 178e6: 0e 94 98 73 call 0xe730 ; 0xe730 lcd_putc(type_char); 178ea: 80 e2 ldi r24, 0x20 ; 32 178ec: 0e 94 72 6f call 0xdee4 ; 0xdee4 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)) 178f0: 80 91 61 04 lds r24, 0x0461 ; 0x800461 178f4: 88 23 and r24, r24 178f6: 21 f1 breq .+72 ; 0x17940 178f8: 20 91 63 04 lds r18, 0x0463 ; 0x800463 178fc: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 17900: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 17904: 28 17 cp r18, r24 17906: 19 06 cpc r1, r25 17908: d9 f4 brne .+54 ; 0x17940 { lcd_update_enabled = 0; 1790a: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a if (func) func(); 1790e: 8b ef ldi r24, 0xFB ; 251 17910: 98 e7 ldi r25, 0x78 ; 120 17912: 89 2b or r24, r25 17914: 11 f0 breq .+4 ; 0x1791a 17916: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 lcd_update_enabled = 1; 1791a: 81 e0 ldi r24, 0x01 ; 1 1791c: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a menu_item_ret(); 17920: 0e 94 c4 62 call 0xc588 ; 0xc588 return; } } menu_item++; } 17924: 63 96 adiw r28, 0x13 ; 19 17926: 0f b6 in r0, 0x3f ; 63 17928: f8 94 cli 1792a: de bf out 0x3e, r29 ; 62 1792c: 0f be out 0x3f, r0 ; 63 1792e: cd bf out 0x3d, r28 ; 61 17930: df 91 pop r29 17932: cf 91 pop r28 17934: 1f 91 pop r17 17936: 0f 91 pop r16 17938: ff 90 pop r15 1793a: ef 90 pop r14 1793c: df 90 pop r13 1793e: 08 95 ret lcd_update_enabled = 1; menu_item_ret(); return; } } menu_item++; 17940: 80 91 63 04 lds r24, 0x0463 ; 0x800463 17944: 8f 5f subi r24, 0xFF ; 255 17946: 80 93 63 04 sts 0x0463, r24 ; 0x800463 1794a: ec cf rjmp .-40 ; 0x17924 0001794c : } //! @brief Send host action "start" void lcd_send_action_start() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); 1794c: 89 e5 ldi r24, 0x59 ; 89 1794e: 99 e6 ldi r25, 0x69 ; 105 17950: 0e 94 0e 7d call 0xfa1c ; 0xfa1c lcd_return_to_status(); 17954: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 00017958 : //! 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) { 17958: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.384> 1795c: 81 30 cpi r24, 0x01 ; 1 1795e: 21 f4 brne .+8 ; 0x17968 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); 17960: 8f e0 ldi r24, 0x0F ; 15 17962: 99 e6 ldi r25, 0x69 ; 105 } else { SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); 17964: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c 17968: 80 e0 ldi r24, 0x00 ; 0 1796a: 99 e6 ldi r25, 0x69 ; 105 1796c: fb cf rjmp .-10 ; 0x17964 0001796e : #endif // TMC2130 #ifdef FILAMENT_SENSOR static void fsensor_reinit() { fsensor.init(); 1796e: 0d 94 7a 6d jmp 0x2daf4 ; 0x2daf4 00017972 : 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) { 17972: 0f 93 push r16 17974: 1f 93 push r17 17976: cf 93 push r28 17978: df 93 push r29 1797a: 98 2f mov r25, r24 1797c: 86 2f mov r24, r22 1797e: 14 2f mov r17, r20 17980: e9 01 movw r28, r18 lcd_set_cursor(_col, _row); 17982: 69 2f mov r22, r25 17984: 0e 94 ab 6f call 0xdf56 ; 0xdf56 switch (_state) 17988: 11 30 cpi r17, 0x01 ; 1 1798a: 21 f0 breq .+8 ; 0x17994 1798c: 12 30 cpi r17, 0x02 ; 2 1798e: 79 f0 breq .+30 ; 0x179ae lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 17990: ce 01 movw r24, r28 17992: 15 c0 rjmp .+42 ; 0x179be { lcd_set_cursor(_col, _row); switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); 17994: ce 01 movw r24, r28 17996: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_putc(':'); 1799a: 8a e3 ldi r24, 0x3A ; 58 1799c: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_putc(_indicator); 179a0: 80 2f mov r24, r16 lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); } } 179a2: df 91 pop r29 179a4: cf 91 pop r28 179a6: 1f 91 pop r17 179a8: 0f 91 pop r16 switch (_state) { case 1: lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_putc(_indicator); 179aa: 0c 94 72 6f jmp 0xdee4 ; 0xdee4 break; case 2: lcd_puts_P(_name_PROGMEM); 179ae: ce 01 movw r24, r28 179b0: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_putc(':'); 179b4: 8a e3 ldi r24, 0x3A ; 58 179b6: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_puts_P(MSG_OK_CAPS); 179ba: 82 e3 ldi r24, 0x32 ; 50 179bc: 99 e6 ldi r25, 0x69 ; 105 break; default: lcd_puts_P(_name_PROGMEM); } } 179be: df 91 pop r29 179c0: cf 91 pop r28 179c2: 1f 91 pop r17 179c4: 0f 91 pop r16 lcd_puts_P(_name_PROGMEM); lcd_putc(':'); lcd_puts_P(MSG_OK_CAPS); break; default: lcd_puts_P(_name_PROGMEM); 179c6: 0c 94 6e 6f jmp 0xdedc ; 0xdedc 000179ca : } #endif // not defined TMC2130 static void lcd_print_state(uint8_t state) { switch (state) { 179ca: 81 30 cpi r24, 0x01 ; 1 179cc: 21 f4 brne .+8 ; 0x179d6 case STATE_ON: lcd_puts_P(_N(" 1")); 179ce: 8c e4 ldi r24, 0x4C ; 76 179d0: 98 e6 ldi r25, 0x68 ; 104 break; case STATE_OFF: lcd_puts_P(_N(" 0")); 179d2: 0c 94 6e 6f jmp 0xdedc ; 0xdedc 179d6: 88 e4 ldi r24, 0x48 ; 72 179d8: 98 e6 ldi r25, 0x68 ; 104 179da: fb cf rjmp .-10 ; 0x179d2 000179dc : } #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); 179dc: 87 ea ldi r24, 0xA7 ; 167 179de: 9c e0 ldi r25, 0x0C ; 12 179e0: 0f 94 81 a4 call 0x34902 ; 0x34902 if (value > 1) value = 1; 179e4: 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) 179e6: 82 30 cpi r24, 0x02 ; 2 179e8: 08 f4 brcc .+2 ; 0x179ec 179ea: 68 27 eor r22, r24 179ec: 87 ea ldi r24, 0xA7 ; 167 179ee: 9c e0 ldi r25, 0x0C ; 12 179f0: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 000179f4 : 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); 179f4: 8a ea ldi r24, 0xAA ; 170 179f6: 9d e0 ldi r25, 0x0D ; 13 179f8: 0f 94 81 a4 call 0x34902 ; 0x34902 switch (mbl_z_probe_nr) { case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; 179fc: 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) { 179fe: 83 30 cpi r24, 0x03 ; 3 17a00: 21 f0 breq .+8 ; 0x17a0a case 1: mbl_z_probe_nr = 3; break; case 3: mbl_z_probe_nr = 5; break; case 5: mbl_z_probe_nr = 1; break; 17a02: 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) { 17a04: 85 30 cpi r24, 0x05 ; 5 17a06: 09 f0 breq .+2 ; 0x17a0a case 1: mbl_z_probe_nr = 3; break; 17a08: 63 e0 ldi r22, 0x03 ; 3 17a0a: 8a ea ldi r24, 0xAA ; 170 17a0c: 9d e0 ldi r25, 0x0D ; 13 17a0e: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017a12 : 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); 17a12: 8b ea ldi r24, 0xAB ; 171 17a14: 9d e0 ldi r25, 0x0D ; 13 17a16: 0f 94 81 a4 call 0x34902 ; 0x34902 if(mesh_nr == 3) mesh_nr = 7; else mesh_nr = 3; 17a1a: 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; 17a1c: 83 30 cpi r24, 0x03 ; 3 17a1e: 09 f4 brne .+2 ; 0x17a22 17a20: 67 e0 ldi r22, 0x07 ; 7 17a22: 8b ea ldi r24, 0xAB ; 171 17a24: 9d e0 ldi r25, 0x0D ; 13 17a26: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017a2a : #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); 17a2a: 8c ea ldi r24, 0xAC ; 172 17a2c: 9d e0 ldi r25, 0x0D ; 13 17a2e: 0f 94 81 a4 call 0x34902 ; 0x34902 magnet_elimination = !magnet_elimination; 17a32: 61 e0 ldi r22, 0x01 ; 1 17a34: 81 11 cpse r24, r1 17a36: 60 e0 ldi r22, 0x00 ; 0 17a38: 8c ea ldi r24, 0xAC ; 172 17a3a: 9d e0 ldi r25, 0x0D ; 13 17a3c: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017a40 : 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); 17a40: 8e ee ldi r24, 0xEE ; 238 17a42: 93 e0 ldi r25, 0x03 ; 3 17a44: 0e 94 d6 bb call 0x177ac ; 0x177ac 17a48: 60 91 ee 03 lds r22, 0x03EE ; 0x8003ee 17a4c: 80 e2 ldi r24, 0x20 ; 32 17a4e: 9c e0 ldi r25, 0x0C ; 12 17a50: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017a54 : 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); 17a54: 89 ee ldi r24, 0xE9 ; 233 17a56: 93 e0 ldi r25, 0x03 ; 3 17a58: 0e 94 d6 bb call 0x177ac ; 0x177ac 17a5c: 60 91 e9 03 lds r22, 0x03E9 ; 0x8003e9 17a60: 83 ea ldi r24, 0xA3 ; 163 17a62: 9d e0 ldi r25, 0x0D ; 13 17a64: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017a68 : 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); 17a68: 8a ee ldi r24, 0xEA ; 234 17a6a: 93 e0 ldi r25, 0x03 ; 3 17a6c: 0e 94 d6 bb call 0x177ac ; 0x177ac 17a70: 60 91 ea 03 lds r22, 0x03EA ; 0x8003ea 17a74: 84 ea ldi r24, 0xA4 ; 164 17a76: 9d e0 ldi r25, 0x0D ; 13 17a78: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017a7c : *oCheckSetting = ClCheckMode::_None; } } static void lcd_check_mode_set() { lcd_check_update_RAM(&oCheckMode); 17a7c: 8d ee ldi r24, 0xED ; 237 17a7e: 93 e0 ldi r25, 0x03 ; 3 17a80: 0e 94 d6 bb call 0x177ac ; 0x177ac 17a84: 60 91 ed 03 lds r22, 0x03ED ; 0x8003ed 17a88: 88 ea ldi r24, 0xA8 ; 168 17a8a: 9d e0 ldi r25, 0x0D ; 13 17a8c: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017a90 : #endif //FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_actionNA_set(void) { Filament_sensor::SensorActionOnError act = fsensor.getActionOnError(); switch(act) { 17a90: 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; 17a94: 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) { 17a96: 81 11 cpse r24, r1 17a98: 01 c0 rjmp .+2 ; 0x17a9c case Filament_sensor::SensorActionOnError::_Continue: act = Filament_sensor::SensorActionOnError::_Pause; 17a9a: 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; 17a9c: 60 93 f9 16 sts 0x16F9, r22 ; 0x8016f9 17aa0: 87 e4 ldi r24, 0x47 ; 71 17aa2: 9d e0 ldi r25, 0x0D ; 13 17aa4: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017aa8 : static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); } static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); 17aa8: e1 ef ldi r30, 0xF1 ; 241 17aaa: f6 e1 ldi r31, 0x16 ; 22 17aac: 61 81 ldd r22, Z+1 ; 0x01 17aae: 81 e0 ldi r24, 0x01 ; 1 17ab0: 68 27 eor r22, r24 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 17ab2: 61 83 std Z+1, r22 ; 0x01 17ab4: 87 e0 ldi r24, 0x07 ; 7 17ab6: 9f e0 ldi r25, 0x0F ; 15 17ab8: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017abc : static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); } static void lcd_fsensor_runout_set() { fsensor.setRunoutEnabled(!fsensor.getRunoutEnabled(), true); 17abc: e1 ef ldi r30, 0xF1 ; 241 17abe: f6 e1 ldi r31, 0x16 ; 22 17ac0: 62 81 ldd r22, Z+2 ; 0x02 17ac2: 81 e0 ldi r24, 0x01 ; 1 17ac4: 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; 17ac6: 62 83 std Z+2, r22 ; 0x02 17ac8: 85 ed ldi r24, 0xD5 ; 213 17aca: 9e e0 ldi r25, 0x0E ; 14 17acc: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017ad0 : lcd_return_to_status(); } void lcd_toshiba_flash_air_compatibility_toggle() { card.ToshibaFlashAir_enable(! card.ToshibaFlashAir_isEnabled()); 17ad0: e8 e4 ldi r30, 0x48 ; 72 17ad2: f6 e1 ldi r31, 0x16 ; 22 17ad4: 60 81 ld r22, Z 17ad6: 81 e0 ldi r24, 0x01 ; 1 17ad8: 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; } 17ada: 60 83 st Z, r22 17adc: 8b eb ldi r24, 0xBB ; 187 17ade: 9f e0 ldi r25, 0x0F ; 15 17ae0: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017ae4 : 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); 17ae4: 8f ea ldi r24, 0xAF ; 175 17ae6: 9f e0 ldi r25, 0x0F ; 15 17ae8: 0f 94 81 a4 call 0x34902 ; 0x34902 temp_cal_active = !temp_cal_active; 17aec: 61 e0 ldi r22, 0x01 ; 1 17aee: 81 11 cpse r24, r1 17af0: 60 e0 ldi r22, 0x00 ; 0 17af2: 8f ea ldi r24, 0xAF ; 175 17af4: 9f e0 ldi r25, 0x0F ; 15 17af6: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017afa : eeprom_update_byte_notify((uint8_t*)EEPROM_SOUND_MODE,(uint8_t)eSoundMode); } void Sound_CycleState(void) { switch(eSoundMode) 17afa: 80 91 47 04 lds r24, 0x0447 ; 0x800447 17afe: 81 30 cpi r24, 0x01 ; 1 17b00: 71 f0 breq .+28 ; 0x17b1e 17b02: 20 f0 brcs .+8 ; 0x17b0c 17b04: 82 30 cpi r24, 0x02 ; 2 17b06: 69 f4 brne .+26 ; 0x17b22 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; 17b08: 83 e0 ldi r24, 0x03 ; 3 17b0a: 01 c0 rjmp .+2 ; 0x17b0e void Sound_CycleState(void) { switch(eSoundMode) { case e_SOUND_MODE_LOUD: eSoundMode=e_SOUND_MODE_ONCE; 17b0c: 81 e0 ldi r24, 0x01 ; 1 break; case e_SOUND_MODE_ONCE: eSoundMode=e_SOUND_MODE_SILENT; 17b0e: 80 93 47 04 sts 0x0447, r24 ; 0x800447 17b12: 60 91 47 04 lds r22, 0x0447 ; 0x800447 17b16: 87 ed ldi r24, 0xD7 ; 215 17b18: 9e e0 ldi r25, 0x0E ; 14 17b1a: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 17b1e: 82 e0 ldi r24, 0x02 ; 2 17b20: f6 cf rjmp .-20 ; 0x17b0e break; case e_SOUND_MODE_SILENT: eSoundMode=e_SOUND_MODE_BLIND; break; case e_SOUND_MODE_BLIND: eSoundMode=e_SOUND_MODE_LOUD; 17b22: 10 92 47 04 sts 0x0447, r1 ; 0x800447 17b26: f5 cf rjmp .-22 ; 0x17b12 00017b28 : } #ifdef SDCARD_SORT_ALPHA static void lcd_sort_type_set() { uint8_t sdSort; sdSort = eeprom_read_byte((uint8_t*) EEPROM_SD_SORT); 17b28: 89 e0 ldi r24, 0x09 ; 9 17b2a: 9f e0 ldi r25, 0x0F ; 15 17b2c: 0f 94 81 a4 call 0x34902 ; 0x34902 switch (sdSort) { case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; 17b30: 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) { 17b32: 88 23 and r24, r24 17b34: 21 f0 breq .+8 ; 0x17b3e case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; 17b36: 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) { 17b38: 81 30 cpi r24, 0x01 ; 1 17b3a: 09 f0 breq .+2 ; 0x17b3e case SD_SORT_TIME: sdSort = SD_SORT_ALPHA; break; case SD_SORT_ALPHA: sdSort = SD_SORT_NONE; break; default: sdSort = SD_SORT_TIME; 17b3c: 60 e0 ldi r22, 0x00 ; 0 17b3e: 89 e0 ldi r24, 0x09 ; 9 17b40: 9f e0 ldi r25, 0x0F ; 15 17b42: 0f 94 a5 a4 call 0x3494a ; 0x3494a } eeprom_update_byte_notify((uint8_t*)EEPROM_SD_SORT, sdSort); card.presort_flag = true; 17b46: 81 e0 ldi r24, 0x01 ; 1 17b48: 80 93 26 14 sts 0x1426, r24 ; 0x801426 } 17b4c: 08 95 ret 00017b4e : MENU_ITEM_TOGGLE_P(_T(MSG_SOUND), _T(MSG_SOUND_LOUD), lcd_sound_state_set);\ }\ }\ while (0) static void lcd_nozzle_diameter_cycle(void) { 17b4e: cf 93 push r28 17b50: df 93 push r29 uint16_t nDiameter; switch(oNozzleDiameter){ 17b52: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb 17b56: 8c 33 cpi r24, 0x3C ; 60 17b58: e1 f0 breq .+56 ; 0x17b92 17b5a: 80 35 cpi r24, 0x50 ; 80 17b5c: 01 f1 breq .+64 ; 0x17b9e 17b5e: 88 32 cpi r24, 0x28 ; 40 17b60: 91 f0 breq .+36 ; 0x17b86 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; 17b62: 88 e2 ldi r24, 0x28 ; 40 17b64: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=400; 17b68: c0 e9 ldi r28, 0x90 ; 144 17b6a: d1 e0 ldi r29, 0x01 ; 1 17b6c: 60 91 eb 03 lds r22, 0x03EB ; 0x8003eb 17b70: 87 ea ldi r24, 0xA7 ; 167 17b72: 9d e0 ldi r25, 0x0D ; 13 17b74: 0f 94 a5 a4 call 0x3494a ; 0x3494a if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 17b78: be 01 movw r22, r28 17b7a: 85 ea ldi r24, 0xA5 ; 165 17b7c: 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); } 17b7e: df 91 pop r29 17b80: cf 91 pop r28 17b82: 0d 94 c3 a4 jmp 0x34986 ; 0x34986 case ClNozzleDiameter::_Diameter_250: oNozzleDiameter=ClNozzleDiameter::_Diameter_400; nDiameter=400; break; case ClNozzleDiameter::_Diameter_400: oNozzleDiameter=ClNozzleDiameter::_Diameter_600; 17b86: 8c e3 ldi r24, 0x3C ; 60 17b88: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=600; 17b8c: c8 e5 ldi r28, 0x58 ; 88 17b8e: d2 e0 ldi r29, 0x02 ; 2 17b90: ed cf rjmp .-38 ; 0x17b6c break; case ClNozzleDiameter::_Diameter_600: oNozzleDiameter=ClNozzleDiameter::_Diameter_800; 17b92: 80 e5 ldi r24, 0x50 ; 80 17b94: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=800; 17b98: c0 e2 ldi r28, 0x20 ; 32 17b9a: d3 e0 ldi r29, 0x03 ; 3 17b9c: e7 cf rjmp .-50 ; 0x17b6c break; case ClNozzleDiameter::_Diameter_800: oNozzleDiameter=ClNozzleDiameter::_Diameter_250; 17b9e: 89 e1 ldi r24, 0x19 ; 25 17ba0: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb nDiameter=250; 17ba4: ca ef ldi r28, 0xFA ; 250 17ba6: d0 e0 ldi r29, 0x00 ; 0 17ba8: e1 cf rjmp .-62 ; 0x17b6c 00017baa : } return 0; } bool eeprom_fw_version_older_than_p(const uint16_t (&ver_req)[4]) { 17baa: 0f 93 push r16 17bac: 1f 93 push r17 17bae: cf 93 push r28 17bb0: df 93 push r29 17bb2: 00 d0 rcall .+0 ; 0x17bb4 17bb4: 00 d0 rcall .+0 ; 0x17bb6 17bb6: 1f 92 push r1 17bb8: 1f 92 push r1 17bba: cd b7 in r28, 0x3d ; 61 17bbc: de b7 in r29, 0x3e ; 62 17bbe: 8c 01 movw r16, r24 uint16_t ver_eeprom[4]; ver_eeprom[0] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MAJOR); 17bc0: 8a e0 ldi r24, 0x0A ; 10 17bc2: 90 e0 ldi r25, 0x00 ; 0 17bc4: 0f 94 8f a4 call 0x3491e ; 0x3491e 17bc8: 9a 83 std Y+2, r25 ; 0x02 17bca: 89 83 std Y+1, r24 ; 0x01 ver_eeprom[1] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR); 17bcc: 8c e0 ldi r24, 0x0C ; 12 17bce: 90 e0 ldi r25, 0x00 ; 0 17bd0: 0f 94 8f a4 call 0x3491e ; 0x3491e 17bd4: 9c 83 std Y+4, r25 ; 0x04 17bd6: 8b 83 std Y+3, r24 ; 0x03 ver_eeprom[2] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION); 17bd8: 8e e0 ldi r24, 0x0E ; 14 17bda: 90 e0 ldi r25, 0x00 ; 0 17bdc: 0f 94 8f a4 call 0x3491e ; 0x3491e 17be0: 9e 83 std Y+6, r25 ; 0x06 17be2: 8d 83 std Y+5, r24 ; 0x05 ver_eeprom[3] = eeprom_read_word((uint16_t*)EEPROM_FIRMWARE_VERSION_FLAVOR); 17be4: 80 e1 ldi r24, 0x10 ; 16 17be6: 90 e0 ldi r25, 0x00 ; 0 17be8: 0f 94 8f a4 call 0x3491e ; 0x3491e 17bec: 98 87 std Y+8, r25 ; 0x08 17bee: 8f 83 std Y+7, r24 ; 0x07 17bf0: c8 01 movw r24, r16 17bf2: de 01 movw r26, r28 17bf4: 11 96 adiw r26, 0x01 ; 1 17bf6: be 01 movw r22, r28 17bf8: 67 5f subi r22, 0xF7 ; 247 17bfa: 7f 4f sbci r23, 0xFF ; 255 for (uint8_t i = 0; i < 4; ++i) { uint16_t v = pgm_read_word(&ver_req[i]); 17bfc: fc 01 movw r30, r24 17bfe: 25 91 lpm r18, Z+ 17c00: 34 91 lpm r19, Z if (v > ver_eeprom[i]) 17c02: 4d 91 ld r20, X+ 17c04: 5d 91 ld r21, X+ 17c06: 42 17 cp r20, r18 17c08: 53 07 cpc r21, r19 17c0a: 48 f0 brcs .+18 ; 0x17c1e return true; else if (v < ver_eeprom[i]) 17c0c: 24 17 cp r18, r20 17c0e: 35 07 cpc r19, r21 17c10: 20 f0 brcs .+8 ; 0x17c1a 17c12: 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) { 17c14: a6 17 cp r26, r22 17c16: b7 07 cpc r27, r23 17c18: 89 f7 brne .-30 ; 0x17bfc return true; else if (v < ver_eeprom[i]) break; } return false; 17c1a: 80 e0 ldi r24, 0x00 ; 0 17c1c: 01 c0 rjmp .+2 ; 0x17c20 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; 17c1e: 81 e0 ldi r24, 0x01 ; 1 else if (v < ver_eeprom[i]) break; } return false; } 17c20: 28 96 adiw r28, 0x08 ; 8 17c22: 0f b6 in r0, 0x3f ; 63 17c24: f8 94 cli 17c26: de bf out 0x3e, r29 ; 62 17c28: 0f be out 0x3f, r0 ; 63 17c2a: cd bf out 0x3d, r28 ; 61 17c2c: df 91 pop r29 17c2e: cf 91 pop r28 17c30: 1f 91 pop r17 17c32: 0f 91 pop r16 17c34: 08 95 ret 00017c36 : #endif // MMU_FORCE_STEALTH_MODE } static void mmu_enable_switch() { uint8_t current_state = eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED); 17c36: 8c ea ldi r24, 0xAC ; 172 17c38: 9c e0 ldi r25, 0x0C ; 12 17c3a: 0f 94 81 a4 call 0x34902 ; 0x34902 if (current_state) 17c3e: 88 23 and r24, r24 17c40: 99 f0 breq .+38 ; 0x17c68 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 17c42: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 17c46: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 17c4a: 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)); 17c4e: 8c ea ldi r24, 0xAC ; 172 17c50: 9c e0 ldi r25, 0x0C ; 12 17c52: 0f 94 81 a4 call 0x34902 ; 0x34902 17c56: 61 e0 ldi r22, 0x01 ; 1 17c58: 81 11 cpse r24, r1 17c5a: 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); 17c5c: 8c ea ldi r24, 0xAC ; 172 17c5e: 9c e0 ldi r25, 0x0C ; 12 17c60: 0f 94 c9 a4 call 0x34992 ; 0x34992 { MMU2::mmu2.Start(); } eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); 17c64: 0d 94 4b 65 jmp 0x2ca96 ; 0x2ca96 { MMU2::mmu2.Stop(); } else { MMU2::mmu2.Start(); 17c68: 0f 94 21 96 call 0x32c42 ; 0x32c42 17c6c: f0 cf rjmp .-32 ; 0x17c4e 00017c6e : eeprom_toggle((uint8_t*)EEPROM_MMU_STEALTH); } #endif //MMU_FORCE_STEALTH_MODE static void lcd_silent_mode_set() { switch (SilentModeMenu) { 17c6e: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb 17c72: 88 23 and r24, r24 17c74: 21 f0 breq .+8 ; 0x17c7e 17c76: 81 30 cpi r24, 0x01 ; 1 17c78: 69 f4 brne .+26 ; 0x17c94 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; 17c7a: 82 e0 ldi r24, 0x02 ; 2 17c7c: 01 c0 rjmp .+2 ; 0x17c80 #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; 17c7e: 81 e0 ldi r24, 0x01 ; 1 case SILENT_MODE_SILENT: SilentModeMenu = SILENT_MODE_AUTO; break; 17c80: 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); 17c84: 60 91 bb 03 lds r22, 0x03BB ; 0x8003bb 17c88: 8f ef ldi r24, 0xFF ; 255 17c8a: 9f e0 ldi r25, 0x0F ; 15 17c8c: 0f 94 a5 a4 call 0x3494a ; 0x3494a // 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(); 17c90: 0d 94 1d 18 jmp 0x2303a ; 0x2303a 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; 17c94: 10 92 bb 03 sts 0x03BB, r1 ; 0x8003bb 17c98: f5 cf rjmp .-22 ; 0x17c84 00017c9a : static void fsensor_reinit() { fsensor.init(); } static void lcd_fsensor_enabled_set(void) { fsensor.setEnabled(!fsensor.isEnabled()); 17c9a: 81 e0 ldi r24, 0x01 ; 1 17c9c: 90 91 f1 16 lds r25, 0x16F1 ; 0x8016f1 17ca0: 91 11 cpse r25, r1 17ca2: 80 e0 ldi r24, 0x00 ; 0 17ca4: 0c 94 e1 77 jmp 0xefc2 ; 0xefc2 00017ca8 : static void lcd_fsensor_autoload_set() { fsensor.setAutoLoadEnabled(!fsensor.getAutoLoadEnabled(), true); } #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static void lcd_fsensor_jam_detection_set() { 17ca8: 0f 93 push r16 17caa: 1f 93 push r17 17cac: cf 93 push r28 fsensor.setJamDetectionEnabled(!fsensor.getJamDetectionEnabled(), true); 17cae: 01 ef ldi r16, 0xF1 ; 241 17cb0: 16 e1 ldi r17, 0x16 ; 22 17cb2: f8 01 movw r30, r16 17cb4: c6 85 ldd r28, Z+14 ; 0x0e 17cb6: 81 e0 ldi r24, 0x01 ; 1 17cb8: c8 27 eor r28, r24 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 17cba: c6 87 std Z+14, r28 ; 0x0e oldPos = pat9125_y; 17cbc: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 17cc0: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 17cc4: 90 8b std Z+16, r25 ; 0x10 17cc6: 87 87 std Z+15, r24 ; 0x0f resetStepCount(); 17cc8: 0f 94 2b 6d call 0x2da56 ; 0x2da56 jamErrCnt = 0; 17ccc: f8 01 movw r30, r16 17cce: 15 8a std Z+21, r1 ; 0x15 17cd0: 6c 2f mov r22, r28 17cd2: 8d ea ldi r24, 0xAD ; 173 17cd4: 9c e0 ldi r25, 0x0C ; 12 } 17cd6: cf 91 pop r28 17cd8: 1f 91 pop r17 17cda: 0f 91 pop r16 17cdc: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00017ce0 : //! | | //! ---------------------- //! @endcode void pid_extruder() { lcd_clear(); 17ce0: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 0, _T(MSG_SET_TEMPERATURE)); 17ce4: 86 e2 ldi r24, 0x26 ; 38 17ce6: 9b e3 ldi r25, 0x3B ; 59 17ce8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17cec: ac 01 movw r20, r24 17cee: 60 e0 ldi r22, 0x00 ; 0 17cf0: 80 e0 ldi r24, 0x00 ; 0 17cf2: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 pid_temp += lcd_encoder; 17cf6: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 17cfa: 90 91 4f 02 lds r25, 0x024F ; 0x80024f 17cfe: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 17d02: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 17d06: 82 0f add r24, r18 17d08: 93 1f adc r25, r19 if (pid_temp > HEATER_0_MAXTEMP) pid_temp = HEATER_0_MAXTEMP; 17d0a: 82 33 cpi r24, 0x32 ; 50 17d0c: 21 e0 ldi r18, 0x01 ; 1 17d0e: 92 07 cpc r25, r18 17d10: 50 f1 brcs .+84 ; 0x17d66 17d12: 81 e3 ldi r24, 0x31 ; 49 17d14: 91 e0 ldi r25, 0x01 ; 1 else if (pid_temp < HEATER_0_MINTEMP) pid_temp = HEATER_0_MINTEMP; 17d16: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f 17d1a: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e lcd_encoder = 0; 17d1e: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 17d22: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e lcd_set_cursor(1, 2); 17d26: 62 e0 ldi r22, 0x02 ; 2 17d28: 81 e0 ldi r24, 0x01 ; 1 17d2a: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(PSTR("%3u"), pid_temp); 17d2e: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 17d32: 8f 93 push r24 17d34: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 17d38: 8f 93 push r24 17d3a: 8b e5 ldi r24, 0x5B ; 91 17d3c: 93 e8 ldi r25, 0x83 ; 131 17d3e: 9f 93 push r25 17d40: 8f 93 push r24 17d42: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 if (lcd_clicked()) { 17d46: 0e 94 c6 73 call 0xe78c ; 0xe78c 17d4a: 0f 90 pop r0 17d4c: 0f 90 pop r0 17d4e: 0f 90 pop r0 17d50: 0f 90 pop r0 17d52: 88 23 and r24, r24 17d54: 71 f0 breq .+28 ; 0x17d72 lcd_commands_type = LcdCommands::PidExtruder; 17d56: 83 e0 ldi r24, 0x03 ; 3 17d58: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e lcd_return_to_status(); 17d5c: 0f 94 6e 05 call 0x20adc ; 0x20adc lcd_update(2); 17d60: 82 e0 ldi r24, 0x02 ; 2 17d62: 0c 94 4a 6f jmp 0xde94 ; 0xde94 { 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; 17d66: 8e 31 cpi r24, 0x1E ; 30 17d68: 91 05 cpc r25, r1 17d6a: a8 f6 brcc .-86 ; 0x17d16 17d6c: 8e e1 ldi r24, 0x1E ; 30 17d6e: 90 e0 ldi r25, 0x00 ; 0 17d70: d2 cf rjmp .-92 ; 0x17d16 lcd_commands_type = LcdCommands::PidExtruder; lcd_return_to_status(); lcd_update(2); } } 17d72: 08 95 ret 00017d74 : 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)) { 17d74: 0f 93 push r16 17d76: 1f 93 push r17 17d78: cf 93 push r28 17d7a: df 93 push r29 17d7c: eb 01 movw r28, r22 17d7e: 8a 01 movw r16, r20 switch(*oCheckSetting) { 17d80: 81 30 cpi r24, 0x01 ; 1 17d82: 81 f0 breq .+32 ; 0x17da4 17d84: 82 30 cpi r24, 0x02 ; 2 17d86: 89 f0 breq .+34 ; 0x17daa case ClCheckMode::_None: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); 17d88: 83 e4 ldi r24, 0x43 ; 67 17d8a: 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); 17d8c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17d90: 22 e0 ldi r18, 0x02 ; 2 17d92: a8 01 movw r20, r16 17d94: bc 01 movw r22, r24 17d96: ce 01 movw r24, r28 break; default: MENU_ITEM_TOGGLE_P(msg, _T(MSG_NONE), func); } } 17d98: df 91 pop r29 17d9a: cf 91 pop r28 17d9c: 1f 91 pop r17 17d9e: 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); 17da0: 0c 94 af 75 jmp 0xeb5e ; 0xeb5e 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); 17da4: 8c e3 ldi r24, 0x3C ; 60 17da6: 9b e4 ldi r25, 0x4B ; 75 17da8: f1 cf rjmp .-30 ; 0x17d8c break; case ClCheckMode::_Strict: MENU_ITEM_TOGGLE_P(msg, _T(MSG_STRICT), func); 17daa: 83 e3 ldi r24, 0x33 ; 51 17dac: 9b e4 ldi r25, 0x4B ; 75 17dae: ee cf rjmp .-36 ; 0x17d8c 00017db0 : eeprom_toggle((uint8_t *)EEPROM_MMU_ENABLED); MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() 17db0: cf 93 push r28 17db2: 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)) 17db4: 8f ef ldi r24, 0xFF ; 255 17db6: 9f e0 ldi r25, 0x0F ; 15 17db8: 0f 94 81 a4 call 0x34902 ; 0x34902 17dbc: 81 30 cpi r24, 0x01 ; 1 17dbe: 99 f0 breq .+38 ; 0x17de6 17dc0: 82 30 cpi r24, 0x02 ; 2 17dc2: a1 f0 breq .+40 ; 0x17dec { case SILENT_MODE_POWER: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_HIGH_POWER), lcd_silent_mode_set); 17dc4: 86 e2 ldi r24, 0x26 ; 38 17dc6: 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); 17dc8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17dcc: ec 01 movw r28, r24 17dce: 8f e1 ldi r24, 0x1F ; 31 17dd0: 9b e4 ldi r25, 0x4B ; 75 17dd2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17dd6: 22 e0 ldi r18, 0x02 ; 2 17dd8: 47 e3 ldi r20, 0x37 ; 55 17dda: 5e eb ldi r21, 0xBE ; 190 17ddc: 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 } } 17dde: df 91 pop r29 17de0: 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); 17de2: 0c 94 af 75 jmp 0xeb5e ; 0xeb5e { 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); 17de6: 86 e1 ldi r24, 0x16 ; 22 17de8: 9b e4 ldi r25, 0x4B ; 75 17dea: ee cf rjmp .-36 ; 0x17dc8 break; case SILENT_MODE_AUTO: MENU_ITEM_TOGGLE_P(_T(MSG_MODE), _T(MSG_AUTO_POWER), lcd_silent_mode_set); 17dec: 89 e0 ldi r24, 0x09 ; 9 17dee: 9b e4 ldi r25, 0x4B ; 75 17df0: eb cf rjmp .-42 ; 0x17dc8 00017df2 : 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() { 17df2: cf 93 push r28 17df4: 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); 17df6: 80 91 40 02 lds r24, 0x0240 ; 0x800240 17dfa: 88 23 and r24, r24 17dfc: 89 f0 breq .+34 ; 0x17e20 17dfe: 8c e5 ldi r24, 0x5C ; 92 17e00: 93 e6 ldi r25, 0x63 ; 99 17e02: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17e06: ec 01 movw r28, r24 17e08: 80 ed ldi r24, 0xD0 ; 208 17e0a: 94 e4 ldi r25, 0x44 ; 68 17e0c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17e10: 22 e0 ldi r18, 0x02 ; 2 17e12: 4a e2 ldi r20, 0x2A ; 42 17e14: 58 e3 ldi r21, 0x38 ; 56 17e16: be 01 movw r22, r28 } 17e18: df 91 pop r29 17e1a: 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); 17e1c: 0c 94 af 75 jmp 0xeb5e ; 0xeb5e 17e20: 86 e5 ldi r24, 0x56 ; 86 17e22: 93 e6 ldi r25, 0x63 ; 99 17e24: ee cf rjmp .-36 ; 0x17e02 00017e26 : } #endif //FILAMENT_SENSOR static void menuitems_MMU_settings_common() { 17e26: cf 93 push r28 17e28: df 93 push r29 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 17e2a: 86 ed ldi r24, 0xD6 ; 214 17e2c: 9e e0 ldi r25, 0x0E ; 14 17e2e: 0f 94 81 a4 call 0x34902 ; 0x34902 17e32: 81 30 cpi r24, 0x01 ; 1 17e34: 19 f5 brne .+70 ; 0x17e7c MENU_ITEM_TOGGLE_P(MSG_SPOOL_JOIN, SpoolJoin::spooljoin.isSpoolJoinEnabled() ? _T(MSG_ON) : _T(MSG_OFF), SpoolJoin::spooljoin.toggleSpoolJoin); 17e36: 8c e5 ldi r24, 0x5C ; 92 17e38: 93 e6 ldi r25, 0x63 ; 99 17e3a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17e3e: 22 e0 ldi r18, 0x02 ; 2 17e40: 44 e3 ldi r20, 0x34 ; 52 17e42: 57 e3 ldi r21, 0x37 ; 55 17e44: bc 01 movw r22, r24 17e46: 86 e9 ldi r24, 0x96 ; 150 17e48: 98 e6 ldi r25, 0x68 ; 104 17e4a: 0e 94 af 75 call 0xeb5e ; 0xeb5e #ifdef MMU_HAS_CUTTER if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t *)EEPROM_MMU_CUTTER_ENABLED)) 17e4e: 8e ec ldi r24, 0xCE ; 206 17e50: 9e e0 ldi r25, 0x0E ; 14 17e52: 0f 94 81 a4 call 0x34902 ; 0x34902 17e56: 81 30 cpi r24, 0x01 ; 1 17e58: a1 f4 brne .+40 ; 0x17e82 { MENU_ITEM_TOGGLE_P(_T(MSG_CUTTER), _T(MSG_ON), lcd_cutter_enabled); 17e5a: 8c e5 ldi r24, 0x5C ; 92 17e5c: 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); 17e5e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17e62: ec 01 movw r28, r24 17e64: 85 eb ldi r24, 0xB5 ; 181 17e66: 94 e4 ldi r25, 0x44 ; 68 17e68: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17e6c: 22 e0 ldi r18, 0x02 ; 2 17e6e: 4a ef ldi r20, 0xFA ; 250 17e70: 58 e3 ldi r21, 0x38 ; 56 17e72: 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 } 17e74: df 91 pop r29 17e76: 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); 17e78: 0c 94 af 75 jmp 0xeb5e ; 0xeb5e #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); 17e7c: 86 e5 ldi r24, 0x56 ; 86 17e7e: 93 e6 ldi r25, 0x63 ; 99 17e80: dc cf rjmp .-72 ; 0x17e3a 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); 17e82: 86 e5 ldi r24, 0x56 ; 86 17e84: 93 e6 ldi r25, 0x63 ; 99 17e86: eb cf rjmp .-42 ; 0x17e5e 00017e88 : 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) 17e88: 80 91 96 03 lds r24, 0x0396 ; 0x800396 17e8c: 88 23 and r24, r24 17e8e: 21 f0 breq .+8 ; 0x17e98 17e90: 80 91 59 02 lds r24, 0x0259 ; 0x800259 17e94: 88 23 and r24, r24 17e96: 51 f0 breq .+20 ; 0x17eac { _md->status = 1; 17e98: 81 e0 ldi r24, 0x01 ; 1 17e9a: 80 93 96 03 sts 0x0396, r24 ; 0x800396 _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); 17e9e: 60 e0 ldi r22, 0x00 ; 0 17ea0: 8a e2 ldi r24, 0x2A ; 42 17ea2: 9d e0 ldi r25, 0x0D ; 13 17ea4: 0e 94 ae 78 call 0xf15c ; 0xf15c 17ea8: 80 93 97 03 sts 0x0397, r24 ; 0x800397 } MENU_BEGIN(); 17eac: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 17eb0: 10 92 60 04 sts 0x0460, r1 ; 0x800460 17eb4: 80 91 60 04 lds r24, 0x0460 ; 0x800460 17eb8: 84 30 cpi r24, 0x04 ; 4 17eba: 08 f0 brcs .+2 ; 0x17ebe 17ebc: 90 c0 rjmp .+288 ; 0x17fde 17ebe: 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 17ec2: 80 91 ec 03 lds r24, 0x03EC ; 0x8003ec 17ec6: 81 11 cpse r24, r1 17ec8: 55 c0 rjmp .+170 ; 0x17f74 17eca: 82 e0 ldi r24, 0x02 ; 2 17ecc: 9b e4 ldi r25, 0x4B ; 75 17ece: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17ed2: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); 17ed6: 85 ee ldi r24, 0xE5 ; 229 17ed8: 96 e4 ldi r25, 0x46 ; 70 17eda: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17ede: 62 e8 ldi r22, 0x82 ; 130 17ee0: 7e ec ldi r23, 0xCE ; 206 17ee2: 0e 94 44 73 call 0xe688 ; 0xe688 SETTINGS_NOZZLE; 17ee6: 80 91 eb 03 lds r24, 0x03EB ; 0x8003eb 17eea: 8c 33 cpi r24, 0x3C ; 60 17eec: 09 f4 brne .+2 ; 0x17ef0 17eee: 60 c0 rjmp .+192 ; 0x17fb0 17ef0: 08 f0 brcs .+2 ; 0x17ef4 17ef2: 43 c0 rjmp .+134 ; 0x17f7a 17ef4: 89 31 cpi r24, 0x19 ; 25 17ef6: 09 f4 brne .+2 ; 0x17efa 17ef8: 4f c0 rjmp .+158 ; 0x17f98 17efa: 88 32 cpi r24, 0x28 ; 40 17efc: 09 f4 brne .+2 ; 0x17f00 17efe: 42 c0 rjmp .+132 ; 0x17f84 MENU_ITEM_FUNCTION_P(_T(MSG_NOZZLE_CNG_MENU),nozzle_change); 17f00: 8e e7 ldi r24, 0x7E ; 126 17f02: 95 e4 ldi r25, 0x45 ; 69 17f04: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17f08: 6d e0 ldi r22, 0x0D ; 13 17f0a: 79 ee ldi r23, 0xE9 ; 233 17f0c: 0e 94 ee 72 call 0xe5dc ; 0xe5dc MENU_ITEM_SUBMENU_P(_T(MSG_CHECKS), lcd_checking_menu); 17f10: 8b e2 ldi r24, 0x2B ; 43 17f12: 95 e4 ldi r25, 0x45 ; 69 17f14: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17f18: 64 ec ldi r22, 0xC4 ; 196 17f1a: 71 ec ldi r23, 0xC1 ; 193 17f1c: 0e 94 44 73 call 0xe688 ; 0xe688 //! 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) 17f20: 80 91 97 03 lds r24, 0x0397 ; 0x800397 17f24: 88 23 and r24, r24 17f26: 31 f0 breq .+12 ; 0x17f34 { MENU_ITEM_SUBMENU_P(PSTR("Experimental"), lcd_experimental_menu);////MSG_MENU_EXPERIMENTAL c=18 17f28: 60 ef ldi r22, 0xF0 ; 240 17f2a: 7f eb ldi r23, 0xBF ; 191 17f2c: 80 e2 ldi r24, 0x20 ; 32 17f2e: 94 e8 ldi r25, 0x84 ; 132 17f30: 0e 94 44 73 call 0xe688 ; 0xe688 //! 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); 17f34: 89 e2 ldi r24, 0x29 ; 41 17f36: 9d e0 ldi r25, 0x0D ; 13 17f38: 0f 94 81 a4 call 0x34902 ; 0x34902 17f3c: 88 23 and r24, r24 17f3e: 09 f4 brne .+2 ; 0x17f42 17f40: 4b c0 rjmp .+150 ; 0x17fd8 17f42: 82 ea ldi r24, 0xA2 ; 162 17f44: 98 e4 ldi r25, 0x48 ; 72 17f46: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17f4a: 22 e0 ldi r18, 0x02 ; 2 17f4c: 40 e2 ldi r20, 0x20 ; 32 17f4e: 56 ec ldi r21, 0xC6 ; 198 17f50: bc 01 movw r22, r24 17f52: 89 ea ldi r24, 0xA9 ; 169 17f54: 98 e6 ldi r25, 0x68 ; 104 17f56: 0e 94 af 75 call 0xeb5e ; 0xeb5e #endif //PINDA_TEMP_COMP MENU_END(); 17f5a: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 _md->status = 1; _md->experimental_menu_visibility = eeprom_init_default_byte((uint8_t *)EEPROM_EXPERIMENTAL_VISIBILITY, 0); } MENU_BEGIN(); 17f5e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 17f62: 8f 5f subi r24, 0xFF ; 255 17f64: 80 93 60 04 sts 0x0460, r24 ; 0x800460 17f68: 80 91 62 04 lds r24, 0x0462 ; 0x800462 17f6c: 8f 5f subi r24, 0xFF ; 255 17f6e: 80 93 62 04 sts 0x0462, r24 ; 0x800462 17f72: a0 cf rjmp .-192 ; 0x17eb4 MENU_ITEM_BACK_P(_T(bSettings?MSG_SETTINGS:MSG_BACK)); // i.e. default menu-item / menu-item after checking mismatch 17f74: 87 e9 ldi r24, 0x97 ; 151 17f76: 98 e4 ldi r25, 0x48 ; 72 17f78: aa cf rjmp .-172 ; 0x17ece MENU_ITEM_SUBMENU_P(_T(MSG_STEEL_SHEETS), sheets_menu); SETTINGS_NOZZLE; 17f7a: 80 35 cpi r24, 0x50 ; 80 17f7c: 19 f1 breq .+70 ; 0x17fc4 17f7e: 8f 3f cpi r24, 0xFF ; 255 17f80: 09 f0 breq .+2 ; 0x17f84 17f82: be cf rjmp .-132 ; 0x17f00 17f84: 84 e3 ldi r24, 0x34 ; 52 17f86: 95 e4 ldi r25, 0x45 ; 69 17f88: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17f8c: 22 e0 ldi r18, 0x02 ; 2 17f8e: 47 ea ldi r20, 0xA7 ; 167 17f90: 5d eb ldi r21, 0xBD ; 189 17f92: 67 e3 ldi r22, 0x37 ; 55 17f94: 74 e8 ldi r23, 0x84 ; 132 17f96: 09 c0 rjmp .+18 ; 0x17faa 17f98: 84 e3 ldi r24, 0x34 ; 52 17f9a: 95 e4 ldi r25, 0x45 ; 69 17f9c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17fa0: 22 e0 ldi r18, 0x02 ; 2 17fa2: 47 ea ldi r20, 0xA7 ; 167 17fa4: 5d eb ldi r21, 0xBD ; 189 17fa6: 6c e3 ldi r22, 0x3C ; 60 17fa8: 74 e8 ldi r23, 0x84 ; 132 17faa: 0e 94 af 75 call 0xeb5e ; 0xeb5e 17fae: a8 cf rjmp .-176 ; 0x17f00 17fb0: 84 e3 ldi r24, 0x34 ; 52 17fb2: 95 e4 ldi r25, 0x45 ; 69 17fb4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17fb8: 22 e0 ldi r18, 0x02 ; 2 17fba: 47 ea ldi r20, 0xA7 ; 167 17fbc: 5d eb ldi r21, 0xBD ; 189 17fbe: 62 e3 ldi r22, 0x32 ; 50 17fc0: 74 e8 ldi r23, 0x84 ; 132 17fc2: f3 cf rjmp .-26 ; 0x17faa 17fc4: 84 e3 ldi r24, 0x34 ; 52 17fc6: 95 e4 ldi r25, 0x45 ; 69 17fc8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17fcc: 22 e0 ldi r18, 0x02 ; 2 17fce: 47 ea ldi r20, 0xA7 ; 167 17fd0: 5d eb ldi r21, 0xBD ; 189 17fd2: 6d e2 ldi r22, 0x2D ; 45 17fd4: 74 e8 ldi r23, 0x84 ; 132 17fd6: e9 cf rjmp .-46 ; 0x17faa //! 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); 17fd8: 88 ea ldi r24, 0xA8 ; 168 17fda: 98 e4 ldi r25, 0x48 ; 72 17fdc: b4 cf rjmp .-152 ; 0x17f46 #endif //PINDA_TEMP_COMP MENU_END(); } 17fde: 08 95 ret 00017fe0 : } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 17fe0: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 17fe4: 10 92 60 04 sts 0x0460, r1 ; 0x800460 17fe8: 80 91 60 04 lds r24, 0x0460 ; 0x800460 17fec: 84 30 cpi r24, 0x04 ; 4 17fee: a8 f4 brcc .+42 ; 0x1801a 17ff0: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_BACK)); 17ff4: 82 e0 ldi r24, 0x02 ; 2 17ff6: 9b e4 ldi r25, 0x4B ; 75 17ff8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 17ffc: 0e 94 1f 73 call 0xe63e ; 0xe63e #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(); 18000: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 } #endif //PRUSA_SN_SUPPORT void lcd_experimental_menu() { MENU_BEGIN(); 18004: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18008: 8f 5f subi r24, 0xFF ; 255 1800a: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1800e: 80 91 62 04 lds r24, 0x0462 ; 0x800462 18012: 8f 5f subi r24, 0xFF ; 255 18014: 80 93 62 04 sts 0x0462, r24 ; 0x800462 18018: e7 cf rjmp .-50 ; 0x17fe8 #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(); } 1801a: 08 95 ret 0001801c : lcd_return_to_status(); } #endif //THERMAL_MODEL void lcd_sdcard_stop() { 1801c: cf 93 push r28 // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); 1801e: 8d ea ldi r24, 0xAD ; 173 18020: 98 e4 ldi r25, 0x48 ; 72 18022: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18026: ac 01 movw r20, r24 18028: 60 e0 ldi r22, 0x00 ; 0 1802a: 80 e0 ldi r24, 0x00 ; 0 1802c: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_putc_at(0, 1, '\n'); 18030: 4a e0 ldi r20, 0x0A ; 10 18032: 61 e0 ldi r22, 0x01 ; 1 18034: 80 e0 ldi r24, 0x00 ; 0 18036: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 MENU_BEGIN(); 1803a: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 1803e: 10 92 60 04 sts 0x0460, r1 ; 0x800460 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 18042: 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(); 18044: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18048: 84 30 cpi r24, 0x04 ; 4 1804a: 18 f5 brcc .+70 ; 0x18092 1804c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 // Skip first two LCD rows used by static message if(menu_row == 0) menu_row = 2; 18050: 81 11 cpse r24, r1 18052: 02 c0 rjmp .+4 ; 0x18058 18054: 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); 18058: 88 ea ldi r24, 0xA8 ; 168 1805a: 98 e4 ldi r25, 0x48 ; 72 1805c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18060: 62 e5 ldi r22, 0x52 ; 82 18062: 77 e3 ldi r23, 0x37 ; 55 18064: 0e 94 ee 72 call 0xe5dc ; 0xe5dc MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); 18068: 82 ea ldi r24, 0xA2 ; 162 1806a: 98 e4 ldi r25, 0x48 ; 72 1806c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18070: 6a e2 ldi r22, 0x2A ; 42 18072: 7d ed ldi r23, 0xDD ; 221 18074: 0e 94 ee 72 call 0xe5dc ; 0xe5dc MENU_END(); 18078: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 { // Show static message lcd_puts_at_P(0, 0, _T(MSG_STOP_PRINT)); lcd_putc_at(0, 1, '\n'); MENU_BEGIN(); 1807c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18080: 8f 5f subi r24, 0xFF ; 255 18082: 80 93 60 04 sts 0x0460, r24 ; 0x800460 18086: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1808a: 8f 5f subi r24, 0xFF ; 255 1808c: 80 93 62 04 sts 0x0462, r24 ; 0x800462 18090: d9 cf rjmp .-78 ; 0x18044 // 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(); } 18092: cf 91 pop r28 18094: 08 95 ret 00018096 : act = Filament_sensor::SensorActionOnError::_Continue; } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { 18096: cf 93 push r28 18098: df 93 push r29 MENU_BEGIN(); 1809a: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 1809e: 10 92 60 04 sts 0x0460, r1 ; 0x800460 180a2: 80 91 60 04 lds r24, 0x0460 ; 0x800460 180a6: 84 30 cpi r24, 0x04 ; 4 180a8: 08 f0 brcs .+2 ; 0x180ac 180aa: bd c0 rjmp .+378 ; 0x18226 180ac: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_BACK)); 180b0: 82 e0 ldi r24, 0x02 ; 2 180b2: 9b e4 ldi r25, 0x4B ; 75 180b4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 180b8: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR), fsensor.isEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_enabled_set); 180bc: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 180c0: 88 23 and r24, r24 180c2: 09 f4 brne .+2 ; 0x180c6 180c4: 4e c0 rjmp .+156 ; 0x18162 180c6: 8c e5 ldi r24, 0x5C ; 92 180c8: 93 e6 ldi r25, 0x63 ; 99 180ca: 0e 94 8b 75 call 0xeb16 ; 0xeb16 180ce: ec 01 movw r28, r24 180d0: 8d e3 ldi r24, 0x3D ; 61 180d2: 98 e4 ldi r25, 0x48 ; 72 180d4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 180d8: 22 e0 ldi r18, 0x02 ; 2 180da: 4d e4 ldi r20, 0x4D ; 77 180dc: 5e eb ldi r21, 0xBE ; 190 180de: be 01 movw r22, r28 180e0: 0e 94 af 75 call 0xeb5e ; 0xeb5e 180e4: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 if (fsensor.isEnabled()) { 180e8: 88 23 and r24, r24 180ea: 09 f4 brne .+2 ; 0x180ee 180ec: 8c c0 rjmp .+280 ; 0x18206 if (fsensor.isError()) { 180ee: 83 30 cpi r24, 0x03 ; 3 180f0: d9 f5 brne .+118 ; 0x18168 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_RUNOUT), _T(MSG_NA), fsensor_reinit); 180f2: 8c e7 ldi r24, 0x7C ; 124 180f4: 98 e4 ldi r25, 0x48 ; 72 180f6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 180fa: ec 01 movw r28, r24 180fc: 89 ea ldi r24, 0xA9 ; 169 180fe: 94 e4 ldi r25, 0x44 ; 68 18100: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18104: 22 e0 ldi r18, 0x02 ; 2 18106: 47 eb ldi r20, 0xB7 ; 183 18108: 5c eb ldi r21, 0xBC ; 188 1810a: be 01 movw r22, r28 1810c: 0e 94 af 75 call 0xeb5e ; 0xeb5e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), _T(MSG_NA), fsensor_reinit); 18110: 8c e7 ldi r24, 0x7C ; 124 18112: 98 e4 ldi r25, 0x48 ; 72 18114: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18118: ec 01 movw r28, r24 1811a: 8b e9 ldi r24, 0x9B ; 155 1811c: 94 e4 ldi r25, 0x44 ; 68 1811e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18122: 22 e0 ldi r18, 0x02 ; 2 18124: 47 eb ldi r20, 0xB7 ; 183 18126: 5c eb ldi r21, 0xBC ; 188 18128: be 01 movw r22, r28 1812a: 0e 94 af 75 call 0xeb5e ; 0xeb5e #if defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_JAM_DETECTION), _T(MSG_NA), fsensor_reinit); 1812e: 8c e7 ldi r24, 0x7C ; 124 18130: 98 e4 ldi r25, 0x48 ; 72 18132: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18136: ec 01 movw r28, r24 18138: 8b e8 ldi r24, 0x8B ; 139 1813a: 94 e4 ldi r25, 0x44 ; 68 1813c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18140: 22 e0 ldi r18, 0x02 ; 2 18142: 47 eb ldi r20, 0xB7 ; 183 18144: 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); 18146: be 01 movw r22, r28 18148: 0e 94 af 75 call 0xeb5e ; 0xeb5e #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) } switch(fsensor.getActionOnError()) { 1814c: 80 91 f9 16 lds r24, 0x16F9 ; 0x8016f9 18150: 88 23 and r24, r24 18152: 09 f4 brne .+2 ; 0x18156 18154: 49 c0 rjmp .+146 ; 0x181e8 18156: 81 30 cpi r24, 0x01 ; 1 18158: 09 f4 brne .+2 ; 0x1815c 1815a: 62 c0 rjmp .+196 ; 0x18220 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(); 1815c: 0e 94 48 bd call 0x17a90 ; 0x17a90 18160: 52 c0 rjmp .+164 ; 0x18206 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); 18162: 86 e5 ldi r24, 0x56 ; 86 18164: 93 e6 ldi r25, 0x63 ; 99 18166: b1 cf rjmp .-158 ; 0x180ca #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); 18168: 80 91 f3 16 lds r24, 0x16F3 ; 0x8016f3 1816c: 88 23 and r24, r24 1816e: 99 f1 breq .+102 ; 0x181d6 18170: 8c e5 ldi r24, 0x5C ; 92 18172: 93 e6 ldi r25, 0x63 ; 99 18174: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18178: ec 01 movw r28, r24 1817a: 89 ea ldi r24, 0xA9 ; 169 1817c: 94 e4 ldi r25, 0x44 ; 68 1817e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18182: 22 e0 ldi r18, 0x02 ; 2 18184: 4e e5 ldi r20, 0x5E ; 94 18186: 5d eb ldi r21, 0xBD ; 189 18188: be 01 movw r22, r28 1818a: 0e 94 af 75 call 0xeb5e ; 0xeb5e MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 1818e: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 18192: 88 23 and r24, r24 18194: 19 f1 breq .+70 ; 0x181dc 18196: 8c e5 ldi r24, 0x5C ; 92 18198: 93 e6 ldi r25, 0x63 ; 99 1819a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1819e: ec 01 movw r28, r24 181a0: 8b e9 ldi r24, 0x9B ; 155 181a2: 94 e4 ldi r25, 0x44 ; 68 181a4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 181a8: 22 e0 ldi r18, 0x02 ; 2 181aa: 44 e5 ldi r20, 0x54 ; 84 181ac: 5d eb ldi r21, 0xBD ; 189 181ae: be 01 movw r22, r28 181b0: 0e 94 af 75 call 0xeb5e ; 0xeb5e #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); 181b4: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 181b8: 88 23 and r24, r24 181ba: 99 f0 breq .+38 ; 0x181e2 181bc: 8c e5 ldi r24, 0x5C ; 92 181be: 93 e6 ldi r25, 0x63 ; 99 181c0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 181c4: ec 01 movw r28, r24 181c6: 8b e8 ldi r24, 0x8B ; 139 181c8: 94 e4 ldi r25, 0x44 ; 68 181ca: 0e 94 8b 75 call 0xeb16 ; 0xeb16 181ce: 22 e0 ldi r18, 0x02 ; 2 181d0: 44 e5 ldi r20, 0x54 ; 84 181d2: 5e eb ldi r21, 0xBE ; 190 181d4: b8 cf rjmp .-144 ; 0x18146 #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); 181d6: 86 e5 ldi r24, 0x56 ; 86 181d8: 93 e6 ldi r25, 0x63 ; 99 181da: cc cf rjmp .-104 ; 0x18174 MENU_ITEM_TOGGLE_P(_T(MSG_FSENSOR_AUTOLOAD), fsensor.getAutoLoadEnabled() ? _T(MSG_ON) : _T(MSG_OFF), lcd_fsensor_autoload_set); 181dc: 86 e5 ldi r24, 0x56 ; 86 181de: 93 e6 ldi r25, 0x63 ; 99 181e0: dc cf rjmp .-72 ; 0x1819a #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); 181e2: 86 e5 ldi r24, 0x56 ; 86 181e4: 93 e6 ldi r25, 0x63 ; 99 181e6: ec cf rjmp .-40 ; 0x181c0 #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); 181e8: 83 e8 ldi r24, 0x83 ; 131 181ea: 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); 181ec: 0e 94 8b 75 call 0xeb16 ; 0xeb16 181f0: ec 01 movw r28, r24 181f2: 87 e7 ldi r24, 0x77 ; 119 181f4: 94 e4 ldi r25, 0x44 ; 68 181f6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 181fa: 22 e0 ldi r18, 0x02 ; 2 181fc: 48 e4 ldi r20, 0x48 ; 72 181fe: 5d eb ldi r21, 0xBD ; 189 18200: be 01 movw r22, r28 18202: 0e 94 af 75 call 0xeb5e ; 0xeb5e default: lcd_fsensor_actionNA_set(); } } MENU_END(); 18206: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 } fsensor.setActionOnError(act, true); } static void lcd_fsensor_settings_menu() { MENU_BEGIN(); 1820a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1820e: 8f 5f subi r24, 0xFF ; 255 18210: 80 93 60 04 sts 0x0460, r24 ; 0x800460 18214: 80 91 62 04 lds r24, 0x0462 ; 0x800462 18218: 8f 5f subi r24, 0xFF ; 255 1821a: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1821e: 41 cf rjmp .-382 ; 0x180a2 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); 18220: 8f e6 ldi r24, 0x6F ; 111 18222: 94 e4 ldi r25, 0x44 ; 68 18224: e3 cf rjmp .-58 ; 0x181ec lcd_fsensor_actionNA_set(); } } MENU_END(); } 18226: df 91 pop r29 18228: cf 91 pop r28 1822a: 08 95 ret 0001822c : lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 1822c: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 18230: 10 92 60 04 sts 0x0460, r1 ; 0x800460 18234: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18238: 84 30 cpi r24, 0x04 ; 4 1823a: 08 f0 brcs .+2 ; 0x1823e 1823c: 3f c0 rjmp .+126 ; 0x182bc 1823e: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_STEEL_SHEETS)); 18242: 85 ee ldi r24, 0xE5 ; 229 18244: 96 e4 ldi r25, 0x46 ; 70 18246: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1824a: 0e 94 1f 73 call 0xe63e ; 0xe63e if(eeprom_is_sheet_initialized(selected_sheet)){ 1824e: 80 91 ca 03 lds r24, 0x03CA ; 0x8003ca 18252: 0e 94 d9 78 call 0xf1b2 ; 0xf1b2 18256: 88 23 and r24, r24 18258: 41 f0 breq .+16 ; 0x1826a MENU_ITEM_SUBMENU_P(_T(MSG_SELECT), change_sheet); 1825a: 8c ed ldi r24, 0xDC ; 220 1825c: 96 e4 ldi r25, 0x46 ; 70 1825e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18262: 60 ec ldi r22, 0xC0 ; 192 18264: 7d ec ldi r23, 0xCD ; 205 18266: 0e 94 44 73 call 0xe688 ; 0xe688 } if (lcd_commands_type == LcdCommands::Idle) 1826a: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1826e: 81 11 cpse r24, r1 18270: 08 c0 rjmp .+16 ; 0x18282 { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), activate_calibrate_sheet); 18272: 89 ec ldi r24, 0xC9 ; 201 18274: 96 e4 ldi r25, 0x46 ; 70 18276: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1827a: 6e e3 ldi r22, 0x3E ; 62 1827c: 77 ed ldi r23, 0xD7 ; 215 1827e: 0e 94 44 73 call 0xe688 ; 0xe688 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); 18282: 80 ec ldi r24, 0xC0 ; 192 18284: 96 e4 ldi r25, 0x46 ; 70 18286: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1828a: 65 ef ldi r22, 0xF5 ; 245 1828c: 73 ec ldi r23, 0xC3 ; 195 1828e: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); 18292: 88 eb ldi r24, 0xB8 ; 184 18294: 96 e4 ldi r25, 0x46 ; 70 18296: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1829a: 6f ee ldi r22, 0xEF ; 239 1829c: 74 ed ldi r23, 0xD4 ; 212 1829e: 0e 94 ee 72 call 0xe5dc ; 0xe5dc MENU_END(); 182a2: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 lcd_first_layer_calibration_reset(); } static void lcd_sheet_menu() { MENU_BEGIN(); 182a6: 80 91 60 04 lds r24, 0x0460 ; 0x800460 182aa: 8f 5f subi r24, 0xFF ; 255 182ac: 80 93 60 04 sts 0x0460, r24 ; 0x800460 182b0: 80 91 62 04 lds r24, 0x0462 ; 0x800462 182b4: 8f 5f subi r24, 0xFF ; 255 182b6: 80 93 62 04 sts 0x0462, r24 ; 0x800462 182ba: bc cf rjmp .-136 ; 0x18234 } MENU_ITEM_SUBMENU_P(_T(MSG_RENAME), lcd_rename_sheet_menu); MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_reset_sheet); MENU_END(); } 182bc: 08 95 ret 000182be ()>: } template static void select_sheet_menu() { selected_sheet = number; 182be: 87 e0 ldi r24, 0x07 ; 7 182c0: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182c4: 0c 94 16 c1 jmp 0x1822c ; 0x1822c 000182c8 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182c8: 86 e0 ldi r24, 0x06 ; 6 182ca: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182ce: 0c 94 16 c1 jmp 0x1822c ; 0x1822c 000182d2 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182d2: 85 e0 ldi r24, 0x05 ; 5 182d4: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182d8: 0c 94 16 c1 jmp 0x1822c ; 0x1822c 000182dc ()>: } template static void select_sheet_menu() { selected_sheet = number; 182dc: 84 e0 ldi r24, 0x04 ; 4 182de: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182e2: 0c 94 16 c1 jmp 0x1822c ; 0x1822c 000182e6 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182e6: 83 e0 ldi r24, 0x03 ; 3 182e8: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182ec: 0c 94 16 c1 jmp 0x1822c ; 0x1822c 000182f0 ()>: } template static void select_sheet_menu() { selected_sheet = number; 182f0: 82 e0 ldi r24, 0x02 ; 2 182f2: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 182f6: 0c 94 16 c1 jmp 0x1822c ; 0x1822c 000182fa ()>: } template static void select_sheet_menu() { selected_sheet = number; 182fa: 81 e0 ldi r24, 0x01 ; 1 182fc: 80 93 ca 03 sts 0x03CA, r24 ; 0x8003ca lcd_sheet_menu(); 18300: 0c 94 16 c1 jmp 0x1822c ; 0x1822c 00018304 ()>: } template static void select_sheet_menu() { selected_sheet = number; 18304: 10 92 ca 03 sts 0x03CA, r1 ; 0x8003ca lcd_sheet_menu(); 18308: 0c 94 16 c1 jmp 0x1822c ; 0x1822c 0001830c : menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 1830c: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 18310: 10 92 60 04 sts 0x0460, r1 ; 0x800460 18314: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18318: 84 30 cpi r24, 0x04 ; 4 1831a: a8 f5 brcc .+106 ; 0x18386 1831c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 18320: 87 e9 ldi r24, 0x97 ; 151 18322: 98 e4 ldi r25, 0x48 ; 72 18324: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18328: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_X), lcd_move_x); 1832c: 8a eb ldi r24, 0xBA ; 186 1832e: 9c e3 ldi r25, 0x3C ; 60 18330: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18334: 62 e4 ldi r22, 0x42 ; 66 18336: 76 ec ldi r23, 0xC6 ; 198 18338: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Y), lcd_move_y); 1833c: 81 eb ldi r24, 0xB1 ; 177 1833e: 9c e3 ldi r25, 0x3C ; 60 18340: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18344: 6b e4 ldi r22, 0x4B ; 75 18346: 76 ec ldi r23, 0xC6 ; 198 18348: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_Z), lcd_move_z); 1834c: 88 ea ldi r24, 0xA8 ; 168 1834e: 9c e3 ldi r25, 0x3C ; 60 18350: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18354: 69 e3 ldi r22, 0x39 ; 57 18356: 76 ec ldi r23, 0xC6 ; 198 18358: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_EXTRUDER), lcd_move_e); 1835c: 8d e9 ldi r24, 0x9D ; 157 1835e: 9c e3 ldi r25, 0x3C ; 60 18360: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18364: 60 eb ldi r22, 0xB0 ; 176 18366: 7c ec ldi r23, 0xCC ; 204 18368: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_END(); 1836c: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 menu_back_if_clicked(); } void lcd_move_menu_axis() { MENU_BEGIN(); 18370: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18374: 8f 5f subi r24, 0xFF ; 255 18376: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1837a: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1837e: 8f 5f subi r24, 0xFF ; 255 18380: 80 93 62 04 sts 0x0462, r24 ; 0x800462 18384: c7 cf rjmp .-114 ; 0x18314 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(); } 18386: 08 95 ret 00018388 : } } static void lcd_checking_menu(void) { MENU_BEGIN(); 18388: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 1838c: 10 92 60 04 sts 0x0460, r1 ; 0x800460 18390: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18394: 84 30 cpi r24, 0x04 ; 4 18396: d8 f5 brcc .+118 ; 0x1840e 18398: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 1839c: 8e e8 ldi r24, 0x8E ; 142 1839e: 95 e4 ldi r25, 0x45 ; 69 183a0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 183a4: 0e 94 1f 73 call 0xe63e ; 0xe63e settings_check_toggle(&oCheckMode, _T(MSG_NOZZLE), lcd_check_mode_set); 183a8: 85 ee ldi r24, 0xE5 ; 229 183aa: 94 e4 ldi r25, 0x44 ; 68 183ac: 0e 94 8b 75 call 0xeb16 ; 0xeb16 183b0: 4e e3 ldi r20, 0x3E ; 62 183b2: 5d eb ldi r21, 0xBD ; 189 183b4: bc 01 movw r22, r24 183b6: 80 91 ed 03 lds r24, 0x03ED ; 0x8003ed 183ba: 0e 94 ba be call 0x17d74 ; 0x17d74 settings_check_toggle(&oCheckModel, _T(MSG_MODEL), lcd_check_model_set); 183be: 8d ed ldi r24, 0xDD ; 221 183c0: 94 e4 ldi r25, 0x44 ; 68 183c2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 183c6: 44 e3 ldi r20, 0x34 ; 52 183c8: 5d eb ldi r21, 0xBD ; 189 183ca: bc 01 movw r22, r24 183cc: 80 91 ea 03 lds r24, 0x03EA ; 0x8003ea 183d0: 0e 94 ba be call 0x17d74 ; 0x17d74 settings_check_toggle(&oCheckVersion, MSG_FIRMWARE, lcd_check_version_set); 183d4: 4a e2 ldi r20, 0x2A ; 42 183d6: 5d eb ldi r21, 0xBD ; 189 183d8: 60 ea ldi r22, 0xA0 ; 160 183da: 78 e6 ldi r23, 0x68 ; 104 183dc: 80 91 e9 03 lds r24, 0x03E9 ; 0x8003e9 183e0: 0e 94 ba be call 0x17d74 ; 0x17d74 settings_check_toggle(&oCheckFilament, MSG_FILAMENT, lcd_check_filament_set); 183e4: 40 e2 ldi r20, 0x20 ; 32 183e6: 5d eb ldi r21, 0xBD ; 189 183e8: 63 e9 ldi r22, 0x93 ; 147 183ea: 7a e6 ldi r23, 0x6A ; 106 183ec: 80 91 ee 03 lds r24, 0x03EE ; 0x8003ee 183f0: 0e 94 ba be call 0x17d74 ; 0x17d74 MENU_END(); 183f4: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 } } static void lcd_checking_menu(void) { MENU_BEGIN(); 183f8: 80 91 60 04 lds r24, 0x0460 ; 0x800460 183fc: 8f 5f subi r24, 0xFF ; 255 183fe: 80 93 60 04 sts 0x0460, r24 ; 0x800460 18402: 80 91 62 04 lds r24, 0x0462 ; 0x800462 18406: 8f 5f subi r24, 0xFF ; 255 18408: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1840c: c1 cf rjmp .-126 ; 0x18390 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(); } 1840e: 08 95 ret 00018410 : ++str; } return str; } bool __attribute__((noinline)) Tag(const char *str, const char *tag_P, uint8_t tagSize, uint16_t tagMask, uint16_t *v){ 18410: cf 92 push r12 18412: df 92 push r13 18414: ef 92 push r14 18416: ff 92 push r15 18418: 0f 93 push r16 1841a: 1f 93 push r17 1841c: cf 93 push r28 1841e: df 93 push r29 18420: 6c 01 movw r12, r24 18422: 79 01 movw r14, r18 if( ! strncmp_P(str, tag_P, tagSize) ){ 18424: c4 2f mov r28, r20 18426: d0 e0 ldi r29, 0x00 ; 0 18428: ae 01 movw r20, r28 1842a: 0f 94 60 a2 call 0x344c0 ; 0x344c0 1842e: 89 2b or r24, r25 18430: b9 f4 brne .+46 ; 0x18460 Number(str + tagSize, v); 18432: b8 01 movw r22, r16 18434: c6 01 movw r24, r12 18436: 8c 0f add r24, r28 18438: 9d 1f adc r25, r29 1843a: 0e 94 b8 bb call 0x17770 ; 0x17770 *v |= tagMask; 1843e: f8 01 movw r30, r16 18440: 20 81 ld r18, Z 18442: 31 81 ldd r19, Z+1 ; 0x01 18444: 2e 29 or r18, r14 18446: 3f 29 or r19, r15 18448: 31 83 std Z+1, r19 ; 0x01 1844a: 20 83 st Z, r18 return true; 1844c: 81 e0 ldi r24, 0x01 ; 1 } return false; } 1844e: df 91 pop r29 18450: cf 91 pop r28 18452: 1f 91 pop r17 18454: 0f 91 pop r16 18456: ff 90 pop r15 18458: ef 90 pop r14 1845a: df 90 pop r13 1845c: cf 90 pop r12 1845e: 08 95 ret if( ! strncmp_P(str, tag_P, tagSize) ){ Number(str + tagSize, v); *v |= tagMask; return true; } return false; 18460: 80 e0 ldi r24, 0x00 ; 0 18462: f5 cf rjmp .-22 ; 0x1844e 00018464 : } } #if (LANG_MODE != 0) void lcd_language() { 18464: cf 93 push r28 18466: df 93 push r29 lcd_update_enable(true); 18468: 81 e0 ldi r24, 0x01 ; 1 1846a: 0e 94 89 70 call 0xe112 ; 0xe112 menu_goto(lcd_language_menu, 0, true, true); 1846e: 21 e0 ldi r18, 0x01 ; 1 18470: 41 e0 ldi r20, 0x01 ; 1 18472: 70 e0 ldi r23, 0x00 ; 0 18474: 60 e0 ldi r22, 0x00 ; 0 18476: 83 ec ldi r24, 0xC3 ; 195 18478: 93 ee ldi r25, 0xE3 ; 227 1847a: 0e 94 08 63 call 0xc610 ; 0xc610 1847e: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout while ((menu_menu != lcd_status_screen) && (!lang_is_selected())) 18482: c0 91 02 04 lds r28, 0x0402 ; 0x800402 18486: d0 91 03 04 lds r29, 0x0403 ; 0x800403 1848a: 0e 94 7f 74 call 0xe8fe ; 0xe8fe 1848e: c2 54 subi r28, 0x42 ; 66 18490: d7 43 sbci r29, 0x37 ; 55 18492: 39 f0 breq .+14 ; 0x184a2 18494: 81 11 cpse r24, r1 18496: 07 c0 rjmp .+14 ; 0x184a6 { delay_keep_alive(50); 18498: 82 e3 ldi r24, 0x32 ; 50 1849a: 90 e0 ldi r25, 0x00 ; 0 1849c: 0e 94 07 8d call 0x11a0e ; 0x11a0e 184a0: f0 cf rjmp .-32 ; 0x18482 } if (lang_is_selected()) 184a2: 88 23 and r24, r24 184a4: 21 f0 breq .+8 ; 0x184ae lcd_return_to_status(); else lang_select(LANG_ID_PRI); } 184a6: df 91 pop r29 184a8: 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(); 184aa: 0d 94 6e 05 jmp 0x20adc ; 0x20adc else lang_select(LANG_ID_PRI); 184ae: 80 e0 ldi r24, 0x00 ; 0 } 184b0: df 91 pop r29 184b2: cf 91 pop r28 delay_keep_alive(50); } if (lang_is_selected()) lcd_return_to_status(); else lang_select(LANG_ID_PRI); 184b4: 0c 94 1f 75 jmp 0xea3e ; 0xea3e 000184b8 : lcd_return_to_status(); } void lcd_mesh_calibration() { enquecommand_P(PSTR("M45")); 184b8: 61 e0 ldi r22, 0x01 ; 1 184ba: 88 ef ldi r24, 0xF8 ; 248 184bc: 93 e8 ldi r25, 0x83 ; 131 184be: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 lcd_return_to_status(); 184c2: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 000184c6 : } void lcd_mesh_calibration_z() { enquecommand_P(PSTR("M45 Z")); 184c6: 61 e0 ldi r22, 0x01 ; 1 184c8: 8c ef ldi r24, 0xFC ; 252 184ca: 93 e8 ldi r25, 0x83 ; 131 184cc: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 lcd_return_to_status(); 184d0: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 000184d4 : } #endif //(LANG_MODE != 0) void lcd_mesh_bedleveling() { enquecommand_P(PSTR("G80")); 184d4: 61 e0 ldi r22, 0x01 ; 1 184d6: 84 ef ldi r24, 0xF4 ; 244 184d8: 93 e8 ldi r25, 0x83 ; 131 184da: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 lcd_return_to_status(); 184de: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 000184e2 : MYSERIAL.begin(BAUDRATE); } #endif //HAS_SECOND_SERIAL_PORT void lcd_calibrate_pinda() { enquecommand_P(PSTR("G76")); 184e2: 61 e0 ldi r22, 0x01 ; 1 184e4: 82 e0 ldi r24, 0x02 ; 2 184e6: 94 e8 ldi r25, 0x84 ; 132 184e8: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 lcd_return_to_status(); 184ec: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 000184f0 : 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()") { 184f0: cf 93 push r28 184f2: 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); 184f6: c3 b1 in r28, 0x03 ; 3 lcd_puts_at_P(0, 0, MSG_PINDA); 184f8: 4a e7 ldi r20, 0x7A ; 122 184fa: 58 e6 ldi r21, 0x68 ; 104 184fc: 60 e0 ldi r22, 0x00 ; 0 184fe: 80 e0 ldi r24, 0x00 ; 0 18500: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(LCD_WIDTH - 14, 0); 18504: 60 e0 ldi r22, 0x00 ; 0 18506: 86 e0 ldi r24, 0x06 ; 6 18508: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_print_state(pinda_state); 1850c: c4 fb bst r28, 4 1850e: 88 27 eor r24, r24 18510: 80 f9 bld r24, 0 18512: 0e 94 e5 bc call 0x179ca ; 0x179ca if (MMU2::mmu2.Enabled()) { 18516: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1851a: 81 30 cpi r24, 0x01 ; 1 1851c: 99 f4 brne .+38 ; 0x18544 inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 1851e: c1 e0 ldi r28, 0x01 ; 1 18520: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 18524: 81 11 cpse r24, r1 18526: 01 c0 rjmp .+2 ; 0x1852a 18528: 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 1852a: 44 e7 ldi r20, 0x74 ; 116 1852c: 58 e6 ldi r21, 0x68 ; 104 1852e: 60 e0 ldi r22, 0x00 ; 0 18530: 8a e0 ldi r24, 0x0A ; 10 18532: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(LCD_WIDTH - 3, 0); 18536: 60 e0 ldi r22, 0x00 ; 0 18538: 81 e1 ldi r24, 0x11 ; 17 1853a: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_print_state(finda_state); 1853e: 8c 2f mov r24, r28 18540: 0e 94 e5 bc call 0x179ca ; 0x179ca 18544: c1 e0 ldi r28, 0x01 ; 1 18546: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1854a: 81 11 cpse r24, r1 1854c: 01 c0 rjmp .+2 ; 0x18550 1854e: c0 e0 ldi r28, 0x00 ; 0 } #ifdef FILAMENT_SENSOR idler_state = fsensor.getFilamentPresent(); lcd_puts_at_P(0, 1, _T(MSG_FSENSOR)); 18550: 8d e3 ldi r24, 0x3D ; 61 18552: 98 e4 ldi r25, 0x48 ; 72 18554: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18558: ac 01 movw r20, r24 1855a: 61 e0 ldi r22, 0x01 ; 1 1855c: 80 e0 ldi r24, 0x00 ; 0 1855e: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(LCD_WIDTH - 3, 1); 18562: 61 e0 ldi r22, 0x01 ; 1 18564: 81 e1 ldi r24, 0x11 ; 17 18566: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_print_state(idler_state); 1856a: 8c 2f mov r24, r28 1856c: 0e 94 e5 bc call 0x179ca ; 0x179ca // 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); 18570: 62 e0 ldi r22, 0x02 ; 2 18572: 80 e0 ldi r24, 0x00 ; 0 18574: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(_N("B: %3d Xd:%6d\n" 18578: 80 91 39 0e lds r24, 0x0E39 ; 0x800e39 1857c: 8f 93 push r24 1857e: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 18582: 8f 93 push r24 18584: 80 91 64 0d lds r24, 0x0D64 ; 0x800d64 18588: 1f 92 push r1 1858a: 8f 93 push r24 1858c: 80 91 8a 03 lds r24, 0x038A ; 0x80038a 18590: 8f 93 push r24 18592: 80 91 89 03 lds r24, 0x0389 ; 0x800389 18596: 8f 93 push r24 18598: 80 91 63 0d lds r24, 0x0D63 ; 0x800d63 1859c: 1f 92 push r1 1859e: 8f 93 push r24 185a0: 80 e5 ldi r24, 0x50 ; 80 185a2: 98 e6 ldi r25, 0x68 ; 104 185a4: 9f 93 push r25 185a6: 8f 93 push r24 185a8: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 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(); 185ac: 8d b7 in r24, 0x3d ; 61 185ae: 9e b7 in r25, 0x3e ; 62 185b0: 0a 96 adiw r24, 0x0a ; 10 185b2: 0f b6 in r0, 0x3f ; 63 185b4: f8 94 cli 185b6: 9e bf out 0x3e, r25 ; 62 185b8: 0f be out 0x3f, r0 ; 63 185ba: 8d bf out 0x3d, r24 ; 61 } 185bc: 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(); 185be: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae 000185c2 : } #endif //FANCHECK static uint8_t lcd_selftest_screen(TestScreen screen, uint8_t _progress, uint8_t _progress_scale, bool _clear, uint16_t _delay) { 185c2: bf 92 push r11 185c4: cf 92 push r12 185c6: df 92 push r13 185c8: ef 92 push r14 185ca: ff 92 push r15 185cc: 0f 93 push r16 185ce: 1f 93 push r17 185d0: cf 93 push r28 185d2: df 93 push r29 185d4: c8 2f mov r28, r24 185d6: f6 2e mov r15, r22 185d8: e4 2e mov r14, r20 185da: b2 2e mov r11, r18 185dc: 68 01 movw r12, r16 lcd_update_enable(false); 185de: 80 e0 ldi r24, 0x00 ; 0 185e0: 0e 94 89 70 call 0xe112 ; 0xe112 const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; 185e4: dc e7 ldi r29, 0x7C ; 124 185e6: fe 14 cp r15, r14 185e8: 08 f0 brcs .+2 ; 0x185ec 185ea: dd e2 ldi r29, 0x2D ; 45 if (_clear) 185ec: bb 20 and r11, r11 185ee: 09 f1 breq .+66 ; 0x18632 lcd_clear(); 185f0: 0e 94 77 70 call 0xe0ee ; 0xe0ee else lcd_home(); if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 185f4: c1 11 cpse r28, r1 185f6: 20 c0 rjmp .+64 ; 0x18638 if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 185f8: 8f e2 ldi r24, 0x2F ; 47 185fa: 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)); 185fc: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18600: 0e 94 6e 6f call 0xdedc ; 0xdedc if (screen == TestScreen::Hotend || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 18604: 88 ef ldi r24, 0xF8 ; 248 18606: 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 18608: 82 30 cpi r24, 0x02 ; 2 1860a: 78 f5 brcc .+94 ; 0x1866a || screen == TestScreen::HotendOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_HOTEND)); 1860c: 88 e8 ldi r24, 0x88 ; 136 1860e: 9a e4 ldi r25, 0x4A ; 74 18610: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18614: 0e 94 6e 6f call 0xdedc ; 0xdedc 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)); 18618: 87 e6 ldi r24, 0x67 ; 103 1861a: 9a e4 ldi r25, 0x4A ; 74 1861c: cc 30 cpi r28, 0x0C ; 12 1861e: 49 f1 breq .+82 ; 0x18672 if (screen == TestScreen::Failed) lcd_puts_P(_T(MSG_SELFTEST_FAILED)); 18620: 85 e5 ldi r24, 0x55 ; 85 18622: 9a e4 ldi r25, 0x4A ; 74 18624: cd 30 cpi r28, 0x0D ; 13 18626: 29 f1 breq .+74 ; 0x18672 if (screen == TestScreen::Home) lcd_puts_P(_T(MSG_CALIBRATING_HOME)); 18628: ce 30 cpi r28, 0x0E ; 14 1862a: 39 f5 brne .+78 ; 0x1867a 1862c: 82 e4 ldi r24, 0x42 ; 66 1862e: 9a e4 ldi r25, 0x4A ; 74 18630: 20 c0 rjmp .+64 ; 0x18672 lcd_update_enable(false); const char _indicator = (_progress >= _progress_scale) ? '-' : '|'; if (_clear) lcd_clear(); else lcd_home(); 18632: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 18636: de cf rjmp .-68 ; 0x185f4 if (screen == TestScreen::ExtruderFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); if (screen == TestScreen::PrintFan) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 18638: c1 30 cpi r28, 0x01 ; 1 1863a: f1 f2 breq .-68 ; 0x185f8 if (screen == TestScreen::FansOk) lcd_puts_P(_T(MSG_SELFTEST_FAN)); 1863c: c2 30 cpi r28, 0x02 ; 2 1863e: e1 f2 breq .-72 ; 0x185f8 if (screen == TestScreen::EndStops) lcd_puts_P(_T(MSG_SELFTEST_CHECK_ENDSTOPS)); 18640: 8f ed ldi r24, 0xDF ; 223 18642: 9a e4 ldi r25, 0x4A ; 74 18644: c3 30 cpi r28, 0x03 ; 3 18646: d1 f2 breq .-76 ; 0x185fc if (screen == TestScreen::AxisX) lcd_puts_P(_T(MSG_CHECKING_X)); 18648: 8d ec ldi r24, 0xCD ; 205 1864a: 9a e4 ldi r25, 0x4A ; 74 1864c: c4 30 cpi r28, 0x04 ; 4 1864e: b1 f2 breq .-84 ; 0x185fc if (screen == TestScreen::AxisY) lcd_puts_P(_T(MSG_CHECKING_Y)); 18650: 8b eb ldi r24, 0xBB ; 187 18652: 9a e4 ldi r25, 0x4A ; 74 18654: c5 30 cpi r28, 0x05 ; 5 18656: 91 f2 breq .-92 ; 0x185fc if (screen == TestScreen::AxisZ) lcd_puts_P(_T(MSG_SELFTEST_CHECK_Z)); 18658: 89 ea ldi r24, 0xA9 ; 169 1865a: 9a e4 ldi r25, 0x4A ; 74 1865c: c6 30 cpi r28, 0x06 ; 6 1865e: 71 f2 breq .-100 ; 0x185fc if (screen == TestScreen::Bed) lcd_puts_P(_T(MSG_SELFTEST_CHECK_BED)); 18660: c7 30 cpi r28, 0x07 ; 7 18662: 81 f6 brne .-96 ; 0x18604 18664: 8a e9 ldi r24, 0x9A ; 154 18666: 9a e4 ldi r25, 0x4A ; 74 18668: c9 cf rjmp .-110 ; 0x185fc 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)); 1866a: ca 30 cpi r28, 0x0A ; 10 1866c: 99 f5 brne .+102 ; 0x186d4 if (screen == TestScreen::FsensorOk) lcd_puts_P(_T(MSG_SELFTEST_CHECK_FSENSOR)); 1866e: 85 e7 ldi r24, 0x75 ; 117 18670: 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)); 18672: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18676: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_puts_at_P(0, 1, STR_SEPARATOR); 1867a: 44 ec ldi r20, 0xC4 ; 196 1867c: 54 e8 ldi r21, 0x84 ; 132 1867e: 61 e0 ldi r22, 0x01 ; 1 18680: 80 e0 ldi r24, 0x00 ; 0 18682: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 if ((screen >= TestScreen::ExtruderFan) && (screen <= TestScreen::FansOk)) 18686: c3 30 cpi r28, 0x03 ; 3 18688: 70 f5 brcc .+92 ; 0x186e6 { //SERIAL_ECHOLNPGM("Fan test"); lcd_puts_at_P(0, 2, _T(MSG_HOTEND_FAN_SPEED)); 1868a: 84 e3 ldi r24, 0x34 ; 52 1868c: 9a e4 ldi r25, 0x4A ; 74 1868e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18692: ac 01 movw r20, r24 18694: 62 e0 ldi r22, 0x02 ; 2 18696: 80 e0 ldi r24, 0x00 ; 0 18698: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(18, 2); 1869c: 62 e0 ldi r22, 0x02 ; 2 1869e: 82 e1 ldi r24, 0x12 ; 18 186a0: 0e 94 ab 6f call 0xdf56 ; 0xdf56 (screen < TestScreen::PrintFan) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 186a4: c1 11 cpse r28, r1 186a6: 1a c0 rjmp .+52 ; 0x186dc 186a8: 8d 2f mov r24, r29 186aa: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_puts_at_P(0, 3, _T(MSG_PRINT_FAN_SPEED)); 186ae: 87 e2 ldi r24, 0x27 ; 39 186b0: 9a e4 ldi r25, 0x4A ; 74 186b2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 186b6: ac 01 movw r20, r24 186b8: 63 e0 ldi r22, 0x03 ; 3 186ba: 80 e0 ldi r24, 0x00 ; 0 186bc: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(18, 3); 186c0: 63 e0 ldi r22, 0x03 ; 3 186c2: 82 e1 ldi r24, 0x12 ; 18 186c4: 0e 94 ab 6f call 0xdf56 ; 0xdf56 (screen < TestScreen::FansOk) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 186c8: c2 30 cpi r28, 0x02 ; 2 186ca: 19 f1 breq .+70 ; 0x18712 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); 186cc: 8d 2f mov r24, r29 186ce: 0e 94 72 6f call 0xdee4 ; 0xdee4 186d2: 23 c0 rjmp .+70 ; 0x1871a 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)); 186d4: cb 30 cpi r28, 0x0B ; 11 186d6: 09 f0 breq .+2 ; 0x186da 186d8: 9f cf rjmp .-194 ; 0x18618 186da: c9 cf rjmp .-110 ; 0x1866e 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); 186dc: 82 e3 ldi r24, 0x32 ; 50 186de: 99 e6 ldi r25, 0x69 ; 105 186e0: 0e 94 6e 6f call 0xdedc ; 0xdedc 186e4: e4 cf rjmp .-56 ; 0x186ae 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) 186e6: 86 ef ldi r24, 0xF6 ; 246 186e8: 8c 0f add r24, r28 186ea: 82 30 cpi r24, 0x02 ; 2 186ec: a8 f5 brcc .+106 ; 0x18758 { lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 186ee: 85 e1 ldi r24, 0x15 ; 21 186f0: 9a e4 ldi r25, 0x4A ; 74 186f2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 186f6: ac 01 movw r20, r24 186f8: 62 e0 ldi r22, 0x02 ; 2 186fa: 80 e0 ldi r24, 0x00 ; 0 186fc: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_putc(':'); 18700: 8a e3 ldi r24, 0x3A ; 58 18702: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_set_cursor(18, 2); 18706: 62 e0 ldi r22, 0x02 ; 2 18708: 82 e1 ldi r24, 0x12 ; 18 1870a: 0e 94 ab 6f call 0xdf56 ; 0xdf56 (screen == TestScreen::Fsensor) ? (void)lcd_putc(_indicator) : (void)lcd_puts_P(MSG_OK_CAPS); 1870e: ca 30 cpi r28, 0x0A ; 10 18710: e9 f2 breq .-70 ; 0x186cc 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); 18712: 82 e3 ldi r24, 0x32 ; 50 18714: 99 e6 ldi r25, 0x69 ; 105 18716: 0e 94 6e 6f call 0xdedc ; 0xdedc _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); 1871a: c1 14 cp r12, r1 1871c: d1 04 cpc r13, r1 1871e: 19 f0 breq .+6 ; 0x18726 18720: c6 01 movw r24, r12 18722: 0e 94 07 8d call 0x11a0e ; 0x11a0e _progress++; 18726: 81 e0 ldi r24, 0x01 ; 1 18728: 8f 0d add r24, r15 return (_progress >= _progress_scale * 2) ? 0 : _progress; 1872a: 48 2f mov r20, r24 1872c: 50 e0 ldi r21, 0x00 ; 0 1872e: 92 e0 ldi r25, 0x02 ; 2 18730: 24 e0 ldi r18, 0x04 ; 4 18732: 30 e0 ldi r19, 0x00 ; 0 18734: e9 16 cp r14, r25 18736: 11 f0 breq .+4 ; 0x1873c 18738: 26 e0 ldi r18, 0x06 ; 6 1873a: 30 e0 ldi r19, 0x00 ; 0 1873c: 42 17 cp r20, r18 1873e: 53 07 cpc r21, r19 18740: 0c f0 brlt .+2 ; 0x18744 18742: 80 e0 ldi r24, 0x00 ; 0 } 18744: df 91 pop r29 18746: cf 91 pop r28 18748: 1f 91 pop r17 1874a: 0f 91 pop r16 1874c: ff 90 pop r15 1874e: ef 90 pop r14 18750: df 90 pop r13 18752: cf 90 pop r12 18754: bf 90 pop r11 18756: 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) 18758: ca 30 cpi r28, 0x0A ; 10 1875a: f8 f6 brcc .-66 ; 0x1871a { //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); 1875c: 41 e0 ldi r20, 0x01 ; 1 1875e: c4 30 cpi r28, 0x04 ; 4 18760: 21 f0 breq .+8 ; 0x1876a 18762: 42 e0 ldi r20, 0x02 ; 2 18764: c3 30 cpi r28, 0x03 ; 3 18766: 09 f4 brne .+2 ; 0x1876a 18768: 40 e0 ldi r20, 0x00 ; 0 1876a: 0d 2f mov r16, r29 1876c: 22 ec ldi r18, 0xC2 ; 194 1876e: 34 e8 ldi r19, 0x84 ; 132 18770: 62 e0 ldi r22, 0x02 ; 2 18772: 82 e0 ldi r24, 0x02 ; 2 18774: 0e 94 b9 bc call 0x17972 ; 0x17972 _step_block = TestScreen::AxisY; lcd_selftest_screen_step(2, 8, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Y"), _indicator); 18778: 41 e0 ldi r20, 0x01 ; 1 1877a: c5 30 cpi r28, 0x05 ; 5 1877c: 21 f0 breq .+8 ; 0x18786 1877e: 42 e0 ldi r20, 0x02 ; 2 18780: c5 30 cpi r28, 0x05 ; 5 18782: 08 f4 brcc .+2 ; 0x18786 18784: 40 e0 ldi r20, 0x00 ; 0 18786: 0d 2f mov r16, r29 18788: 20 ec ldi r18, 0xC0 ; 192 1878a: 34 e8 ldi r19, 0x84 ; 132 1878c: 68 e0 ldi r22, 0x08 ; 8 1878e: 82 e0 ldi r24, 0x02 ; 2 18790: 0e 94 b9 bc call 0x17972 ; 0x17972 _step_block = TestScreen::AxisZ; lcd_selftest_screen_step(2, 14, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Z"), _indicator); 18794: 41 e0 ldi r20, 0x01 ; 1 18796: c6 30 cpi r28, 0x06 ; 6 18798: 21 f0 breq .+8 ; 0x187a2 1879a: 42 e0 ldi r20, 0x02 ; 2 1879c: c6 30 cpi r28, 0x06 ; 6 1879e: 08 f4 brcc .+2 ; 0x187a2 187a0: 40 e0 ldi r20, 0x00 ; 0 187a2: 0d 2f mov r16, r29 187a4: 2e eb ldi r18, 0xBE ; 190 187a6: 34 e8 ldi r19, 0x84 ; 132 187a8: 6e e0 ldi r22, 0x0E ; 14 187aa: 82 e0 ldi r24, 0x02 ; 2 187ac: 0e 94 b9 bc call 0x17972 ; 0x17972 _step_block = TestScreen::Bed; lcd_selftest_screen_step(3, 0, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Bed"), _indicator); 187b0: 41 e0 ldi r20, 0x01 ; 1 187b2: c7 30 cpi r28, 0x07 ; 7 187b4: 21 f0 breq .+8 ; 0x187be 187b6: 42 e0 ldi r20, 0x02 ; 2 187b8: c7 30 cpi r28, 0x07 ; 7 187ba: 08 f4 brcc .+2 ; 0x187be 187bc: 40 e0 ldi r20, 0x00 ; 0 187be: 0d 2f mov r16, r29 187c0: 2a eb ldi r18, 0xBA ; 186 187c2: 34 e8 ldi r19, 0x84 ; 132 187c4: 60 e0 ldi r22, 0x00 ; 0 187c6: 83 e0 ldi r24, 0x03 ; 3 187c8: 0e 94 b9 bc call 0x17972 ; 0x17972 _step_block = TestScreen::Hotend; lcd_selftest_screen_step(3, 9, ((screen == _step_block) ? 1 : (screen < _step_block) ? 0 : 2), PSTR("Hotend"), _indicator); 187cc: 41 e0 ldi r20, 0x01 ; 1 187ce: c8 30 cpi r28, 0x08 ; 8 187d0: 21 f0 breq .+8 ; 0x187da 187d2: 42 e0 ldi r20, 0x02 ; 2 187d4: c8 30 cpi r28, 0x08 ; 8 187d6: 08 f4 brcc .+2 ; 0x187da 187d8: 40 e0 ldi r20, 0x00 ; 0 187da: 0d 2f mov r16, r29 187dc: 23 eb ldi r18, 0xB3 ; 179 187de: 34 e8 ldi r19, 0x84 ; 132 187e0: 69 e0 ldi r22, 0x09 ; 9 187e2: 83 e0 ldi r24, 0x03 ; 3 187e4: 0e 94 b9 bc call 0x17972 ; 0x17972 187e8: 98 cf rjmp .-208 ; 0x1871a 000187ea : { printf_P(MSG_HOST_ACTION_NOTIFICATION, message); } static void lcd_rename_sheet_menu() { 187ea: cf 93 push r28 187ec: 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) 187ee: 80 91 96 03 lds r24, 0x0396 ; 0x800396 187f2: 81 11 cpse r24, r1 187f4: 18 c0 rjmp .+48 ; 0x18826 { eeprom_read_block(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); 187f6: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 187fa: 8b e0 ldi r24, 0x0B ; 11 187fc: 68 9f mul r22, r24 187fe: b0 01 movw r22, r0 18800: 11 24 eor r1, r1 18802: 67 5b subi r22, 0xB7 ; 183 18804: 72 4f sbci r23, 0xF2 ; 242 18806: 47 e0 ldi r20, 0x07 ; 7 18808: 50 e0 ldi r21, 0x00 ; 0 1880a: 88 e9 ldi r24, 0x98 ; 152 1880c: 93 e0 ldi r25, 0x03 ; 3 1880e: 0f 94 71 a4 call 0x348e2 ; 0x348e2 lcd_encoder = menuData->name[0]; 18812: 80 91 98 03 lds r24, 0x0398 ; 0x800398 18816: 90 e0 ldi r25, 0x00 ; 0 18818: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 1881c: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e menuData->initialized = true; 18820: 81 e0 ldi r24, 0x01 ; 1 18822: 80 93 96 03 sts 0x0396, r24 ; 0x800396 } if (lcd_encoder < 0x20) lcd_encoder = 0x20; 18826: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1882a: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1882e: 80 97 sbiw r24, 0x20 ; 32 18830: 34 f4 brge .+12 ; 0x1883e 18832: 80 e2 ldi r24, 0x20 ; 32 18834: 90 e0 ldi r25, 0x00 ; 0 18836: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 1883a: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e if (lcd_encoder > 0xFF) lcd_encoder = 0xFF; 1883e: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 18842: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 18846: 8f 3f cpi r24, 0xFF ; 255 18848: 91 05 cpc r25, r1 1884a: 39 f0 breq .+14 ; 0x1885a 1884c: 34 f0 brlt .+12 ; 0x1885a 1884e: 8f ef ldi r24, 0xFF ; 255 18850: 90 e0 ldi r25, 0x00 ; 0 18852: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 18856: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e menuData->name[menuData->selected] = lcd_encoder; 1885a: e0 91 97 03 lds r30, 0x0397 ; 0x800397 1885e: f0 e0 ldi r31, 0x00 ; 0 18860: ea 56 subi r30, 0x6A ; 106 18862: fc 4f sbci r31, 0xFC ; 252 18864: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 18868: 82 83 std Z+2, r24 ; 0x02 lcd_home(); 1886a: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 1886e: c8 e9 ldi r28, 0x98 ; 152 18870: d3 e0 ldi r29, 0x03 ; 3 for (uint_least8_t i = 0; i < sizeof(Sheet::name); ++i) { lcd_putc(menuData->name[i]); 18872: 89 91 ld r24, Y+ 18874: 0e 94 72 6f call 0xdee4 ; 0xdee4 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) 18878: 83 e0 ldi r24, 0x03 ; 3 1887a: cf 39 cpi r28, 0x9F ; 159 1887c: d8 07 cpc r29, r24 1887e: c9 f7 brne .-14 ; 0x18872 { lcd_putc(menuData->name[i]); } lcd_putc_at(menuData->selected, 1, '^'); 18880: 4e e5 ldi r20, 0x5E ; 94 18882: 61 e0 ldi r22, 0x01 ; 1 18884: 80 91 97 03 lds r24, 0x0397 ; 0x800397 18888: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 if (menuData->selected > 0) 1888c: 80 91 97 03 lds r24, 0x0397 ; 0x800397 18890: 88 23 and r24, r24 18892: 29 f0 breq .+10 ; 0x1889e { lcd_putc_at(menuData->selected-1, 1, ' '); 18894: 40 e2 ldi r20, 0x20 ; 32 18896: 61 e0 ldi r22, 0x01 ; 1 18898: 81 50 subi r24, 0x01 ; 1 1889a: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 } if (lcd_clicked()) 1889e: 0e 94 c6 73 call 0xe78c ; 0xe78c 188a2: 88 23 and r24, r24 188a4: 99 f0 breq .+38 ; 0x188cc { if ((menuData->selected + 1u) < sizeof(Sheet::name)) 188a6: e0 91 97 03 lds r30, 0x0397 ; 0x800397 188aa: 8e 2f mov r24, r30 188ac: 90 e0 ldi r25, 0x00 ; 0 188ae: 01 96 adiw r24, 0x01 ; 1 188b0: 07 97 sbiw r24, 0x07 ; 7 188b2: 78 f4 brcc .+30 ; 0x188d2 { lcd_encoder = menuData->name[++(menuData->selected)]; 188b4: ef 5f subi r30, 0xFF ; 255 188b6: e0 93 97 03 sts 0x0397, r30 ; 0x800397 188ba: f0 e0 ldi r31, 0x00 ; 0 188bc: ea 56 subi r30, 0x6A ; 106 188be: fc 4f sbci r31, 0xFC ; 252 188c0: 82 81 ldd r24, Z+2 ; 0x02 188c2: 90 e0 ldi r25, 0x00 ; 0 188c4: 90 93 1f 06 sts 0x061F, r25 ; 0x80061f 188c8: 80 93 1e 06 sts 0x061E, r24 ; 0x80061e EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 188cc: df 91 pop r29 188ce: cf 91 pop r28 188d0: 08 95 ret { lcd_encoder = menuData->name[++(menuData->selected)]; } else { eeprom_update_block_notify(menuData->name, 188d2: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 188d6: 8b e0 ldi r24, 0x0B ; 11 188d8: 68 9f mul r22, r24 188da: b0 01 movw r22, r0 188dc: 11 24 eor r1, r1 188de: 67 5b subi r22, 0xB7 ; 183 188e0: 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); 188e2: 47 e0 ldi r20, 0x07 ; 7 188e4: 50 e0 ldi r21, 0x00 ; 0 188e6: 88 e9 ldi r24, 0x98 ; 152 188e8: 93 e0 ldi r25, 0x03 ; 3 188ea: 0f 94 95 a4 call 0x3492a ; 0x3492a EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); } } } 188ee: df 91 pop r29 188f0: cf 91 pop r28 else { eeprom_update_block_notify(menuData->name, EEPROM_Sheets_base->s[selected_sheet].name, sizeof(Sheet::name)); menu_back(); 188f2: 0c 94 6c 63 jmp 0xc6d8 ; 0xc6d8 000188f6 : //! |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() { 188f6: 2f 92 push r2 188f8: 3f 92 push r3 188fa: 4f 92 push r4 188fc: 5f 92 push r5 188fe: 6f 92 push r6 18900: 7f 92 push r7 18902: 8f 92 push r8 18904: 9f 92 push r9 18906: af 92 push r10 18908: bf 92 push r11 1890a: cf 92 push r12 1890c: df 92 push r13 1890e: ef 92 push r14 18910: ff 92 push r15 18912: 0f 93 push r16 18914: 1f 93 push r17 18916: cf 93 push r28 18918: df 93 push r29 1891a: cd b7 in r28, 0x3d ; 61 1891c: de b7 in r29, 0x3e ; 62 1891e: a8 97 sbiw r28, 0x28 ; 40 18920: 0f b6 in r0, 0x3f ; 63 18922: f8 94 cli 18924: de bf out 0x3e, r29 ; 62 18926: 0f be out 0x3f, r0 ; 63 18928: 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); 1892a: 48 e0 ldi r20, 0x08 ; 8 1892c: 50 e0 ldi r21, 0x00 ; 0 1892e: 65 ee ldi r22, 0xE5 ; 229 18930: 7f e0 ldi r23, 0x0F ; 15 18932: ce 01 movw r24, r28 18934: 41 96 adiw r24, 0x11 ; 17 18936: 0f 94 71 a4 call 0x348e2 ; 0x348e2 eeprom_read_block(&vec_x[0], (float*)(EEPROM_BED_CALIBRATION_VEC_X), 8); 1893a: 48 e0 ldi r20, 0x08 ; 8 1893c: 50 e0 ldi r21, 0x00 ; 0 1893e: 6d ed ldi r22, 0xDD ; 221 18940: 7f e0 ldi r23, 0x0F ; 15 18942: ce 01 movw r24, r28 18944: 09 96 adiw r24, 0x09 ; 9 18946: 0f 94 71 a4 call 0x348e2 ; 0x348e2 eeprom_read_block(&vec_y[0], (float*)(EEPROM_BED_CALIBRATION_VEC_Y), 8); 1894a: 48 e0 ldi r20, 0x08 ; 8 1894c: 50 e0 ldi r21, 0x00 ; 0 1894e: 65 ed ldi r22, 0xD5 ; 213 18950: 7f e0 ldi r23, 0x0F ; 15 18952: ce 01 movw r24, r28 18954: 01 96 adiw r24, 0x01 ; 1 18956: 0f 94 71 a4 call 0x348e2 ; 0x348e2 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]; 1895a: 8d 84 ldd r8, Y+13 ; 0x0d 1895c: 9e 84 ldd r9, Y+14 ; 0x0e 1895e: af 84 ldd r10, Y+15 ; 0x0f 18960: b8 88 ldd r11, Y+16 ; 0x10 18962: e1 e0 ldi r30, 0x01 ; 1 18964: fd e9 ldi r31, 0x9D ; 157 18966: 25 91 lpm r18, Z+ 18968: 35 91 lpm r19, Z+ 1896a: 45 91 lpm r20, Z+ 1896c: 54 91 lpm r21, Z 1896e: cd 80 ldd r12, Y+5 ; 0x05 18970: de 80 ldd r13, Y+6 ; 0x06 18972: ef 80 ldd r14, Y+7 ; 0x07 18974: f8 84 ldd r15, Y+8 ; 0x08 18976: e5 e0 ldi r30, 0x05 ; 5 18978: fd e9 ldi r31, 0x9D ; 157 1897a: 85 91 lpm r24, Z+ 1897c: 95 91 lpm r25, Z+ 1897e: a5 91 lpm r26, Z+ 18980: b4 91 lpm r27, Z 18982: 8d a3 std Y+37, r24 ; 0x25 18984: 9e a3 std Y+38, r25 ; 0x26 18986: af a3 std Y+39, r26 ; 0x27 18988: b8 a7 std Y+40, r27 ; 0x28 1898a: 8d 89 ldd r24, Y+21 ; 0x15 1898c: 9e 89 ldd r25, Y+22 ; 0x16 1898e: af 89 ldd r26, Y+23 ; 0x17 18990: b8 8d ldd r27, Y+24 ; 0x18 18992: 89 a3 std Y+33, r24 ; 0x21 18994: 9a a3 std Y+34, r25 ; 0x22 18996: ab a3 std Y+35, r26 ; 0x23 18998: bc a3 std Y+36, r27 ; 0x24 1899a: c5 01 movw r24, r10 1899c: b4 01 movw r22, r8 1899e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 189a2: 2b 01 movw r4, r22 189a4: 3c 01 movw r6, r24 189a6: 2d a1 ldd r18, Y+37 ; 0x25 189a8: 3e a1 ldd r19, Y+38 ; 0x26 189aa: 4f a1 ldd r20, Y+39 ; 0x27 189ac: 58 a5 ldd r21, Y+40 ; 0x28 189ae: c7 01 movw r24, r14 189b0: b6 01 movw r22, r12 189b2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 189b6: 9b 01 movw r18, r22 189b8: ac 01 movw r20, r24 189ba: c3 01 movw r24, r6 189bc: b2 01 movw r22, r4 189be: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 189c2: 29 a1 ldd r18, Y+33 ; 0x21 189c4: 3a a1 ldd r19, Y+34 ; 0x22 189c6: 4b a1 ldd r20, Y+35 ; 0x23 189c8: 5c a1 ldd r21, Y+36 ; 0x24 189ca: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 189ce: 20 e0 ldi r18, 0x00 ; 0 189d0: 30 e0 ldi r19, 0x00 ; 0 189d2: 40 e9 ldi r20, 0x90 ; 144 189d4: 50 e4 ldi r21, 0x40 ; 64 189d6: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 189da: 1b 01 movw r2, r22 189dc: 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]; 189de: e9 e0 ldi r30, 0x09 ; 9 189e0: fd e9 ldi r31, 0x9D ; 157 189e2: 25 91 lpm r18, Z+ 189e4: 35 91 lpm r19, Z+ 189e6: 45 91 lpm r20, Z+ 189e8: 54 91 lpm r21, Z 189ea: ed e0 ldi r30, 0x0D ; 13 189ec: fd e9 ldi r31, 0x9D ; 157 189ee: 45 90 lpm r4, Z+ 189f0: 55 90 lpm r5, Z+ 189f2: 65 90 lpm r6, Z+ 189f4: 74 90 lpm r7, Z 189f6: c5 01 movw r24, r10 189f8: b4 01 movw r22, r8 189fa: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 189fe: 4b 01 movw r8, r22 18a00: 5c 01 movw r10, r24 18a02: a3 01 movw r20, r6 18a04: 92 01 movw r18, r4 18a06: c7 01 movw r24, r14 18a08: b6 01 movw r22, r12 18a0a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 18a0e: 9b 01 movw r18, r22 18a10: ac 01 movw r20, r24 18a12: c5 01 movw r24, r10 18a14: b4 01 movw r22, r8 18a16: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 18a1a: 29 a1 ldd r18, Y+33 ; 0x21 18a1c: 3a a1 ldd r19, Y+34 ; 0x22 18a1e: 4b a1 ldd r20, Y+35 ; 0x23 18a20: 5c a1 ldd r21, Y+36 ; 0x24 18a22: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> distanceMin[mesh_point] = (y - Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 18a26: 20 e0 ldi r18, 0x00 ; 0 18a28: 30 e0 ldi r19, 0x00 ; 0 18a2a: 40 e9 ldi r20, 0x90 ; 144 18a2c: 50 e4 ldi r21, 0x40 ; 64 18a2e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 18a32: 6d 8f std Y+29, r22 ; 0x1d 18a34: 7e 8f std Y+30, r23 ; 0x1e 18a36: 8f 8f std Y+31, r24 ; 0x1f 18a38: 98 a3 std Y+32, r25 ; 0x20 float distanceMin[2]; count_xyz_details(distanceMin); lcd_home(); 18a3a: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 lcd_printf_P(_N( 18a3e: 8b e8 ldi r24, 0x8B ; 139 18a40: 9a e3 ldi r25, 0x3A ; 58 18a42: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18a46: d8 2e mov r13, r24 18a48: c9 2e mov r12, r25 18a4a: 84 e8 ldi r24, 0x84 ; 132 18a4c: 9a e3 ldi r25, 0x3A ; 58 18a4e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18a52: f8 2e mov r15, r24 18a54: e9 2e mov r14, r25 18a56: 8e e6 ldi r24, 0x6E ; 110 18a58: 9a e3 ldi r25, 0x3A ; 58 18a5a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18a5e: cf 92 push r12 18a60: df 92 push r13 18a62: ef 92 push r14 18a64: ff 92 push r15 18a66: 24 ec ldi r18, 0xC4 ; 196 18a68: 34 e8 ldi r19, 0x84 ; 132 18a6a: 3f 93 push r19 18a6c: 2f 93 push r18 18a6e: 9f 93 push r25 18a70: 8f 93 push r24 18a72: 86 e0 ldi r24, 0x06 ; 6 18a74: 98 e6 ldi r25, 0x68 ; 104 18a76: 9f 93 push r25 18a78: 8f 93 push r24 18a7a: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 18a7e: 62 e0 ldi r22, 0x02 ; 2 18a80: 8b e0 ldi r24, 0x0B ; 11 18a82: 0e 94 ab 6f call 0xdf56 ; 0xdf56 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 18a86: 0f b6 in r0, 0x3f ; 63 18a88: f8 94 cli 18a8a: de bf out 0x3e, r29 ; 62 18a8c: 0f be out 0x3f, r0 ; 63 18a8e: cd bf out 0x3d, r28 ; 61 18a90: 20 e0 ldi r18, 0x00 ; 0 18a92: 30 e0 ldi r19, 0x00 ; 0 18a94: 48 e4 ldi r20, 0x48 ; 72 18a96: 53 e4 ldi r21, 0x43 ; 67 18a98: 62 2d mov r22, r2 18a9a: 73 2d mov r23, r3 18a9c: 80 2f mov r24, r16 18a9e: 91 2f mov r25, r17 18aa0: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 18aa4: 87 ff sbrs r24, 7 18aa6: 51 c0 rjmp .+162 ; 0x18b4a else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 18aa8: 1f 93 push r17 18aaa: 0f 93 push r16 18aac: 3f 92 push r3 18aae: 2f 92 push r2 18ab0: 8e ef ldi r24, 0xFE ; 254 18ab2: 97 e6 ldi r25, 0x67 ; 103 18ab4: 9f 93 push r25 18ab6: 8f 93 push r24 18ab8: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 18abc: 0f 90 pop r0 18abe: 0f 90 pop r0 18ac0: 0f 90 pop r0 18ac2: 0f 90 pop r0 18ac4: 0f 90 pop r0 18ac6: 0f 90 pop r0 _T(MSG_LEFT), _T(MSG_RIGHT) ); for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(11,2+i); 18ac8: 63 e0 ldi r22, 0x03 ; 3 18aca: 8b e0 ldi r24, 0x0B ; 11 18acc: 0e 94 ab 6f call 0xdf56 ; 0xdf56 if (distanceMin[i] >= 200) lcd_puts_P(_T(MSG_NA)); 18ad0: 1d 8d ldd r17, Y+29 ; 0x1d 18ad2: 0e 8d ldd r16, Y+30 ; 0x1e 18ad4: ff 8c ldd r15, Y+31 ; 0x1f 18ad6: e8 a0 ldd r14, Y+32 ; 0x20 18ad8: 20 e0 ldi r18, 0x00 ; 0 18ada: 30 e0 ldi r19, 0x00 ; 0 18adc: 48 e4 ldi r20, 0x48 ; 72 18ade: 53 e4 ldi r21, 0x43 ; 67 18ae0: d8 01 movw r26, r16 18ae2: f7 01 movw r30, r14 18ae4: 6b 2f mov r22, r27 18ae6: 7a 2f mov r23, r26 18ae8: 8f 2f mov r24, r31 18aea: 9e 2f mov r25, r30 18aec: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 18af0: 87 fd sbrc r24, 7 18af2: 32 c0 rjmp .+100 ; 0x18b58 18af4: 8c e7 ldi r24, 0x7C ; 124 18af6: 98 e4 ldi r25, 0x48 ; 72 18af8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18afc: 0e 94 6e 6f call 0xdedc ; 0xdedc else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); } if (lcd_clicked()) 18b00: 0e 94 c6 73 call 0xe78c ; 0xe78c 18b04: 88 23 and r24, r24 18b06: 41 f0 breq .+16 ; 0x18b18 menu_goto(lcd_menu_xyz_skew, 0, true); 18b08: 20 e0 ldi r18, 0x00 ; 0 18b0a: 41 e0 ldi r20, 0x01 ; 1 18b0c: 70 e0 ldi r23, 0x00 ; 0 18b0e: 60 e0 ldi r22, 0x00 ; 0 18b10: 8b e1 ldi r24, 0x1B ; 27 18b12: 9f ec ldi r25, 0xCF ; 207 18b14: 0e 94 08 63 call 0xc610 ; 0xc610 } 18b18: a8 96 adiw r28, 0x28 ; 40 18b1a: 0f b6 in r0, 0x3f ; 63 18b1c: f8 94 cli 18b1e: de bf out 0x3e, r29 ; 62 18b20: 0f be out 0x3f, r0 ; 63 18b22: cd bf out 0x3d, r28 ; 61 18b24: df 91 pop r29 18b26: cf 91 pop r28 18b28: 1f 91 pop r17 18b2a: 0f 91 pop r16 18b2c: ff 90 pop r15 18b2e: ef 90 pop r14 18b30: df 90 pop r13 18b32: cf 90 pop r12 18b34: bf 90 pop r11 18b36: af 90 pop r10 18b38: 9f 90 pop r9 18b3a: 8f 90 pop r8 18b3c: 7f 90 pop r7 18b3e: 6f 90 pop r6 18b40: 5f 90 pop r5 18b42: 4f 90 pop r4 18b44: 3f 90 pop r3 18b46: 2f 90 pop r2 18b48: 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)); 18b4a: 8c e7 ldi r24, 0x7C ; 124 18b4c: 98 e4 ldi r25, 0x48 ; 72 18b4e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18b52: 0e 94 6e 6f call 0xdedc ; 0xdedc 18b56: b8 cf rjmp .-144 ; 0x18ac8 else lcd_printf_P(_N("%6.2fmm"), distanceMin[i]); 18b58: ef 92 push r14 18b5a: ff 92 push r15 18b5c: 0f 93 push r16 18b5e: 1f 93 push r17 18b60: 8e ef ldi r24, 0xFE ; 254 18b62: 97 e6 ldi r25, 0x67 ; 103 18b64: 9f 93 push r25 18b66: 8f 93 push r24 18b68: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 18b6c: 0f 90 pop r0 18b6e: 0f 90 pop r0 18b70: 0f 90 pop r0 18b72: 0f 90 pop r0 18b74: 0f 90 pop r0 18b76: 0f 90 pop r0 18b78: c3 cf rjmp .-122 ; 0x18b00 00018b7a : else value = !value; eeprom_update_byte_notify((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, value); } void lcd_reprint_from_eeprom() { 18b7a: ef 92 push r14 18b7c: ff 92 push r15 18b7e: 0f 93 push r16 18b80: 1f 93 push r17 18b82: cf 93 push r28 18b84: df 93 push r29 18b86: cd b7 in r28, 0x3d ; 61 18b88: de b7 in r29, 0x3e ; 62 18b8a: 6b 97 sbiw r28, 0x1b ; 27 18b8c: 0f b6 in r0, 0x3f ; 63 18b8e: f8 94 cli 18b90: de bf out 0x3e, r29 ; 62 18b92: 0f be out 0x3f, r0 ; 63 18b94: 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); 18b96: 8a e5 ldi r24, 0x5A ; 90 18b98: 9f e0 ldi r25, 0x0F ; 15 18b9a: 0f 94 81 a4 call 0x34902 ; 0x34902 18b9e: e8 2e mov r14, r24 18ba0: 0a e0 ldi r16, 0x0A ; 10 18ba2: 1f e0 ldi r17, 0x0F ; 15 for (uint8_t i = 0; i < depth; i++) { 18ba4: 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); 18ba6: 48 e0 ldi r20, 0x08 ; 8 18ba8: 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++) { 18baa: ef 14 cp r14, r15 18bac: 79 f0 breq .+30 ; 0x18bcc eeprom_read_block(dir_name, (const char *)EEPROM_DIRS + 8 * i, 8); 18bae: b8 01 movw r22, r16 18bb0: ce 01 movw r24, r28 18bb2: 0e 96 adiw r24, 0x0e ; 14 18bb4: 0f 94 71 a4 call 0x348e2 ; 0x348e2 dir_name[8] = '\0'; 18bb8: 1e 8a std Y+22, r1 ; 0x16 card.chdir(dir_name, false); 18bba: 60 e0 ldi r22, 0x00 ; 0 18bbc: ce 01 movw r24, r28 18bbe: 0e 96 adiw r24, 0x0e ; 14 18bc0: 0f 94 5a 70 call 0x2e0b4 ; 0x2e0b4 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++) { 18bc4: f3 94 inc r15 18bc6: 08 5f subi r16, 0xF8 ; 248 18bc8: 1f 4f sbci r17, 0xFF ; 255 18bca: ed cf rjmp .-38 ; 0x18ba6 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); 18bcc: 65 e9 ldi r22, 0x95 ; 149 18bce: 7f e0 ldi r23, 0x0F ; 15 18bd0: 8e 01 movw r16, r28 18bd2: 0f 5f subi r16, 0xFF ; 255 18bd4: 1f 4f sbci r17, 0xFF ; 255 18bd6: c8 01 movw r24, r16 18bd8: 0f 94 71 a4 call 0x348e2 ; 0x348e2 // Add null delimiter in case all 8 characters were not NULL filename[8] = '\0'; 18bdc: 19 86 std Y+9, r1 ; 0x09 // Add extension to complete the DOS 8.3 filename e.g. ".gco" or ".g" extension_ptr[0] = '.'; 18bde: 8e e2 ldi r24, 0x2E ; 46 18be0: 8f 8b std Y+23, r24 ; 0x17 eeprom_read_block(&extension_ptr[1], (const char *)EEPROM_FILENAME_EXTENSION, 3); 18be2: 43 e0 ldi r20, 0x03 ; 3 18be4: 50 e0 ldi r21, 0x00 ; 0 18be6: 61 e9 ldi r22, 0x91 ; 145 18be8: 7c e0 ldi r23, 0x0C ; 12 18bea: ce 01 movw r24, r28 18bec: 48 96 adiw r24, 0x18 ; 24 18bee: 0f 94 71 a4 call 0x348e2 ; 0x348e2 extension_ptr[4] = '\0'; 18bf2: 1b 8e std Y+27, r1 ; 0x1b strcat(filename, extension_ptr); 18bf4: be 01 movw r22, r28 18bf6: 69 5e subi r22, 0xE9 ; 233 18bf8: 7f 4f sbci r23, 0xFF ; 255 18bfa: c8 01 movw r24, r16 18bfc: 0f 94 cd aa call 0x3559a ; 0x3559a enquecommandf_P(MSG_M23, filename); 18c00: 1f 93 push r17 18c02: 0f 93 push r16 18c04: 8b e0 ldi r24, 0x0B ; 11 18c06: 9d e6 ldi r25, 0x6D ; 109 18c08: 9f 93 push r25 18c0a: 8f 93 push r24 18c0c: 0e 94 28 8e call 0x11c50 ; 0x11c50 restore_file_from_sd(); // M24: Start/resume SD print enquecommand_P(MSG_M24); 18c10: 61 e0 ldi r22, 0x01 ; 1 18c12: 87 e0 ldi r24, 0x07 ; 7 18c14: 9d e6 ldi r25, 0x6D ; 109 18c16: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 lcd_return_to_status(); 18c1a: 0f 94 6e 05 call 0x20adc ; 0x20adc 18c1e: 0f 90 pop r0 18c20: 0f 90 pop r0 18c22: 0f 90 pop r0 18c24: 0f 90 pop r0 } 18c26: 6b 96 adiw r28, 0x1b ; 27 18c28: 0f b6 in r0, 0x3f ; 63 18c2a: f8 94 cli 18c2c: de bf out 0x3e, r29 ; 62 18c2e: 0f be out 0x3f, r0 ; 63 18c30: cd bf out 0x3d, r28 ; 61 18c32: df 91 pop r29 18c34: cf 91 pop r28 18c36: 1f 91 pop r17 18c38: 0f 91 pop r16 18c3a: ff 90 pop r15 18c3c: ef 90 pop r14 18c3e: 08 95 ret 00018c40 : MENU_END(); } #ifdef PINDA_TEMP_COMP void lcd_pinda_temp_compensation_toggle() { 18c40: cf 93 push r28 uint8_t pinda_temp_compensation = eeprom_read_byte((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION); 18c42: 89 e2 ldi r24, 0x29 ; 41 18c44: 9d e0 ldi r25, 0x0D ; 13 18c46: 0f 94 81 a4 call 0x34902 ; 0x34902 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; 18c4a: 81 50 subi r24, 0x01 ; 1 18c4c: c1 e0 ldi r28, 0x01 ; 1 18c4e: 8e 3f cpi r24, 0xFE ; 254 18c50: 08 f4 brcc .+2 ; 0x18c54 18c52: 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); 18c54: 6c 2f mov r22, r28 18c56: 89 e2 ldi r24, 0x29 ; 41 18c58: 9d e0 ldi r25, 0x0D ; 13 18c5a: 0f 94 a5 a4 call 0x3494a ; 0x3494a eeprom_update_byte_notify((uint8_t*)EEPROM_PINDA_TEMP_COMPENSATION, pinda_temp_compensation); SERIAL_ECHOLNPGM("SuperPINDA:"); 18c5e: 89 ed ldi r24, 0xD9 ; 217 18c60: 94 e8 ldi r25, 0x84 ; 132 18c62: 0e 94 0e 7d call 0xfa1c ; 0xfa1c } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 18c66: 8c 2f mov r24, r28 18c68: 0e 94 02 7a call 0xf404 ; 0xf404 SERIAL_ECHOLN(pinda_temp_compensation); } 18c6c: cf 91 pop r28 } void MarlinSerial::println(unsigned char b, int base) { print(b, base); println(); 18c6e: 0c 94 0d 7b jmp 0xf61a ; 0xf61a 00018c72 : } 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); 18c72: 22 ed ldi r18, 0xD2 ; 210 18c74: 30 e0 ldi r19, 0x00 ; 0 18c76: 50 e0 ldi r21, 0x00 ; 0 18c78: 40 e0 ldi r20, 0x00 ; 0 18c7a: 62 e0 ldi r22, 0x02 ; 2 18c7c: 87 e4 ldi r24, 0x47 ; 71 18c7e: 93 e8 ldi r25, 0x83 ; 131 18c80: 0d 94 40 4a jmp 0x29480 ; 0x29480 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]> 00018c84 : } // 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); 18c84: 2a ef ldi r18, 0xFA ; 250 18c86: 30 e0 ldi r19, 0x00 ; 0 18c88: 50 e0 ldi r21, 0x00 ; 0 18c8a: 40 e0 ldi r20, 0x00 ; 0 18c8c: 60 e0 ldi r22, 0x00 ; 0 18c8e: 81 e4 ldi r24, 0x41 ; 65 18c90: 93 e8 ldi r25, 0x83 ; 131 18c92: 0d 94 40 4a jmp 0x29480 ; 0x29480 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]> 00018c96 : } static void lcd_move_y() { _lcd_move(PSTR("Y:"), Y_AXIS, Y_MIN_POS, Y_MAX_POS); 18c96: 22 ed ldi r18, 0xD2 ; 210 18c98: 30 e0 ldi r19, 0x00 ; 0 18c9a: 4c ef ldi r20, 0xFC ; 252 18c9c: 5f ef ldi r21, 0xFF ; 255 18c9e: 61 e0 ldi r22, 0x01 ; 1 18ca0: 84 e4 ldi r24, 0x44 ; 68 18ca2: 93 e8 ldi r25, 0x83 ; 131 18ca4: 0d 94 40 4a jmp 0x29480 ; 0x29480 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]> 00018ca8 : { return lcd_status_message_level; } void menu_lcd_longpress_func(void) { 18ca8: cf 93 push r28 18caa: df 93 push r29 // Wake up the LCD backlight and, // start LCD inactivity timer lcd_timeoutToStatus.start(); 18cac: 83 ee ldi r24, 0xE3 ; 227 18cae: 93 e0 ldi r25, 0x03 ; 3 18cb0: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> if (homing_flag || mesh_bed_leveling_flag || menu_menu == lcd_babystep_z || menu_menu == lcd_move_z || menu_is_any_block() || Stopped) 18cb4: 80 91 71 12 lds r24, 0x1271 ; 0x801271 18cb8: 81 11 cpse r24, r1 18cba: 18 c0 rjmp .+48 ; 0x18cec 18cbc: 80 91 72 12 lds r24, 0x1272 ; 0x801272 18cc0: 81 11 cpse r24, r1 18cc2: 14 c0 rjmp .+40 ; 0x18cec 18cc4: c0 91 02 04 lds r28, 0x0402 ; 0x800402 18cc8: d0 91 03 04 lds r29, 0x0403 ; 0x800403 18ccc: 85 ed ldi r24, 0xD5 ; 213 18cce: c0 35 cpi r28, 0x50 ; 80 18cd0: d8 07 cpc r29, r24 18cd2: 61 f0 breq .+24 ; 0x18cec 18cd4: 86 ec ldi r24, 0xC6 ; 198 18cd6: c9 33 cpi r28, 0x39 ; 57 18cd8: d8 07 cpc r29, r24 18cda: 41 f0 breq .+16 ; 0x18cec 18cdc: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 18ce0: 81 11 cpse r24, r1 18ce2: 04 c0 rjmp .+8 ; 0x18cec 18ce4: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 18ce8: 88 23 and r24, r24 18cea: 31 f0 breq .+12 ; 0x18cf8 { // disable longpress during re-entry, while homing, calibration or if a serious error lcd_draw_update = 2; 18cec: 82 e0 ldi r24, 0x02 ; 2 18cee: 80 93 59 02 sts 0x0259, r24 ; 0x800259 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18cf2: df 91 pop r29 18cf4: cf 91 pop r28 18cf6: 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) 18cf8: 8f eb ldi r24, 0xBF ; 191 18cfa: c4 34 cpi r28, 0x44 ; 68 18cfc: d8 07 cpc r29, r24 18cfe: 81 f4 brne .+32 ; 0x18d20 { // only toggle the experimental menu visibility flag lcd_draw_update = 2; 18d00: 82 e0 ldi r24, 0x02 ; 2 18d02: 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)); 18d06: 8a e2 ldi r24, 0x2A ; 42 18d08: 9d e0 ldi r25, 0x0D ; 13 18d0a: 0f 94 81 a4 call 0x34902 ; 0x34902 18d0e: 61 e0 ldi r22, 0x01 ; 1 18d10: 81 11 cpse r24, r1 18d12: 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); 18d14: 8a e2 ldi r24, 0x2A ; 42 18d16: 9d e0 ldi r25, 0x0D ; 13 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18d18: df 91 pop r29 18d1a: cf 91 pop r28 18d1c: 0d 94 c9 a4 jmp 0x34992 ; 0x34992 18d20: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 18d24: 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 18d28: 98 13 cpse r25, r24 18d2a: 04 c0 rjmp .+8 ; 0x18d34 18d2c: 0e 94 91 66 call 0xcd22 ; 0xcd22 18d30: 88 23 and r24, r24 18d32: 61 f0 breq .+24 ; 0x18d4c if ( babystep_allowed_strict() 18d34: 0e 94 cc 66 call 0xcd98 ; 0xcd98 && (menu_menu == lcd_status_screen // and in listed menus... 18d38: 81 11 cpse r24, r1 18d3a: 10 c0 rjmp .+32 ; 0x18d5c Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } void lcd_quick_feedback(void) { lcd_draw_update = 2; 18d3c: 82 e0 ldi r24, 0x02 ; 2 18d3e: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 18d42: 80 e0 ldi r24, 0x00 ; 0 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18d44: df 91 pop r29 18d46: cf 91 pop r28 18d48: 0d 94 3f 23 jmp 0x2467e ; 0x2467e menu_submenu(lcd_babystep_z); } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen 18d4c: 87 e3 ldi r24, 0x37 ; 55 18d4e: c2 34 cpi r28, 0x42 ; 66 18d50: d8 07 cpc r29, r24 18d52: e1 f4 brne .+56 ; 0x18d8c #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 18d54: 60 e0 ldi r22, 0x00 ; 0 18d56: 89 e3 ldi r24, 0x39 ; 57 18d58: 96 ec ldi r25, 0xC6 ; 198 18d5a: 14 c0 rjmp .+40 ; 0x18d84 // 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... 18d5c: 87 e3 ldi r24, 0x37 ; 55 18d5e: c2 34 cpi r28, 0x42 ; 66 18d60: d8 07 cpc r29, r24 18d62: 59 f0 breq .+22 ; 0x18d7a || menu_menu == lcd_main_menu 18d64: 86 ec ldi r24, 0xC6 ; 198 18d66: c3 3e cpi r28, 0xE3 ; 227 18d68: d8 07 cpc r29, r24 18d6a: 39 f0 breq .+14 ; 0x18d7a || menu_menu == lcd_tune_menu 18d6c: 8a ec ldi r24, 0xCA ; 202 18d6e: cf 30 cpi r28, 0x0F ; 15 18d70: d8 07 cpc r29, r24 18d72: 19 f0 breq .+6 ; 0x18d7a || menu_menu == lcd_support_menu 18d74: c8 54 subi r28, 0x48 ; 72 18d76: d7 43 sbci r29, 0x37 ; 55 18d78: 09 f7 brne .-62 ; 0x18d3c ) ){ lcd_clear(); 18d7a: 0e 94 77 70 call 0xe0ee ; 0xe0ee menu_submenu(lcd_babystep_z); 18d7e: 60 e0 ldi r22, 0x00 ; 0 18d80: 80 e5 ldi r24, 0x50 ; 80 18d82: 95 ed ldi r25, 0xD5 ; 213 menu_submenu(lcd_move_z); } else { lcd_quick_feedback(); } } } 18d84: df 91 pop r29 18d86: cf 91 pop r28 #if (LANG_MODE != 0) || menu_menu == lcd_language #endif || menu_menu == lcd_support_menu ){ menu_submenu(lcd_move_z); 18d88: 0c 94 2e 63 jmp 0xc65c ; 0xc65c } else { lcd_quick_feedback(); } } else { // long press as move-z if (menu_menu == lcd_status_screen || menu_menu == lcd_main_menu 18d8c: 86 ec ldi r24, 0xC6 ; 198 18d8e: c3 3e cpi r28, 0xE3 ; 227 18d90: d8 07 cpc r29, r24 18d92: 01 f3 breq .-64 ; 0x18d54 || menu_menu == lcd_preheat_menu 18d94: 87 e3 ldi r24, 0x37 ; 55 18d96: c4 38 cpi r28, 0x84 ; 132 18d98: d8 07 cpc r29, r24 18d9a: e1 f2 breq .-72 ; 0x18d54 || menu_menu == lcd_sdcard_menu 18d9c: 84 ee ldi r24, 0xE4 ; 228 18d9e: cd 32 cpi r28, 0x2D ; 45 18da0: d8 07 cpc r29, r24 18da2: c1 f2 breq .-80 ; 0x18d54 || menu_menu == lcd_settings_menu 18da4: 8a ec ldi r24, 0xCA ; 202 18da6: cd 3c cpi r28, 0xCD ; 205 18da8: d8 07 cpc r29, r24 18daa: a1 f2 breq .-88 ; 0x18d54 || menu_menu == lcd_control_temperature_menu 18dac: 89 ec ldi r24, 0xC9 ; 201 18dae: c6 33 cpi r28, 0x36 ; 54 18db0: d8 07 cpc r29, r24 18db2: 81 f2 breq .-96 ; 0x18d54 #if (LANG_MODE != 0) || menu_menu == lcd_language 18db4: 82 ec ldi r24, 0xC2 ; 194 18db6: c2 33 cpi r28, 0x32 ; 50 18db8: d8 07 cpc r29, r24 18dba: 61 f2 breq .-104 ; 0x18d54 #endif || menu_menu == lcd_support_menu 18dbc: c8 54 subi r28, 0x48 ; 72 18dbe: d7 43 sbci r29, 0x37 ; 55 18dc0: 09 f0 breq .+2 ; 0x18dc4 18dc2: bc cf rjmp .-136 ; 0x18d3c 18dc4: c7 cf rjmp .-114 ; 0x18d54 00018dc6 : //! | Fail stats | allways //! | Fail stats MMU | mmu //! | Support | allways //! @endcode static void lcd_main_menu() { 18dc6: 1f 93 push r17 18dc8: cf 93 push r28 18dca: df 93 push r29 MENU_BEGIN(); 18dcc: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 18dd0: 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); 18dd4: 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 18dd6: d1 e0 ldi r29, 0x01 ; 1 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 18dd8: 80 91 60 04 lds r24, 0x0460 ; 0x800460 18ddc: 84 30 cpi r24, 0x04 ; 4 18dde: 08 f0 brcs .+2 ; 0x18de2 18de0: 08 c2 rjmp .+1040 ; 0x191f2 18de2: 10 92 63 04 sts 0x0463, r1 ; 0x800463 // Majkl superawesome menu MENU_ITEM_BACK_P(_T(MSG_INFO_SCREEN)); 18de6: 80 e1 ldi r24, 0x10 ; 16 18de8: 98 e4 ldi r25, 0x48 ; 72 18dea: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18dee: 0e 94 1f 73 call 0xe63e ; 0xe63e 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)) { 18df2: 0e 94 e2 66 call 0xcdc4 ; 0xcdc4 18df6: 81 11 cpse r24, r1 18df8: 19 c0 rjmp .+50 ; 0x18e2c 18dfa: 0e 94 7c 66 call 0xccf8 ; 0xccf8 18dfe: 81 11 cpse r24, r1 18e00: 15 c0 rjmp .+42 ; 0x18e2c 18e02: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 18e06: 81 11 cpse r24, r1 18e08: 11 c0 rjmp .+34 ; 0x18e2c #include "printer_state.h" static PrinterState printer_state; PrinterState GetPrinterState() { return printer_state; 18e0a: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.384> if ((GetPrinterState() == PrinterState::SDPrintingFinished) && card.mounted) { 18e0e: 83 30 cpi r24, 0x03 ; 3 18e10: 09 f0 breq .+2 ; 0x18e14 18e12: 5d c0 rjmp .+186 ; 0x18ece 18e14: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 18e18: 88 23 and r24, r24 18e1a: 41 f0 breq .+16 ; 0x18e2c MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_reprint_from_eeprom); 18e1c: 86 e0 ldi r24, 0x06 ; 6 18e1e: 98 e4 ldi r25, 0x48 ; 72 18e20: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18e24: 6d eb ldi r22, 0xBD ; 189 18e26: 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); 18e28: 0e 94 ee 72 call 0xe5dc ; 0xe5dc } } // Menu is never shown when idle if (babystep_allowed_strict() && (printJobOngoing() || lcd_commands_type == LcdCommands::Layer1Cal)) 18e2c: 0e 94 cc 66 call 0xcd98 ; 0xcd98 18e30: 88 23 and r24, r24 18e32: 81 f0 breq .+32 ; 0x18e54 18e34: 0e 94 91 66 call 0xcd22 ; 0xcd22 18e38: 81 11 cpse r24, r1 18e3a: 04 c0 rjmp .+8 ; 0x18e44 18e3c: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 18e40: 84 30 cpi r24, 0x04 ; 4 18e42: 41 f4 brne .+16 ; 0x18e54 MENU_ITEM_SUBMENU_P(_T(MSG_BABYSTEP_Z), lcd_babystep_z);//8 18e44: 86 ef ldi r24, 0xF6 ; 246 18e46: 97 e4 ldi r25, 0x47 ; 71 18e48: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18e4c: 60 e5 ldi r22, 0x50 ; 80 18e4e: 75 ed ldi r23, 0xD5 ; 213 18e50: 0e 94 44 73 call 0xe688 ; 0xe688 if (farm_mode) 18e54: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 18e58: 88 23 and r24, r24 18e5a: 41 f0 breq .+16 ; 0x18e6c MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 18e5c: 8b e4 ldi r24, 0x4B ; 75 18e5e: 98 e4 ldi r25, 0x48 ; 72 18e60: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18e64: 6d e8 ldi r22, 0x8D ; 141 18e66: 7c ed ldi r23, 0xDC ; 220 18e68: 0e 94 ee 72 call 0xe5dc ; 0xe5dc if (!printer_recovering()) { 18e6c: 0e 94 7c 66 call 0xccf8 ; 0xccf8 18e70: 81 11 cpse r24, r1 18e72: 61 c0 rjmp .+194 ; 0x18f36 } //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); 18e74: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 18e78: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 18e7c: 89 1b sub r24, r25 18e7e: 8f 70 andi r24, 0x0F ; 15 if ( moves_planned() || printer_active() #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 18e80: a9 f5 brne .+106 ; 0x18eec if (farm_mode) MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change);//8 if (!printer_recovering()) { if ( moves_planned() || printer_active() 18e82: 0e 94 e2 66 call 0xcdc4 ; 0xcdc4 18e86: 81 11 cpse r24, r1 18e88: 31 c0 rjmp .+98 ; 0x18eec #ifdef FANCHECK || fan_check_error == EFCE_REPORTED 18e8a: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 18e8e: 82 30 cpi r24, 0x02 ; 2 18e90: 69 f1 breq .+90 ; 0x18eec #endif //End FANCHECK ) { MENU_ITEM_SUBMENU_P(_T(MSG_TUNE), lcd_tune_menu); } else if (!Stopped) { 18e92: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 18e96: 81 11 cpse r24, r1 18e98: 31 c0 rjmp .+98 ; 0x18efc MENU_ITEM_SUBMENU_P(_T(MSG_PREHEAT), lcd_preheat_menu); 18e9a: 85 ee ldi r24, 0xE5 ; 229 18e9c: 97 e4 ldi r25, 0x47 ; 71 18e9e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18ea2: 64 e8 ldi r22, 0x84 ; 132 18ea4: 77 e3 ldi r23, 0x37 ; 55 18ea6: 0e 94 44 73 call 0xe688 ; 0xe688 if (M79_timer_get_status()) { 18eaa: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.419> 18eae: 88 23 and r24, r24 18eb0: 29 f1 breq .+74 ; 0x18efc #ifndef REPLACE_SETREADY if(GetPrinterState() == PrinterState::IsReady) { 18eb2: 80 91 61 0d lds r24, 0x0D61 ; 0x800d61 <_ZL13printer_state.lto_priv.384> 18eb6: 81 30 cpi r24, 0x01 ; 1 18eb8: 09 f0 breq .+2 ; 0x18ebc 18eba: 45 c1 rjmp .+650 ; 0x19146 MENU_ITEM_FUNCTION_P(_T(MSG_SET_NOT_READY), lcd_printer_ready_state_toggle); 18ebc: 85 ed ldi r24, 0xD5 ; 213 18ebe: 97 e4 ldi r25, 0x47 ; 71 } else { MENU_ITEM_FUNCTION_P(_T(MSG_SET_READY), lcd_printer_ready_state_toggle); 18ec0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18ec4: 6c ea ldi r22, 0xAC ; 172 18ec6: 7c eb ldi r23, 0xBC ; 188 18ec8: 0e 94 ee 72 call 0xe5dc ; 0xe5dc 18ecc: 17 c0 rjmp .+46 ; 0x18efc // 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()) { 18ece: 84 30 cpi r24, 0x04 ; 4 18ed0: 09 f0 breq .+2 ; 0x18ed4 18ed2: ac cf rjmp .-168 ; 0x18e2c 18ed4: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.419> 18ed8: 88 23 and r24, r24 18eda: 09 f4 brne .+2 ; 0x18ede 18edc: a7 cf rjmp .-178 ; 0x18e2c MENU_ITEM_FUNCTION_P(_T(MSG_REPRINT), lcd_send_action_start); 18ede: 86 e0 ldi r24, 0x06 ; 6 18ee0: 98 e4 ldi r25, 0x48 ; 72 18ee2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18ee6: 66 ea ldi r22, 0xA6 ; 166 18ee8: 7c eb ldi r23, 0xBC ; 188 18eea: 9e cf rjmp .-196 ; 0x18e28 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); 18eec: 8f ee ldi r24, 0xEF ; 239 18eee: 97 e4 ldi r25, 0x47 ; 71 18ef0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18ef4: 6f e0 ldi r22, 0x0F ; 15 18ef6: 7a ec ldi r23, 0xCA ; 202 18ef8: 0e 94 44 73 call 0xe688 ; 0xe688 #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) { 18efc: c0 91 72 12 lds r28, 0x1272 ; 0x801272 18f00: 0e 94 86 66 call 0xcd0c ; 0xcd0c 18f04: c1 11 cpse r28, r1 18f06: 17 c0 rjmp .+46 ; 0x18f36 18f08: 90 91 71 12 lds r25, 0x1271 ; 0x801271 18f0c: 91 11 cpse r25, r1 18f0e: 13 c0 rjmp .+38 ; 0x18f36 18f10: 81 11 cpse r24, r1 18f12: 15 c0 rjmp .+42 ; 0x18f3e 18f14: 80 91 91 03 lds r24, 0x0391 ; 0x800391 18f18: 81 11 cpse r24, r1 18f1a: 0d c0 rjmp .+26 ; 0x18f36 if (usb_timer.running()) { 18f1c: 80 91 42 12 lds r24, 0x1242 ; 0x801242 18f20: 88 23 and r24, r24 18f22: 09 f4 brne .+2 ; 0x18f26 18f24: 13 c1 rjmp .+550 ; 0x1914c MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_usb_print); 18f26: 8b eb ldi r24, 0xBB ; 187 18f28: 97 e4 ldi r25, 0x47 ; 71 18f2a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18f2e: 60 ee ldi r22, 0xE0 ; 224 18f30: 77 e3 ldi r23, 0x37 ; 55 } else if (IS_SD_PRINTING) { MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 18f32: 0e 94 ee 72 call 0xe5dc ; 0xe5dc } } } if (printingIsPaused() 18f36: 0e 94 86 66 call 0xcd0c ; 0xcd0c && !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) { 18f3a: 88 23 and r24, r24 18f3c: f1 f0 breq .+60 ; 0x18f7a temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 18f3e: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> } } } if (printingIsPaused() // only allow resuming if hardware errors (temperature or fan) are cleared && !get_temp_error() 18f42: 81 11 cpse r24, r1 18f44: 1a c0 rjmp .+52 ; 0x18f7a #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18f46: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 18f4a: 82 30 cpi r24, 0x02 ; 2 18f4c: b1 f0 breq .+44 ; 0x18f7a #endif //FANCHECK && (saved_printing_type != PowerPanic::PRINT_TYPE_NONE || saved_printing) 18f4e: 80 91 79 02 lds r24, 0x0279 ; 0x800279 18f52: 82 30 cpi r24, 0x02 ; 2 18f54: 21 f4 brne .+8 ; 0x18f5e 18f56: 90 91 73 12 lds r25, 0x1273 ; 0x801273 18f5a: 99 23 and r25, r25 18f5c: 71 f0 breq .+28 ; 0x18f7a && custom_message_type != CustomMsg::Resuming) { 18f5e: 90 91 5d 06 lds r25, 0x065D ; 0x80065d 18f62: 98 30 cpi r25, 0x08 ; 8 18f64: 51 f0 breq .+20 ; 0x18f7a if (saved_printing_type == PowerPanic::PRINT_TYPE_SD) { 18f66: 81 11 cpse r24, r1 18f68: fd c0 rjmp .+506 ; 0x19164 MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_print); 18f6a: 8c ea ldi r24, 0xAC ; 172 18f6c: 97 e4 ldi r25, 0x47 ; 71 18f6e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18f72: 61 ea ldi r22, 0xA1 ; 161 18f74: 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); 18f76: 0e 94 44 73 call 0xe688 ; 0xe688 } } if((printJobOngoing() || printingIsPaused() || (printer_recovering())) 18f7a: 0e 94 91 66 call 0xcd22 ; 0xcd22 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 18f7e: 81 11 cpse r24, r1 18f80: 08 c0 rjmp .+16 ; 0x18f92 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())) 18f82: 0e 94 86 66 call 0xcd0c ; 0xcd0c 18f86: 81 11 cpse r24, r1 18f88: 04 c0 rjmp .+8 ; 0x18f92 18f8a: 0e 94 7c 66 call 0xccf8 ; 0xccf8 18f8e: 88 23 and r24, r24 18f90: 81 f0 breq .+32 ; 0x18fb2 && (custom_message_type != CustomMsg::MeshBedLeveling) && !processing_tcode) { 18f92: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 18f96: 81 30 cpi r24, 0x01 ; 1 18f98: 61 f0 breq .+24 ; 0x18fb2 18f9a: 80 91 91 03 lds r24, 0x0391 ; 0x800391 18f9e: 81 11 cpse r24, r1 18fa0: 08 c0 rjmp .+16 ; 0x18fb2 MENU_ITEM_SUBMENU_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop); 18fa2: 8d ea ldi r24, 0xAD ; 173 18fa4: 98 e4 ldi r25, 0x48 ; 72 18fa6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 18faa: 6e e0 ldi r22, 0x0E ; 14 18fac: 70 ec ldi r23, 0xC0 ; 192 18fae: 0e 94 44 73 call 0xe688 ; 0xe688 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() 18fb2: 0e 94 7c 66 call 0xccf8 ; 0xccf8 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18fb6: 81 11 cpse r24, r1 18fb8: 95 c0 rjmp .+298 ; 0x190e4 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() 18fba: 0e 94 e2 66 call 0xcdc4 ; 0xcdc4 18fbe: 81 11 cpse r24, r1 18fc0: 91 c0 rjmp .+290 ; 0x190e4 18fc2: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 18fc6: 81 11 cpse r24, r1 18fc8: 8d c0 rjmp .+282 ; 0x190e4 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 18fca: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 18fce: 82 30 cpi r24, 0x02 ; 2 18fd0: 09 f4 brne .+2 ; 0x18fd4 18fd2: 88 c0 rjmp .+272 ; 0x190e4 #endif //FANCHECK ) { #ifdef SDSUPPORT //!@todo SDSUPPORT undefined creates several issues in source code if (card.mounted 18fd4: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 18fd8: 81 11 cpse r24, r1 18fda: 05 c0 rjmp .+10 ; 0x18fe6 || lcd_commands_type != LcdCommands::Idle) { 18fdc: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 18fe0: 88 23 and r24, r24 18fe2: 09 f4 brne .+2 ; 0x18fe6 18fe4: ce c0 rjmp .+412 ; 0x19182 if (!card.isFileOpen()) { 18fe6: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 18fea: 81 11 cpse r24, r1 18fec: 12 c0 rjmp .+36 ; 0x19012 if (!usb_timer.running() && (lcd_commands_type == LcdCommands::Idle)) { 18fee: 80 91 42 12 lds r24, 0x1242 ; 0x801242 18ff2: 81 11 cpse r24, r1 18ff4: 0e c0 rjmp .+28 ; 0x19012 18ff6: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 18ffa: 81 11 cpse r24, r1 18ffc: 0a c0 rjmp .+20 ; 0x19012 bMain=true; // flag ('fake parameter') for 'lcd_sdcard_menu()' function 18ffe: d0 93 c9 03 sts 0x03C9, r29 ; 0x8003c9 MENU_ITEM_SUBMENU_P(_T(MSG_CARD_MENU), lcd_sdcard_menu); 19002: 8c e9 ldi r24, 0x9C ; 156 19004: 97 e4 ldi r25, 0x47 ; 71 19006: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1900a: 6d e2 ldi r22, 0x2D ; 45 1900c: 74 ee ldi r23, 0xE4 ; 228 1900e: 0e 94 44 73 call 0xe688 ; 0xe688 #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) { 19012: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19016: 81 11 cpse r24, r1 19018: 12 c0 rjmp .+36 ; 0x1903e const int8_t sheet = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 1901a: 81 ea ldi r24, 0xA1 ; 161 1901c: 9d e0 ldi r25, 0x0D ; 13 1901e: 0f 94 81 a4 call 0x34902 ; 0x34902 19022: c8 2f mov r28, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheet); 19024: 0e 94 e7 78 call 0xf1ce ; 0xf1ce if ((nextSheet >= 0) && (sheet != nextSheet)) { // show menu only if we have 2 or more sheets initialized 19028: 87 fd sbrc r24, 7 1902a: 09 c0 rjmp .+18 ; 0x1903e 1902c: c8 17 cp r28, r24 1902e: 39 f0 breq .+14 ; 0x1903e MENU_ITEM_FUNCTION_E(EEPROM_Sheets_base->s[sheet], eeprom_switch_to_next_sheet); 19030: c1 02 muls r28, r17 19032: c0 01 movw r24, r0 19034: 11 24 eor r1, r1 19036: 87 5b subi r24, 0xB7 ; 183 19038: 92 4f sbci r25, 0xF2 ; 242 1903a: 0e 94 18 bc call 0x17830 ; 0x17830 SETTINGS_NOZZLE; #endif //QUICK_NOZZLE_CHANGE } if (!((eFilamentAction != FilamentAction::None) || Stopped )) { 1903e: 80 91 94 03 lds r24, 0x0394 ; 0x800394 19042: 81 11 cpse r24, r1 19044: 4f c0 rjmp .+158 ; 0x190e4 19046: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 1904a: 81 11 cpse r24, r1 1904c: 4b c0 rjmp .+150 ; 0x190e4 if (MMU2::mmu2.Enabled()) { 1904e: 80 91 01 13 lds r24, 0x1301 ; 0x801301 19052: 81 30 cpi r24, 0x01 ; 1 19054: 09 f0 breq .+2 ; 0x19058 19056: 9e c0 rjmp .+316 ; 0x19194 if(!MMU2::mmu2.FindaDetectsFilament() && !fsensor.getFilamentPresent()) { 19058: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 1905c: 81 11 cpse r24, r1 1905e: 0c c0 rjmp .+24 ; 0x19078 19060: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 19064: 81 11 cpse r24, r1 19066: 08 c0 rjmp .+16 ; 0x19078 // 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); 19068: 8e e7 ldi r24, 0x7E ; 126 1906a: 97 e4 ldi r25, 0x47 ; 71 1906c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19070: 6a e7 ldi r22, 0x7A ; 122 19072: 7d ec ldi r23, 0xCD ; 205 19074: 0e 94 44 73 call 0xe688 ; 0xe688 } MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_TO_NOZZLE), lcd_mmuLoadFilament); 19078: 8d e6 ldi r24, 0x6D ; 109 1907a: 97 e4 ldi r25, 0x47 ; 71 1907c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19080: 61 eb ldi r22, 0xB1 ; 177 19082: 7d ec ldi r23, 0xCD ; 205 19084: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_mmuUnloadFilament); 19088: 8b e5 ldi r24, 0x5B ; 91 1908a: 97 e4 ldi r25, 0x47 ; 71 1908c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19090: 64 eb ldi r22, 0xB4 ; 180 19092: 7d ec ldi r23, 0xCD ; 205 19094: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_EJECT_FROM_MMU), lcd_mmuEjectFilament); 19098: 8e e9 ldi r24, 0x9E ; 158 1909a: 92 e6 ldi r25, 0x62 ; 98 1909c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 190a0: 67 eb ldi r22, 0xB7 ; 183 190a2: 7d ec ldi r23, 0xCD ; 205 190a4: 0e 94 44 73 call 0xe688 ; 0xe688 #ifdef MMU_HAS_CUTTER if (eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED) != 0) { 190a8: 8e ec ldi r24, 0xCE ; 206 190aa: 9e e0 ldi r25, 0x0E ; 14 190ac: 0f 94 81 a4 call 0x34902 ; 0x34902 190b0: 88 23 and r24, r24 190b2: 41 f0 breq .+16 ; 0x190c4 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); 190b4: 8f e8 ldi r24, 0x8F ; 143 190b6: 92 e6 ldi r25, 0x62 ; 98 190b8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 190bc: 6a eb ldi r22, 0xBA ; 186 190be: 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); 190c0: 0e 94 44 73 call 0xe688 ; 0xe688 #ifdef FILAMENT_SENSOR } #endif //FILAMENT_SENSOR } MENU_ITEM_SUBMENU_P(_T(MSG_SETTINGS), lcd_settings_menu); 190c4: 87 e9 ldi r24, 0x97 ; 151 190c6: 98 e4 ldi r25, 0x48 ; 72 190c8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 190cc: 6d ec ldi r22, 0xCD ; 205 190ce: 7a ec ldi r23, 0xCA ; 202 190d0: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_CALIBRATION), lcd_calibration_menu); 190d4: 89 e2 ldi r24, 0x29 ; 41 190d6: 97 e4 ldi r25, 0x47 ; 71 190d8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 190dc: 69 e2 ldi r22, 0x29 ; 41 190de: 7c ec ldi r23, 0xCC ; 204 190e0: 0e 94 44 73 call 0xe688 ; 0xe688 } } MENU_ITEM_SUBMENU_P(_T(MSG_STATISTICS), lcd_menu_statistics); 190e4: 8c e1 ldi r24, 0x1C ; 28 190e6: 97 e4 ldi r25, 0x47 ; 71 190e8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 190ec: 6a ea ldi r22, 0xAA ; 170 190ee: 77 e3 ldi r23, 0x37 ; 55 190f0: 0e 94 44 73 call 0xe688 ; 0xe688 #if defined(TMC2130) || defined(FILAMENT_SENSOR) MENU_ITEM_SUBMENU_P(_T(MSG_FAIL_STATS), lcd_menu_fails_stats); 190f4: 8f e0 ldi r24, 0x0F ; 15 190f6: 97 e4 ldi r25, 0x47 ; 71 190f8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 190fc: 64 e5 ldi r22, 0x54 ; 84 190fe: 78 e3 ldi r23, 0x38 ; 56 19100: 0e 94 44 73 call 0xe688 ; 0xe688 #endif if (MMU2::mmu2.Enabled()) { 19104: 80 91 01 13 lds r24, 0x1301 ; 0x801301 19108: 81 30 cpi r24, 0x01 ; 1 1910a: 41 f4 brne .+16 ; 0x1911c MENU_ITEM_SUBMENU_P(_T(MSG_MMU_FAIL_STATS), lcd_menu_fails_stats_mmu); 1910c: 8e ef ldi r24, 0xFE ; 254 1910e: 96 e4 ldi r25, 0x46 ; 70 19110: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19114: 66 e1 ldi r22, 0x16 ; 22 19116: 77 e3 ldi r23, 0x37 ; 55 19118: 0e 94 44 73 call 0xe688 ; 0xe688 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); 1911c: 84 ef ldi r24, 0xF4 ; 244 1911e: 96 e4 ldi r25, 0x46 ; 70 19120: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19124: 68 e4 ldi r22, 0x48 ; 72 19126: 77 e3 ldi r23, 0x37 ; 55 19128: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_END(); 1912c: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 //! | Support | allways //! @endcode static void lcd_main_menu() { MENU_BEGIN(); 19130: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19134: 8f 5f subi r24, 0xFF ; 255 19136: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1913a: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1913e: 8f 5f subi r24, 0xFF ; 255 19140: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19144: 49 ce rjmp .-878 ; 0x18dd8 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); 19146: 89 ec ldi r24, 0xC9 ; 201 19148: 97 e4 ldi r25, 0x47 ; 71 1914a: ba ce rjmp .-652 ; 0x18ec0 } } 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) { 1914c: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 19150: 88 23 and r24, r24 19152: 09 f4 brne .+2 ; 0x19156 19154: f0 ce rjmp .-544 ; 0x18f36 MENU_ITEM_FUNCTION_P(_T(MSG_PAUSE_PRINT), lcd_pause_print); 19156: 8b eb ldi r24, 0xBB ; 187 19158: 97 e4 ldi r25, 0x47 ; 71 1915a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1915e: 66 e7 ldi r22, 0x76 ; 118 19160: 77 e3 ldi r23, 0x37 ; 55 19162: e7 ce rjmp .-562 ; 0x18f32 #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())) { 19164: 81 30 cpi r24, 0x01 ; 1 19166: 09 f0 breq .+2 ; 0x1916a 19168: 08 cf rjmp .-496 ; 0x18f7a 1916a: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.419> 1916e: 88 23 and r24, r24 19170: 09 f4 brne .+2 ; 0x19174 19172: 03 cf rjmp .-506 ; 0x18f7a MENU_ITEM_SUBMENU_P(_T(MSG_RESUME_PRINT), lcd_resume_usb_print); 19174: 8c ea ldi r24, 0xAC ; 172 19176: 97 e4 ldi r25, 0x47 ; 71 19178: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1917c: 63 e7 ldi r22, 0x73 ; 115 1917e: 7c ed ldi r23, 0xDC ; 220 19180: fa ce rjmp .-524 ; 0x18f76 #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 19182: d0 93 c9 03 sts 0x03C9, r29 ; 0x8003c9 MENU_ITEM_BACK_P(_T(MSG_NO_CARD)); 19186: 8f e8 ldi r24, 0x8F ; 143 19188: 97 e4 ldi r25, 0x47 ; 71 1918a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1918e: 0e 94 1f 73 call 0xe63e ; 0xe63e 19192: 3f cf rjmp .-386 ; 0x19012 MENU_ITEM_SUBMENU_P(_T(MSG_CUT_FILAMENT), lcd_mmuCutFilament); } #endif //MMU_HAS_CUTTER } else { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled()) { 19194: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 19198: 88 23 and r24, r24 1919a: e1 f0 breq .+56 ; 0x191d4 if (!fsensor.getAutoLoadEnabled()) { 1919c: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 191a0: 81 11 cpse r24, r1 191a2: 08 c0 rjmp .+16 ; 0x191b4 MENU_ITEM_SUBMENU_P(_T(MSG_LOAD_FILAMENT), lcd_LoadFilament); 191a4: 8b e4 ldi r24, 0x4B ; 75 191a6: 97 e4 ldi r25, 0x47 ; 71 191a8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 191ac: 66 e4 ldi r22, 0x46 ; 70 191ae: 78 e3 ldi r23, 0x38 ; 56 191b0: 0e 94 44 73 call 0xe688 ; 0xe688 } if (!fsensor.getFilamentPresent()) { 191b4: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 191b8: 81 11 cpse r24, r1 191ba: 14 c0 rjmp .+40 ; 0x191e4 if (fsensor.getAutoLoadEnabled()) { 191bc: 80 91 f2 16 lds r24, 0x16F2 ; 0x8016f2 191c0: 88 23 and r24, r24 191c2: 09 f4 brne .+2 ; 0x191c6 191c4: 7f cf rjmp .-258 ; 0x190c4 MENU_ITEM_SUBMENU_P(_T(MSG_AUTOLOAD_FILAMENT), lcd_menu_AutoLoadFilament); 191c6: 87 e3 ldi r24, 0x37 ; 55 191c8: 97 e4 ldi r25, 0x47 ; 71 191ca: 0e 94 8b 75 call 0xeb16 ; 0xeb16 191ce: 66 e8 ldi r22, 0x86 ; 134 191d0: 77 e3 ldi r23, 0x37 ; 55 191d2: 76 cf rjmp .-276 ; 0x190c0 } 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); 191d4: 8b e4 ldi r24, 0x4B ; 75 191d6: 97 e4 ldi r25, 0x47 ; 71 191d8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 191dc: 66 e4 ldi r22, 0x46 ; 70 191de: 78 e3 ldi r23, 0x38 ; 56 191e0: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), lcd_unLoadFilament); 191e4: 8b e5 ldi r24, 0x5B ; 91 191e6: 97 e4 ldi r25, 0x47 ; 71 191e8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 191ec: 62 ef ldi r22, 0xF2 ; 242 191ee: 78 e3 ldi r23, 0x38 ; 56 191f0: 67 cf rjmp .-306 ; 0x190c0 #endif //HOST_SHUTOWN MENU_ITEM_SUBMENU_P(_T(MSG_SUPPORT), lcd_support_menu); MENU_END(); } 191f2: df 91 pop r29 191f4: cf 91 pop r28 191f6: 1f 91 pop r17 191f8: 08 95 ret 000191fa : } #endif // TMC2130 } } static void menuitems_temperature_common() { 191fa: ef 92 push r14 191fc: ff 92 push r15 191fe: 0f 93 push r16 19200: 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); 19202: 85 ee ldi r24, 0xE5 ; 229 19204: 94 e4 ldi r25, 0x44 ; 68 19206: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1920a: 28 ec ldi r18, 0xC8 ; 200 1920c: e2 2e mov r14, r18 1920e: f1 2c mov r15, r1 19210: 07 e2 ldi r16, 0x27 ; 39 19212: 11 e0 ldi r17, 0x01 ; 1 19214: 30 e0 ldi r19, 0x00 ; 0 19216: 20 e0 ldi r18, 0x00 ; 0 19218: 40 e1 ldi r20, 0x10 ; 16 1921a: 6d e5 ldi r22, 0x5D ; 93 1921c: 72 e1 ldi r23, 0x12 ; 18 1921e: 0e 94 bf 6f call 0xdf7e ; 0xdf7e #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); 19222: 8a ec ldi r24, 0xCA ; 202 19224: 94 e4 ldi r25, 0x44 ; 68 19226: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1922a: 32 e3 ldi r19, 0x32 ; 50 1922c: e3 2e mov r14, r19 1922e: f1 2c mov r15, r1 19230: 08 e7 ldi r16, 0x78 ; 120 19232: 10 e0 ldi r17, 0x00 ; 0 19234: 30 e0 ldi r19, 0x00 ; 0 19236: 20 e0 ldi r18, 0x00 ; 0 19238: 40 e1 ldi r20, 0x10 ; 16 1923a: 69 e5 ldi r22, 0x59 ; 89 1923c: 72 e1 ldi r23, 0x12 ; 18 1923e: 0e 94 bf 6f call 0xdf7e ; 0xdf7e #endif MENU_ITEM_EDIT_int3_jmp_P(_T(MSG_FAN_SPEED), &fanSpeed, 0, 255, LCD_JUMP_FAN_SPEED); 19242: 8e eb ldi r24, 0xBE ; 190 19244: 94 e4 ldi r25, 0x44 ; 68 19246: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1924a: 4f e7 ldi r20, 0x7F ; 127 1924c: e4 2e mov r14, r20 1924e: f1 2c mov r15, r1 19250: 0f ef ldi r16, 0xFF ; 255 19252: 10 e0 ldi r17, 0x00 ; 0 19254: 30 e0 ldi r19, 0x00 ; 0 19256: 20 e0 ldi r18, 0x00 ; 0 19258: 48 e0 ldi r20, 0x08 ; 8 1925a: 65 e5 ldi r22, 0x55 ; 85 1925c: 72 e1 ldi r23, 0x12 ; 18 1925e: 0e 94 bf 6f call 0xdf7e ; 0xdf7e } 19262: 1f 91 pop r17 19264: 0f 91 pop r16 19266: ff 90 pop r15 19268: ef 90 pop r14 1926a: 08 95 ret 0001926c : } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 1926c: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 19270: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19274: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19278: 84 30 cpi r24, 0x04 ; 4 1927a: b8 f4 brcc .+46 ; 0x192aa 1927c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); 19280: 87 e9 ldi r24, 0x97 ; 151 19282: 98 e4 ldi r25, 0x48 ; 72 19284: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19288: 0e 94 1f 73 call 0xe63e ; 0xe63e menuitems_temperature_common(); 1928c: 0e 94 fd c8 call 0x191fa ; 0x191fa MENU_END(); 19290: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 } #endif //LCD_BL_PIN static void lcd_control_temperature_menu() { MENU_BEGIN(); 19294: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19298: 8f 5f subi r24, 0xFF ; 255 1929a: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1929e: 80 91 62 04 lds r24, 0x0462 ; 0x800462 192a2: 8f 5f subi r24, 0xFF ; 255 192a4: 80 93 62 04 sts 0x0462, r24 ; 0x800462 192a8: e5 cf rjmp .-54 ; 0x19274 MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); menuitems_temperature_common(); MENU_END(); } 192aa: 08 95 ret 000192ac : //! |Rear side [µm]: | MSG_BED_CORRECTION_REAR //! |Reset | MSG_BED_CORRECTION_RESET //! ---------------------- //! @endcode void lcd_adjust_bed(void) { 192ac: ef 92 push r14 192ae: ff 92 push r15 192b0: 0f 93 push r16 192b2: 1f 93 push r17 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); if (_md->status == 0) 192b4: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 192b8: 81 11 cpse r24, r1 192ba: 35 c0 rjmp .+106 ; 0x19326 { // Menu was entered. if (eeprom_read_byte((unsigned char*)EEPROM_BED_CORRECTION_VALID) == 1) 192bc: 80 ec ldi r24, 0xC0 ; 192 192be: 9f e0 ldi r25, 0x0F ; 15 192c0: 0f 94 81 a4 call 0x34902 ; 0x34902 192c4: 81 30 cpi r24, 0x01 ; 1 192c6: 61 f5 brne .+88 ; 0x19320 { _md->left = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_LEFT); 192c8: 8f eb ldi r24, 0xBF ; 191 192ca: 9f e0 ldi r25, 0x0F ; 15 192cc: 0f 94 81 a4 call 0x34902 ; 0x34902 192d0: 08 2e mov r0, r24 192d2: 00 0c add r0, r0 192d4: 99 0b sbc r25, r25 192d6: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 192da: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 _md->right = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_RIGHT); 192de: 8e eb ldi r24, 0xBE ; 190 192e0: 9f e0 ldi r25, 0x0F ; 15 192e2: 0f 94 81 a4 call 0x34902 ; 0x34902 192e6: 08 2e mov r0, r24 192e8: 00 0c add r0, r0 192ea: 99 0b sbc r25, r25 192ec: 90 93 a7 03 sts 0x03A7, r25 ; 0x8003a7 192f0: 80 93 a6 03 sts 0x03A6, r24 ; 0x8003a6 _md->front = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_FRONT); 192f4: 8d eb ldi r24, 0xBD ; 189 192f6: 9f e0 ldi r25, 0x0F ; 15 192f8: 0f 94 81 a4 call 0x34902 ; 0x34902 192fc: 08 2e mov r0, r24 192fe: 00 0c add r0, r0 19300: 99 0b sbc r25, r25 19302: 90 93 a9 03 sts 0x03A9, r25 ; 0x8003a9 19306: 80 93 a8 03 sts 0x03A8, r24 ; 0x8003a8 _md->rear = (int8_t)eeprom_read_byte((uint8_t*)EEPROM_BED_CORRECTION_REAR); 1930a: 8c eb ldi r24, 0xBC ; 188 1930c: 9f e0 ldi r25, 0x0F ; 15 1930e: 0f 94 81 a4 call 0x34902 ; 0x34902 19312: 08 2e mov r0, r24 19314: 00 0c add r0, r0 19316: 99 0b sbc r25, r25 19318: 90 93 ab 03 sts 0x03AB, r25 ; 0x8003ab 1931c: 80 93 aa 03 sts 0x03AA, r24 ; 0x8003aa } _md->status = 1; 19320: 81 e0 ldi r24, 0x01 ; 1 19322: 80 93 a3 03 sts 0x03A3, r24 ; 0x8003a3 } MENU_BEGIN(); 19326: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 1932a: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1932e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19332: 84 30 cpi r24, 0x04 ; 4 19334: 08 f0 brcs .+2 ; 0x19338 19336: 6e c0 rjmp .+220 ; 0x19414 19338: 10 92 63 04 sts 0x0463, r1 ; 0x800463 // leaving menu - this condition must be immediately before MENU_ITEM_BACK_P ON_MENU_LEAVE( 1933c: 0e 94 9d 62 call 0xc53a ; 0xc53a 19340: 88 23 and r24, r24 19342: e9 f0 breq .+58 ; 0x1937e if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 19344: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 19348: 8f eb ldi r24, 0xBF ; 191 1934a: 9f e0 ldi r25, 0x0F ; 15 1934c: 0f 94 a5 a4 call 0x3494a ; 0x3494a 19350: 60 91 a8 03 lds r22, 0x03A8 ; 0x8003a8 19354: 8d eb ldi r24, 0xBD ; 189 19356: 9f e0 ldi r25, 0x0F ; 15 19358: 0f 94 a5 a4 call 0x3494a ; 0x3494a 1935c: 60 91 aa 03 lds r22, 0x03AA ; 0x8003aa 19360: 8c eb ldi r24, 0xBC ; 188 19362: 9f e0 ldi r25, 0x0F ; 15 19364: 0f 94 a5 a4 call 0x3494a ; 0x3494a 19368: 60 91 a6 03 lds r22, 0x03A6 ; 0x8003a6 1936c: 8e eb ldi r24, 0xBE ; 190 1936e: 9f e0 ldi r25, 0x0F ; 15 19370: 0f 94 a5 a4 call 0x3494a ; 0x3494a 19374: 61 e0 ldi r22, 0x01 ; 1 19376: 80 ec ldi r24, 0xC0 ; 192 19378: 9f e0 ldi r25, 0x0F ; 15 1937a: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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)); 1937e: 82 e0 ldi r24, 0x02 ; 2 19380: 9b e4 ldi r25, 0x4B ; 75 19382: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19386: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_LEFT), &_md->left, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 1938a: 85 e1 ldi r24, 0x15 ; 21 1938c: 9b e3 ldi r25, 0x3B ; 59 1938e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19392: f1 2c mov r15, r1 19394: e1 2c mov r14, r1 19396: 04 e6 ldi r16, 0x64 ; 100 19398: 10 e0 ldi r17, 0x00 ; 0 1939a: 2c e9 ldi r18, 0x9C ; 156 1939c: 3f ef ldi r19, 0xFF ; 255 1939e: 40 e1 ldi r20, 0x10 ; 16 193a0: 64 ea ldi r22, 0xA4 ; 164 193a2: 73 e0 ldi r23, 0x03 ; 3 193a4: 0e 94 bf 6f call 0xdf7e ; 0xdf7e MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_RIGHT), &_md->right, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 193a8: 84 e0 ldi r24, 0x04 ; 4 193aa: 9b e3 ldi r25, 0x3B ; 59 193ac: 0e 94 8b 75 call 0xeb16 ; 0xeb16 193b0: 2c e9 ldi r18, 0x9C ; 156 193b2: 3f ef ldi r19, 0xFF ; 255 193b4: 40 e1 ldi r20, 0x10 ; 16 193b6: 66 ea ldi r22, 0xA6 ; 166 193b8: 73 e0 ldi r23, 0x03 ; 3 193ba: 0e 94 bf 6f call 0xdf7e ; 0xdf7e MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_FRONT), &_md->front, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 193be: 83 ef ldi r24, 0xF3 ; 243 193c0: 9a e3 ldi r25, 0x3A ; 58 193c2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 193c6: 2c e9 ldi r18, 0x9C ; 156 193c8: 3f ef ldi r19, 0xFF ; 255 193ca: 40 e1 ldi r20, 0x10 ; 16 193cc: 68 ea ldi r22, 0xA8 ; 168 193ce: 73 e0 ldi r23, 0x03 ; 3 193d0: 0e 94 bf 6f call 0xdf7e ; 0xdf7e MENU_ITEM_EDIT_int3_P(_T(MSG_BED_CORRECTION_REAR), &_md->rear, -BED_ADJUSTMENT_UM_MAX, BED_ADJUSTMENT_UM_MAX); 193d4: 82 ee ldi r24, 0xE2 ; 226 193d6: 9a e3 ldi r25, 0x3A ; 58 193d8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 193dc: 2c e9 ldi r18, 0x9C ; 156 193de: 3f ef ldi r19, 0xFF ; 255 193e0: 40 e1 ldi r20, 0x10 ; 16 193e2: 6a ea ldi r22, 0xAA ; 170 193e4: 73 e0 ldi r23, 0x03 ; 3 193e6: 0e 94 bf 6f call 0xdf7e ; 0xdf7e MENU_ITEM_FUNCTION_P(_T(MSG_RESET), lcd_adjust_bed_reset); 193ea: 88 eb ldi r24, 0xB8 ; 184 193ec: 96 e4 ldi r25, 0x46 ; 70 193ee: 0e 94 8b 75 call 0xeb16 ; 0xeb16 193f2: 61 ed ldi r22, 0xD1 ; 209 193f4: 7e ec ldi r23, 0xCE ; 206 193f6: 0e 94 ee 72 call 0xe5dc ; 0xe5dc MENU_END(); 193fa: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 _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(); 193fe: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19402: 8f 5f subi r24, 0xFF ; 255 19404: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19408: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1940c: 8f 5f subi r24, 0xFF ; 255 1940e: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19412: 8d cf rjmp .-230 ; 0x1932e 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(); } 19414: 1f 91 pop r17 19416: 0f 91 pop r16 19418: ff 90 pop r15 1941a: ef 90 pop r14 1941c: 08 95 ret 0001941e : #define MENU_ITEM_EDIT_advance_K() do { lcd_advance_K(); } while (0) #endif static void lcd_tune_menu() { 1941e: ef 92 push r14 19420: ff 92 push r15 19422: 0f 93 push r16 19424: 1f 93 push r17 19426: cf 93 push r28 19428: df 93 push r29 1942a: 80 91 75 02 lds r24, 0x0275 ; 0x800275 1942e: 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) 19432: 20 91 a3 03 lds r18, 0x03A3 ; 0x8003a3 19436: 21 11 cpse r18, r1 19438: 91 c0 rjmp .+290 ; 0x1955c { // Menu was entered. Mark the menu as entered and save the current extrudemultiply value. _md->status = 1; 1943a: 21 e0 ldi r18, 0x01 ; 1 1943c: 20 93 a3 03 sts 0x03A3, r18 ; 0x8003a3 _md->extrudemultiply = extrudemultiply; 19440: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 19444: 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); 19448: 8f ef ldi r24, 0xFF ; 255 1944a: 9f e0 ldi r25, 0x0F ; 15 1944c: 0f 94 81 a4 call 0x34902 ; 0x34902 19450: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb MENU_BEGIN(); 19454: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 19458: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1945c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19460: 84 30 cpi r24, 0x04 ; 4 19462: 08 f0 brcs .+2 ; 0x19466 19464: 93 c0 rjmp .+294 ; 0x1958c 19466: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 1946a: 0e 94 9d 62 call 0xc53a ; 0xc53a 1946e: 81 11 cpse r24, r1 19470: 0e 94 8e 64 call 0xc91c ; 0xc91c refresh_saved_feedrate_multiplier_in_ram(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19474: 89 ef ldi r24, 0xF9 ; 249 19476: 98 e4 ldi r25, 0x48 ; 72 19478: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1947c: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_EDIT_int3_P(_T(MSG_SPEED), &feedmultiply, 10, 999); 19480: 84 e6 ldi r24, 0x64 ; 100 19482: 98 e4 ldi r25, 0x48 ; 72 19484: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19488: f1 2c mov r15, r1 1948a: e1 2c mov r14, r1 1948c: 07 ee ldi r16, 0xE7 ; 231 1948e: 13 e0 ldi r17, 0x03 ; 3 19490: 2a e0 ldi r18, 0x0A ; 10 19492: 30 e0 ldi r19, 0x00 ; 0 19494: 40 e1 ldi r20, 0x10 ; 16 19496: 6e e8 ldi r22, 0x8E ; 142 19498: 72 e0 ldi r23, 0x02 ; 2 1949a: 0e 94 bf 6f call 0xdf7e ; 0xdf7e menuitems_temperature_common(); 1949e: 0e 94 fd c8 call 0x191fa ; 0x191fa MENU_ITEM_EDIT_int3_P(_T(MSG_FLOW), &extrudemultiply, 10, 999); 194a2: 8d e5 ldi r24, 0x5D ; 93 194a4: 98 e4 ldi r25, 0x48 ; 72 194a6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 194aa: 2a e0 ldi r18, 0x0A ; 10 194ac: 30 e0 ldi r19, 0x00 ; 0 194ae: 40 e1 ldi r20, 0x10 ; 16 194b0: 65 e7 ldi r22, 0x75 ; 117 194b2: 72 e0 ldi r23, 0x02 ; 2 194b4: 0e 94 bf 6f call 0xdf7e ; 0xdf7e #ifdef LA_LIVE_K MENU_ITEM_EDIT_advance_K(); #endif #ifdef FILAMENTCHANGEENABLE if (!farm_mode) 194b8: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 194bc: 81 11 cpse r24, r1 194be: 08 c0 rjmp .+16 ; 0x194d0 MENU_ITEM_FUNCTION_P(_T(MSG_FILAMENTCHANGE), lcd_colorprint_change); 194c0: 8b e4 ldi r24, 0x4B ; 75 194c2: 98 e4 ldi r25, 0x48 ; 72 194c4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 194c8: 6d e8 ldi r22, 0x8D ; 141 194ca: 7c ed ldi r23, 0xDC ; 220 194cc: 0e 94 ee 72 call 0xe5dc ; 0xe5dc #endif if (printingIsPaused()) {// Don't allow rehome if actively printing. Maaaaybe it could work to insert on the fly, seems too risky. 194d0: 0e 94 86 66 call 0xcd0c ; 0xcd0c 194d4: 88 23 and r24, r24 194d6: 41 f0 breq .+16 ; 0x194e8 MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME),PSTR("G28 XY")); 194d8: 83 e8 ldi r24, 0x83 ; 131 194da: 92 e6 ldi r25, 0x62 ; 98 194dc: 0e 94 8b 75 call 0xeb16 ; 0xeb16 194e0: 6c e7 ldi r22, 0x7C ; 124 194e2: 74 e8 ldi r23, 0x84 ; 132 194e4: 0e 94 e1 8d call 0x11bc2 ; 0x11bc2 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 194e8: 8d e3 ldi r24, 0x3D ; 61 194ea: 98 e4 ldi r25, 0x48 ; 72 194ec: 0e 94 8b 75 call 0xeb16 ; 0xeb16 194f0: 6b e4 ldi r22, 0x4B ; 75 194f2: 70 ec ldi r23, 0xC0 ; 192 194f4: 0e 94 44 73 call 0xe688 ; 0xe688 #endif //FILAMENT_SENSOR if (MMU2::mmu2.Enabled()) 194f8: 80 91 01 13 lds r24, 0x1301 ; 0x801301 194fc: 81 30 cpi r24, 0x01 ; 1 194fe: 11 f4 brne .+4 ; 0x19504 { menuitems_MMU_settings_common(); 19500: 0e 94 13 bf call 0x17e26 ; 0x17e26 } SETTINGS_FANS_CHECK(); 19504: 0e 94 f9 be call 0x17df2 ; 0x17df2 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 19508: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1950c: 81 11 cpse r24, r1 1950e: 02 c0 rjmp .+4 ; 0x19514 19510: 0e 94 d8 be call 0x17db0 ; 0x17db0 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 19514: 80 91 47 04 lds r24, 0x0447 ; 0x800447 19518: 82 30 cpi r24, 0x02 ; 2 1951a: 91 f1 breq .+100 ; 0x19580 1951c: 83 30 cpi r24, 0x03 ; 3 1951e: 99 f1 breq .+102 ; 0x19586 19520: 81 30 cpi r24, 0x01 ; 1 19522: 59 f1 breq .+86 ; 0x1957a 19524: 86 e3 ldi r24, 0x36 ; 54 19526: 98 e4 ldi r25, 0x48 ; 72 19528: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1952c: ec 01 movw r28, r24 1952e: 8e e2 ldi r24, 0x2E ; 46 19530: 98 e4 ldi r25, 0x48 ; 72 19532: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19536: 22 e0 ldi r18, 0x02 ; 2 19538: 4d e7 ldi r20, 0x7D ; 125 1953a: 5d eb ldi r21, 0xBD ; 189 1953c: be 01 movw r22, r28 1953e: 0e 94 af 75 call 0xeb5e ; 0xeb5e if (backlightSupport) { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); 19542: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 calculate_extruder_multipliers(); } SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 19546: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1954a: 8f 5f subi r24, 0xFF ; 255 1954c: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19550: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19554: 8f 5f subi r24, 0xFF ; 255 19556: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1955a: 80 cf rjmp .-256 ; 0x1945c { // 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) 1955c: 20 91 a4 03 lds r18, 0x03A4 ; 0x8003a4 19560: 30 91 a5 03 lds r19, 0x03A5 ; 0x8003a5 19564: 28 17 cp r18, r24 19566: 39 07 cpc r19, r25 19568: 09 f4 brne .+2 ; 0x1956c 1956a: 6e cf rjmp .-292 ; 0x19448 { // extrudemultiply has been changed from the child menu. Apply the new value. _md->extrudemultiply = extrudemultiply; 1956c: 90 93 a5 03 sts 0x03A5, r25 ; 0x8003a5 19570: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 calculate_extruder_multipliers(); 19574: 0e 94 9b 64 call 0xc936 ; 0xc936 19578: 67 cf rjmp .-306 ; 0x19448 menuitems_MMU_settings_common(); } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); SETTINGS_SOUND; 1957a: 87 e2 ldi r24, 0x27 ; 39 1957c: 98 e4 ldi r25, 0x48 ; 72 1957e: d4 cf rjmp .-88 ; 0x19528 19580: 86 e1 ldi r24, 0x16 ; 22 19582: 9b e4 ldi r25, 0x4B ; 75 19584: d1 cf rjmp .-94 ; 0x19528 19586: 8e e1 ldi r24, 0x1E ; 30 19588: 98 e4 ldi r25, 0x48 ; 72 1958a: ce cf rjmp .-100 ; 0x19528 { MENU_ITEM_SUBMENU_P(_T(MSG_BRIGHTNESS), lcd_backlight_menu); } #endif //LCD_BL_PIN MENU_END(); } 1958c: df 91 pop r29 1958e: cf 91 pop r28 19590: 1f 91 pop r17 19592: 0f 91 pop r16 19594: ff 90 pop r15 19596: ef 90 pop r14 19598: 08 95 ret 0001959a : MENU_END(); } static void lcd_settings_menu() { 1959a: 1f 93 push r17 1959c: cf 93 push r28 1959e: df 93 push r29 SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); 195a0: 8f ef ldi r24, 0xFF ; 255 195a2: 9f e0 ldi r25, 0x0F ; 15 195a4: 0f 94 81 a4 call 0x34902 ; 0x34902 195a8: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb MENU_BEGIN(); 195ac: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 195b0: 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 195b4: 11 e0 ldi r17, 0x01 ; 1 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 195b6: 80 91 60 04 lds r24, 0x0460 ; 0x800460 195ba: 84 30 cpi r24, 0x04 ; 4 195bc: 08 f0 brcs .+2 ; 0x195c0 195be: 45 c1 rjmp .+650 ; 0x1984a 195c0: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 195c4: 89 ef ldi r24, 0xF9 ; 249 195c6: 98 e4 ldi r25, 0x48 ; 72 195c8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 195cc: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_SUBMENU_P(_T(MSG_TEMPERATURE), lcd_control_temperature_menu); 195d0: 87 ec ldi r24, 0xC7 ; 199 195d2: 95 e4 ldi r25, 0x45 ; 69 195d4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 195d8: 66 e3 ldi r22, 0x36 ; 54 195da: 79 ec ldi r23, 0xC9 ; 201 195dc: 0e 94 44 73 call 0xe688 ; 0xe688 if (!printer_active() || printingIsPaused()) 195e0: 0e 94 e2 66 call 0xcdc4 ; 0xcdc4 195e4: 88 23 and r24, r24 195e6: 21 f0 breq .+8 ; 0x195f0 195e8: 0e 94 86 66 call 0xcd0c ; 0xcd0c 195ec: 88 23 and r24, r24 195ee: 81 f0 breq .+32 ; 0x19610 { MENU_ITEM_SUBMENU_P(_T(MSG_MOVE_AXIS), lcd_move_menu_axis); 195f0: 8b eb ldi r24, 0xBB ; 187 195f2: 95 e4 ldi r25, 0x45 ; 69 195f4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 195f8: 66 e8 ldi r22, 0x86 ; 134 195fa: 71 ec ldi r23, 0xC1 ; 193 195fc: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_GCODE_P(_T(MSG_DISABLE_STEPPERS), MSG_M84); 19600: 88 ea ldi r24, 0xA8 ; 168 19602: 95 e4 ldi r25, 0x45 ; 69 19604: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19608: 68 e6 ldi r22, 0x68 ; 104 1960a: 79 e6 ldi r23, 0x69 ; 105 1960c: 0e 94 e1 8d call 0x11bc2 ; 0x11bc2 } #ifdef FILAMENT_SENSOR MENU_ITEM_SUBMENU_P(_T(MSG_FSENSOR), lcd_fsensor_settings_menu); 19610: 8d e3 ldi r24, 0x3D ; 61 19612: 98 e4 ldi r25, 0x48 ; 72 19614: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19618: 6b e4 ldi r22, 0x4B ; 75 1961a: 70 ec ldi r23, 0xC0 ; 192 1961c: 0e 94 44 73 call 0xe688 ; 0xe688 #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); 19620: 8c ea ldi r24, 0xAC ; 172 19622: 9c e0 ldi r25, 0x0C ; 12 19624: 0f 94 81 a4 call 0x34902 ; 0x34902 19628: 88 23 and r24, r24 1962a: 09 f4 brne .+2 ; 0x1962e 1962c: 91 c0 rjmp .+290 ; 0x19750 1962e: 8c e5 ldi r24, 0x5C ; 92 19630: 93 e6 ldi r25, 0x63 ; 99 19632: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19636: 22 e0 ldi r18, 0x02 ; 2 19638: 4b e1 ldi r20, 0x1B ; 27 1963a: 5e eb ldi r21, 0xBE ; 190 1963c: bc 01 movw r22, r24 1963e: 8d e5 ldi r24, 0x5D ; 93 19640: 94 e8 ldi r25, 0x84 ; 132 19642: 0e 94 af 75 call 0xeb5e ; 0xeb5e if (eeprom_read_byte((uint8_t *)EEPROM_MMU_ENABLED)) 19646: 8c ea ldi r24, 0xAC ; 172 19648: 9c e0 ldi r25, 0x0C ; 12 1964a: 0f 94 81 a4 call 0x34902 ; 0x34902 1964e: 88 23 and r24, r24 19650: 31 f0 breq .+12 ; 0x1965e { // Communication with MMU not required to reset MMU MENU_ITEM_FUNCTION_P(PSTR("Reset MMU"), []() { MMU2::mmu2.Reset(MMU2::MMU2::ResetForm::Software); }); 19652: 6f e7 ldi r22, 0x7F ; 127 19654: 7e ec ldi r23, 0xCE ; 206 19656: 83 e5 ldi r24, 0x53 ; 83 19658: 94 e8 ldi r25, 0x84 ; 132 1965a: 0e 94 ee 72 call 0xe5dc ; 0xe5dc } if (MMU2::mmu2.Enabled()) 1965e: 80 91 01 13 lds r24, 0x1301 ; 0x801301 19662: 81 30 cpi r24, 0x01 ; 1 19664: 51 f4 brne .+20 ; 0x1967a { // Only show menus when communicating with MMU menuitems_MMU_settings_common(); 19666: 0e 94 13 bf call 0x17e26 ; 0x17e26 MENU_ITEM_SUBMENU_P(_T(MSG_LOADING_TEST), lcd_mmuLoadingTest); 1966a: 89 e9 ldi r24, 0x99 ; 153 1966c: 95 e4 ldi r25, 0x45 ; 69 1966e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19672: 6d eb ldi r22, 0xBD ; 189 19674: 7d ec ldi r23, 0xCD ; 205 19676: 0e 94 44 73 call 0xe688 ; 0xe688 } SETTINGS_FANS_CHECK(); 1967a: 0e 94 f9 be call 0x17df2 ; 0x17df2 MMU2::mmu2.Status(); } static void SETTINGS_SILENT_MODE() { if (!farm_mode) 1967e: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19682: 81 11 cpse r24, r1 19684: 02 c0 rjmp .+4 ; 0x1968a 19686: 0e 94 d8 be call 0x17db0 ; 0x17db0 } SETTINGS_FANS_CHECK(); SETTINGS_SILENT_MODE(); if(!farm_mode) 1968a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1968e: 81 11 cpse r24, r1 19690: 62 c0 rjmp .+196 ; 0x19756 { bSettings=true; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 19692: 10 93 ec 03 sts 0x03EC, r17 ; 0x8003ec MENU_ITEM_SUBMENU_P(_T(MSG_HW_SETUP), lcd_hw_setup_menu); 19696: 8e e8 ldi r24, 0x8E ; 142 19698: 95 e4 ldi r25, 0x45 ; 69 1969a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1969e: 64 e4 ldi r22, 0x44 ; 68 196a0: 7f eb ldi r23, 0xBF ; 191 196a2: 0e 94 44 73 call 0xe688 ; 0xe688 } 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); 196a6: 8d e2 ldi r24, 0x2D ; 45 196a8: 96 e4 ldi r25, 0x46 ; 70 196aa: 0e 94 8b 75 call 0xeb16 ; 0xeb16 196ae: 64 ec ldi r22, 0xC4 ; 196 196b0: 77 ee ldi r23, 0xE7 ; 231 196b2: 0e 94 44 73 call 0xe688 ; 0xe688 #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()) 196b6: 0f 94 f1 10 call 0x221e2 ; 0x221e2 196ba: 88 23 and r24, r24 196bc: b1 f0 breq .+44 ; 0x196ea 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); 196be: 8f ea ldi r24, 0xAF ; 175 196c0: 9f e0 ldi r25, 0x0F ; 15 196c2: 0f 94 81 a4 call 0x34902 ; 0x34902 196c6: 88 23 and r24, r24 196c8: 09 f4 brne .+2 ; 0x196cc 196ca: 4e c0 rjmp .+156 ; 0x19768 196cc: 8c e5 ldi r24, 0x5C ; 92 196ce: 93 e6 ldi r25, 0x63 ; 99 196d0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 196d4: ec 01 movw r28, r24 196d6: 85 ed ldi r24, 0xD5 ; 213 196d8: 95 e4 ldi r25, 0x45 ; 69 196da: 0e 94 8b 75 call 0xeb16 ; 0xeb16 196de: 22 e0 ldi r18, 0x02 ; 2 196e0: 42 e7 ldi r20, 0x72 ; 114 196e2: 5d eb ldi r21, 0xBD ; 189 196e4: be 01 movw r22, r28 196e6: 0e 94 af 75 call 0xeb5e ; 0xeb5e #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); 196ea: 0e 94 86 66 call 0xcd0c ; 0xcd0c 196ee: 81 11 cpse r24, r1 196f0: 08 c0 rjmp .+16 ; 0x19702 196f2: 86 ef ldi r24, 0xF6 ; 246 196f4: 97 e4 ldi r25, 0x47 ; 71 196f6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 196fa: 60 e5 ldi r22, 0x50 ; 80 196fc: 75 ed ldi r23, 0xD5 ; 213 196fe: 0e 94 44 73 call 0xe688 ; 0xe688 #if (LANG_MODE != 0) MENU_ITEM_SUBMENU_P(_T(MSG_SELECT_LANGUAGE), lcd_language_menu); 19702: 8c e6 ldi r24, 0x6C ; 108 19704: 95 e4 ldi r25, 0x45 ; 69 19706: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1970a: 63 ec ldi r22, 0xC3 ; 195 1970c: 73 ee ldi r23, 0xE3 ; 227 1970e: 0e 94 44 73 call 0xe688 ; 0xe688 #endif //(LANG_MODE != 0) if (!farm_mode) { //SD related settings are not available in farm mode 19712: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19716: 81 11 cpse r24, r1 19718: 47 c0 rjmp .+142 ; 0x197a8 if (card.ToshibaFlashAir_isEnabled()) 1971a: 80 91 48 16 lds r24, 0x1648 ; 0x801648 1971e: 88 23 and r24, r24 19720: 31 f1 breq .+76 ; 0x1976e MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY, lcd_toshiba_flash_air_compatibility_toggle); 19722: 82 e6 ldi r24, 0x62 ; 98 19724: 95 e4 ldi r25, 0x45 ; 69 19726: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1972a: 22 e0 ldi r18, 0x02 ; 2 1972c: 48 e6 ldi r20, 0x68 ; 104 1972e: 5d eb ldi r21, 0xBD ; 189 19730: 61 ec ldi r22, 0xC1 ; 193 19732: 78 e6 ldi r23, 0x68 ; 104 else MENU_ITEM_TOGGLE_P(_T(MSG_SD_CARD), _T(MSG_NORMAL), lcd_toshiba_flash_air_compatibility_toggle); 19734: 0e 94 af 75 call 0xeb5e ; 0xeb5e #ifdef SDCARD_SORT_ALPHA switch (eeprom_read_byte((uint8_t*) EEPROM_SD_SORT)) { 19738: 89 e0 ldi r24, 0x09 ; 9 1973a: 9f e0 ldi r25, 0x0F ; 15 1973c: 0f 94 81 a4 call 0x34902 ; 0x34902 19740: 88 23 and r24, r24 19742: 19 f1 breq .+70 ; 0x1978a 19744: 81 30 cpi r24, 0x01 ; 1 19746: 09 f4 brne .+2 ; 0x1974a 19748: 71 c0 rjmp .+226 ; 0x1982c 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); 1974a: 83 e4 ldi r24, 0x43 ; 67 1974c: 9b e4 ldi r25, 0x4B ; 75 1974e: 1f c0 rjmp .+62 ; 0x1978e #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); 19750: 86 e5 ldi r24, 0x56 ; 86 19752: 93 e6 ldi r25, 0x63 ; 99 19754: 6e cf rjmp .-292 ; 0x19632 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); 19756: 8e e7 ldi r24, 0x7E ; 126 19758: 95 e4 ldi r25, 0x45 ; 69 1975a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1975e: 6d e0 ldi r22, 0x0D ; 13 19760: 79 ee ldi r23, 0xE9 ; 233 19762: 0e 94 ee 72 call 0xe5dc ; 0xe5dc 19766: 9f cf rjmp .-194 ; 0x196a6 #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); 19768: 86 e5 ldi r24, 0x56 ; 86 1976a: 93 e6 ldi r25, 0x63 ; 99 1976c: b1 cf rjmp .-158 ; 0x196d0 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); 1976e: 89 e5 ldi r24, 0x59 ; 89 19770: 95 e4 ldi r25, 0x45 ; 69 19772: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19776: ec 01 movw r28, r24 19778: 82 e6 ldi r24, 0x62 ; 98 1977a: 95 e4 ldi r25, 0x45 ; 69 1977c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19780: 22 e0 ldi r18, 0x02 ; 2 19782: 48 e6 ldi r20, 0x68 ; 104 19784: 5d eb ldi r21, 0xBD ; 189 19786: be 01 movw r22, r28 19788: d5 cf rjmp .-86 ; 0x19734 #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; 1978a: 82 e5 ldi r24, 0x52 ; 82 1978c: 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); 1978e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19792: ec 01 movw r28, r24 19794: 8b e4 ldi r24, 0x4B ; 75 19796: 95 e4 ldi r25, 0x45 ; 69 19798: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1979c: 22 e0 ldi r18, 0x02 ; 2 1979e: 44 e9 ldi r20, 0x94 ; 148 197a0: 5d eb ldi r21, 0xBD ; 189 197a2: be 01 movw r22, r28 197a4: 0e 94 af 75 call 0xeb5e ; 0xeb5e } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 197a8: 80 91 47 04 lds r24, 0x0447 ; 0x800447 197ac: 82 30 cpi r24, 0x02 ; 2 197ae: 09 f4 brne .+2 ; 0x197b2 197b0: 43 c0 rjmp .+134 ; 0x19838 197b2: 83 30 cpi r24, 0x03 ; 3 197b4: 09 f4 brne .+2 ; 0x197b8 197b6: 43 c0 rjmp .+134 ; 0x1983e 197b8: 81 30 cpi r24, 0x01 ; 1 197ba: d9 f1 breq .+118 ; 0x19832 197bc: 86 e3 ldi r24, 0x36 ; 54 197be: 98 e4 ldi r25, 0x48 ; 72 197c0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 197c4: ec 01 movw r28, r24 197c6: 8e e2 ldi r24, 0x2E ; 46 197c8: 98 e4 ldi r25, 0x48 ; 72 197ca: 0e 94 8b 75 call 0xeb16 ; 0xeb16 197ce: 22 e0 ldi r18, 0x02 ; 2 197d0: 4d e7 ldi r20, 0x7D ; 125 197d2: 5d eb ldi r21, 0xBD ; 189 197d4: be 01 movw r22, r28 197d6: 0e 94 af 75 call 0xeb5e ; 0xeb5e 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 197da: 87 ea ldi r24, 0xA7 ; 167 197dc: 9c e0 ldi r25, 0x0C ; 12 197de: 0f 94 81 a4 call 0x34902 ; 0x34902 197e2: 88 23 and r24, r24 197e4: 79 f1 breq .+94 ; 0x19844 197e6: 82 ea ldi r24, 0xA2 ; 162 197e8: 98 e4 ldi r25, 0x48 ; 72 197ea: 0e 94 8b 75 call 0xeb16 ; 0xeb16 197ee: 22 e0 ldi r18, 0x02 ; 2 197f0: 4e ee ldi r20, 0xEE ; 238 197f2: 5c eb ldi r21, 0xBC ; 188 197f4: bc 01 movw r22, r24 197f6: 84 eb ldi r24, 0xB4 ; 180 197f8: 98 e6 ldi r25, 0x68 ; 104 197fa: 0e 94 af 75 call 0xeb5e ; 0xeb5e if (farm_mode) 197fe: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 19802: 88 23 and r24, r24 19804: 31 f0 breq .+12 ; 0x19812 { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); 19806: 6f e3 ldi r22, 0x3F ; 63 19808: 77 ee ldi r23, 0xE7 ; 231 1980a: 81 e4 ldi r24, 0x41 ; 65 1980c: 94 e8 ldi r25, 0x84 ; 132 1980e: 0e 94 ee 72 call 0xe5dc ; 0xe5dc } MENU_END(); 19812: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 } static void lcd_settings_menu() { SilentModeMenu = eeprom_read_byte((uint8_t*) EEPROM_SILENT); MENU_BEGIN(); 19816: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1981a: 8f 5f subi r24, 0xFF ; 255 1981c: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19820: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19824: 8f 5f subi r24, 0xFF ; 255 19826: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1982a: c5 ce rjmp .-630 ; 0x195b6 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; 1982c: 80 e4 ldi r24, 0x40 ; 64 1982e: 95 e4 ldi r25, 0x45 ; 69 19830: ae cf rjmp .-164 ; 0x1978e default: MENU_ITEM_TOGGLE_P(_T(MSG_SORT), _T(MSG_NONE), lcd_sort_type_set); } } #endif //SDCARD_SORT_ALPHA SETTINGS_SOUND; 19832: 87 e2 ldi r24, 0x27 ; 39 19834: 98 e4 ldi r25, 0x48 ; 72 19836: c4 cf rjmp .-120 ; 0x197c0 19838: 86 e1 ldi r24, 0x16 ; 22 1983a: 9b e4 ldi r25, 0x4B ; 75 1983c: c1 cf rjmp .-126 ; 0x197c0 1983e: 8e e1 ldi r24, 0x1E ; 30 19840: 98 e4 ldi r25, 0x48 ; 72 19842: be cf rjmp .-132 ; 0x197c0 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 19844: 88 ea ldi r24, 0xA8 ; 168 19846: 98 e4 ldi r25, 0x48 ; 72 19848: d0 cf rjmp .-96 ; 0x197ea { MENU_ITEM_FUNCTION_P(PSTR("Disable farm mode"), lcd_disable_farm_mode); } MENU_END(); } 1984a: df 91 pop r29 1984c: cf 91 pop r28 1984e: 1f 91 pop r17 19850: 08 95 ret 00019852 : } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 19852: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 19856: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1985a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1985e: 84 30 cpi r24, 0x04 ; 4 19860: 08 f0 brcs .+2 ; 0x19864 19862: 7d c0 rjmp .+250 ; 0x1995e 19864: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19868: 89 ef ldi r24, 0xF9 ; 249 1986a: 98 e4 ldi r25, 0x48 ; 72 1986c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19870: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_FUNCTION_P(_T(MSG_WIZARD), lcd_wizard); 19874: 8a e6 ldi r24, 0x6A ; 106 19876: 96 e4 ldi r25, 0x46 ; 70 19878: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1987c: 6a e5 ldi r22, 0x5A ; 90 1987e: 79 ef ldi r23, 0xF9 ; 249 19880: 0e 94 ee 72 call 0xe5dc ; 0xe5dc if (lcd_commands_type == LcdCommands::Idle) 19884: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 19888: 81 11 cpse r24, r1 1988a: 08 c0 rjmp .+16 ; 0x1989c { MENU_ITEM_SUBMENU_P(_T(MSG_V2_CALIBRATION), lcd_first_layer_calibration_reset); 1988c: 89 ec ldi r24, 0xC9 ; 201 1988e: 96 e4 ldi r25, 0x46 ; 70 19890: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19894: 61 e8 ldi r22, 0x81 ; 129 19896: 76 ed ldi r23, 0xD6 ; 214 19898: 0e 94 44 73 call 0xe688 ; 0xe688 } MENU_ITEM_GCODE_P(_T(MSG_AUTO_HOME), G28W); 1989c: 83 e8 ldi r24, 0x83 ; 131 1989e: 92 e6 ldi r25, 0x62 ; 98 198a0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 198a4: 61 e7 ldi r22, 0x71 ; 113 198a6: 79 e6 ldi r23, 0x69 ; 105 198a8: 0e 94 e1 8d call 0x11bc2 ; 0x11bc2 #ifdef TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_BELTTEST), lcd_belttest_v); #endif //TMC2130 MENU_ITEM_FUNCTION_P(_T(MSG_SELFTEST), lcd_selftest_v); 198ac: 8f e5 ldi r24, 0x5F ; 95 198ae: 96 e4 ldi r25, 0x46 ; 70 198b0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 198b4: 64 e6 ldi r22, 0x64 ; 100 198b6: 71 ee ldi r23, 0xE1 ; 225 198b8: 0e 94 ee 72 call 0xe5dc ; 0xe5dc // MK2 MENU_ITEM_FUNCTION_P(_T(MSG_CALIBRATE_BED), lcd_mesh_calibration); 198bc: 8f e4 ldi r24, 0x4F ; 79 198be: 96 e4 ldi r25, 0x46 ; 70 198c0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 198c4: 6c e5 ldi r22, 0x5C ; 92 198c6: 72 ec ldi r23, 0xC2 ; 194 198c8: 0e 94 ee 72 call 0xe5dc ; 0xe5dc // "Calibrate Z" with storing the reference values to EEPROM. MENU_ITEM_FUNCTION_P(_T(MSG_HOMEYZ), lcd_mesh_calibration_z); 198cc: 81 e4 ldi r24, 0x41 ; 65 198ce: 96 e4 ldi r25, 0x46 ; 70 198d0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 198d4: 63 e6 ldi r22, 0x63 ; 99 198d6: 72 ec ldi r23, 0xC2 ; 194 198d8: 0e 94 ee 72 call 0xe5dc ; 0xe5dc MENU_ITEM_SUBMENU_P(_T(MSG_MESH_BED_LEVELING), lcd_mesh_bedleveling); ////MSG_MESH_BED_LEVELING c=18 198dc: 8d e2 ldi r24, 0x2D ; 45 198de: 96 e4 ldi r25, 0x46 ; 70 198e0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 198e4: 6a e6 ldi r22, 0x6A ; 106 198e6: 72 ec ldi r23, 0xC2 ; 194 198e8: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_BED_CORRECTION_MENU), lcd_adjust_bed); 198ec: 89 e1 ldi r24, 0x19 ; 25 198ee: 96 e4 ldi r25, 0x46 ; 70 198f0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 198f4: 66 e5 ldi r22, 0x56 ; 86 198f6: 79 ec ldi r23, 0xC9 ; 201 198f8: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_PID_EXTRUDER), pid_extruder); 198fc: 87 e0 ldi r24, 0x07 ; 7 198fe: 96 e4 ldi r25, 0x46 ; 70 19900: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19904: 60 e7 ldi r22, 0x70 ; 112 19906: 7e eb ldi r23, 0xBE ; 190 19908: 0e 94 44 73 call 0xe688 ; 0xe688 #ifndef TMC2130 MENU_ITEM_SUBMENU_P(_T(MSG_SHOW_END_STOPS), menu_show_end_stops); 1990c: 86 ef ldi r24, 0xF6 ; 246 1990e: 95 e4 ldi r25, 0x45 ; 69 19910: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19914: 65 e5 ldi r22, 0x55 ; 85 19916: 7d ed ldi r23, 0xDD ; 221 19918: 0e 94 44 73 call 0xe688 ; 0xe688 #endif MENU_ITEM_GCODE_P(_T(MSG_CALIBRATE_BED_RESET), PSTR("M44")); 1991c: 82 ee ldi r24, 0xE2 ; 226 1991e: 95 e4 ldi r25, 0x45 ; 69 19920: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19924: 61 e6 ldi r22, 0x61 ; 97 19926: 74 e8 ldi r23, 0x84 ; 132 19928: 0e 94 e1 8d call 0x11bc2 ; 0x11bc2 #ifdef PINDA_THERMISTOR if(has_temperature_compensation()) 1992c: 0f 94 f1 10 call 0x221e2 ; 0x221e2 19930: 88 23 and r24, r24 19932: 41 f0 breq .+16 ; 0x19944 MENU_ITEM_FUNCTION_P(_T(MSG_PINDA_CALIBRATION), lcd_calibrate_pinda); 19934: 85 ed ldi r24, 0xD5 ; 213 19936: 95 e4 ldi r25, 0x45 ; 69 19938: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1993c: 61 e7 ldi r22, 0x71 ; 113 1993e: 72 ec ldi r23, 0xC2 ; 194 19940: 0e 94 ee 72 call 0xe5dc ; 0xe5dc #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); 19944: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 } #endif //TMC2130 static void lcd_calibration_menu() { MENU_BEGIN(); 19948: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1994c: 8f 5f subi r24, 0xFF ; 255 1994e: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19952: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19956: 8f 5f subi r24, 0xFF ; 255 19958: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1995c: 7e cf rjmp .-260 ; 0x1985a #ifdef THERMAL_MODEL MENU_ITEM_FUNCTION_P(_n("Thermal Model cal."), lcd_thermal_model_cal); #endif //THERMAL_MODEL MENU_END(); } 1995e: 08 95 ret 00019960 : } void lcd_move_e() { if ((int)degHotend0() > extrude_min_temp) 19960: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 19964: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 19968: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1996c: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 19970: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 19974: 20 91 57 02 lds r18, 0x0257 ; 0x800257 19978: 30 91 58 02 lds r19, 0x0258 ; 0x800258 1997c: 26 17 cp r18, r22 1997e: 37 07 cpc r19, r23 19980: 0c f0 brlt .+2 ; 0x19984 19982: 65 c0 rjmp .+202 ; 0x19a4e { if (lcd_encoder != 0) 19984: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 19988: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1998c: 89 2b or r24, r25 1998e: b9 f1 breq .+110 ; 0x199fe { refresh_cmd_timeout(); 19990: 0e 94 92 65 call 0xcb24 ; 0xcb24 } FORCE_INLINE bool planner_queue_full() { uint8_t next_block_index = block_buffer_head; 19994: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e if (++ next_block_index == BLOCK_BUFFER_SIZE) 19998: 8f 5f subi r24, 0xFF ; 255 1999a: 80 31 cpi r24, 0x10 ; 16 1999c: 09 f4 brne .+2 ; 0x199a0 next_block_index = 0; 1999e: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 199a0: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f if (! planner_queue_full()) 199a4: 98 17 cp r25, r24 199a6: 59 f1 breq .+86 ; 0x199fe { current_position[E_AXIS] += lcd_encoder; 199a8: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 199ac: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 199b0: 07 2e mov r0, r23 199b2: 00 0c add r0, r0 199b4: 88 0b sbc r24, r24 199b6: 99 0b sbc r25, r25 199b8: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 199bc: 9b 01 movw r18, r22 199be: ac 01 movw r20, r24 199c0: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 199c4: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 199c8: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 199cc: 90 91 70 12 lds r25, 0x1270 ; 0x801270 199d0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 199d4: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 199d8: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 199dc: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 199e0: 90 93 70 12 sts 0x1270, r25 ; 0x801270 lcd_encoder = 0; 199e4: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 199e8: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e plan_buffer_line_curposXYZE(manual_feedrate[E_AXIS] / 60); 199ec: 65 e5 ldi r22, 0x55 ; 85 199ee: 75 e5 ldi r23, 0x55 ; 85 199f0: 85 ed ldi r24, 0xD5 ; 213 199f2: 9f e3 ldi r25, 0x3F ; 63 199f4: 0f 94 0d 4a call 0x2941a ; 0x2941a lcd_draw_update = 1; 199f8: 81 e0 ldi r24, 0x01 ; 1 199fa: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } } if (lcd_draw_update) 199fe: 80 91 59 02 lds r24, 0x0259 ; 0x800259 19a02: 88 23 and r24, r24 19a04: 11 f1 breq .+68 ; 0x19a4a { lcd_set_cursor(0, 1); 19a06: 61 e0 ldi r22, 0x01 ; 1 19a08: 80 e0 ldi r24, 0x00 ; 0 19a0a: 0e 94 ab 6f call 0xdf56 ; 0xdf56 //! 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); 19a0e: 80 91 70 12 lds r24, 0x1270 ; 0x801270 19a12: 8f 93 push r24 19a14: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 19a18: 8f 93 push r24 19a1a: 80 91 6e 12 lds r24, 0x126E ; 0x80126e 19a1e: 8f 93 push r24 19a20: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 19a24: 8f 93 push r24 19a26: 8c e2 ldi r24, 0x2C ; 44 19a28: 93 e8 ldi r25, 0x83 ; 131 19a2a: 9f 93 push r25 19a2c: 8f 93 push r24 19a2e: 8d e1 ldi r24, 0x1D ; 29 19a30: 93 e8 ldi r25, 0x83 ; 131 19a32: 9f 93 push r25 19a34: 8f 93 push r24 19a36: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 19a3a: 8d b7 in r24, 0x3d ; 61 19a3c: 9e b7 in r25, 0x3e ; 62 19a3e: 08 96 adiw r24, 0x08 ; 8 19a40: 0f b6 in r0, 0x3f ; 63 19a42: f8 94 cli 19a44: 9e bf out 0x3e, r25 ; 62 19a46: 0f be out 0x3f, r0 ; 63 19a48: 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(); 19a4a: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae }; } void show_preheat_nozzle_warning() { lcd_clear(); 19a4e: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 0, _T(MSG_ERROR)); 19a52: 85 e6 ldi r24, 0x65 ; 101 19a54: 9a e3 ldi r25, 0x3A ; 58 19a56: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19a5a: ac 01 movw r20, r24 19a5c: 60 e0 ldi r22, 0x00 ; 0 19a5e: 80 e0 ldi r24, 0x00 ; 0 19a60: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 2, _T(MSG_PREHEAT_NOZZLE)); 19a64: 8f e4 ldi r24, 0x4F ; 79 19a66: 9a e3 ldi r25, 0x3A ; 58 19a68: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19a6c: ac 01 movw r20, r24 19a6e: 62 e0 ldi r22, 0x02 ; 2 19a70: 80 e0 ldi r24, 0x00 ; 0 19a72: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 _delay(2000); 19a76: 60 ed ldi r22, 0xD0 ; 208 19a78: 77 e0 ldi r23, 0x07 ; 7 19a7a: 80 e0 ldi r24, 0x00 ; 0 19a7c: 90 e0 ldi r25, 0x00 ; 0 19a7e: 0f 94 56 0b call 0x216ac ; 0x216ac lcd_clear(); 19a82: 0e 94 77 70 call 0xe0ee ; 0xe0ee menu_back_if_clicked(); } else { show_preheat_nozzle_warning(); lcd_return_to_status(); 19a86: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 00019a8a : static void lcd_sd_refresh() { #if SDCARDDETECT == -1 card.mount(); #else card.presort(); 19a8a: 0f 94 d0 6e call 0x2dda0 ; 0x2dda0 #endif menu_top = 0; 19a8e: 10 92 92 03 sts 0x0392, r1 ; 0x800392 lcd_encoder = 0; 19a92: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 19a96: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e menu_data_reset(); //Forces reloading of cached variables. 19a9a: 0c 94 00 63 jmp 0xc600 ; 0xc600 00019a9e : } } void CardReader::updir() { if(workDirDepth > 0) 19a9e: 80 91 77 15 lds r24, 0x1577 ; 0x801577 19aa2: 88 23 and r24, r24 19aa4: f9 f0 breq .+62 ; 0x19ae4 { --workDirDepth; 19aa6: 81 50 subi r24, 0x01 ; 1 19aa8: 80 93 77 15 sts 0x1577, r24 ; 0x801577 workDir = workDirParents[0]; 19aac: 93 e2 ldi r25, 0x23 ; 35 19aae: e5 ea ldi r30, 0xA5 ; 165 19ab0: f4 e1 ldi r31, 0x14 ; 20 19ab2: a2 e8 ldi r26, 0x82 ; 130 19ab4: b4 e1 ldi r27, 0x14 ; 20 19ab6: 01 90 ld r0, Z+ 19ab8: 0d 92 st X+, r0 19aba: 9a 95 dec r25 19abc: e1 f7 brne .-8 ; 0x19ab6 19abe: 25 ea ldi r18, 0xA5 ; 165 19ac0: 34 e1 ldi r19, 0x14 ; 20 for (uint8_t d = 0; d < workDirDepth; d++) 19ac2: 90 e0 ldi r25, 0x00 ; 0 19ac4: 98 17 cp r25, r24 19ac6: 60 f4 brcc .+24 ; 0x19ae0 { workDirParents[d] = workDirParents[d+1]; 19ac8: 43 e2 ldi r20, 0x23 ; 35 19aca: f9 01 movw r30, r18 19acc: b3 96 adiw r30, 0x23 ; 35 19ace: d9 01 movw r26, r18 19ad0: 01 90 ld r0, Z+ 19ad2: 0d 92 st X+, r0 19ad4: 4a 95 dec r20 19ad6: e1 f7 brne .-8 ; 0x19ad0 { if(workDirDepth > 0) { --workDirDepth; workDir = workDirParents[0]; for (uint8_t d = 0; d < workDirDepth; d++) 19ad8: 9f 5f subi r25, 0xFF ; 255 19ada: 2d 5d subi r18, 0xDD ; 221 19adc: 3f 4f sbci r19, 0xFF ; 255 19ade: f2 cf rjmp .-28 ; 0x19ac4 { workDirParents[d] = workDirParents[d+1]; } #ifdef SDCARD_SORT_ALPHA presort(); 19ae0: 0f 94 d0 6e call 0x2dda0 ; 0x2dda0 } static void lcd_sd_updir() { card.updir(); menu_top = 0; 19ae4: 10 92 92 03 sts 0x0392, r1 ; 0x800392 lcd_encoder = 0; 19ae8: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 19aec: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e menu_data_reset(); //Forces reloading of cached variables. 19af0: 0c 94 00 63 jmp 0xc600 ; 0xc600 00019af4 : static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { 19af4: cf 93 push r28 MENU_BEGIN(); 19af6: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 19afa: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19afe: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19b02: 84 30 cpi r24, 0x04 ; 4 19b04: 60 f5 brcc .+88 ; 0x19b5e 19b06: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19b0a: 89 ef ldi r24, 0xF9 ; 249 19b0c: 98 e4 ldi r25, 0x48 ; 72 19b0e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19b12: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), load_all_wrapper); 19b16: 86 e8 ldi r24, 0x86 ; 134 19b18: 96 e4 ldi r25, 0x46 ; 70 19b1a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19b1e: 6e e6 ldi r22, 0x6E ; 110 19b20: 7e ec ldi r23, 0xCE ; 206 19b22: 0e 94 ee 72 call 0xe5dc ; 0xe5dc for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19b26: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); 19b28: 8b e4 ldi r24, 0x4B ; 75 19b2a: 97 e4 ldi r25, 0x47 ; 71 19b2c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19b30: 61 e3 ldi r22, 0x31 ; 49 19b32: 6c 0f add r22, r28 19b34: 2c 2f mov r18, r28 19b36: 4d e7 ldi r20, 0x7D ; 125 19b38: 5e ec ldi r21, 0xCE ; 206 19b3a: 0e 94 80 72 call 0xe500 ; 0xe500 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++) 19b3e: cf 5f subi r28, 0xFF ; 255 19b40: c5 30 cpi r28, 0x05 ; 5 19b42: 91 f7 brne .-28 ; 0x19b28 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', load_filament_wrapper, i); MENU_END(); 19b44: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); } static void mmu_preload_filament_menu() { MENU_BEGIN(); 19b48: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19b4c: 8f 5f subi r24, 0xFF ; 255 19b4e: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19b52: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19b56: 8f 5f subi r24, 0xFF ; 255 19b58: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19b5c: d0 cf rjmp .-96 ; 0x19afe 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(); } 19b5e: cf 91 pop r28 19b60: 08 95 ret 00019b62 : static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); } static void lcd_mmuLoadFilament() { preheat_or_continue(FilamentAction::MmuLoad); 19b62: 84 e0 ldi r24, 0x04 ; 4 19b64: 0d 94 b6 24 jmp 0x2496c ; 0x2496c 00019b68 : } static void lcd_mmuUnloadFilament() { preheat_or_continue(FilamentAction::MmuUnLoad); 19b68: 85 e0 ldi r24, 0x05 ; 5 19b6a: 0d 94 b6 24 jmp 0x2496c ; 0x2496c 00019b6e : } static void lcd_mmuEjectFilament() { preheat_or_continue(FilamentAction::MmuEject); 19b6e: 86 e0 ldi r24, 0x06 ; 6 19b70: 0d 94 b6 24 jmp 0x2496c ; 0x2496c 00019b74 : static void lcd_mmuLoadingTest() { preheat_or_continue(FilamentAction::MmuLoadingTest); } static void lcd_mmuCutFilament() { preheat_or_continue(FilamentAction::MmuCut); 19b74: 87 e0 ldi r24, 0x07 ; 7 19b76: 0d 94 b6 24 jmp 0x2496c ; 0x2496c 00019b7a : 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); 19b7a: 88 e0 ldi r24, 0x08 ; 8 19b7c: 0d 94 b6 24 jmp 0x2496c ; 0x2496c 00019b80 : 19b80: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 19b84: 81 ea ldi r24, 0xA1 ; 161 19b86: 9d e0 ldi r25, 0x0D ; 13 19b88: 0f 94 a5 a4 call 0x3494a ; 0x3494a } static void change_sheet() { eeprom_update_byte_notify(&(EEPROM_Sheets_base->active_sheet), selected_sheet); menu_back(3); 19b8c: 83 e0 ldi r24, 0x03 ; 3 19b8e: 0c 94 50 63 jmp 0xc6a0 ; 0xc6a0 00019b92 : // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { 19b92: cf 93 push r28 MENU_BEGIN(); 19b94: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 19b98: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19b9c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19ba0: 84 30 cpi r24, 0x04 ; 4 19ba2: 88 f5 brcc .+98 ; 0x19c06 19ba4: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 19ba8: 0e 94 9d 62 call 0xc53a ; 0xc53a 19bac: 81 11 cpse r24, r1 19bae: 0f 94 6f 09 call 0x212de ; 0x212de clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19bb2: 89 ef ldi r24, 0xF9 ; 249 19bb4: 98 e4 ldi r25, 0x48 ; 72 19bb6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19bba: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_FUNCTION_P(_T(MSG_LOAD_ALL), loading_test_all_wrapper); 19bbe: 86 e8 ldi r24, 0x86 ; 134 19bc0: 96 e4 ldi r25, 0x46 ; 70 19bc2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19bc6: 64 e8 ldi r22, 0x84 ; 132 19bc8: 7c ef ldi r23, 0xFC ; 252 19bca: 0e 94 ee 72 call 0xe5dc ; 0xe5dc for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19bce: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); 19bd0: 8b e4 ldi r24, 0x4B ; 75 19bd2: 97 e4 ldi r25, 0x47 ; 71 19bd4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19bd8: 61 e3 ldi r22, 0x31 ; 49 19bda: 6c 0f add r22, r28 19bdc: 2c 2f mov r18, r28 19bde: 4f e6 ldi r20, 0x6F ; 111 19be0: 5c ef ldi r21, 0xFC ; 252 19be2: 0e 94 80 72 call 0xe500 ; 0xe500 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++) 19be6: cf 5f subi r28, 0xFF ; 255 19be8: c5 30 cpi r28, 0x05 ; 5 19bea: 91 f7 brne .-28 ; 0x19bd0 MENU_ITEM_FUNCTION_NR_P(_T(MSG_LOAD_FILAMENT), i + '1', loading_test_wrapper, i); MENU_END(); 19bec: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 // Clear the filament action clearFilamentAction(); } static void mmu_loading_test_menu() { MENU_BEGIN(); 19bf0: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19bf4: 8f 5f subi r24, 0xFF ; 255 19bf6: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19bfa: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19bfe: 8f 5f subi r24, 0xFF ; 255 19c00: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19c04: cb cf rjmp .-106 ; 0x19b9c 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(); } 19c06: cf 91 pop r28 19c08: 08 95 ret 00019c0a : } // 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)) { 19c0a: ef 92 push r14 19c0c: ff 92 push r15 19c0e: 0f 93 push r16 19c10: 1f 93 push r17 19c12: cf 93 push r28 19c14: 8c 01 movw r16, r24 19c16: 7b 01 movw r14, r22 MENU_BEGIN(); 19c18: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 19c1c: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19c20: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19c24: 84 30 cpi r24, 0x04 ; 4 19c26: 28 f5 brcc .+74 ; 0x19c72 19c28: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 19c2c: 0e 94 9d 62 call 0xc53a ; 0xc53a 19c30: 81 11 cpse r24, r1 19c32: 0f 94 6f 09 call 0x212de ; 0x212de clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); 19c36: 89 ef ldi r24, 0xF9 ; 249 19c38: 98 e4 ldi r25, 0x48 ; 72 19c3a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19c3e: 0e 94 1f 73 call 0xe63e ; 0xe63e for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19c42: c0 e0 ldi r28, 0x00 ; 0 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); 19c44: 61 e3 ldi r22, 0x31 ; 49 19c46: 6c 0f add r22, r28 19c48: 2c 2f mov r18, r28 19c4a: a7 01 movw r20, r14 19c4c: c8 01 movw r24, r16 19c4e: 0e 94 80 72 call 0xe500 ; 0xe500 MENU_BEGIN(); ON_MENU_LEAVE( clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(MSG_MAIN)); for (uint8_t i = 0; i < MMU_FILAMENT_COUNT; i++) 19c52: cf 5f subi r28, 0xFF ; 255 19c54: c5 30 cpi r28, 0x05 ; 5 19c56: b1 f7 brne .-20 ; 0x19c44 MENU_ITEM_FUNCTION_NR_P(label, i + '1', menuAction, i); MENU_END(); 19c58: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 // 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(); 19c5c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19c60: 8f 5f subi r24, 0xFF ; 255 19c62: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19c66: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19c6a: 8f 5f subi r24, 0xFF ; 255 19c6c: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19c70: d7 cf rjmp .-82 ; 0x19c20 ); 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(); } 19c72: cf 91 pop r28 19c74: 1f 91 pop r17 19c76: 0f 91 pop r16 19c78: ff 90 pop r15 19c7a: ef 90 pop r14 19c7c: 08 95 ret 00019c7e : 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); 19c7e: 8f e8 ldi r24, 0x8F ; 143 19c80: 92 e6 ldi r25, 0x62 ; 98 19c82: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19c86: 67 e5 ldi r22, 0x57 ; 87 19c88: 7e ec ldi r23, 0xCE ; 206 19c8a: 0c 94 05 ce jmp 0x19c0a ; 0x19c0a 00019c8e : // Clear the filament action clearFilamentAction(); } static void mmu_fil_eject_menu() { mmu_common_choose_filament_menu(_T(MSG_EJECT_FROM_MMU), mmu_eject_filament); 19c8e: 8e e9 ldi r24, 0x9E ; 158 19c90: 92 e6 ldi r25, 0x62 ; 98 19c92: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19c96: 63 e6 ldi r22, 0x63 ; 99 19c98: 7e ec ldi r23, 0xCE ; 206 19c9a: 0c 94 05 ce jmp 0x19c0a ; 0x19c0a 00019c9e : 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); 19c9e: 8b e4 ldi r24, 0x4B ; 75 19ca0: 97 e4 ldi r25, 0x47 ; 71 19ca2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19ca6: 65 e0 ldi r22, 0x05 ; 5 19ca8: 7c ef ldi r23, 0xFC ; 252 19caa: 0c 94 05 ce jmp 0x19c0a ; 0x19c0a 00019cae : 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){ 19cae: cf 93 push r28 19cb0: c8 2f mov r28, r24 IncrementMMUFails(); } } bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { if (!WaitForMMUReady()) { 19cb2: 0f 94 47 7a call 0x2f48e ; 0x2f48e 19cb6: 88 23 and r24, r24 19cb8: 21 f0 breq .+8 ; 0x19cc2 19cba: 8c 2f mov r24, r28 MMU2::mmu2.cut_filament(index); } 19cbc: cf 91 pop r28 19cbe: 0d 94 ea 9e jmp 0x33dd4 ; 0x33dd4 19cc2: cf 91 pop r28 19cc4: 08 95 ret 00019cc6 : 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) { 19cc6: cf 93 push r28 19cc8: c8 2f mov r28, r24 menu_back(); 19cca: 0e 94 6c 63 call 0xc6d8 ; 0xc6d8 MMU2::mmu2.eject_filament(filament, true); 19cce: 61 e0 ldi r22, 0x01 ; 1 19cd0: 8c 2f mov r24, r28 19cd2: 0f 94 6d 9e call 0x33cda ; 0x33cda // Clear the filament action clearFilamentAction(); } 19cd6: 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(); 19cd8: 0d 94 6f 09 jmp 0x212de ; 0x212de 00019cdc : } static inline void load_all_wrapper(){ for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.load_filament(i); 19cdc: 80 e0 ldi r24, 0x00 ; 0 19cde: 0f 94 2a 9e call 0x33c54 ; 0x33c54 19ce2: 81 e0 ldi r24, 0x01 ; 1 19ce4: 0f 94 2a 9e call 0x33c54 ; 0x33c54 19ce8: 82 e0 ldi r24, 0x02 ; 2 19cea: 0f 94 2a 9e call 0x33c54 ; 0x33c54 19cee: 83 e0 ldi r24, 0x03 ; 3 19cf0: 0f 94 2a 9e call 0x33c54 ; 0x33c54 19cf4: 84 e0 ldi r24, 0x04 ; 4 19cf6: 0d 94 2a 9e jmp 0x33c54 ; 0x33c54 00019cfa : } } static inline void load_filament_wrapper(uint8_t i){ MMU2::mmu2.load_filament(i); 19cfa: 0d 94 2a 9e jmp 0x33c54 ; 0x33c54 00019cfe : break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 19cfe: 80 e0 ldi r24, 0x00 ; 0 19d00: 0d 94 e4 95 jmp 0x32bc8 ; 0x32bc8 00019d04 : lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 19d04: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 19d08: 10 92 60 04 sts 0x0460, r1 ; 0x800460 19d0c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19d10: 84 30 cpi r24, 0x04 ; 4 19d12: 08 f0 brcs .+2 ; 0x19d16 19d14: 45 c0 rjmp .+138 ; 0x19da0 19d16: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_HW_SETUP)); 19d1a: 8e e8 ldi r24, 0x8E ; 142 19d1c: 95 e4 ldi r25, 0x45 ; 69 19d1e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19d22: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[0], select_sheet_menu<0>); 19d26: 62 e8 ldi r22, 0x82 ; 130 19d28: 71 ec ldi r23, 0xC1 ; 193 19d2a: 89 e4 ldi r24, 0x49 ; 73 19d2c: 9d e0 ldi r25, 0x0D ; 13 19d2e: 0e 94 76 76 call 0xecec ; 0xecec MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[1], select_sheet_menu<1>); 19d32: 6d e7 ldi r22, 0x7D ; 125 19d34: 71 ec ldi r23, 0xC1 ; 193 19d36: 84 e5 ldi r24, 0x54 ; 84 19d38: 9d e0 ldi r25, 0x0D ; 13 19d3a: 0e 94 76 76 call 0xecec ; 0xecec MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[2], select_sheet_menu<2>); 19d3e: 68 e7 ldi r22, 0x78 ; 120 19d40: 71 ec ldi r23, 0xC1 ; 193 19d42: 8f e5 ldi r24, 0x5F ; 95 19d44: 9d e0 ldi r25, 0x0D ; 13 19d46: 0e 94 76 76 call 0xecec ; 0xecec MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[3], select_sheet_menu<3>); 19d4a: 63 e7 ldi r22, 0x73 ; 115 19d4c: 71 ec ldi r23, 0xC1 ; 193 19d4e: 8a e6 ldi r24, 0x6A ; 106 19d50: 9d e0 ldi r25, 0x0D ; 13 19d52: 0e 94 76 76 call 0xecec ; 0xecec MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[4], select_sheet_menu<4>); 19d56: 6e e6 ldi r22, 0x6E ; 110 19d58: 71 ec ldi r23, 0xC1 ; 193 19d5a: 85 e7 ldi r24, 0x75 ; 117 19d5c: 9d e0 ldi r25, 0x0D ; 13 19d5e: 0e 94 76 76 call 0xecec ; 0xecec MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[5], select_sheet_menu<5>); 19d62: 69 e6 ldi r22, 0x69 ; 105 19d64: 71 ec ldi r23, 0xC1 ; 193 19d66: 80 e8 ldi r24, 0x80 ; 128 19d68: 9d e0 ldi r25, 0x0D ; 13 19d6a: 0e 94 76 76 call 0xecec ; 0xecec MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[6], select_sheet_menu<6>); 19d6e: 64 e6 ldi r22, 0x64 ; 100 19d70: 71 ec ldi r23, 0xC1 ; 193 19d72: 8b e8 ldi r24, 0x8B ; 139 19d74: 9d e0 ldi r25, 0x0D ; 13 19d76: 0e 94 76 76 call 0xecec ; 0xecec MENU_ITEM_SUBMENU_E(EEPROM_Sheets_base->s[7], select_sheet_menu<7>); 19d7a: 6f e5 ldi r22, 0x5F ; 95 19d7c: 71 ec ldi r23, 0xC1 ; 193 19d7e: 86 e9 ldi r24, 0x96 ; 150 19d80: 9d e0 ldi r25, 0x0D ; 13 19d82: 0e 94 76 76 call 0xecec ; 0xecec MENU_END(); 19d86: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 lcd_sheet_menu(); } static void sheets_menu() { MENU_BEGIN(); 19d8a: 80 91 60 04 lds r24, 0x0460 ; 0x800460 19d8e: 8f 5f subi r24, 0xFF ; 255 19d90: 80 93 60 04 sts 0x0460, r24 ; 0x800460 19d94: 80 91 62 04 lds r24, 0x0462 ; 0x800462 19d98: 8f 5f subi r24, 0xFF ; 255 19d9a: 80 93 62 04 sts 0x0462, r24 ; 0x800462 19d9e: b6 cf rjmp .-148 ; 0x19d0c 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(); } 19da0: 08 95 ret 00019da2 : } _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(); 19da2: 0e 94 30 79 call 0xf260 ; 0xf260 _menu_data_adjust_bed_t* _md = (_menu_data_adjust_bed_t*)&(menu_data[0]); _md->status = 0; 19da6: 10 92 a3 03 sts 0x03A3, r1 ; 0x8003a3 } 19daa: 08 95 ret 00019dac : //! |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() { 19dac: cf 93 push r28 19dae: df 93 push r29 lcd_puts_at_P(0, 0, _T(MSG_MEASURED_OFFSET)); 19db0: 8f eb ldi r24, 0xBF ; 191 19db2: 9a e3 ldi r25, 0x3A ; 58 19db4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19db8: ac 01 movw r20, r24 19dba: 60 e0 ldi r22, 0x00 ; 0 19dbc: 80 e0 ldi r24, 0x00 ; 0 19dbe: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 1, STR_SEPARATOR); 19dc2: 44 ec ldi r20, 0xC4 ; 196 19dc4: 54 e8 ldi r21, 0x84 ; 132 19dc6: 61 e0 ldi r22, 0x01 ; 1 19dc8: 80 e0 ldi r24, 0x00 ; 0 19dca: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 for (uint8_t i = 0; i < 2; i++) { lcd_set_cursor(0, i + 2); 19dce: 62 e0 ldi r22, 0x02 ; 2 19dd0: 80 e0 ldi r24, 0x00 ; 0 19dd2: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 19dd6: 85 ee ldi r24, 0xE5 ; 229 19dd8: 9f e0 ldi r25, 0x0F ; 15 19dda: 0f 94 89 a4 call 0x34912 ; 0x34912 19dde: 9f 93 push r25 19de0: 8f 93 push r24 19de2: 7f 93 push r23 19de4: 6f 93 push r22 19de6: 1f 92 push r1 19de8: 88 e5 ldi r24, 0x58 ; 88 19dea: 8f 93 push r24 19dec: c6 e3 ldi r28, 0x36 ; 54 19dee: d3 e8 ldi r29, 0x83 ; 131 19df0: df 93 push r29 19df2: cf 93 push r28 19df4: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 { 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); 19df8: 63 e0 ldi r22, 0x03 ; 3 19dfa: 80 e0 ldi r24, 0x00 ; 0 19dfc: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(PSTR("%c%17.2fmm"), 'X' + i, eeprom_read_float((float*)(EEPROM_BED_CALIBRATION_CENTER+4*i))); 19e00: 89 ee ldi r24, 0xE9 ; 233 19e02: 9f e0 ldi r25, 0x0F ; 15 19e04: 0f 94 89 a4 call 0x34912 ; 0x34912 19e08: 9f 93 push r25 19e0a: 8f 93 push r24 19e0c: 7f 93 push r23 19e0e: 6f 93 push r22 19e10: 1f 92 push r1 19e12: 89 e5 ldi r24, 0x59 ; 89 19e14: 8f 93 push r24 19e16: df 93 push r29 19e18: cf 93 push r28 19e1a: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 } menu_back_if_clicked(); 19e1e: 8d b7 in r24, 0x3d ; 61 19e20: 9e b7 in r25, 0x3e ; 62 19e22: 40 96 adiw r24, 0x10 ; 16 19e24: 0f b6 in r0, 0x3f ; 63 19e26: f8 94 cli 19e28: 9e bf out 0x3e, r25 ; 62 19e2a: 0f be out 0x3f, r0 ; 63 19e2c: 8d bf out 0x3d, r24 ; 61 } 19e2e: df 91 pop r29 19e30: 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(); 19e32: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae 00019e36 : //! ---------------------- //! 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() { 19e36: cf 92 push r12 19e38: df 92 push r13 19e3a: ef 92 push r14 19e3c: ff 92 push r15 19e3e: 0f 93 push r16 19e40: 1f 93 push r17 19e42: cf 93 push r28 19e44: df 93 push r29 float angleDiff = eeprom_read_float((float*)(EEPROM_XYZ_CAL_SKEW)); 19e46: 80 e6 ldi r24, 0x60 ; 96 19e48: 9f e0 ldi r25, 0x0F ; 15 19e4a: 0f 94 89 a4 call 0x34912 ; 0x34912 19e4e: 6b 01 movw r12, r22 19e50: 7c 01 movw r14, r24 lcd_home(); 19e52: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 lcd_printf_P(_N( 19e56: 81 eb ldi r24, 0xB1 ; 177 19e58: 9a e3 ldi r25, 0x3A ; 58 19e5a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19e5e: 18 2f mov r17, r24 19e60: 09 2f mov r16, r25 19e62: 83 ea ldi r24, 0xA3 ; 163 19e64: 9a e3 ldi r25, 0x3A ; 58 19e66: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19e6a: ec 01 movw r28, r24 19e6c: 83 e9 ldi r24, 0x93 ; 147 19e6e: 9a e3 ldi r25, 0x3A ; 58 19e70: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19e74: 2e e3 ldi r18, 0x3E ; 62 19e76: 2f 93 push r18 19e78: 20 e8 ldi r18, 0x80 ; 128 19e7a: 2f 93 push r18 19e7c: 1f 92 push r1 19e7e: 1f 92 push r1 19e80: 0f 93 push r16 19e82: 1f 93 push r17 19e84: 2d e3 ldi r18, 0x3D ; 61 19e86: 2f 93 push r18 19e88: 25 ef ldi r18, 0xF5 ; 245 19e8a: 2f 93 push r18 19e8c: 22 ec ldi r18, 0xC2 ; 194 19e8e: 2f 93 push r18 19e90: 20 e9 ldi r18, 0x90 ; 144 19e92: 2f 93 push r18 19e94: df 93 push r29 19e96: cf 93 push r28 19e98: 24 ec ldi r18, 0xC4 ; 196 19e9a: 34 e8 ldi r19, 0x84 ; 132 19e9c: 3f 93 push r19 19e9e: 2f 93 push r18 19ea0: 9f 93 push r25 19ea2: 8f 93 push r24 19ea4: 8b e1 ldi r24, 0x1B ; 27 19ea6: 98 e6 ldi r25, 0x68 ; 104 19ea8: 9f 93 push r25 19eaa: 8f 93 push r24 19eac: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 _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); 19eb0: 60 e0 ldi r22, 0x00 ; 0 19eb2: 8f e0 ldi r24, 0x0F ; 15 19eb4: 0e 94 ab 6f call 0xdf56 ; 0xdf56 if (angleDiff < 100){ 19eb8: 8d b7 in r24, 0x3d ; 61 19eba: 9e b7 in r25, 0x3e ; 62 19ebc: 42 96 adiw r24, 0x12 ; 18 19ebe: 0f b6 in r0, 0x3f ; 63 19ec0: f8 94 cli 19ec2: 9e bf out 0x3e, r25 ; 62 19ec4: 0f be out 0x3f, r0 ; 63 19ec6: 8d bf out 0x3d, r24 ; 61 19ec8: 20 e0 ldi r18, 0x00 ; 0 19eca: 30 e0 ldi r19, 0x00 ; 0 19ecc: 48 ec ldi r20, 0xC8 ; 200 19ece: 52 e4 ldi r21, 0x42 ; 66 19ed0: c7 01 movw r24, r14 19ed2: b6 01 movw r22, r12 19ed4: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 19ed8: 87 ff sbrs r24, 7 19eda: 32 c0 rjmp .+100 ; 0x19f40 } //@brief Show measured axis skewness float _deg(float rad) { return rad * 180 / M_PI; 19edc: 20 e0 ldi r18, 0x00 ; 0 19ede: 30 e0 ldi r19, 0x00 ; 0 19ee0: 44 e3 ldi r20, 0x34 ; 52 19ee2: 53 e4 ldi r21, 0x43 ; 67 19ee4: c7 01 movw r24, r14 19ee6: b6 01 movw r22, r12 19ee8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 19eec: 2b ed ldi r18, 0xDB ; 219 19eee: 3f e0 ldi r19, 0x0F ; 15 19ef0: 49 e4 ldi r20, 0x49 ; 73 19ef2: 50 e4 ldi r21, 0x40 ; 64 19ef4: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__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)); 19ef8: 9f 93 push r25 19efa: 8f 93 push r24 19efc: 7f 93 push r23 19efe: 6f 93 push r22 19f00: 84 e1 ldi r24, 0x14 ; 20 19f02: 98 e6 ldi r25, 0x68 ; 104 19f04: 9f 93 push r25 19f06: 8f 93 push r24 19f08: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 19f0c: 0f 90 pop r0 19f0e: 0f 90 pop r0 19f10: 0f 90 pop r0 19f12: 0f 90 pop r0 19f14: 0f 90 pop r0 19f16: 0f 90 pop r0 } else { lcd_puts_P(_T(MSG_NA)); } if (lcd_clicked()) 19f18: 0e 94 c6 73 call 0xe78c ; 0xe78c 19f1c: 88 23 and r24, r24 19f1e: b9 f0 breq .+46 ; 0x19f4e menu_goto(lcd_menu_xyz_offset, 0, true); 19f20: 20 e0 ldi r18, 0x00 ; 0 19f22: 41 e0 ldi r20, 0x01 ; 1 19f24: 70 e0 ldi r23, 0x00 ; 0 19f26: 60 e0 ldi r22, 0x00 ; 0 19f28: 86 ed ldi r24, 0xD6 ; 214 19f2a: 9e ec ldi r25, 0xCE ; 206 } 19f2c: df 91 pop r29 19f2e: cf 91 pop r28 19f30: 1f 91 pop r17 19f32: 0f 91 pop r16 19f34: ff 90 pop r15 19f36: ef 90 pop r14 19f38: df 90 pop r13 19f3a: 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); 19f3c: 0c 94 08 63 jmp 0xc610 ; 0xc610 ); 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)); 19f40: 8c e7 ldi r24, 0x7C ; 124 19f42: 98 e4 ldi r25, 0x48 ; 72 19f44: 0e 94 8b 75 call 0xeb16 ; 0xeb16 19f48: 0e 94 6e 6f call 0xdedc ; 0xdedc 19f4c: e5 cf rjmp .-54 ; 0x19f18 } if (lcd_clicked()) menu_goto(lcd_menu_xyz_offset, 0, true); } 19f4e: df 91 pop r29 19f50: cf 91 pop r28 19f52: 1f 91 pop r17 19f54: 0f 91 pop r16 19f56: ff 90 pop r15 19f58: ef 90 pop r14 19f5a: df 90 pop r13 19f5c: cf 90 pop r12 19f5e: 08 95 ret 00019f60 : //! //! @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) 19f60: 4f 92 push r4 19f62: 5f 92 push r5 19f64: 6f 92 push r6 19f66: 7f 92 push r7 19f68: 8f 92 push r8 19f6a: 9f 92 push r9 19f6c: af 92 push r10 19f6e: bf 92 push r11 19f70: cf 92 push r12 19f72: df 92 push r13 19f74: ef 92 push r14 19f76: ff 92 push r15 19f78: 0f 93 push r16 19f7a: 1f 93 push r17 19f7c: cf 93 push r28 19f7e: df 93 push r29 19f80: 6c 01 movw r12, r24 19f82: 7b 01 movw r14, r22 19f84: 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); 19f88: 67 2b or r22, r23 19f8a: 29 f0 breq .+10 ; 0x19f96 19f8c: 06 e0 ldi r16, 0x06 ; 6 19f8e: 81 30 cpi r24, 0x01 ; 1 19f90: 29 f0 breq .+10 ; 0x19f9c 19f92: 05 e0 ldi r16, 0x05 ; 5 19f94: 03 c0 rjmp .+6 ; 0x19f9c 19f96: 04 e0 ldi r16, 0x04 ; 4 19f98: 81 30 cpi r24, 0x01 ; 1 19f9a: d9 f3 breq .-10 ; 0x19f92 const uint8_t item_len = item?strlen_P(item):0; int8_t first = 0; int8_t cursor_pos = 1; lcd_clear(); 19f9c: 0e 94 77 70 call 0xe0ee ; 0xe0ee KEEPALIVE_STATE(PAUSED_FOR_USER); 19fa0: 84 e0 ldi r24, 0x04 ; 4 19fa2: 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; 19fa6: 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; 19fa8: 81 2c mov r8, r1 } if (cursor_pos > 3) { cursor_pos = 3; if (first < items_no - 3) 19faa: 03 50 subi r16, 0x03 ; 3 19fac: 11 0b sbc r17, r17 lcd_clear(); KEEPALIVE_STATE(PAUSED_FOR_USER); while (1) { manage_heater(); 19fae: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 19fb2: 81 e0 ldi r24, 0x01 ; 1 19fb4: 0e 94 ad 8a call 0x1155a ; 0x1155a if (lcd_encoder) 19fb8: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 19fbc: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 19fc0: 00 97 sbiw r24, 0x00 ; 0 19fc2: 09 f4 brne .+2 ; 0x19fc6 19fc4: 9d c0 rjmp .+314 ; 0x1a100 { if (lcd_encoder < 0) 19fc6: 97 ff sbrs r25, 7 19fc8: 88 c0 rjmp .+272 ; 0x1a0da { cursor_pos--; 19fca: c1 50 subi r28, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } lcd_encoder = 0; 19fcc: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 19fd0: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } if (cursor_pos > 3) 19fd4: c4 30 cpi r28, 0x04 ; 4 19fd6: 0c f4 brge .+2 ; 0x19fda 19fd8: 86 c0 rjmp .+268 ; 0x1a0e6 { cursor_pos = 3; if (first < items_no - 3) 19fda: 88 2d mov r24, r8 19fdc: 08 2c mov r0, r8 19fde: 00 0c add r0, r0 19fe0: 99 0b sbc r25, r25 19fe2: 80 17 cp r24, r16 19fe4: 91 07 cpc r25, r17 19fe6: 0c f0 brlt .+2 ; 0x19fea 19fe8: 7a c0 rjmp .+244 ; 0x1a0de { first++; 19fea: 83 94 inc r8 lcd_clear(); 19fec: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_encoder = 0; } if (cursor_pos > 3) { cursor_pos = 3; 19ff0: 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); 19ff2: c1 14 cp r12, r1 19ff4: d1 04 cpc r13, r1 19ff6: 29 f0 breq .+10 ; 0x1a002 19ff8: a6 01 movw r20, r12 19ffa: 60 e0 ldi r22, 0x00 ; 0 19ffc: 80 e0 ldi r24, 0x00 ; 0 19ffe: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 const bool last_visible = (first == items_no - 3); 1a002: a8 2c mov r10, r8 1a004: 08 2c mov r0, r8 1a006: 00 0c add r0, r0 1a008: bb 08 sbc r11, r11 const uint_least8_t ordinary_items = (last_item&&last_visible)?2:3; 1a00a: e1 14 cp r14, r1 1a00c: f1 04 cpc r15, r1 1a00e: 29 f0 breq .+10 ; 0x1a01a 1a010: 82 e0 ldi r24, 0x02 ; 2 1a012: 98 2e mov r9, r24 1a014: a0 16 cp r10, r16 1a016: b1 06 cpc r11, r17 1a018: 11 f0 breq .+4 ; 0x1a01e 1a01a: 93 e0 ldi r25, 0x03 ; 3 1a01c: 99 2e mov r9, r25 for (uint_least8_t i = 0; i < ordinary_items; i++) 1a01e: d0 e0 ldi r29, 0x00 ; 0 { if (item) lcd_puts_at_P(1, i + 1, item); 1a020: df 5f subi r29, 0xFF ; 255 1a022: 43 e9 ldi r20, 0x93 ; 147 1a024: 5a e6 ldi r21, 0x6A ; 106 1a026: 6d 2f mov r22, r29 1a028: 81 e0 ldi r24, 0x01 ; 1 1a02a: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 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++) 1a02e: 9d 12 cpse r9, r29 1a030: f7 cf rjmp .-18 ; 0x1a020 1a032: 48 2c mov r4, r8 1a034: 08 2c mov r0, r8 1a036: 00 0c add r0, r0 1a038: 55 08 sbc r5, r5 1a03a: 66 08 sbc r6, r6 1a03c: 77 08 sbc r7, r7 1a03e: 8f ef ldi r24, 0xFF ; 255 1a040: 48 1a sub r4, r24 1a042: 58 0a sbc r5, r24 1a044: 68 0a sbc r6, r24 1a046: 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++) 1a048: 91 2c mov r9, r1 { lcd_set_cursor(2 + item_len, i+1); 1a04a: 93 94 inc r9 1a04c: 69 2d mov r22, r9 1a04e: 8a e0 ldi r24, 0x0A ; 10 1a050: 0e 94 ab 6f call 0xdf56 ; 0xdf56 1a054: c3 01 movw r24, r6 1a056: b2 01 movw r22, r4 1a058: 0e 94 2c 72 call 0xe458 ; 0xe458 1a05c: 8f ef ldi r24, 0xFF ; 255 1a05e: 48 1a sub r4, r24 1a060: 58 0a sbc r5, r24 1a062: 68 0a sbc r6, r24 1a064: 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++) 1a066: d9 11 cpse r29, r9 1a068: f0 cf rjmp .-32 ; 0x1a04a { 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); 1a06a: e1 14 cp r14, r1 1a06c: f1 04 cpc r15, r1 1a06e: 41 f0 breq .+16 ; 0x1a080 1a070: a0 16 cp r10, r16 1a072: b1 06 cpc r11, r17 1a074: 29 f4 brne .+10 ; 0x1a080 1a076: a7 01 movw r20, r14 1a078: 63 e0 ldi r22, 0x03 ; 3 1a07a: 81 e0 ldi r24, 0x01 ; 1 1a07c: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 1, PSTR(" \n \n ")); 1a080: 4b e6 ldi r20, 0x6B ; 107 1a082: 58 e8 ldi r21, 0x88 ; 136 1a084: 61 e0 ldi r22, 0x01 ; 1 1a086: 80 e0 ldi r24, 0x00 ; 0 1a088: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_putc_at(0, cursor_pos, '>'); 1a08c: 4e e3 ldi r20, 0x3E ; 62 1a08e: 6c 2f mov r22, r28 1a090: 80 e0 ldi r24, 0x00 ; 0 1a092: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 _delay(100); 1a096: 64 e6 ldi r22, 0x64 ; 100 1a098: 70 e0 ldi r23, 0x00 ; 0 1a09a: 80 e0 ldi r24, 0x00 ; 0 1a09c: 90 e0 ldi r25, 0x00 ; 0 1a09e: 0f 94 56 0b call 0x216ac ; 0x216ac if (lcd_clicked()) 1a0a2: 0e 94 c6 73 call 0xe78c ; 0xe78c 1a0a6: 88 23 and r24, r24 1a0a8: 09 f4 brne .+2 ; 0x1a0ac 1a0aa: 81 cf rjmp .-254 ; 0x19fae { KEEPALIVE_STATE(IN_HANDLER); 1a0ac: 82 e0 ldi r24, 0x02 ; 2 1a0ae: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(cursor_pos + first - 1); 1a0b2: 8f ef ldi r24, 0xFF ; 255 1a0b4: 8c 0f add r24, r28 1a0b6: 88 0d add r24, r8 } } } 1a0b8: df 91 pop r29 1a0ba: cf 91 pop r28 1a0bc: 1f 91 pop r17 1a0be: 0f 91 pop r16 1a0c0: ff 90 pop r15 1a0c2: ef 90 pop r14 1a0c4: df 90 pop r13 1a0c6: cf 90 pop r12 1a0c8: bf 90 pop r11 1a0ca: af 90 pop r10 1a0cc: 9f 90 pop r9 1a0ce: 8f 90 pop r8 1a0d0: 7f 90 pop r7 1a0d2: 6f 90 pop r6 1a0d4: 5f 90 pop r5 1a0d6: 4f 90 pop r4 1a0d8: 08 95 ret cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1a0da: cf 5f subi r28, 0xFF ; 255 1a0dc: 77 cf rjmp .-274 ; 0x19fcc 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); 1a0de: 87 e0 ldi r24, 0x07 ; 7 1a0e0: 0f 94 3f 23 call 0x2467e ; 0x2467e 1a0e4: 85 cf rjmp .-246 ; 0x19ff0 } } if (cursor_pos < 1) 1a0e6: c1 11 cpse r28, r1 1a0e8: 84 cf rjmp .-248 ; 0x19ff2 { cursor_pos = 1; if (first > 0) 1a0ea: 18 14 cp r1, r8 1a0ec: 2c f4 brge .+10 ; 0x1a0f8 { first--; 1a0ee: 8a 94 dec r8 lcd_clear(); 1a0f0: 0e 94 77 70 call 0xe0ee ; 0xe0ee } } if (cursor_pos < 1) { cursor_pos = 1; 1a0f4: c1 e0 ldi r28, 0x01 ; 1 1a0f6: 7d cf rjmp .-262 ; 0x19ff2 if (first > 0) { first--; lcd_clear(); } else { // here we are at the very end of the list Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1a0f8: 87 e0 ldi r24, 0x07 ; 7 1a0fa: 0f 94 3f 23 call 0x2467e ; 0x2467e 1a0fe: fa cf rjmp .-12 ; 0x1a0f4 cursor_pos++; } lcd_encoder = 0; } if (cursor_pos > 3) 1a100: c4 30 cpi r28, 0x04 ; 4 1a102: 0c f0 brlt .+2 ; 0x1a106 1a104: 6a cf rjmp .-300 ; 0x19fda 1a106: 75 cf rjmp .-278 ; 0x19ff2 0001a108 : // Update cached value lastReadRegisterValue = logic.rsp.paramValue; return true; } bool __attribute__((noinline)) MMU2::WriteRegister(uint8_t address, uint16_t data) { 1a108: ef 92 push r14 1a10a: ff 92 push r15 1a10c: 0f 93 push r16 1a10e: 1f 93 push r17 1a110: cf 93 push r28 1a112: df 93 push r29 1a114: 00 d0 rcall .+0 ; 0x1a116 1a116: 1f 92 push r1 1a118: 1f 92 push r1 1a11a: cd b7 in r28, 0x3d ; 61 1a11c: de b7 in r29, 0x3e ; 62 1a11e: 08 2f mov r16, r24 1a120: 16 2f mov r17, r22 1a122: f7 2e mov r15, r23 if (!WaitForMMUReady()) { 1a124: 0f 94 47 7a call 0x2f48e ; 0x2f48e 1a128: 88 23 and r24, r24 1a12a: d9 f0 breq .+54 ; 0x1a162 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) { 1a12c: 0b 30 cpi r16, 0x0B ; 11 1a12e: 29 f1 breq .+74 ; 0x1a17a 1a130: 04 31 cpi r16, 0x14 ; 20 1a132: 31 f1 breq .+76 ; 0x1a180 /// @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()) { 1a134: 87 e5 ldi r24, 0x57 ; 87 1a136: e8 2e mov r14, r24 1a138: e9 82 std Y+1, r14 ; 0x01 1a13a: 0a 83 std Y+2, r16 ; 0x02 1a13c: 1b 83 std Y+3, r17 ; 0x03 1a13e: fc 82 std Y+4, r15 ; 0x04 1a140: ce 01 movw r24, r28 1a142: 01 96 adiw r24, 0x01 ; 1 1a144: 0f 94 2f 4e call 0x29c5e ; 0x29c5e 1a148: 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)); 1a14a: 47 e5 ldi r20, 0x57 ; 87 1a14c: 50 2f mov r21, r16 1a14e: 61 2f mov r22, r17 1a150: 7f 2d mov r23, r15 1a152: 0f 94 ba 95 call 0x32b74 ; 0x32b74 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)); 1a156: 60 e0 ldi r22, 0x00 ; 0 1a158: 80 e0 ldi r24, 0x00 ; 0 1a15a: 0f 94 4b 9d call 0x33a96 ; 0x33a96 1a15e: 88 23 and r24, r24 1a160: 59 f3 breq .-42 ; 0x1a138 return true; } 1a162: 0f 90 pop r0 1a164: 0f 90 pop r0 1a166: 0f 90 pop r0 1a168: 0f 90 pop r0 1a16a: 0f 90 pop r0 1a16c: df 91 pop r29 1a16e: cf 91 pop r28 1a170: 1f 91 pop r17 1a172: 0f 91 pop r16 1a174: ff 90 pop r15 1a176: ef 90 pop r14 1a178: 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); 1a17a: 10 93 de 12 sts 0x12DE, r17 ; 0x8012de 1a17e: da cf rjmp .-76 ; 0x1a134 break; case (uint8_t)Register::Pulley_Slow_Feedrate: logic.PlanPulleySlowFeedRate(data); 1a180: 10 93 df 12 sts 0x12DF, r17 ; 0x8012df 1a184: d7 cf rjmp .-82 ; 0x1a134 0001a186 : #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) 1a186: 82 30 cpi r24, 0x02 ; 2 1a188: 91 05 cpc r25, r1 1a18a: 38 f0 brcs .+14 ; 0x1a19a // 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 1a18c: 88 0f add r24, r24 1a18e: 99 1f adc r25, r25 1a190: 88 0f add r24, r24 1a192: 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, 1a194: 05 97 sbiw r24, 0x05 ; 5 #endif // busy wait __asm__ __volatile__ ( 1a196: 01 97 sbiw r24, 0x01 ; 1 1a198: f1 f7 brne .-4 ; 0x1a196 "1: sbiw %0,1" "\n\t" // 2 cycles "brne 1b" : "=w" (us) : "0" (us) // 2 cycles ); // return = 4 cycles } 1a19a: 08 95 ret 0001a19c : SREG = oldSREG; } int digitalRead(uint8_t pin) { 1a19c: cf 93 push r28 1a19e: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1a1a0: 28 2f mov r18, r24 1a1a2: 30 e0 ldi r19, 0x00 ; 0 1a1a4: f9 01 movw r30, r18 1a1a6: e5 5f subi r30, 0xF5 ; 245 1a1a8: f8 47 sbci r31, 0x78 ; 120 1a1aa: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1a1ac: f9 01 movw r30, r18 1a1ae: eb 54 subi r30, 0x4B ; 75 1a1b0: f9 47 sbci r31, 0x79 ; 121 1a1b2: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1a1b4: f9 01 movw r30, r18 1a1b6: e1 5a subi r30, 0xA1 ; 161 1a1b8: f9 47 sbci r31, 0x79 ; 121 1a1ba: c4 91 lpm r28, Z if (port == NOT_A_PIN) return LOW; 1a1bc: cc 23 and r28, r28 1a1be: a1 f0 breq .+40 ; 0x1a1e8 // 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); 1a1c0: 81 11 cpse r24, r1 1a1c2: 0e 94 d5 ba call 0x175aa ; 0x175aa if (*portInputRegister(port) & bit) return HIGH; 1a1c6: ec 2f mov r30, r28 1a1c8: f0 e0 ldi r31, 0x00 ; 0 1a1ca: ee 0f add r30, r30 1a1cc: ff 1f adc r31, r31 1a1ce: eb 5b subi r30, 0xBB ; 187 1a1d0: f9 47 sbci r31, 0x79 ; 121 1a1d2: a5 91 lpm r26, Z+ 1a1d4: b4 91 lpm r27, Z 1a1d6: ec 91 ld r30, X 1a1d8: ed 23 and r30, r29 1a1da: 81 e0 ldi r24, 0x01 ; 1 1a1dc: 90 e0 ldi r25, 0x00 ; 0 1a1de: 09 f4 brne .+2 ; 0x1a1e2 1a1e0: 80 e0 ldi r24, 0x00 ; 0 return LOW; } 1a1e2: df 91 pop r29 1a1e4: cf 91 pop r28 1a1e6: 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; 1a1e8: 80 e0 ldi r24, 0x00 ; 0 1a1ea: 90 e0 ldi r25, 0x00 ; 0 1a1ec: fa cf rjmp .-12 ; 0x1a1e2 0001a1ee : #endif } } void digitalWrite(uint8_t pin, uint8_t val) { 1a1ee: 1f 93 push r17 1a1f0: cf 93 push r28 1a1f2: df 93 push r29 uint8_t timer = digitalPinToTimer(pin); 1a1f4: 28 2f mov r18, r24 1a1f6: 30 e0 ldi r19, 0x00 ; 0 1a1f8: f9 01 movw r30, r18 1a1fa: e5 5f subi r30, 0xF5 ; 245 1a1fc: f8 47 sbci r31, 0x78 ; 120 1a1fe: 84 91 lpm r24, Z uint8_t bit = digitalPinToBitMask(pin); 1a200: f9 01 movw r30, r18 1a202: eb 54 subi r30, 0x4B ; 75 1a204: f9 47 sbci r31, 0x79 ; 121 1a206: d4 91 lpm r29, Z uint8_t port = digitalPinToPort(pin); 1a208: f9 01 movw r30, r18 1a20a: e1 5a subi r30, 0xA1 ; 161 1a20c: f9 47 sbci r31, 0x79 ; 121 1a20e: c4 91 lpm r28, Z volatile uint8_t *out; if (port == NOT_A_PIN) return; 1a210: cc 23 and r28, r28 1a212: a9 f0 breq .+42 ; 0x1a23e 1a214: 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); 1a216: 81 11 cpse r24, r1 1a218: 0e 94 d5 ba call 0x175aa ; 0x175aa out = portOutputRegister(port); 1a21c: ec 2f mov r30, r28 1a21e: f0 e0 ldi r31, 0x00 ; 0 1a220: ee 0f add r30, r30 1a222: ff 1f adc r31, r31 1a224: e5 5d subi r30, 0xD5 ; 213 1a226: f9 47 sbci r31, 0x79 ; 121 1a228: a5 91 lpm r26, Z+ 1a22a: b4 91 lpm r27, Z uint8_t oldSREG = SREG; 1a22c: 8f b7 in r24, 0x3f ; 63 cli(); 1a22e: f8 94 cli if (val == LOW) { *out &= ~bit; 1a230: ec 91 ld r30, X out = portOutputRegister(port); uint8_t oldSREG = SREG; cli(); if (val == LOW) { 1a232: 11 11 cpse r17, r1 1a234: 08 c0 rjmp .+16 ; 0x1a246 *out &= ~bit; 1a236: d0 95 com r29 1a238: de 23 and r29, r30 } else { *out |= bit; 1a23a: dc 93 st X, r29 } SREG = oldSREG; 1a23c: 8f bf out 0x3f, r24 ; 63 } 1a23e: df 91 pop r29 1a240: cf 91 pop r28 1a242: 1f 91 pop r17 1a244: 08 95 ret cli(); if (val == LOW) { *out &= ~bit; } else { *out |= bit; 1a246: de 2b or r29, r30 1a248: f8 cf rjmp .-16 ; 0x1a23a 0001a24a : #define ARDUINO_MAIN #include "wiring_private.h" #include "pins_arduino.h" void pinMode(uint8_t pin, uint8_t mode) { 1a24a: cf 93 push r28 1a24c: df 93 push r29 uint8_t bit = digitalPinToBitMask(pin); 1a24e: 90 e0 ldi r25, 0x00 ; 0 1a250: fc 01 movw r30, r24 1a252: eb 54 subi r30, 0x4B ; 75 1a254: f9 47 sbci r31, 0x79 ; 121 1a256: 24 91 lpm r18, Z uint8_t port = digitalPinToPort(pin); 1a258: 81 5a subi r24, 0xA1 ; 161 1a25a: 99 47 sbci r25, 0x79 ; 121 1a25c: fc 01 movw r30, r24 1a25e: 84 91 lpm r24, Z volatile uint8_t *reg, *out; if (port == NOT_A_PIN) return; 1a260: 88 23 and r24, r24 1a262: d1 f0 breq .+52 ; 0x1a298 // JWS: can I let the optimizer do this? reg = portModeRegister(port); 1a264: 90 e0 ldi r25, 0x00 ; 0 1a266: 88 0f add r24, r24 1a268: 99 1f adc r25, r25 1a26a: fc 01 movw r30, r24 1a26c: ef 5e subi r30, 0xEF ; 239 1a26e: f9 47 sbci r31, 0x79 ; 121 1a270: a5 91 lpm r26, Z+ 1a272: b4 91 lpm r27, Z out = portOutputRegister(port); 1a274: fc 01 movw r30, r24 1a276: e5 5d subi r30, 0xD5 ; 213 1a278: f9 47 sbci r31, 0x79 ; 121 1a27a: c5 91 lpm r28, Z+ 1a27c: d4 91 lpm r29, Z if (mode == INPUT) { 1a27e: 61 11 cpse r22, r1 1a280: 0e c0 rjmp .+28 ; 0x1a29e uint8_t oldSREG = SREG; 1a282: 9f b7 in r25, 0x3f ; 63 cli(); 1a284: f8 94 cli *reg &= ~bit; 1a286: 8c 91 ld r24, X 1a288: e2 2f mov r30, r18 1a28a: e0 95 com r30 1a28c: 8e 23 and r24, r30 1a28e: 8c 93 st X, r24 *out &= ~bit; 1a290: 28 81 ld r18, Y 1a292: e2 23 and r30, r18 1a294: e8 83 st Y, r30 SREG = oldSREG; 1a296: 9f bf out 0x3f, r25 ; 63 uint8_t oldSREG = SREG; cli(); *reg |= bit; SREG = oldSREG; } } 1a298: df 91 pop r29 1a29a: cf 91 pop r28 1a29c: 08 95 ret cli(); *reg &= ~bit; *out |= bit; SREG = oldSREG; } else { uint8_t oldSREG = SREG; 1a29e: 8f b7 in r24, 0x3f ; 63 cli(); 1a2a0: f8 94 cli *reg |= bit; 1a2a2: ec 91 ld r30, X 1a2a4: e2 2b or r30, r18 1a2a6: ec 93 st X, r30 SREG = oldSREG; 1a2a8: 8f bf out 0x3f, r24 ; 63 1a2aa: f6 cf rjmp .-20 ; 0x1a298 0001a2ac : // 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) { 1a2ac: 1f 93 push r17 1a2ae: cf 93 push r28 1a2b0: df 93 push r29 1a2b2: 18 2f mov r17, r24 1a2b4: 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); 1a2b6: 61 e0 ldi r22, 0x01 ; 1 1a2b8: 0e 94 25 d1 call 0x1a24a ; 0x1a24a if (val == 0) 1a2bc: 20 97 sbiw r28, 0x00 ; 0 1a2be: 39 f4 brne .+14 ; 0x1a2ce { digitalWrite(pin, LOW); 1a2c0: 60 e0 ldi r22, 0x00 ; 0 } else if (val == 255) { digitalWrite(pin, HIGH); 1a2c2: 81 2f mov r24, r17 } else { digitalWrite(pin, HIGH); } } } } 1a2c4: df 91 pop r29 1a2c6: cf 91 pop r28 1a2c8: 1f 91 pop r17 { digitalWrite(pin, LOW); } else if (val == 255) { digitalWrite(pin, HIGH); 1a2ca: 0c 94 f7 d0 jmp 0x1a1ee ; 0x1a1ee pinMode(pin, OUTPUT); if (val == 0) { digitalWrite(pin, LOW); } else if (val == 255) 1a2ce: cf 3f cpi r28, 0xFF ; 255 1a2d0: d1 05 cpc r29, r1 1a2d2: 11 f4 brne .+4 ; 0x1a2d8 { digitalWrite(pin, HIGH); 1a2d4: 61 e0 ldi r22, 0x01 ; 1 1a2d6: f5 cf rjmp .-22 ; 0x1a2c2 } else { switch(digitalPinToTimer(pin)) 1a2d8: e1 2f mov r30, r17 1a2da: f0 e0 ldi r31, 0x00 ; 0 1a2dc: e5 5f subi r30, 0xF5 ; 245 1a2de: f8 47 sbci r31, 0x78 ; 120 1a2e0: e4 91 lpm r30, Z 1a2e2: e1 50 subi r30, 0x01 ; 1 1a2e4: e2 31 cpi r30, 0x12 ; 18 1a2e6: 08 f0 brcs .+2 ; 0x1a2ea 1a2e8: b3 c0 rjmp .+358 ; 0x1a450 1a2ea: f0 e0 ldi r31, 0x00 ; 0 1a2ec: 88 27 eor r24, r24 1a2ee: e4 58 subi r30, 0x84 ; 132 1a2f0: fe 42 sbci r31, 0x2E ; 46 1a2f2: 8f 4f sbci r24, 0xFF ; 255 1a2f4: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> 1a2f8: 8e d1 rcall .+796 ; 0x1a616 1a2fa: 96 d1 rcall .+812 ; 0x1a628 1a2fc: 9b d1 rcall .+822 ; 0x1a634 1a2fe: a5 d1 rcall .+842 ; 0x1a64a 1a300: af d1 rcall .+862 ; 0x1a660 1a302: 28 d2 rcall .+1104 ; 0x1a754 1a304: b9 d1 rcall .+882 ; 0x1a678 1a306: c1 d1 rcall .+898 ; 0x1a68a 1a308: c9 d1 rcall .+914 ; 0x1a69c 1a30a: d3 d1 rcall .+934 ; 0x1a6b2 1a30c: dd d1 rcall .+954 ; 0x1a6c8 1a30e: e7 d1 rcall .+974 ; 0x1a6de 1a310: f6 d1 rcall .+1004 ; 0x1a6fe 1a312: 00 d2 rcall .+1024 ; 0x1a714 1a314: 28 d2 rcall .+1104 ; 0x1a766 1a316: 0a d2 rcall .+1044 ; 0x1a72c 1a318: 14 d2 rcall .+1064 ; 0x1a742 1a31a: 1e d2 rcall .+1084 ; 0x1a758 #endif #if defined(TCCR0A) && defined(COM0A1) case TIMER0A: // connect pwm to pin on timer 0, channel A sbi(TCCR0A, COM0A1); 1a31c: 84 b5 in r24, 0x24 ; 36 1a31e: 80 68 ori r24, 0x80 ; 128 1a320: 84 bd out 0x24, r24 ; 36 OCR0A = val; // set pwm duty 1a322: c7 bd out 0x27, r28 ; 39 } else { digitalWrite(pin, HIGH); } } } } 1a324: df 91 pop r29 1a326: cf 91 pop r28 1a328: 1f 91 pop r17 1a32a: 08 95 ret #endif #if defined(TCCR0A) && defined(COM0B1) case TIMER0B: // connect pwm to pin on timer 0, channel B sbi(TCCR0A, COM0B1); 1a32c: 84 b5 in r24, 0x24 ; 36 1a32e: 80 62 ori r24, 0x20 ; 32 1a330: 84 bd out 0x24, r24 ; 36 OCR0B = val; // set pwm duty 1a332: c8 bd out 0x28, r28 ; 40 1a334: f7 cf rjmp .-18 ; 0x1a324 #endif #if defined(TCCR1A) && defined(COM1A1) case TIMER1A: // connect pwm to pin on timer 1, channel A sbi(TCCR1A, COM1A1); 1a336: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1a33a: 80 68 ori r24, 0x80 ; 128 1a33c: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1A = val; // set pwm duty 1a340: d0 93 89 00 sts 0x0089, r29 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1a344: c0 93 88 00 sts 0x0088, r28 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 1a348: ed cf rjmp .-38 ; 0x1a324 #endif #if defined(TCCR1A) && defined(COM1B1) case TIMER1B: // connect pwm to pin on timer 1, channel B sbi(TCCR1A, COM1B1); 1a34a: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1a34e: 80 62 ori r24, 0x20 ; 32 1a350: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1B = val; // set pwm duty 1a354: d0 93 8b 00 sts 0x008B, r29 ; 0x80008b <__TEXT_REGION_LENGTH__+0x7c208b> 1a358: c0 93 8a 00 sts 0x008A, r28 ; 0x80008a <__TEXT_REGION_LENGTH__+0x7c208a> 1a35c: e3 cf rjmp .-58 ; 0x1a324 #endif #if defined(TCCR1A) && defined(COM1C1) case TIMER1C: // connect pwm to pin on timer 1, channel C sbi(TCCR1A, COM1C1); 1a35e: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1a362: 88 60 ori r24, 0x08 ; 8 1a364: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> OCR1C = val; // set pwm duty 1a368: d0 93 8d 00 sts 0x008D, r29 ; 0x80008d <__TEXT_REGION_LENGTH__+0x7c208d> 1a36c: c0 93 8c 00 sts 0x008C, r28 ; 0x80008c <__TEXT_REGION_LENGTH__+0x7c208c> 1a370: d9 cf rjmp .-78 ; 0x1a324 #endif #if defined(TCCR2A) && defined(COM2A1) case TIMER2A: // connect pwm to pin on timer 2, channel A sbi(TCCR2A, COM2A1); 1a372: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1a376: 80 68 ori r24, 0x80 ; 128 1a378: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2A = val; // set pwm duty 1a37c: c0 93 b3 00 sts 0x00B3, r28 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> 1a380: d1 cf rjmp .-94 ; 0x1a324 #endif #if defined(TCCR2A) && defined(COM2B1) case TIMER2B: // connect pwm to pin on timer 2, channel B sbi(TCCR2A, COM2B1); 1a382: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1a386: 80 62 ori r24, 0x20 ; 32 1a388: 80 93 b0 00 sts 0x00B0, r24 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> OCR2B = val; // set pwm duty 1a38c: c0 93 b4 00 sts 0x00B4, r28 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> 1a390: c9 cf rjmp .-110 ; 0x1a324 #endif #if defined(TCCR3A) && defined(COM3A1) case TIMER3A: // connect pwm to pin on timer 3, channel A sbi(TCCR3A, COM3A1); 1a392: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1a396: 80 68 ori r24, 0x80 ; 128 1a398: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3A = val; // set pwm duty 1a39c: d0 93 99 00 sts 0x0099, r29 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1a3a0: c0 93 98 00 sts 0x0098, r28 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> 1a3a4: bf cf rjmp .-130 ; 0x1a324 #endif #if defined(TCCR3A) && defined(COM3B1) case TIMER3B: // connect pwm to pin on timer 3, channel B sbi(TCCR3A, COM3B1); 1a3a6: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1a3aa: 80 62 ori r24, 0x20 ; 32 1a3ac: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3B = val; // set pwm duty 1a3b0: d0 93 9b 00 sts 0x009B, r29 ; 0x80009b <__TEXT_REGION_LENGTH__+0x7c209b> 1a3b4: c0 93 9a 00 sts 0x009A, r28 ; 0x80009a <__TEXT_REGION_LENGTH__+0x7c209a> 1a3b8: b5 cf rjmp .-150 ; 0x1a324 #endif #if defined(TCCR3A) && defined(COM3C1) case TIMER3C: // connect pwm to pin on timer 3, channel C sbi(TCCR3A, COM3C1); 1a3ba: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1a3be: 88 60 ori r24, 0x08 ; 8 1a3c0: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> OCR3C = val; // set pwm duty 1a3c4: d0 93 9d 00 sts 0x009D, r29 ; 0x80009d <__TEXT_REGION_LENGTH__+0x7c209d> 1a3c8: c0 93 9c 00 sts 0x009C, r28 ; 0x80009c <__TEXT_REGION_LENGTH__+0x7c209c> 1a3cc: ab cf rjmp .-170 ; 0x1a324 #endif #if defined(TCCR4A) case TIMER4A: //connect pwm to pin on timer 4, channel A sbi(TCCR4A, COM4A1); 1a3ce: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a3d2: 80 68 ori r24, 0x80 ; 128 1a3d4: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #if defined(COM4A0) // only used on 32U4 cbi(TCCR4A, COM4A0); 1a3d8: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a3dc: 8f 7b andi r24, 0xBF ; 191 1a3de: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> #endif OCR4A = val; // set pwm duty 1a3e2: d0 93 a9 00 sts 0x00A9, r29 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1a3e6: c0 93 a8 00 sts 0x00A8, r28 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 1a3ea: 9c cf rjmp .-200 ; 0x1a324 #endif #if defined(TCCR4A) && defined(COM4B1) case TIMER4B: // connect pwm to pin on timer 4, channel B sbi(TCCR4A, COM4B1); 1a3ec: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a3f0: 80 62 ori r24, 0x20 ; 32 1a3f2: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4B = val; // set pwm duty 1a3f6: d0 93 ab 00 sts 0x00AB, r29 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1a3fa: c0 93 aa 00 sts 0x00AA, r28 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> 1a3fe: 92 cf rjmp .-220 ; 0x1a324 #endif #if defined(TCCR4A) && defined(COM4C1) case TIMER4C: // connect pwm to pin on timer 4, channel C sbi(TCCR4A, COM4C1); 1a400: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1a404: 88 60 ori r24, 0x08 ; 8 1a406: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> OCR4C = val; // set pwm duty 1a40a: d0 93 ad 00 sts 0x00AD, r29 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1a40e: c0 93 ac 00 sts 0x00AC, r28 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 1a412: 88 cf rjmp .-240 ; 0x1a324 #if defined(TCCR5A) && defined(COM5A1) case TIMER5A: // connect pwm to pin on timer 5, channel A sbi(TCCR5A, COM5A1); 1a414: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1a418: 80 68 ori r24, 0x80 ; 128 1a41a: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5A = val; // set pwm duty 1a41e: d0 93 29 01 sts 0x0129, r29 ; 0x800129 <__TEXT_REGION_LENGTH__+0x7c2129> 1a422: c0 93 28 01 sts 0x0128, r28 ; 0x800128 <__TEXT_REGION_LENGTH__+0x7c2128> 1a426: 7e cf rjmp .-260 ; 0x1a324 #endif #if defined(TCCR5A) && defined(COM5B1) case TIMER5B: // connect pwm to pin on timer 5, channel B sbi(TCCR5A, COM5B1); 1a428: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1a42c: 80 62 ori r24, 0x20 ; 32 1a42e: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5B = val; // set pwm duty 1a432: d0 93 2b 01 sts 0x012B, r29 ; 0x80012b <__TEXT_REGION_LENGTH__+0x7c212b> 1a436: c0 93 2a 01 sts 0x012A, r28 ; 0x80012a <__TEXT_REGION_LENGTH__+0x7c212a> 1a43a: 74 cf rjmp .-280 ; 0x1a324 #endif #if defined(TCCR5A) && defined(COM5C1) case TIMER5C: // connect pwm to pin on timer 5, channel C sbi(TCCR5A, COM5C1); 1a43c: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1a440: 88 60 ori r24, 0x08 ; 8 1a442: 80 93 20 01 sts 0x0120, r24 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> OCR5C = val; // set pwm duty 1a446: d0 93 2d 01 sts 0x012D, r29 ; 0x80012d <__TEXT_REGION_LENGTH__+0x7c212d> 1a44a: c0 93 2c 01 sts 0x012C, r28 ; 0x80012c <__TEXT_REGION_LENGTH__+0x7c212c> 1a44e: 6a cf rjmp .-300 ; 0x1a324 break; #endif case NOT_ON_TIMER: default: if (val < 128) { 1a450: c0 38 cpi r28, 0x80 ; 128 1a452: d1 05 cpc r29, r1 1a454: 0c f0 brlt .+2 ; 0x1a458 1a456: 3e cf rjmp .-388 ; 0x1a2d4 1a458: 33 cf rjmp .-410 ; 0x1a2c0 0001a45a : } } /// 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){ 1a45a: 4f 92 push r4 1a45c: 5f 92 push r5 1a45e: 6f 92 push r6 1a460: 7f 92 push r7 1a462: 8f 92 push r8 1a464: 9f 92 push r9 1a466: af 92 push r10 1a468: bf 92 push r11 1a46a: cf 92 push r12 1a46c: df 92 push r13 1a46e: ef 92 push r14 1a470: ff 92 push r15 1a472: 0f 93 push r16 1a474: 1f 93 push r17 1a476: cf 93 push r28 1a478: df 93 push r29 1a47a: eb 01 movw r28, r22 1a47c: 6a 01 movw r12, r20 1a47e: 79 01 movw r14, r18 sm4_do_step(axes); 1a480: 0f 94 20 26 call 0x24c40 ; 0x24c40 1a484: f6 01 movw r30, r12 1a486: 00 81 ld r16, Z 1a488: 11 81 ldd r17, Z+1 ; 0x01 /// keep max speed (avoid extra computation) if (acc > 0 && delay_us == min_delay_us){ 1a48a: 1c 16 cp r1, r28 1a48c: 1d 06 cpc r1, r29 1a48e: b4 f4 brge .+44 ; 0x1a4bc 1a490: 0e 15 cp r16, r14 1a492: 1f 05 cpc r17, r15 1a494: 99 f4 brne .+38 ; 0x1a4bc delayMicroseconds(delay_us); 1a496: c8 01 movw r24, r16 //DBG(_n("%d "), t1); delayMicroseconds(t1); delay_us = t1; } 1a498: df 91 pop r29 1a49a: cf 91 pop r28 1a49c: 1f 91 pop r17 1a49e: 0f 91 pop r16 1a4a0: ff 90 pop r15 1a4a2: ef 90 pop r14 1a4a4: df 90 pop r13 1a4a6: cf 90 pop r12 1a4a8: bf 90 pop r11 1a4aa: af 90 pop r10 1a4ac: 9f 90 pop r9 1a4ae: 8f 90 pop r8 1a4b0: 7f 90 pop r7 1a4b2: 6f 90 pop r6 1a4b4: 5f 90 pop r5 1a4b6: 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); 1a4b8: 0c 94 c3 d0 jmp 0x1a186 ; 0x1a186 return; } // v1 = v0 + a * t // 0.01 = length of a step const float t0 = delay_us * 0.000001f; 1a4bc: b8 01 movw r22, r16 1a4be: 90 e0 ldi r25, 0x00 ; 0 1a4c0: 80 e0 ldi r24, 0x00 ; 0 1a4c2: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 1a4c6: 2d eb ldi r18, 0xBD ; 189 1a4c8: 37 e3 ldi r19, 0x37 ; 55 1a4ca: 46 e8 ldi r20, 0x86 ; 134 1a4cc: 55 e3 ldi r21, 0x35 ; 53 1a4ce: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1a4d2: 4b 01 movw r8, r22 1a4d4: 5c 01 movw r10, r24 const float v1 = (0.01f / t0 + acc * t0); 1a4d6: be 01 movw r22, r28 1a4d8: 0d 2e mov r0, r29 1a4da: 00 0c add r0, r0 1a4dc: 88 0b sbc r24, r24 1a4de: 99 0b sbc r25, r25 1a4e0: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1a4e4: a5 01 movw r20, r10 1a4e6: 94 01 movw r18, r8 1a4e8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1a4ec: 2b 01 movw r4, r22 1a4ee: 3c 01 movw r6, r24 1a4f0: a5 01 movw r20, r10 1a4f2: 94 01 movw r18, r8 1a4f4: 6a e0 ldi r22, 0x0A ; 10 1a4f6: 77 ed ldi r23, 0xD7 ; 215 1a4f8: 83 e2 ldi r24, 0x23 ; 35 1a4fa: 9c e3 ldi r25, 0x3C ; 60 1a4fc: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1a500: 9b 01 movw r18, r22 1a502: ac 01 movw r20, r24 1a504: c3 01 movw r24, r6 1a506: b2 01 movw r22, r4 1a508: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1a50c: 4b 01 movw r8, r22 1a50e: 5c 01 movw r10, r24 uint16_t t1; if (v1 <= 0.16f){ ///< slowest speed convertible to uint16_t delay 1a510: 2a e0 ldi r18, 0x0A ; 10 1a512: 37 ed ldi r19, 0xD7 ; 215 1a514: 43 e2 ldi r20, 0x23 ; 35 1a516: 5e e3 ldi r21, 0x3E ; 62 1a518: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1a51c: 18 16 cp r1, r24 1a51e: dc f5 brge .+118 ; 0x1a596 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)); 1a520: a5 01 movw r20, r10 1a522: 94 01 movw r18, r8 1a524: 6a e0 ldi r22, 0x0A ; 10 1a526: 77 ed ldi r23, 0xD7 ; 215 1a528: 83 e2 ldi r24, 0x23 ; 35 1a52a: 9c e3 ldi r25, 0x3C ; 60 1a52c: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1a530: 20 e0 ldi r18, 0x00 ; 0 1a532: 34 e2 ldi r19, 0x24 ; 36 1a534: 44 e7 ldi r20, 0x74 ; 116 1a536: 59 e4 ldi r21, 0x49 ; 73 1a538: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__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); 1a53c: 20 e0 ldi r18, 0x00 ; 0 1a53e: 30 e0 ldi r19, 0x00 ; 0 1a540: 40 e0 ldi r20, 0x00 ; 0 1a542: 5f e3 ldi r21, 0x3F ; 63 1a544: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1a548: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 1a54c: 5b 01 movw r10, r22 1a54e: 6e 15 cp r22, r14 1a550: 7f 05 cpc r23, r15 1a552: 08 f4 brcc .+2 ; 0x1a556 1a554: 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){ 1a556: 0a 15 cp r16, r10 1a558: 1b 05 cpc r17, r11 1a55a: 31 f4 brne .+12 ; 0x1a568 1a55c: 20 97 sbiw r28, 0x00 ; 0 1a55e: 21 f0 breq .+8 ; 0x1a568 if (acc > 0) 1a560: fc f0 brlt .+62 ; 0x1a5a0 t1--; 1a562: f1 e0 ldi r31, 0x01 ; 1 1a564: af 1a sub r10, r31 1a566: b1 08 sbc r11, r1 t1++; } //DBG(_n("%d "), t1); delayMicroseconds(t1); 1a568: c5 01 movw r24, r10 1a56a: 0e 94 c3 d0 call 0x1a186 ; 0x1a186 delay_us = t1; 1a56e: f6 01 movw r30, r12 1a570: b1 82 std Z+1, r11 ; 0x01 1a572: a0 82 st Z, r10 } 1a574: df 91 pop r29 1a576: cf 91 pop r28 1a578: 1f 91 pop r17 1a57a: 0f 91 pop r16 1a57c: ff 90 pop r15 1a57e: ef 90 pop r14 1a580: df 90 pop r13 1a582: cf 90 pop r12 1a584: bf 90 pop r11 1a586: af 90 pop r10 1a588: 9f 90 pop r9 1a58a: 8f 90 pop r8 1a58c: 7f 90 pop r7 1a58e: 6f 90 pop r6 1a590: 5f 90 pop r5 1a592: 4f 90 pop r4 1a594: 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 1a596: 80 e1 ldi r24, 0x10 ; 16 1a598: a8 2e mov r10, r24 1a59a: 87 e2 ldi r24, 0x27 ; 39 1a59c: b8 2e mov r11, r24 1a59e: db cf rjmp .-74 ; 0x1a556 /// make sure delay has changed a bit at least if (t1 == delay_us && acc != 0){ if (acc > 0) t1--; else t1++; 1a5a0: 8f ef ldi r24, 0xFF ; 255 1a5a2: a8 1a sub r10, r24 1a5a4: b8 0a sbc r11, r24 1a5a6: e0 cf rjmp .-64 ; 0x1a568 0001a5a8 : /// 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){ 1a5a8: 2f 92 push r2 1a5aa: 3f 92 push r3 1a5ac: 4f 92 push r4 1a5ae: 5f 92 push r5 1a5b0: 6f 92 push r6 1a5b2: 7f 92 push r7 1a5b4: 8f 92 push r8 1a5b6: 9f 92 push r9 1a5b8: af 92 push r10 1a5ba: bf 92 push r11 1a5bc: cf 92 push r12 1a5be: df 92 push r13 1a5c0: ef 92 push r14 1a5c2: ff 92 push r15 1a5c4: 0f 93 push r16 1a5c6: 1f 93 push r17 1a5c8: cf 93 push r28 1a5ca: df 93 push r29 1a5cc: 00 d0 rcall .+0 ; 0x1a5ce 1a5ce: cd b7 in r28, 0x3d ; 61 1a5d0: de b7 in r29, 0x3e ; 62 if (steps <= 0 || dec <= 0) 1a5d2: f9 01 movw r30, r18 1a5d4: e0 80 ld r14, Z 1a5d6: f1 80 ldd r15, Z+1 ; 0x01 1a5d8: e1 14 cp r14, r1 1a5da: f1 04 cpc r15, r1 1a5dc: 09 f4 brne .+2 ; 0x1a5e0 1a5de: 6c c0 rjmp .+216 ; 0x1a6b8 1a5e0: 16 16 cp r1, r22 1a5e2: 17 06 cpc r1, r23 1a5e4: 0c f0 brlt .+2 ; 0x1a5e8 1a5e6: 68 c0 rjmp .+208 ; 0x1a6b8 1a5e8: 19 01 movw r2, r18 1a5ea: 5b 83 std Y+3, r21 ; 0x03 1a5ec: 4a 83 std Y+2, r20 ; 0x02 1a5ee: 6b 01 movw r12, r22 1a5f0: 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)); 1a5f2: fa 01 movw r30, r20 1a5f4: 00 81 ld r16, Z 1a5f6: 11 81 ldd r17, Z+1 ; 0x01 1a5f8: b8 01 movw r22, r16 1a5fa: 90 e0 ldi r25, 0x00 ; 0 1a5fc: 80 e0 ldi r24, 0x00 ; 0 1a5fe: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 1a602: 4b 01 movw r8, r22 1a604: 5c 01 movw r10, r24 1a606: b6 01 movw r22, r12 1a608: 0d 2c mov r0, r13 1a60a: 00 0c add r0, r0 1a60c: 88 0b sbc r24, r24 1a60e: 99 0b sbc r25, r25 1a610: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1a614: 2b 01 movw r4, r22 1a616: 3c 01 movw r6, r24 1a618: a5 01 movw r20, r10 1a61a: 94 01 movw r18, r8 1a61c: c5 01 movw r24, r10 1a61e: b4 01 movw r22, r8 1a620: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1a624: 9b 01 movw r18, r22 1a626: ac 01 movw r20, r24 1a628: c3 01 movw r24, r6 1a62a: b2 01 movw r22, r4 1a62c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1a630: 9b 01 movw r18, r22 1a632: ac 01 movw r20, r24 1a634: 6a e0 ldi r22, 0x0A ; 10 1a636: 77 ed ldi r23, 0xD7 ; 215 1a638: 83 ea ldi r24, 0xA3 ; 163 1a63a: 9b e3 ldi r25, 0x3B ; 59 1a63c: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__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); 1a640: 20 e0 ldi r18, 0x00 ; 0 1a642: 30 e0 ldi r19, 0x00 ; 0 1a644: 40 e0 ldi r20, 0x00 ; 0 1a646: 5f e3 ldi r21, 0x3F ; 63 1a648: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1a64c: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__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){ 1a650: 6e 15 cp r22, r14 1a652: 7f 05 cpc r23, r15 1a654: 30 f5 brcc .+76 ; 0x1a6a2 /// go steady sm4_do_step(axes); 1a656: 89 81 ldd r24, Y+1 ; 0x01 1a658: 0f 94 20 26 call 0x24c40 ; 0x24c40 delayMicroseconds(delay_us); 1a65c: ea 81 ldd r30, Y+2 ; 0x02 1a65e: fb 81 ldd r31, Y+3 ; 0x03 1a660: 80 81 ld r24, Z 1a662: 91 81 ldd r25, Z+1 ; 0x01 1a664: 0e 94 c3 d0 call 0x1a186 ; 0x1a186 } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); } --steps; 1a668: f1 01 movw r30, r2 1a66a: 80 81 ld r24, Z 1a66c: 91 81 ldd r25, Z+1 ; 0x01 1a66e: 01 97 sbiw r24, 0x01 ; 1 1a670: 91 83 std Z+1, r25 ; 0x01 1a672: 80 83 st Z, r24 return true; 1a674: 81 e0 ldi r24, 0x01 ; 1 } 1a676: 0f 90 pop r0 1a678: 0f 90 pop r0 1a67a: 0f 90 pop r0 1a67c: df 91 pop r29 1a67e: cf 91 pop r28 1a680: 1f 91 pop r17 1a682: 0f 91 pop r16 1a684: ff 90 pop r15 1a686: ef 90 pop r14 1a688: df 90 pop r13 1a68a: cf 90 pop r12 1a68c: bf 90 pop r11 1a68e: af 90 pop r10 1a690: 9f 90 pop r9 1a692: 8f 90 pop r8 1a694: 7f 90 pop r7 1a696: 6f 90 pop r6 1a698: 5f 90 pop r5 1a69a: 4f 90 pop r4 1a69c: 3f 90 pop r3 1a69e: 2f 90 pop r2 1a6a0: 08 95 ret /// go steady sm4_do_step(axes); delayMicroseconds(delay_us); } else { /// decelerate accelerate_1_step(axes, -dec, delay_us, delay_us); 1a6a2: 66 27 eor r22, r22 1a6a4: 77 27 eor r23, r23 1a6a6: 6c 19 sub r22, r12 1a6a8: 7d 09 sbc r23, r13 1a6aa: 98 01 movw r18, r16 1a6ac: 4a 81 ldd r20, Y+2 ; 0x02 1a6ae: 5b 81 ldd r21, Y+3 ; 0x03 1a6b0: 89 81 ldd r24, Y+1 ; 0x01 1a6b2: 0e 94 2d d2 call 0x1a45a ; 0x1a45a 1a6b6: d8 cf rjmp .-80 ; 0x1a668 /// 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; 1a6b8: 80 e0 ldi r24, 0x00 ; 0 1a6ba: dd cf rjmp .-70 ; 0x1a676 0001a6bc : count_position[i] += dir & mask ? -1L : 1L; } } } static void __attribute__((noinline)) set_axes_dir(const uint8_t axis, const uint8_t dir) { 1a6bc: 0f 93 push r16 1a6be: 1f 93 push r17 1a6c0: cf 93 push r28 1a6c2: df 93 push r29 1a6c4: 18 2f mov r17, r24 1a6c6: 06 2f mov r16, r22 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1a6c8: d1 e0 ldi r29, 0x01 ; 1 1a6ca: c0 e0 ldi r28, 0x00 ; 0 if (axis & mask) { 1a6cc: 81 2f mov r24, r17 1a6ce: 8d 23 and r24, r29 1a6d0: 29 f0 breq .+10 ; 0x1a6dc sm4_set_dir(i, dir & mask); 1a6d2: 60 2f mov r22, r16 1a6d4: 6d 23 and r22, r29 1a6d6: 8c 2f mov r24, r28 1a6d8: 0f 94 28 26 call 0x24c50 ; 0x24c50 } } } 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) { 1a6dc: cf 5f subi r28, 0xFF ; 255 1a6de: dd 0f add r29, r29 1a6e0: c3 30 cpi r28, 0x03 ; 3 1a6e2: a1 f7 brne .-24 ; 0x1a6cc if (axis & mask) { sm4_set_dir(i, dir & mask); } } } 1a6e4: df 91 pop r29 1a6e6: cf 91 pop r28 1a6e8: 1f 91 pop r17 1a6ea: 0f 91 pop r16 1a6ec: 08 95 ret 0001a6ee : //@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) { 1a6ee: 8f 92 push r8 1a6f0: 9f 92 push r9 1a6f2: af 92 push r10 1a6f4: bf 92 push r11 1a6f6: cf 92 push r12 1a6f8: df 92 push r13 1a6fa: ef 92 push r14 1a6fc: ff 92 push r15 1a6fe: 30 e0 ldi r19, 0x00 ; 0 1a700: 20 e0 ldi r18, 0x00 ; 0 for (uint8_t i = X_AXIS, mask = X_AXIS_MASK; i <= Z_AXIS; i++, mask <<= 1) { 1a702: 91 e0 ldi r25, 0x01 ; 1 if (axis & mask) { 1a704: 48 2f mov r20, r24 1a706: 49 23 and r20, r25 1a708: 19 f1 breq .+70 ; 0x1a750 count_position[i] += dir & mask ? -1L : 1L; 1a70a: a9 01 movw r20, r18 1a70c: 44 0f add r20, r20 1a70e: 55 1f adc r21, r21 1a710: 44 0f add r20, r20 1a712: 55 1f adc r21, r21 1a714: fa 01 movw r30, r20 1a716: e4 5b subi r30, 0xB4 ; 180 1a718: f9 4f sbci r31, 0xF9 ; 249 1a71a: c0 80 ld r12, Z 1a71c: d1 80 ldd r13, Z+1 ; 0x01 1a71e: e2 80 ldd r14, Z+2 ; 0x02 1a720: f3 80 ldd r15, Z+3 ; 0x03 1a722: 76 2f mov r23, r22 1a724: 79 23 and r23, r25 1a726: 81 2c mov r8, r1 1a728: 91 2c mov r9, r1 1a72a: 54 01 movw r10, r8 1a72c: 83 94 inc r8 1a72e: 77 23 and r23, r23 1a730: 21 f0 breq .+8 ; 0x1a73a 1a732: 88 24 eor r8, r8 1a734: 8a 94 dec r8 1a736: 98 2c mov r9, r8 1a738: 54 01 movw r10, r8 1a73a: c8 0c add r12, r8 1a73c: d9 1c adc r13, r9 1a73e: ea 1c adc r14, r10 1a740: fb 1c adc r15, r11 1a742: 44 5b subi r20, 0xB4 ; 180 1a744: 59 4f sbci r21, 0xF9 ; 249 1a746: fa 01 movw r30, r20 1a748: c0 82 st Z, r12 1a74a: d1 82 std Z+1, r13 ; 0x01 1a74c: e2 82 std Z+2, r14 ; 0x02 1a74e: 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) { 1a750: 99 0f add r25, r25 1a752: 2f 5f subi r18, 0xFF ; 255 1a754: 3f 4f sbci r19, 0xFF ; 255 1a756: 23 30 cpi r18, 0x03 ; 3 1a758: 31 05 cpc r19, r1 1a75a: a1 f6 brne .-88 ; 0x1a704 if (axis & mask) { count_position[i] += dir & mask ? -1L : 1L; } } } 1a75c: ff 90 pop r15 1a75e: ef 90 pop r14 1a760: df 90 pop r13 1a762: cf 90 pop r12 1a764: bf 90 pop r11 1a766: af 90 pop r10 1a768: 9f 90 pop r9 1a76a: 8f 90 pop r8 1a76c: 08 95 ret 0001a76e : /// 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) { 1a76e: 2f 92 push r2 1a770: 3f 92 push r3 1a772: 4f 92 push r4 1a774: 5f 92 push r5 1a776: 6f 92 push r6 1a778: 7f 92 push r7 1a77a: 8f 92 push r8 1a77c: 9f 92 push r9 1a77e: af 92 push r10 1a780: bf 92 push r11 1a782: cf 92 push r12 1a784: df 92 push r13 1a786: ef 92 push r14 1a788: ff 92 push r15 1a78a: 0f 93 push r16 1a78c: 1f 93 push r17 1a78e: cf 93 push r28 1a790: df 93 push r29 1a792: 00 d0 rcall .+0 ; 0x1a794 1a794: 00 d0 rcall .+0 ; 0x1a796 1a796: cd b7 in r28, 0x3d ; 61 1a798: 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]; 1a79a: c0 90 4c 06 lds r12, 0x064C ; 0x80064c 1a79e: d0 90 4d 06 lds r13, 0x064D ; 0x80064d 1a7a2: e0 90 4e 06 lds r14, 0x064E ; 0x80064e 1a7a6: f0 90 4f 06 lds r15, 0x064F ; 0x80064f 1a7aa: 7c 01 movw r14, r24 1a7ac: ec 18 sub r14, r12 1a7ae: fd 08 sbc r15, r13 y -= (int16_t)count_position[1]; 1a7b0: 80 91 50 06 lds r24, 0x0650 ; 0x800650 1a7b4: 90 91 51 06 lds r25, 0x0651 ; 0x800651 1a7b8: a0 91 52 06 lds r26, 0x0652 ; 0x800652 1a7bc: b0 91 53 06 lds r27, 0x0653 ; 0x800653 1a7c0: 68 1b sub r22, r24 1a7c2: 79 0b sbc r23, r25 z -= (int16_t)count_position[2]; 1a7c4: 80 91 54 06 lds r24, 0x0654 ; 0x800654 1a7c8: 90 91 55 06 lds r25, 0x0655 ; 0x800655 1a7cc: a0 91 56 06 lds r26, 0x0656 ; 0x800656 1a7d0: b0 91 57 06 lds r27, 0x0657 ; 0x800657 1a7d4: fa 01 movw r30, r20 1a7d6: e8 1b sub r30, r24 1a7d8: f9 0b sbc r31, r25 1a7da: fa 83 std Y+2, r31 ; 0x02 1a7dc: e9 83 std Y+1, r30 ; 0x01 xyzcal_dm = ((x<0)?1:0) | ((y<0)?2:0) | ((z<0)?4:0); 1a7de: fb 01 movw r30, r22 1a7e0: ff 0f add r31, r31 1a7e2: ee 0b sbc r30, r30 1a7e4: ff 0f add r31, r31 1a7e6: fe 2f mov r31, r30 1a7e8: ee 1f adc r30, r30 1a7ea: e2 70 andi r30, 0x02 ; 2 1a7ec: 89 81 ldd r24, Y+1 ; 0x01 1a7ee: 9a 81 ldd r25, Y+2 ; 0x02 1a7f0: 88 e0 ldi r24, 0x08 ; 8 1a7f2: 98 02 muls r25, r24 1a7f4: 81 2d mov r24, r1 1a7f6: 99 0b sbc r25, r25 1a7f8: 11 24 eor r1, r1 1a7fa: 84 70 andi r24, 0x04 ; 4 1a7fc: e8 2b or r30, r24 1a7fe: 8f 2d mov r24, r15 1a800: 88 1f adc r24, r24 1a802: 88 27 eor r24, r24 1a804: 88 1f adc r24, r24 1a806: e8 2b or r30, r24 1a808: e0 93 f1 03 sts 0x03F1, r30 ; 0x8003f1 asm("nop"); } void sm4_set_dir_bits(uint8_t dir_bits) { uint8_t portL = PORTL; 1a80c: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> portL &= 0xb8; //set direction bits to zero 1a810: 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; 1a812: 87 e0 ldi r24, 0x07 ; 7 1a814: e8 27 eor r30, r24 if (dir_bits & 1) portL |= 2; //set X direction bit 1a816: e0 fd sbrc r30, 0 1a818: 92 60 ori r25, 0x02 ; 2 if (dir_bits & 2) portL |= 1; //set Y direction bit 1a81a: e1 fd sbrc r30, 1 1a81c: 91 60 ori r25, 0x01 ; 1 if (dir_bits & 4) portL |= 4; //set Z direction bit 1a81e: e4 70 andi r30, 0x04 ; 4 1a820: 09 f0 breq .+2 ; 0x1a824 1a822: 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; 1a824: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> asm("nop"); 1a828: 00 00 nop sm4_set_dir_bits(xyzcal_dm); sm4_stop_cb = check_pinda?((check_pinda<0)?check_pinda_0:check_pinda_1):0; 1a82a: 8c e3 ldi r24, 0x3C ; 60 1a82c: 9b eb ldi r25, 0xBB ; 187 1a82e: 01 11 cpse r16, r1 1a830: 02 c0 rjmp .+4 ; 0x1a836 1a832: 90 e0 ldi r25, 0x00 ; 0 1a834: 80 e0 ldi r24, 0x00 ; 0 1a836: 90 93 25 06 sts 0x0625, r25 ; 0x800625 1a83a: 80 93 24 06 sts 0x0624, r24 ; 0x800624 xyzcal_sm4_delay = delay_us; 1a83e: 30 93 f0 03 sts 0x03F0, r19 ; 0x8003f0 1a842: 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; 1a846: 29 81 ldd r18, Y+1 ; 0x01 1a848: 3a 81 ldd r19, Y+2 ; 0x02 1a84a: 3e 83 std Y+6, r19 ; 0x06 1a84c: 2d 83 std Y+5, r18 ; 0x05 1a84e: 37 ff sbrs r19, 7 1a850: 05 c0 rjmp .+10 ; 0x1a85c 1a852: 31 95 neg r19 1a854: 21 95 neg r18 1a856: 31 09 sbc r19, r1 1a858: 3e 83 std Y+6, r19 ; 0x06 1a85a: 2d 83 std Y+5, r18 ; 0x05 1a85c: 8b 01 movw r16, r22 1a85e: 77 ff sbrs r23, 7 1a860: 03 c0 rjmp .+6 ; 0x1a868 1a862: 11 95 neg r17 1a864: 01 95 neg r16 1a866: 11 09 sbc r17, r1 1a868: f7 fe sbrs r15, 7 1a86a: 03 c0 rjmp .+6 ; 0x1a872 1a86c: f1 94 neg r15 1a86e: e1 94 neg r14 1a870: 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); 1a872: 98 01 movw r18, r16 1a874: d8 01 movw r26, r16 1a876: 0f 94 99 a5 call 0x34b32 ; 0x34b32 <__mulhisi3> 1a87a: 4b 01 movw r8, r22 1a87c: 5c 01 movw r10, r24 1a87e: 2d 81 ldd r18, Y+5 ; 0x05 1a880: 3e 81 ldd r19, Y+6 ; 0x06 1a882: d9 01 movw r26, r18 1a884: 0f 94 99 a5 call 0x34b32 ; 0x34b32 <__mulhisi3> 1a888: 86 0e add r8, r22 1a88a: 97 1e adc r9, r23 1a88c: a8 1e adc r10, r24 1a88e: b9 1e adc r11, r25 1a890: 97 01 movw r18, r14 1a892: d7 01 movw r26, r14 1a894: 0f 94 99 a5 call 0x34b32 ; 0x34b32 <__mulhisi3> 1a898: 68 0d add r22, r8 1a89a: 79 1d adc r23, r9 1a89c: 8a 1d adc r24, r10 1a89e: 9b 1d adc r25, r11 1a8a0: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 1a8a4: 0f 94 77 a9 call 0x352ee ; 0x352ee 1a8a8: 20 e0 ldi r18, 0x00 ; 0 1a8aa: 30 e0 ldi r19, 0x00 ; 0 1a8ac: 40 e0 ldi r20, 0x00 ; 0 1a8ae: 5f e3 ldi r21, 0x3F ; 63 1a8b0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1a8b4: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 1a8b8: 2b 01 movw r4, r22 uint16_t nd = dd; uint16_t cx = dd; uint16_t cy = dd; uint16_t cz = dd; 1a8ba: 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; 1a8bc: 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; 1a8be: 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; 1a8c0: 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; 1a8c2: 1c 82 std Y+4, r1 ; 0x04 1a8c4: 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; 1a8c6: 31 2c mov r3, r1 1a8c8: 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; 1a8ca: 1a 82 std Y+2, r1 ; 0x02 1a8cc: 19 82 std Y+1, r1 ; 0x01 uint16_t y = 0; uint16_t z = 0; while (nd){ 1a8ce: 61 14 cp r6, r1 1a8d0: 71 04 cpc r7, r1 1a8d2: 09 f4 brne .+2 ; 0x1a8d6 1a8d4: 48 c0 rjmp .+144 ; 0x1a966 if (sm4_stop_cb && (*sm4_stop_cb)()) break; 1a8d6: e0 91 24 06 lds r30, 0x0624 ; 0x800624 1a8da: f0 91 25 06 lds r31, 0x0625 ; 0x800625 1a8de: 30 97 sbiw r30, 0x00 ; 0 1a8e0: f1 f5 brne .+124 ; 0x1a95e uint8_t sm = 0; //step mask 1a8e2: 80 e0 ldi r24, 0x00 ; 0 if (cx <= dx){ 1a8e4: ec 14 cp r14, r12 1a8e6: fd 04 cpc r15, r13 1a8e8: 40 f0 brcs .+16 ; 0x1a8fa sm |= 1; cx += dd; 1a8ea: c4 0c add r12, r4 1a8ec: d5 1c adc r13, r5 x++; 1a8ee: 89 81 ldd r24, Y+1 ; 0x01 1a8f0: 9a 81 ldd r25, Y+2 ; 0x02 1a8f2: 01 96 adiw r24, 0x01 ; 1 1a8f4: 9a 83 std Y+2, r25 ; 0x02 1a8f6: 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; 1a8f8: 81 e0 ldi r24, 0x01 ; 1 cx += dd; x++; } if (cy <= dy){ 1a8fa: 0a 15 cp r16, r10 1a8fc: 1b 05 cpc r17, r11 1a8fe: 30 f0 brcs .+12 ; 0x1a90c sm |= 2; 1a900: 82 60 ori r24, 0x02 ; 2 cy += dd; 1a902: a4 0c add r10, r4 1a904: b5 1c adc r11, r5 y++; 1a906: 9f ef ldi r25, 0xFF ; 255 1a908: 29 1a sub r2, r25 1a90a: 39 0a sbc r3, r25 } if (cz <= dz){ 1a90c: ed 81 ldd r30, Y+5 ; 0x05 1a90e: fe 81 ldd r31, Y+6 ; 0x06 1a910: e8 15 cp r30, r8 1a912: f9 05 cpc r31, r9 1a914: 48 f0 brcs .+18 ; 0x1a928 sm |= 4; 1a916: 84 60 ori r24, 0x04 ; 4 cz += dd; 1a918: 84 0c add r8, r4 1a91a: 95 1c adc r9, r5 z++; 1a91c: 2b 81 ldd r18, Y+3 ; 0x03 1a91e: 3c 81 ldd r19, Y+4 ; 0x04 1a920: 2f 5f subi r18, 0xFF ; 255 1a922: 3f 4f sbci r19, 0xFF ; 255 1a924: 3c 83 std Y+4, r19 ; 0x04 1a926: 2b 83 std Y+3, r18 ; 0x03 } cx -= dx; 1a928: ce 18 sub r12, r14 1a92a: df 08 sbc r13, r15 cy -= dy; 1a92c: a0 1a sub r10, r16 1a92e: b1 0a sbc r11, r17 cz -= dz; 1a930: ed 81 ldd r30, Y+5 ; 0x05 1a932: fe 81 ldd r31, Y+6 ; 0x06 1a934: 8e 1a sub r8, r30 1a936: 9f 0a sbc r9, r31 sm4_do_step(sm); 1a938: 0f 94 20 26 call 0x24c40 ; 0x24c40 uint16_t delay = SM4_DEFDELAY; if (sm4_calc_delay_cb) delay = (*sm4_calc_delay_cb)(nd, dd); 1a93c: e0 91 20 06 lds r30, 0x0620 ; 0x800620 1a940: f0 91 21 06 lds r31, 0x0621 ; 0x800621 1a944: 30 97 sbiw r30, 0x00 ; 0 1a946: d1 f1 breq .+116 ; 0x1a9bc 1a948: b2 01 movw r22, r4 1a94a: c3 01 movw r24, r6 1a94c: 19 95 eicall if (delay) delayMicroseconds(delay); 1a94e: 00 97 sbiw r24, 0x00 ; 0 1a950: 11 f0 breq .+4 ; 0x1a956 1a952: 0e 94 c3 d0 call 0x1a186 ; 0x1a186 nd--; 1a956: f1 e0 ldi r31, 0x01 ; 1 1a958: 6f 1a sub r6, r31 1a95a: 71 08 sbc r7, r1 1a95c: b8 cf rjmp .-144 ; 0x1a8ce 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; 1a95e: 19 95 eicall 1a960: 88 23 and r24, r24 1a962: 09 f4 brne .+2 ; 0x1a966 1a964: be cf rjmp .-132 ; 0x1a8e2 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) 1a966: e0 91 22 06 lds r30, 0x0622 ; 0x800622 1a96a: f0 91 23 06 lds r31, 0x0623 ; 0x800623 1a96e: 30 97 sbiw r30, 0x00 ; 0 1a970: 41 f0 breq .+16 ; 0x1a982 (*sm4_update_pos_cb)(x, y, z, 0); 1a972: 30 e0 ldi r19, 0x00 ; 0 1a974: 20 e0 ldi r18, 0x00 ; 0 1a976: 4b 81 ldd r20, Y+3 ; 0x03 1a978: 5c 81 ldd r21, Y+4 ; 0x04 1a97a: b1 01 movw r22, r2 1a97c: 89 81 ldd r24, Y+1 ; 0x01 1a97e: 9a 81 ldd r25, Y+2 ; 0x02 1a980: 19 95 eicall 1a982: 81 e0 ldi r24, 0x01 ; 1 1a984: 67 28 or r6, r7 1a986: 09 f4 brne .+2 ; 0x1a98a 1a988: 80 e0 ldi r24, 0x00 ; 0 // u = _micros() - u; return ret; } 1a98a: 26 96 adiw r28, 0x06 ; 6 1a98c: 0f b6 in r0, 0x3f ; 63 1a98e: f8 94 cli 1a990: de bf out 0x3e, r29 ; 62 1a992: 0f be out 0x3f, r0 ; 63 1a994: cd bf out 0x3d, r28 ; 61 1a996: df 91 pop r29 1a998: cf 91 pop r28 1a99a: 1f 91 pop r17 1a99c: 0f 91 pop r16 1a99e: ff 90 pop r15 1a9a0: ef 90 pop r14 1a9a2: df 90 pop r13 1a9a4: cf 90 pop r12 1a9a6: bf 90 pop r11 1a9a8: af 90 pop r10 1a9aa: 9f 90 pop r9 1a9ac: 8f 90 pop r8 1a9ae: 7f 90 pop r7 1a9b0: 6f 90 pop r6 1a9b2: 5f 90 pop r5 1a9b4: 4f 90 pop r4 1a9b6: 3f 90 pop r3 1a9b8: 2f 90 pop r2 1a9ba: 08 95 ret } cx -= dx; cy -= dy; cz -= dz; sm4_do_step(sm); uint16_t delay = SM4_DEFDELAY; 1a9bc: 84 ef ldi r24, 0xF4 ; 244 1a9be: 91 e0 ldi r25, 0x01 ; 1 1a9c0: c8 cf rjmp .-112 ; 0x1a952 0001a9c2 : status |= components; eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } void calibration_status_clear(CalibrationStatus components) { 1a9c2: cf 93 push r28 1a9c4: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1a9c6: 86 ea ldi r24, 0xA6 ; 166 1a9c8: 9c e0 ldi r25, 0x0C ; 12 1a9ca: 0f 94 81 a4 call 0x34902 ; 0x34902 status &= ~components; 1a9ce: c0 95 com r28 1a9d0: 6c 2f mov r22, r28 1a9d2: 68 23 and r22, r24 1a9d4: 86 ea ldi r24, 0xA6 ; 166 1a9d6: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1a9d8: cf 91 pop r28 1a9da: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 0001a9de : } } } static void lcd_reset_sheet() { 1a9de: 1f 93 push r17 1a9e0: cf 93 push r28 1a9e2: df 93 push r29 1a9e4: 00 d0 rcall .+0 ; 0x1a9e6 1a9e6: 00 d0 rcall .+0 ; 0x1a9e8 1a9e8: 1f 92 push r1 1a9ea: 1f 92 push r1 1a9ec: cd b7 in r28, 0x3d ; 61 1a9ee: de b7 in r29, 0x3e ; 62 SheetName sheetName; eeprom_default_sheet_name(selected_sheet, sheetName); 1a9f0: be 01 movw r22, r28 1a9f2: 6f 5f subi r22, 0xFF ; 255 1a9f4: 7f 4f sbci r23, 0xFF ; 255 1a9f6: 80 91 ca 03 lds r24, 0x03CA ; 0x8003ca 1a9fa: 0e 94 09 79 call 0xf212 ; 0xf212 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[selected_sheet].z_offset)),EEPROM_EMPTY_VALUE16); 1a9fe: 80 91 ca 03 lds r24, 0x03CA ; 0x8003ca 1aa02: 1b e0 ldi r17, 0x0B ; 11 1aa04: 81 9f mul r24, r17 1aa06: c0 01 movw r24, r0 1aa08: 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); 1aa0a: 6f ef ldi r22, 0xFF ; 255 1aa0c: 7f ef ldi r23, 0xFF ; 255 1aa0e: 80 5b subi r24, 0xB0 ; 176 1aa10: 92 4f sbci r25, 0xF2 ; 242 1aa12: 0f 94 c3 a4 call 0x34986 ; 0x34986 eeprom_update_block_notify(sheetName.c,EEPROM_Sheets_base->s[selected_sheet].name,sizeof(Sheet::name)); 1aa16: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 1aa1a: 61 9f mul r22, r17 1aa1c: b0 01 movw r22, r0 1aa1e: 11 24 eor r1, r1 1aa20: 67 5b subi r22, 0xB7 ; 183 1aa22: 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); 1aa24: 47 e0 ldi r20, 0x07 ; 7 1aa26: 50 e0 ldi r21, 0x00 ; 0 1aa28: ce 01 movw r24, r28 1aa2a: 01 96 adiw r24, 0x01 ; 1 1aa2c: 0f 94 95 a4 call 0x3492a ; 0x3492a if (selected_sheet == eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet))) 1aa30: 81 ea ldi r24, 0xA1 ; 161 1aa32: 9d e0 ldi r25, 0x0D ; 13 1aa34: 0f 94 81 a4 call 0x34902 ; 0x34902 1aa38: 90 91 ca 03 lds r25, 0x03CA ; 0x8003ca 1aa3c: 89 13 cpse r24, r25 1aa3e: 0a c0 rjmp .+20 ; 0x1aa54 { eeprom_switch_to_next_sheet(); 1aa40: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 if (-1 == eeprom_next_initialized_sheet(0)) 1aa44: 80 e0 ldi r24, 0x00 ; 0 1aa46: 0e 94 e7 78 call 0xf1ce ; 0xf1ce 1aa4a: 8f 3f cpi r24, 0xFF ; 255 1aa4c: 19 f4 brne .+6 ; 0x1aa54 calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 1aa4e: 80 e1 ldi r24, 0x10 ; 16 1aa50: 0e 94 e1 d4 call 0x1a9c2 ; 0x1a9c2 } menu_back(); 1aa54: 0e 94 6c 63 call 0xc6d8 ; 0xc6d8 } 1aa58: 28 96 adiw r28, 0x08 ; 8 1aa5a: 0f b6 in r0, 0x3f ; 63 1aa5c: f8 94 cli 1aa5e: de bf out 0x3e, r29 ; 62 1aa60: 0f be out 0x3f, r0 ; 63 1aa62: cd bf out 0x3d, r28 ; 61 1aa64: df 91 pop r29 1aa66: cf 91 pop r28 1aa68: 1f 91 pop r17 1aa6a: 08 95 ret 0001aa6c : CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); return ((status & components) == components); } void calibration_status_set(CalibrationStatus components) { 1aa6c: cf 93 push r28 1aa6e: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1aa70: 86 ea ldi r24, 0xA6 ; 166 1aa72: 9c e0 ldi r25, 0x0C ; 12 1aa74: 0f 94 81 a4 call 0x34902 ; 0x34902 status |= components; 1aa78: 68 2f mov r22, r24 1aa7a: 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); 1aa7c: 86 ea ldi r24, 0xA6 ; 166 1aa7e: 9c e0 ldi r25, 0x0C ; 12 eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, status); } 1aa80: cf 91 pop r28 1aa82: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 0001aa86 : sprintf_P(dest, PSTR("%u.%u.%u.%u"), IP[0], IP[1], IP[2], IP[3]); } bool calibration_status_get(CalibrationStatus components) { 1aa86: cf 93 push r28 1aa88: c8 2f mov r28, r24 CalibrationStatus status = eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V2); 1aa8a: 86 ea ldi r24, 0xA6 ; 166 1aa8c: 9c e0 ldi r25, 0x0C ; 12 1aa8e: 0f 94 81 a4 call 0x34902 ; 0x34902 return ((status & components) == components); 1aa92: 98 2f mov r25, r24 1aa94: 9c 23 and r25, r28 1aa96: 81 e0 ldi r24, 0x01 ; 1 1aa98: 9c 13 cpse r25, r28 1aa9a: 80 e0 ldi r24, 0x00 ; 0 } 1aa9c: cf 91 pop r28 1aa9e: 08 95 ret 0001aaa0 : * @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() { 1aaa0: ef 92 push r14 1aaa2: ff 92 push r15 1aaa4: 0f 93 push r16 1aaa6: 1f 93 push r17 1aaa8: cf 93 push r28 1aaaa: df 93 push r29 1aaac: cd b7 in r28, 0x3d ; 61 1aaae: de b7 in r29, 0x3e ; 62 1aab0: 63 97 sbiw r28, 0x13 ; 19 1aab2: 0f b6 in r0, 0x3f ; 63 1aab4: f8 94 cli 1aab6: de bf out 0x3e, r29 ; 62 1aab8: 0f be out 0x3f, r0 ; 63 1aaba: 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) 1aabc: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1aac0: 81 11 cpse r24, r1 1aac2: 3a c0 rjmp .+116 ; 0x1ab38 { // Menu was entered. // Initialize its status. _md->status = 1; 1aac4: 81 e0 ldi r24, 0x01 ; 1 1aac6: 80 93 96 03 sts 0x0396, r24 ; 0x800396 check_babystep(); 1aaca: 0e 94 6d 7d call 0xfada ; 0xfada if(!eeprom_is_sheet_initialized(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))){ 1aace: 81 ea ldi r24, 0xA1 ; 161 1aad0: 9d e0 ldi r25, 0x0D ; 13 1aad2: 0f 94 81 a4 call 0x34902 ; 0x34902 1aad6: 18 2f mov r17, r24 1aad8: 0e 94 d9 78 call 0xf1b2 ; 0xf1b2 1aadc: 81 11 cpse r24, r1 1aade: ee c0 rjmp .+476 ; 0x1acbc _md->babystepMemZ = 0; 1aae0: 10 92 98 03 sts 0x0398, r1 ; 0x800398 1aae4: 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)) 1aae8: 80 e1 ldi r24, 0x10 ; 16 1aaea: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 1aaee: 81 11 cpse r24, r1 1aaf0: 04 c0 rjmp .+8 ; 0x1aafa _md->babystepMemZ = 0; 1aaf2: 10 92 98 03 sts 0x0398, r1 ; 0x800398 1aaf6: 10 92 97 03 sts 0x0397, r1 ; 0x800397 _md->babystepMemMMZ = _md->babystepMemZ/cs.axis_steps_per_mm[Z_AXIS]; 1aafa: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1aafe: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1ab02: 07 2e mov r0, r23 1ab04: 00 0c add r0, r0 1ab06: 88 0b sbc r24, r24 1ab08: 99 0b sbc r25, r25 1ab0a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1ab0e: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 1ab12: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1ab16: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1ab1a: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1ab1e: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1ab22: 60 93 99 03 sts 0x0399, r22 ; 0x800399 1ab26: 70 93 9a 03 sts 0x039A, r23 ; 0x80039a 1ab2a: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b 1ab2e: 90 93 9c 03 sts 0x039C, r25 ; 0x80039c lcd_draw_update = 1; 1ab32: 81 e0 ldi r24, 0x01 ; 1 1ab34: 80 93 59 02 sts 0x0259, r24 ; 0x800259 //SERIAL_ECHO("Z baby step: "); //SERIAL_ECHO(_md->babystepMem[2]); } if (lcd_encoder != 0) 1ab38: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1ab3c: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1ab40: 00 97 sbiw r24, 0x00 ; 0 1ab42: f1 f1 breq .+124 ; 0x1abc0 { _md->babystepMemZ += lcd_encoder; 1ab44: 20 91 97 03 lds r18, 0x0397 ; 0x800397 1ab48: 30 91 98 03 lds r19, 0x0398 ; 0x800398 1ab4c: 28 0f add r18, r24 1ab4e: 39 1f adc r19, r25 1ab50: 30 93 98 03 sts 0x0398, r19 ; 0x800398 1ab54: 20 93 97 03 sts 0x0397, r18 ; 0x800397 if (_md->babystepMemZ < Z_BABYSTEP_MIN) _md->babystepMemZ = Z_BABYSTEP_MIN; //-3999 -> -9.99 mm 1ab58: 21 36 cpi r18, 0x61 ; 97 1ab5a: 40 ef ldi r20, 0xF0 ; 240 1ab5c: 34 07 cpc r19, r20 1ab5e: 0c f0 brlt .+2 ; 0x1ab62 1ab60: ba c0 rjmp .+372 ; 0x1acd6 1ab62: 81 e6 ldi r24, 0x61 ; 97 1ab64: 90 ef ldi r25, 0xF0 ; 240 1ab66: 90 93 98 03 sts 0x0398, r25 ; 0x800398 1ab6a: 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]; 1ab6e: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1ab72: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1ab76: 07 2e mov r0, r23 1ab78: 00 0c add r0, r0 1ab7a: 88 0b sbc r24, r24 1ab7c: 99 0b sbc r25, r25 1ab7e: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1ab82: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 1ab86: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1ab8a: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1ab8e: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1ab92: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1ab96: 60 93 99 03 sts 0x0399, r22 ; 0x800399 1ab9a: 70 93 9a 03 sts 0x039A, r23 ; 0x80039a 1ab9e: 80 93 9b 03 sts 0x039B, r24 ; 0x80039b 1aba2: 90 93 9c 03 sts 0x039C, r25 ; 0x80039c _delay(50); 1aba6: 62 e3 ldi r22, 0x32 ; 50 1aba8: 70 e0 ldi r23, 0x00 ; 0 1abaa: 80 e0 ldi r24, 0x00 ; 0 1abac: 90 e0 ldi r25, 0x00 ; 0 1abae: 0f 94 56 0b call 0x216ac ; 0x216ac lcd_encoder = 0; 1abb2: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1abb6: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e lcd_draw_update = 1; 1abba: 81 e0 ldi r24, 0x01 ; 1 1abbc: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } if (lcd_draw_update) 1abc0: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1abc4: 88 23 and r24, r24 1abc6: c9 f1 breq .+114 ; 0x1ac3a { SheetFormatBuffer buffer; menu_format_sheet_E(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))], buffer); 1abc8: 81 ea ldi r24, 0xA1 ; 161 1abca: 9d e0 ldi r25, 0x0D ; 13 1abcc: 0f 94 81 a4 call 0x34902 ; 0x34902 1abd0: 2b e0 ldi r18, 0x0B ; 11 1abd2: 82 9f mul r24, r18 1abd4: c0 01 movw r24, r0 1abd6: 11 24 eor r1, r1 1abd8: be 01 movw r22, r28 1abda: 6f 5f subi r22, 0xFF ; 255 1abdc: 7f 4f sbci r23, 0xFF ; 255 1abde: 87 5b subi r24, 0xB7 ; 183 1abe0: 92 4f sbci r25, 0xF2 ; 242 1abe2: 0e 94 4e 76 call 0xec9c ; 0xec9c lcd_home(); 1abe6: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 lcd_print(buffer.c); 1abea: ce 01 movw r24, r28 1abec: 01 96 adiw r24, 0x01 ; 1 1abee: 0e 94 b0 73 call 0xe760 ; 0xe760 lcd_set_cursor(0, 1); 1abf2: 61 e0 ldi r22, 0x01 ; 1 1abf4: 80 e0 ldi r24, 0x00 ; 0 1abf6: 0e 94 ab 6f call 0xdf56 ; 0xdf56 menu_draw_float13(_T(MSG_BABYSTEPPING_Z), _md->babystepMemMMZ); 1abfa: 10 91 99 03 lds r17, 0x0399 ; 0x800399 1abfe: 00 91 9a 03 lds r16, 0x039A ; 0x80039a 1ac02: f0 90 9b 03 lds r15, 0x039B ; 0x80039b 1ac06: e0 90 9c 03 lds r14, 0x039C ; 0x80039c 1ac0a: 84 ed ldi r24, 0xD4 ; 212 1ac0c: 9a e3 ldi r25, 0x3A ; 58 1ac0e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 //! (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); 1ac12: ef 92 push r14 1ac14: ff 92 push r15 1ac16: 0f 93 push r16 1ac18: 1f 93 push r17 1ac1a: 9f 93 push r25 1ac1c: 8f 93 push r24 1ac1e: 1f 92 push r1 1ac20: 80 e2 ldi r24, 0x20 ; 32 1ac22: 8f 93 push r24 1ac24: 8a e4 ldi r24, 0x4A ; 74 1ac26: 93 e8 ldi r25, 0x83 ; 131 1ac28: 9f 93 push r25 1ac2a: 8f 93 push r24 1ac2c: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 1ac30: 0f b6 in r0, 0x3f ; 63 1ac32: f8 94 cli 1ac34: de bf out 0x3e, r29 ; 62 1ac36: 0f be out 0x3f, r0 ; 63 1ac38: cd bf out 0x3d, r28 ; 61 } if (LCD_CLICKED || menu_leaving) 1ac3a: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1ac3e: 81 11 cpse r24, r1 1ac40: 04 c0 rjmp .+8 ; 0x1ac4a 1ac42: 80 91 c4 03 lds r24, 0x03C4 ; 0x8003c4 1ac46: 88 23 and r24, r24 1ac48: 51 f1 breq .+84 ; 0x1ac9e { // Only update the EEPROM when leaving the menu. uint8_t active_sheet=eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 1ac4a: 81 ea ldi r24, 0xA1 ; 161 1ac4c: 9d e0 ldi r25, 0x0D ; 13 1ac4e: 0f 94 81 a4 call 0x34902 ; 0x34902 1ac52: 9b e0 ldi r25, 0x0B ; 11 1ac54: 89 9f mul r24, r25 1ac56: 80 01 movw r16, r0 1ac58: 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); 1ac5a: 60 91 97 03 lds r22, 0x0397 ; 0x800397 1ac5e: 70 91 98 03 lds r23, 0x0398 ; 0x800398 1ac62: c8 01 movw r24, r16 1ac64: 80 5b subi r24, 0xB0 ; 176 1ac66: 92 4f sbci r25, 0xF2 ; 242 1ac68: 0f 94 c3 a4 call 0x34986 ; 0x34986 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1ac6c: 60 91 59 12 lds r22, 0x1259 ; 0x801259 1ac70: c8 01 movw r24, r16 1ac72: 8e 5a subi r24, 0xAE ; 174 1ac74: 92 4f sbci r25, 0xF2 ; 242 1ac76: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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); 1ac7a: 60 91 85 03 lds r22, 0x0385 ; 0x800385 1ac7e: 70 91 86 03 lds r23, 0x0386 ; 0x800386 1ac82: 80 91 87 03 lds r24, 0x0387 ; 0x800387 1ac86: 90 91 88 03 lds r25, 0x0388 ; 0x800388 1ac8a: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 1ac8e: c8 01 movw r24, r16 1ac90: 8d 5a subi r24, 0xAD ; 173 1ac92: 92 4f sbci r25, 0xF2 ; 242 1ac94: 0f 94 a5 a4 call 0x3494a ; 0x3494a #endif //PINDA_THERMISTOR calibration_status_set(CALIBRATION_STATUS_LIVE_ADJUST); 1ac98: 80 e1 ldi r24, 0x10 ; 16 1ac9a: 0e 94 36 d5 call 0x1aa6c ; 0x1aa6c } menu_back_if_clicked(); 1ac9e: 0e 94 57 74 call 0xe8ae ; 0xe8ae } 1aca2: 63 96 adiw r28, 0x13 ; 19 1aca4: 0f b6 in r0, 0x3f ; 63 1aca6: f8 94 cli 1aca8: de bf out 0x3e, r29 ; 62 1acaa: 0f be out 0x3f, r0 ; 63 1acac: cd bf out 0x3d, r28 ; 61 1acae: df 91 pop r29 1acb0: cf 91 pop r28 1acb2: 1f 91 pop r17 1acb4: 0f 91 pop r16 1acb6: ff 90 pop r15 1acb8: ef 90 pop r14 1acba: 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-> 1acbc: 2b e0 ldi r18, 0x0B ; 11 1acbe: 12 9f mul r17, r18 1acc0: c0 01 movw r24, r0 1acc2: 11 24 eor r1, r1 1acc4: 80 5b subi r24, 0xB0 ; 176 1acc6: 92 4f sbci r25, 0xF2 ; 242 1acc8: 0f 94 8f a4 call 0x3491e ; 0x3491e 1accc: 90 93 98 03 sts 0x0398, r25 ; 0x800398 1acd0: 80 93 97 03 sts 0x0397, r24 ; 0x800397 1acd4: 09 cf rjmp .-494 ; 0x1aae8 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 1acd6: 12 16 cp r1, r18 1acd8: 13 06 cpc r1, r19 1acda: 2c f4 brge .+10 ; 0x1ace6 1acdc: 10 92 98 03 sts 0x0398, r1 ; 0x800398 1ace0: 10 92 97 03 sts 0x0397, r1 ; 0x800397 1ace4: 44 cf rjmp .-376 ; 0x1ab6e extern volatile int babystepsTodo[3]; inline void babystepsTodoZadd(int n) { if (n != 0) { CRITICAL_SECTION_START 1ace6: 2f b7 in r18, 0x3f ; 63 1ace8: f8 94 cli babystepsTodo[Z_AXIS] += n; 1acea: 40 91 83 03 lds r20, 0x0383 ; 0x800383 1acee: 50 91 84 03 lds r21, 0x0384 ; 0x800384 1acf2: 84 0f add r24, r20 1acf4: 95 1f adc r25, r21 1acf6: 90 93 84 03 sts 0x0384, r25 ; 0x800384 1acfa: 80 93 83 03 sts 0x0383, r24 ; 0x800383 CRITICAL_SECTION_END 1acfe: 2f bf out 0x3f, r18 ; 63 1ad00: 36 cf rjmp .-404 ; 0x1ab6e 0001ad02 : //! |>Continue | MSG_CONTINUE //! | Reset | MSG_RESET //! ---------------------- //! @endcode void lcd_first_layer_calibration_reset() { 1ad02: af 92 push r10 1ad04: bf 92 push r11 1ad06: cf 92 push r12 1ad08: df 92 push r13 1ad0a: ef 92 push r14 1ad0c: ff 92 push r15 1ad0e: 0f 93 push r16 1ad10: 1f 93 push r17 1ad12: cf 93 push r28 1ad14: df 93 push r29 1ad16: 00 d0 rcall .+0 ; 0x1ad18 1ad18: 00 d0 rcall .+0 ; 0x1ad1a 1ad1a: 1f 92 push r1 1ad1c: cd b7 in r28, 0x3d ; 61 1ad1e: 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)) || 1ad20: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1ad24: 81 11 cpse r24, r1 1ad26: 18 c0 rjmp .+48 ; 0x1ad58 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))) || 1ad28: 81 ea ldi r24, 0xA1 ; 161 1ad2a: 9d e0 ldi r25, 0x0D ; 13 1ad2c: 0f 94 81 a4 call 0x34902 ; 0x34902 1ad30: 18 2f mov r17, r24 1ad32: 0e 94 d9 78 call 0xf1b2 ; 0xf1b2 1ad36: 88 23 and r24, r24 1ad38: 79 f0 breq .+30 ; 0x1ad58 (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) || 1ad3a: 80 e1 ldi r24, 0x10 ; 16 1ad3c: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 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))) || 1ad40: 88 23 and r24, r24 1ad42: 51 f0 breq .+20 ; 0x1ad58 (!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))))) 1ad44: 2b e0 ldi r18, 0x0B ; 11 1ad46: 12 9f mul r17, r18 1ad48: c0 01 movw r24, r0 1ad4a: 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 1ad4c: 80 5b subi r24, 0xB0 ; 176 1ad4e: 92 4f sbci r25, 0xF2 ; 242 1ad50: 0f 94 8f a4 call 0x3491e ; 0x3491e } 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)) || 1ad54: 89 2b or r24, r25 1ad56: f1 f4 brne .+60 ; 0x1ad94 (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) 1ad58: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1ad5c: 88 23 and r24, r24 1ad5e: 71 f0 breq .+28 ; 0x1ad7c { eeprom_update_word_notify(reinterpret_cast(&EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset), 0xffff); 1ad60: 81 ea ldi r24, 0xA1 ; 161 1ad62: 9d e0 ldi r25, 0x0D ; 13 1ad64: 0f 94 81 a4 call 0x34902 ; 0x34902 1ad68: 2b e0 ldi r18, 0x0B ; 11 1ad6a: 82 9f mul r24, r18 1ad6c: c0 01 movw r24, r0 1ad6e: 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); 1ad70: 6f ef ldi r22, 0xFF ; 255 1ad72: 7f ef ldi r23, 0xFF ; 255 1ad74: 80 5b subi r24, 0xB0 ; 176 1ad76: 92 4f sbci r25, 0xF2 ; 242 1ad78: 0f 94 c3 a4 call 0x34986 ; 0x34986 } // 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()); 1ad7c: 0e 94 c6 73 call 0xe78c ; 0xe78c 1ad80: 21 e0 ldi r18, 0x01 ; 1 1ad82: 81 11 cpse r24, r1 1ad84: 20 e0 ldi r18, 0x00 ; 0 1ad86: 41 e0 ldi r20, 0x01 ; 1 1ad88: 70 e0 ldi r23, 0x00 ; 0 1ad8a: 60 e0 ldi r22, 0x00 ; 0 1ad8c: 85 e5 ldi r24, 0x55 ; 85 1ad8e: 97 ee ldi r25, 0xE7 ; 231 1ad90: 0e 94 08 63 call 0xc610 ; 0xc610 } if (lcd_encoder) { 1ad94: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1ad98: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1ad9c: 21 15 cp r18, r1 1ad9e: 31 05 cpc r19, r1 1ada0: 59 f0 breq .+22 ; 0x1adb8 menuData->reset = lcd_encoder > 0; 1ada2: 81 e0 ldi r24, 0x01 ; 1 1ada4: 12 16 cp r1, r18 1ada6: 13 06 cpc r1, r19 1ada8: 0c f0 brlt .+2 ; 0x1adac 1adaa: 80 e0 ldi r24, 0x00 ; 0 1adac: 80 93 96 03 sts 0x0396, r24 ; 0x800396 lcd_encoder = 0; // Reset 1adb0: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1adb4: 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)); 1adb8: 81 ea ldi r24, 0xA1 ; 161 1adba: 9d e0 ldi r25, 0x0D ; 13 1adbc: 0f 94 81 a4 call 0x34902 ; 0x34902 1adc0: 1b e0 ldi r17, 0x0B ; 11 1adc2: 81 9f mul r24, r17 1adc4: b0 01 movw r22, r0 1adc6: 11 24 eor r1, r1 1adc8: 67 5b subi r22, 0xB7 ; 183 1adca: 72 4f sbci r23, 0xF2 ; 242 1adcc: 47 e0 ldi r20, 0x07 ; 7 1adce: 50 e0 ldi r21, 0x00 ; 0 1add0: ce 01 movw r24, r28 1add2: 01 96 adiw r24, 0x01 ; 1 1add4: 7c 01 movw r14, r24 1add6: 0f 94 71 a4 call 0x348e2 ; 0x348e2 lcd_home(); 1adda: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 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]; 1adde: 81 ea ldi r24, 0xA1 ; 161 1ade0: 9d e0 ldi r25, 0x0D ; 13 1ade2: 0f 94 81 a4 call 0x34902 ; 0x34902 1ade6: 81 9f mul r24, r17 1ade8: c0 01 movw r24, r0 1adea: 11 24 eor r1, r1 1adec: 80 5b subi r24, 0xB0 ; 176 1adee: 92 4f sbci r25, 0xF2 ; 242 1adf0: 0f 94 8f a4 call 0x3491e ; 0x3491e 1adf4: bc 01 movw r22, r24 1adf6: 99 0f add r25, r25 1adf8: 88 0b sbc r24, r24 1adfa: 99 0b sbc r25, r25 1adfc: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1ae00: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 1ae04: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 1ae08: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 1ae0c: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 1ae10: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1ae14: d6 2e mov r13, r22 1ae16: c7 2e mov r12, r23 1ae18: b8 2e mov r11, r24 1ae1a: a9 2e mov r10, r25 lcd_printf_P(_T(MSG_SHEET_OFFSET), 1ae1c: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1ae20: 0e e3 ldi r16, 0x3E ; 62 1ae22: 10 e2 ldi r17, 0x20 ; 32 1ae24: 81 11 cpse r24, r1 1ae26: 02 c0 rjmp .+4 ; 0x1ae2c 1ae28: 00 e2 ldi r16, 0x20 ; 32 1ae2a: 1e e3 ldi r17, 0x3E ; 62 1ae2c: 83 ec ldi r24, 0xC3 ; 195 1ae2e: 9c e3 ldi r25, 0x3C ; 60 1ae30: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1ae34: 1f 92 push r1 1ae36: 0f 93 push r16 1ae38: 1f 92 push r1 1ae3a: 1f 93 push r17 1ae3c: af 92 push r10 1ae3e: bf 92 push r11 1ae40: cf 92 push r12 1ae42: df 92 push r13 1ae44: ff 92 push r15 1ae46: ef 92 push r14 1ae48: 9f 93 push r25 1ae4a: 8f 93 push r24 1ae4c: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 1ae50: 0f b6 in r0, 0x3f ; 63 1ae52: f8 94 cli 1ae54: de bf out 0x3e, r29 ; 62 1ae56: 0f be out 0x3f, r0 ; 63 1ae58: 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. } 1ae5a: 27 96 adiw r28, 0x07 ; 7 1ae5c: 0f b6 in r0, 0x3f ; 63 1ae5e: f8 94 cli 1ae60: de bf out 0x3e, r29 ; 62 1ae62: 0f be out 0x3f, r0 ; 63 1ae64: cd bf out 0x3d, r28 ; 61 1ae66: df 91 pop r29 1ae68: cf 91 pop r28 1ae6a: 1f 91 pop r17 1ae6c: 0f 91 pop r16 1ae6e: ff 90 pop r15 1ae70: ef 90 pop r14 1ae72: df 90 pop r13 1ae74: cf 90 pop r12 1ae76: bf 90 pop r11 1ae78: af 90 pop r10 1ae7a: 08 95 ret 0001ae7c : if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1ae7c: 60 91 ca 03 lds r22, 0x03CA ; 0x8003ca 1ae80: 81 ea ldi r24, 0xA1 ; 161 1ae82: 9d e0 ldi r25, 0x0D ; 13 1ae84: 0f 94 a5 a4 call 0x3494a ; 0x3494a //! @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(); 1ae88: 0c 94 81 d6 jmp 0x1ad02 ; 0x1ad02 0001ae8c : ClCheckMode oCheckVersion; ClCheckMode oCheckGcode; ClCheckMode oCheckFilament; void fCheckModeInit() { oCheckMode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODE, (uint8_t)ClCheckMode::_Warn); 1ae8c: 61 e0 ldi r22, 0x01 ; 1 1ae8e: 88 ea ldi r24, 0xA8 ; 168 1ae90: 9d e0 ldi r25, 0x0D ; 13 1ae92: 0e 94 ae 78 call 0xf15c ; 0xf15c 1ae96: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed if (farm_mode) { 1ae9a: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1ae9e: 88 23 and r24, r24 1aea0: 41 f0 breq .+16 ; 0x1aeb2 oCheckMode = ClCheckMode::_Strict; 1aea2: 82 e0 ldi r24, 0x02 ; 2 1aea4: 80 93 ed 03 sts 0x03ED, r24 ; 0x8003ed 1aea8: 62 e0 ldi r22, 0x02 ; 2 1aeaa: 88 ea ldi r24, 0xA8 ; 168 1aeac: 9d e0 ldi r25, 0x0D ; 13 1aeae: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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); 1aeb2: 68 e2 ldi r22, 0x28 ; 40 1aeb4: 87 ea ldi r24, 0xA7 ; 167 1aeb6: 9d e0 ldi r25, 0x0D ; 13 1aeb8: 0e 94 ae 78 call 0xf15c ; 0xf15c 1aebc: 80 93 eb 03 sts 0x03EB, r24 ; 0x8003eb eeprom_init_default_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM, EEPROM_NOZZLE_DIAMETER_uM_DEFAULT); 1aec0: 60 e9 ldi r22, 0x90 ; 144 1aec2: 71 e0 ldi r23, 0x01 ; 1 1aec4: 85 ea ldi r24, 0xA5 ; 165 1aec6: 9d e0 ldi r25, 0x0D ; 13 1aec8: 0e 94 96 78 call 0xf12c ; 0xf12c oCheckModel = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_MODEL, (uint8_t)ClCheckMode::_Warn); 1aecc: 61 e0 ldi r22, 0x01 ; 1 1aece: 84 ea ldi r24, 0xA4 ; 164 1aed0: 9d e0 ldi r25, 0x0D ; 13 1aed2: 0e 94 ae 78 call 0xf15c ; 0xf15c 1aed6: 80 93 ea 03 sts 0x03EA, r24 ; 0x8003ea oCheckVersion = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_VERSION, (uint8_t)ClCheckMode::_Warn); 1aeda: 61 e0 ldi r22, 0x01 ; 1 1aedc: 83 ea ldi r24, 0xA3 ; 163 1aede: 9d e0 ldi r25, 0x0D ; 13 1aee0: 0e 94 ae 78 call 0xf15c ; 0xf15c 1aee4: 80 93 e9 03 sts 0x03E9, r24 ; 0x8003e9 oCheckGcode = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_GCODE, (uint8_t)ClCheckMode::_Warn); 1aee8: 61 e0 ldi r22, 0x01 ; 1 1aeea: 82 ea ldi r24, 0xA2 ; 162 1aeec: 9d e0 ldi r25, 0x0D ; 13 1aeee: 0e 94 ae 78 call 0xf15c ; 0xf15c 1aef2: 80 93 e8 03 sts 0x03E8, r24 ; 0x8003e8 oCheckFilament = (ClCheckMode)eeprom_init_default_byte((uint8_t *)EEPROM_CHECK_FILAMENT, (uint8_t)ClCheckMode::_Warn); 1aef6: 61 e0 ldi r22, 0x01 ; 1 1aef8: 80 e2 ldi r24, 0x20 ; 32 1aefa: 9c e0 ldi r25, 0x0C ; 12 1aefc: 0e 94 ae 78 call 0xf15c ; 0xf15c 1af00: 80 93 ee 03 sts 0x03EE, r24 ; 0x8003ee } 1af04: 08 95 ret 0001af06 : return false; } // Parse a major.minor.revision version number. // Return true if valid. bool parse_version(const char *str, uint16_t version[4]) { 1af06: 0f 93 push r16 1af08: 1f 93 push r17 1af0a: 8b 01 movw r16, r22 for(uint8_t i = 0; i < 2; ++i){ str = Number(str, version + i); 1af0c: 0e 94 b8 bb call 0x17770 ; 0x17770 if (*str != '.') 1af10: fc 01 movw r30, r24 1af12: 20 81 ld r18, Z 1af14: 2e 32 cpi r18, 0x2E ; 46 1af16: 11 f0 breq .+4 ; 0x1af1c 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 1af18: 80 e0 ldi r24, 0x00 ; 0 1af1a: 34 c0 rjmp .+104 ; 0x1af84 // 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); 1af1c: b8 01 movw r22, r16 1af1e: 6e 5f subi r22, 0xFE ; 254 1af20: 7f 4f sbci r23, 0xFF ; 255 1af22: 01 96 adiw r24, 0x01 ; 1 1af24: 0e 94 b8 bb call 0x17770 ; 0x17770 if (*str != '.') 1af28: fc 01 movw r30, r24 1af2a: 20 81 ld r18, Z 1af2c: 2e 32 cpi r18, 0x2E ; 46 1af2e: a1 f7 brne .-24 ; 0x1af18 return false; ++str; } str = Number(str, version + 2); 1af30: b8 01 movw r22, r16 1af32: 6c 5f subi r22, 0xFC ; 252 1af34: 7f 4f sbci r23, 0xFF ; 255 1af36: 01 96 adiw r24, 0x01 ; 1 1af38: 0e 94 b8 bb call 0x17770 ; 0x17770 version[3] = FIRMWARE_REVISION_RELEASED; 1af3c: 20 e4 ldi r18, 0x40 ; 64 1af3e: 30 e0 ldi r19, 0x00 ; 0 1af40: f8 01 movw r30, r16 1af42: 37 83 std Z+7, r19 ; 0x07 1af44: 26 83 std Z+6, r18 ; 0x06 1af46: fc 01 movw r30, r24 1af48: df 01 movw r26, r30 // skip everything else until eol or '-' for(;;){ if(is_whitespace_or_nl_or_eol(*str)){ 1af4a: 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'; 1af4c: 89 2f mov r24, r25 1af4e: 8f 7d andi r24, 0xDF ; 223 1af50: c1 f1 breq .+112 ; 0x1afc2 1af52: 87 ef ldi r24, 0xF7 ; 247 1af54: 89 0f add r24, r25 1af56: 82 30 cpi r24, 0x02 ; 2 1af58: a0 f1 brcs .+104 ; 0x1afc2 1af5a: 9d 30 cpi r25, 0x0D ; 13 1af5c: 91 f1 breq .+100 ; 0x1afc2 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 == '-'){ 1af5e: 9d 32 cpi r25, 0x2D ; 45 1af60: 99 f7 brne .-26 ; 0x1af48 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1af62: 11 96 adiw r26, 0x01 ; 1 1af64: 9c 91 ld r25, X 1af66: 92 34 cpi r25, 0x42 ; 66 1af68: e1 f0 breq .+56 ; 0x1afa2 1af6a: 7c f4 brge .+30 ; 0x1af8a 1af6c: 91 34 cpi r25, 0x41 ; 65 1af6e: a1 f6 brne .-88 ; 0x1af18 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); 1af70: 0a 5f subi r16, 0xFA ; 250 1af72: 1f 4f sbci r17, 0xFF ; 255 1af74: 28 e0 ldi r18, 0x08 ; 8 1af76: 30 e0 ldi r19, 0x00 ; 0 1af78: 45 e0 ldi r20, 0x05 ; 5 1af7a: 6b e0 ldi r22, 0x0B ; 11 1af7c: 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); 1af7e: cf 01 movw r24, r30 1af80: 0e 94 08 c2 call 0x18410 ; 0x18410 // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); return false; } 1af84: 1f 91 pop r17 1af86: 0f 91 pop r16 1af88: 08 95 ret // SERIAL_ECHO('.'); // SERIAL_ECHO(version[2]); // SERIAL_ECHO('.'); // SERIAL_ECHOLN(version[3]); if (*str++ == '-') { switch(*str){ 1af8a: 94 34 cpi r25, 0x44 ; 68 1af8c: 91 f0 breq .+36 ; 0x1afb2 1af8e: 92 35 cpi r25, 0x52 ; 82 1af90: 19 f6 brne .-122 ; 0x1af18 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); 1af92: 0a 5f subi r16, 0xFA ; 250 1af94: 1f 4f sbci r17, 0xFF ; 255 1af96: 20 e2 ldi r18, 0x20 ; 32 1af98: 30 e0 ldi r19, 0x00 ; 0 1af9a: 42 e0 ldi r20, 0x02 ; 2 1af9c: 6f ef ldi r22, 0xFF ; 255 1af9e: 75 e8 ldi r23, 0x85 ; 133 1afa0: ee cf rjmp .-36 ; 0x1af7e 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); 1afa2: 0a 5f subi r16, 0xFA ; 250 1afa4: 1f 4f sbci r17, 0xFF ; 255 1afa6: 20 e1 ldi r18, 0x10 ; 16 1afa8: 30 e0 ldi r19, 0x00 ; 0 1afaa: 44 e0 ldi r20, 0x04 ; 4 1afac: 66 e0 ldi r22, 0x06 ; 6 1afae: 76 e8 ldi r23, 0x86 ; 134 1afb0: e6 cf rjmp .-52 ; 0x1af7e 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); 1afb2: 0a 5f subi r16, 0xFA ; 250 1afb4: 1f 4f sbci r17, 0xFF ; 255 1afb6: 30 e0 ldi r19, 0x00 ; 0 1afb8: 20 e0 ldi r18, 0x00 ; 0 1afba: 43 e0 ldi r20, 0x03 ; 3 1afbc: 62 e0 ldi r22, 0x02 ; 2 1afbe: 76 e8 ldi r23, 0x86 ; 134 1afc0: de cf rjmp .-68 ; 0x1af7e // 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; 1afc2: 81 e0 ldi r24, 0x01 ; 1 1afc4: df cf rjmp .-66 ; 0x1af84 0001afc6 : } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) strncpy_P(lcd_status_message, message, LCD_WIDTH); 1afc6: 44 e1 ldi r20, 0x14 ; 20 1afc8: 50 e0 ldi r21, 0x00 ; 0 return false; } static void lcd_updatestatus(const char *message, bool progmem = false) { if (progmem) 1afca: 66 23 and r22, r22 1afcc: 89 f0 breq .+34 ; 0x1aff0 strncpy_P(lcd_status_message, message, LCD_WIDTH); 1afce: bc 01 movw r22, r24 1afd0: 85 e6 ldi r24, 0x65 ; 101 1afd2: 94 e0 ldi r25, 0x04 ; 4 1afd4: 0f 94 6e a2 call 0x344dc ; 0x344dc else strncpy(lcd_status_message, message, LCD_WIDTH); lcd_status_message[LCD_WIDTH] = 0; 1afd8: 10 92 79 04 sts 0x0479, r1 ; 0x800479 <_ZL18lcd_status_message.lto_priv.422+0x14> lcd_status_message_idx = 0; // Print message from beginning 1afdc: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.417> SERIAL_PROTOCOLLNRPGM(MSG_LCD_STATUS_CHANGED); 1afe0: 85 e3 ldi r24, 0x35 ; 53 1afe2: 99 e6 ldi r25, 0x69 ; 105 1afe4: 0e 94 0e 7d call 0xfa1c ; 0xfa1c // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; 1afe8: 81 e0 ldi r24, 0x01 ; 1 1afea: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } 1afee: 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); 1aff0: bc 01 movw r22, r24 1aff2: 85 e6 ldi r24, 0x65 ; 101 1aff4: 94 e0 ldi r25, 0x04 ; 4 1aff6: 0f 94 01 ab call 0x35602 ; 0x35602 1affa: ee cf rjmp .-36 ; 0x1afd8 0001affc : } static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) 1affc: 90 91 c0 03 lds r25, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> 1b000: 89 17 cp r24, r25 1b002: 80 f4 brcc .+32 ; 0x1b024 return true; // check if we can override an info message yet if (lcd_status_message_level == LCD_STATUS_INFO) { 1b004: 91 30 cpi r25, 0x01 ; 1 1b006: 61 f4 brne .+24 ; 0x1b020 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 1b008: 80 91 7a 04 lds r24, 0x047A ; 0x80047a <_ZL26lcd_status_message_timeout.lto_priv.421> 1b00c: 88 23 and r24, r24 1b00e: 51 f0 breq .+20 ; 0x1b024 1b010: 40 e2 ldi r20, 0x20 ; 32 1b012: 5e e4 ldi r21, 0x4E ; 78 1b014: 60 e0 ldi r22, 0x00 ; 0 1b016: 70 e0 ldi r23, 0x00 ; 0 1b018: 8a e7 ldi r24, 0x7A ; 122 1b01a: 94 e0 ldi r25, 0x04 ; 4 1b01c: 0d 94 21 0c jmp 0x21842 ; 0x21842 ::expired(unsigned long)> return lcd_status_message_timeout.expired_cont(LCD_STATUS_INFO_TIMEOUT); } return false; 1b020: 80 e0 ldi r24, 0x00 ; 0 1b022: 08 95 ret static bool lcd_message_check(uint8_t priority) { // regular priority check if (priority >= lcd_status_message_level) return true; 1b024: 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; } 1b026: 08 95 ret 0001b028 : { lcd_setalertstatus_(message, severity, false); } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { 1b028: ef 92 push r14 1b02a: ff 92 push r15 1b02c: 1f 93 push r17 1b02e: cf 93 push r28 1b030: df 93 push r29 1b032: ec 01 movw r28, r24 1b034: 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)) { 1b036: 86 2f mov r24, r22 1b038: 0e 94 fe d7 call 0x1affc ; 0x1affc 1b03c: 88 23 and r24, r24 1b03e: e9 f0 breq .+58 ; 0x1b07a bool same = !(progmem? strcmp_P(lcd_status_message, message): 1b040: be 01 movw r22, r28 1b042: 85 e6 ldi r24, 0x65 ; 101 1b044: 94 e0 ldi r25, 0x04 ; 4 1b046: 0f 94 2f a2 call 0x3445e ; 0x3445e 1b04a: 7c 01 movw r14, r24 strcmp(lcd_status_message, message)); lcd_status_message_timeout.start(); 1b04c: 8a e7 ldi r24, 0x7A ; 122 1b04e: 94 e0 ldi r25, 0x04 ; 4 1b050: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> lcd_status_message_level = severity; 1b054: 10 93 c0 03 sts 0x03C0, r17 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> custom_message_type = CustomMsg::Status; 1b058: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d custom_message_state = 0; 1b05c: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de if (!same) { 1b060: ef 28 or r14, r15 1b062: 59 f0 breq .+22 ; 0x1b07a // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 1b064: 61 e0 ldi r22, 0x01 ; 1 1b066: ce 01 movw r24, r28 1b068: 0e 94 e3 d7 call 0x1afc6 ; 0x1afc6 } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1b06c: df 91 pop r29 1b06e: cf 91 pop r28 1b070: 1f 91 pop r17 1b072: ff 90 pop r15 1b074: 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(); 1b076: 0d 94 6e 05 jmp 0x20adc ; 0x20adc } void lcd_setalertstatuspgm(const char* message, uint8_t severity) { lcd_setalertstatus_(message, severity, true); } 1b07a: df 91 pop r29 1b07c: cf 91 pop r28 1b07e: 1f 91 pop r17 1b080: ff 90 pop r15 1b082: ef 90 pop r14 1b084: 08 95 ret 0001b086 : manage_inactivity(true); return _stepresult; } static void lcd_selftest_error(TestError testError, const char *_error_1, const char *_error_2) { 1b086: ef 92 push r14 1b088: ff 92 push r15 1b08a: 1f 93 push r17 1b08c: cf 93 push r28 1b08e: df 93 push r29 1b090: 18 2f mov r17, r24 1b092: eb 01 movw r28, r22 1b094: 7a 01 movw r14, r20 1b096: 80 e0 ldi r24, 0x00 ; 0 1b098: 0f 94 3f 23 call 0x2467e ; 0x2467e lcd_beeper_quick_feedback(); FORCE_BL_ON_END; target_temperature[0] = 0; 1b09c: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1b0a0: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d target_temperature_bed = 0; 1b0a4: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 1b0a8: 10 92 59 12 sts 0x1259, r1 ; 0x801259 manage_heater(); 1b0ac: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(); 1b0b0: 80 e0 ldi r24, 0x00 ; 0 1b0b2: 0e 94 ad 8a call 0x1155a ; 0x1155a lcd_clear(); 1b0b6: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_ERROR)); 1b0ba: 83 e0 ldi r24, 0x03 ; 3 1b0bc: 9a e4 ldi r25, 0x4A ; 74 1b0be: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b0c2: ac 01 movw r20, r24 1b0c4: 60 e0 ldi r22, 0x00 ; 0 1b0c6: 80 e0 ldi r24, 0x00 ; 0 1b0c8: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 1, _T(MSG_SELFTEST_PLEASECHECK)); 1b0cc: 83 ef ldi r24, 0xF3 ; 243 1b0ce: 99 e4 ldi r25, 0x49 ; 73 1b0d0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b0d4: ac 01 movw r20, r24 1b0d6: 61 e0 ldi r22, 0x01 ; 1 1b0d8: 80 e0 ldi r24, 0x00 ; 0 1b0da: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 switch (testError) 1b0de: 11 50 subi r17, 0x01 ; 1 1b0e0: 1a 30 cpi r17, 0x0A ; 10 1b0e2: 90 f4 brcc .+36 ; 0x1b108 1b0e4: e1 2f mov r30, r17 1b0e6: f0 e0 ldi r31, 0x00 ; 0 1b0e8: 88 27 eor r24, r24 1b0ea: e6 58 subi r30, 0x86 ; 134 1b0ec: f7 42 sbci r31, 0x27 ; 39 1b0ee: 8f 4f sbci r24, 0xFF ; 255 1b0f0: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> 1b0f4: 97 d8 rcall .-3794 ; 0x1a224 1b0f6: a3 d8 rcall .-3770 ; 0x1a23e 1b0f8: bb d8 rcall .-3722 ; 0x1a270 1b0fa: 01 d9 rcall .-3582 ; 0x1a2fe 1b0fc: 0d d9 rcall .-3558 ; 0x1a318 1b0fe: 10 d9 rcall .-3552 ; 0x1a320 1b100: 13 d9 rcall .-3546 ; 0x1a328 1b102: 16 d9 rcall .-3540 ; 0x1a330 1b104: 22 d9 rcall .-3516 ; 0x1a34a 1b106: 2e d9 rcall .-3492 ; 0x1a364 { case TestError::Heater: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_HEATERTHERMISTOR)); 1b108: 8f ed ldi r24, 0xDF ; 223 1b10a: 99 e4 ldi r25, 0x49 ; 73 1b10c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b110: ac 01 movw r20, r24 1b112: 62 e0 ldi r22, 0x02 ; 2 1b114: 80 e0 ldi r24, 0x00 ; 0 1b116: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_NOTCONNECTED)); 1b11a: 8f ec ldi r24, 0xCF ; 207 1b11c: 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)); 1b11e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b122: ac 01 movw r20, r24 1b124: 63 e0 ldi r22, 0x03 ; 3 1b126: 80 e0 ldi r24, 0x00 ; 0 1b128: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 1b12c: 44 c0 rjmp .+136 ; 0x1b1b6 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)); 1b12e: 82 ec ldi r24, 0xC2 ; 194 1b130: 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)); 1b132: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b136: ac 01 movw r20, r24 1b138: 62 e0 ldi r22, 0x02 ; 2 1b13a: 80 e0 ldi r24, 0x00 ; 0 1b13c: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1b140: 83 eb ldi r24, 0xB3 ; 179 1b142: 99 e4 ldi r25, 0x49 ; 73 1b144: ec cf rjmp .-40 ; 0x1b11e 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)); 1b146: 88 ea ldi r24, 0xA8 ; 168 1b148: 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)); 1b14a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b14e: ac 01 movw r20, r24 1b150: 62 e0 ldi r22, 0x02 ; 2 1b152: 80 e0 ldi r24, 0x00 ; 0 1b154: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_WIRINGERROR)); 1b158: 83 eb ldi r24, 0xB3 ; 179 1b15a: 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)); 1b15c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b160: ac 01 movw r20, r24 1b162: 63 e0 ldi r22, 0x03 ; 3 1b164: 80 e0 ldi r24, 0x00 ; 0 1b166: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(18, 3); 1b16a: 63 e0 ldi r22, 0x03 ; 3 1b16c: 82 e1 ldi r24, 0x12 ; 18 1b16e: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_print(_error_1); 1b172: ce 01 movw r24, r28 1b174: 1e c0 rjmp .+60 ; 0x1b1b2 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)); 1b176: 80 ea ldi r24, 0xA0 ; 160 1b178: 99 e4 ldi r25, 0x49 ; 73 1b17a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b17e: ac 01 movw r20, r24 1b180: 62 e0 ldi r22, 0x02 ; 2 1b182: 80 e0 ldi r24, 0x00 ; 0 1b184: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(18, 2); 1b188: 62 e0 ldi r22, 0x02 ; 2 1b18a: 82 e1 ldi r24, 0x12 ; 18 1b18c: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_print(_error_1); 1b190: ce 01 movw r24, r28 1b192: 0e 94 b0 73 call 0xe760 ; 0xe760 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_ENDSTOP)); 1b196: 86 e9 ldi r24, 0x96 ; 150 1b198: 99 e4 ldi r25, 0x49 ; 73 1b19a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b19e: ac 01 movw r20, r24 1b1a0: 63 e0 ldi r22, 0x03 ; 3 1b1a2: 80 e0 ldi r24, 0x00 ; 0 1b1a4: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(18, 3); 1b1a8: 63 e0 ldi r22, 0x03 ; 3 1b1aa: 82 e1 ldi r24, 0x12 ; 18 1b1ac: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_print(_error_2); 1b1b0: 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); 1b1b2: 0e 94 b0 73 call 0xe760 ; 0xe760 lcd_set_cursor(0, 3); lcd_printf_P(_T(MSG_SELFTEST_FS_LEVEL),_error_1); break; } _delay(1000); 1b1b6: 68 ee ldi r22, 0xE8 ; 232 1b1b8: 73 e0 ldi r23, 0x03 ; 3 1b1ba: 80 e0 ldi r24, 0x00 ; 0 1b1bc: 90 e0 ldi r25, 0x00 ; 0 1b1be: 0f 94 56 0b call 0x216ac ; 0x216ac 1b1c2: 80 e0 ldi r24, 0x00 ; 0 1b1c4: 0f 94 3f 23 call 0x2467e ; 0x2467e lcd_beeper_quick_feedback(); do { _delay(100); 1b1c8: 64 e6 ldi r22, 0x64 ; 100 1b1ca: 70 e0 ldi r23, 0x00 ; 0 1b1cc: 80 e0 ldi r24, 0x00 ; 0 1b1ce: 90 e0 ldi r25, 0x00 ; 0 1b1d0: 0f 94 56 0b call 0x216ac ; 0x216ac manage_heater(); 1b1d4: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(); 1b1d8: 80 e0 ldi r24, 0x00 ; 0 1b1da: 0e 94 ad 8a call 0x1155a ; 0x1155a } while (!lcd_clicked()); 1b1de: 0e 94 c6 73 call 0xe78c ; 0xe78c 1b1e2: 88 23 and r24, r24 1b1e4: 89 f3 breq .-30 ; 0x1b1c8 LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1b1e6: 85 e5 ldi r24, 0x55 ; 85 1b1e8: 9a e4 ldi r25, 0x4A ; 74 1b1ea: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b1ee: 62 e0 ldi r22, 0x02 ; 2 1b1f0: 0e 94 14 d8 call 0x1b028 ; 0x1b028 lcd_return_to_status(); } 1b1f4: df 91 pop r29 1b1f6: cf 91 pop r28 1b1f8: 1f 91 pop r17 1b1fa: ff 90 pop r15 1b1fc: ef 90 pop r14 manage_heater(); manage_inactivity(); } while (!lcd_clicked()); LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); lcd_return_to_status(); 1b1fe: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 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)); 1b202: 84 e8 ldi r24, 0x84 ; 132 1b204: 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)); 1b206: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b20a: ac 01 movw r20, r24 1b20c: 62 e0 ldi r22, 0x02 ; 2 1b20e: 80 e0 ldi r24, 0x00 ; 0 1b210: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_MOTOR)); 1b214: 80 ea ldi r24, 0xA0 ; 160 1b216: 99 e4 ldi r25, 0x49 ; 73 1b218: a1 cf rjmp .-190 ; 0x1b15c 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)); 1b21a: 8c e1 ldi r24, 0x1C ; 28 1b21c: 9e e5 ldi r25, 0x5E ; 94 1b21e: 95 cf rjmp .-214 ; 0x1b14a 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)); 1b220: 89 e0 ldi r24, 0x09 ; 9 1b222: 9e e5 ldi r25, 0x5E ; 94 1b224: 92 cf rjmp .-220 ; 0x1b14a 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)); 1b226: 85 e7 ldi r24, 0x75 ; 117 1b228: 99 e4 ldi r25, 0x49 ; 73 1b22a: ed cf rjmp .-38 ; 0x1b206 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)); 1b22c: 87 e6 ldi r24, 0x67 ; 103 1b22e: 99 e4 ldi r25, 0x49 ; 73 1b230: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b234: ac 01 movw r20, r24 1b236: 62 e0 ldi r22, 0x02 ; 2 1b238: 80 e0 ldi r24, 0x00 ; 0 1b23a: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_AXIS)); 1b23e: 80 e6 ldi r24, 0x60 ; 96 1b240: 99 e4 ldi r25, 0x49 ; 73 1b242: 8c cf rjmp .-232 ; 0x1b15c lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::SwappedFan: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FANS)); 1b244: 8e e4 ldi r24, 0x4E ; 78 1b246: 99 e4 ldi r25, 0x49 ; 73 1b248: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b24c: ac 01 movw r20, r24 1b24e: 62 e0 ldi r22, 0x02 ; 2 1b250: 80 e0 ldi r24, 0x00 ; 0 1b252: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 3, _T(MSG_SELFTEST_SWAPPED)); 1b256: 84 e4 ldi r24, 0x44 ; 68 1b258: 99 e4 ldi r25, 0x49 ; 73 1b25a: 80 cf rjmp .-256 ; 0x1b15c lcd_set_cursor(18, 3); lcd_print(_error_1); break; case TestError::WiringFsensor: lcd_puts_at_P(0, 2, _T(MSG_SELFTEST_FILAMENT_SENSOR)); 1b25c: 85 e1 ldi r24, 0x15 ; 21 1b25e: 9a e4 ldi r25, 0x4A ; 74 1b260: 68 cf rjmp .-304 ; 0x1b132 0001b262 : manage_inactivity(true); return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { 1b262: 8f 92 push r8 1b264: 9f 92 push r9 1b266: af 92 push r10 1b268: bf 92 push r11 1b26a: cf 92 push r12 1b26c: df 92 push r13 1b26e: ef 92 push r14 1b270: ff 92 push r15 1b272: 0f 93 push r16 1b274: 1f 93 push r17 1b276: cf 93 push r28 1b278: df 93 push r29 1b27a: f8 2e mov r15, r24 1b27c: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1b280: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1b284: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1b288: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1b28c: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1b290: 4b 01 movw r8, r22 1b292: 6b 01 movw r12, r22 1b294: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1b298: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1b29c: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1b2a0: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1b2a4: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1b2a8: 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 1b2aa: 9c e3 ldi r25, 0x3C ; 60 1b2ac: a9 2e mov r10, r25 target_temperature[0] = (_isbed) ? 0 : 200; 1b2ae: 88 ec ldi r24, 0xC8 ; 200 1b2b0: 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); 1b2b2: ff 20 and r15, r15 1b2b4: 31 f0 breq .+12 ; 0x1b2c2 1b2b6: 6b 01 movw r12, r22 int _opposite_snapshot = (_isbed) ? degHotend(0) : degBed(); 1b2b8: e4 01 movw r28, r8 uint8_t _cycles = (_isbed) ? 180 : 60; //~ 90s / 30s 1b2ba: 24 eb ldi r18, 0xB4 ; 180 1b2bc: a2 2e mov r10, r18 target_temperature[0] = (_isbed) ? 0 : 200; 1b2be: 90 e0 ldi r25, 0x00 ; 0 1b2c0: 80 e0 ldi r24, 0x00 ; 0 1b2c2: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 1b2c6: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d target_temperature_bed = (_isbed) ? 100 : 0; 1b2ca: 84 e6 ldi r24, 0x64 ; 100 1b2cc: 90 e0 ldi r25, 0x00 ; 0 1b2ce: f1 10 cpse r15, r1 1b2d0: 02 c0 rjmp .+4 ; 0x1b2d6 1b2d2: 90 e0 ldi r25, 0x00 ; 0 1b2d4: 80 e0 ldi r24, 0x00 ; 0 1b2d6: 90 93 5a 12 sts 0x125A, r25 ; 0x80125a 1b2da: 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(); 1b2de: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 1b2e2: 81 e0 ldi r24, 0x01 ; 1 1b2e4: 0e 94 ad 8a call 0x1155a ; 0x1155a for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b2e8: e1 2c mov r14, r1 return _result; } static bool lcd_selfcheck_check_heater(bool _isbed) { uint8_t _progress = 0; 1b2ea: 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 1b2ec: 85 e0 ldi r24, 0x05 ; 5 1b2ee: 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) 1b2f0: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 1b2f4: 81 11 cpse r24, r1 1b2f6: 1c c0 rjmp .+56 ; 0x1b330 { manage_heater(); 1b2f8: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 1b2fc: 81 e0 ldi r24, 0x01 ; 1 1b2fe: 0e 94 ad 8a call 0x1155a ; 0x1155a _progress = (_isbed? 1b302: 00 e9 ldi r16, 0x90 ; 144 1b304: 11 e0 ldi r17, 0x01 ; 1 1b306: 20 e0 ldi r18, 0x00 ; 0 1b308: 42 e0 ldi r20, 0x02 ; 2 1b30a: 6b 2d mov r22, r11 1b30c: 87 e0 ldi r24, 0x07 ; 7 1b30e: f1 10 cpse r15, r1 1b310: 01 c0 rjmp .+2 ; 0x1b314 1b312: 88 e0 ldi r24, 0x08 ; 8 1b314: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1b318: 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 1b31a: 8e 2d mov r24, r14 1b31c: 69 2d mov r22, r9 1b31e: 0f 94 30 a5 call 0x34a60 ; 0x34a60 <__udivmodqi4> 1b322: 91 11 cpse r25, r1 1b324: 02 c0 rjmp .+4 ; 0x1b32a 1b326: 0e 94 23 7b call 0xf646 ; 0xf646 thermal_model_set_enabled(false); #endif //THERMAL_MODEL manage_heater(); manage_inactivity(true); for(uint8_t _counter = 0; _counter < _cycles && !Stopped; ++_counter) 1b32a: e3 94 inc r14 1b32c: ea 10 cpse r14, r10 1b32e: e0 cf rjmp .-64 ; 0x1b2f0 MYSERIAL.println(degHotend(0)); }*/ if(_counter%5 == 0) serialecho_temperatures(); //show temperatures once in two seconds } target_temperature[0] = 0; 1b330: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1b334: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d target_temperature_bed = 0; 1b338: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 1b33c: 10 92 59 12 sts 0x1259, r1 ; 0x801259 manage_heater(); 1b340: 0f 94 a8 37 call 0x26f50 ; 0x26f50 1b344: b6 01 movw r22, r12 1b346: dd 0c add r13, r13 1b348: 88 0b sbc r24, r24 1b34a: 99 0b sbc r25, r25 1b34c: 4e 01 movw r8, r28 1b34e: dd 0f add r29, r29 1b350: aa 08 sbc r10, r10 1b352: bb 08 sbc r11, r11 int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b354: ff 20 and r15, r15 1b356: 09 f4 brne .+2 ; 0x1b35a 1b358: 4d c0 rjmp .+154 ; 0x1b3f4 1b35a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1b35e: 9b 01 movw r18, r22 1b360: ac 01 movw r20, r24 1b362: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1b366: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1b36a: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1b36e: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1b372: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1b376: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1b37a: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b37c: c5 01 movw r24, r10 1b37e: b4 01 movw r22, r8 1b380: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1b384: 9b 01 movw r18, r22 1b386: ac 01 movw r20, r24 1b388: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1b38c: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1b390: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1b394: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1b398: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1b39c: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1b3a0: 10 91 3b 12 lds r17, 0x123B ; 0x80123b 1b3a4: 11 11 cpse r17, r1 1b3a6: 0c c0 rjmp .+24 ; 0x1b3c0 1b3a8: f1 10 cpse r15, r1 1b3aa: 44 c0 rjmp .+136 ; 0x1b434 1b3ac: 69 30 cpi r22, 0x09 ; 9 1b3ae: 71 05 cpc r23, r1 1b3b0: 0c f0 brlt .+2 ; 0x1b3b4 1b3b2: 46 c0 rjmp .+140 ; 0x1b440 { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b3b4: 8e e1 ldi r24, 0x1E ; 30 1b3b6: 90 e0 ldi r25, 0x00 ; 0 _stepresult = true; 1b3b8: 11 e0 ldi r17, 0x01 ; 1 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b3ba: c8 17 cp r28, r24 1b3bc: d9 07 cpc r29, r25 1b3be: 3c f4 brge .+14 ; 0x1b3ce _stepresult = true; else lcd_selftest_error(TestError::Heater, "", ""); 1b3c0: 4f ed ldi r20, 0xDF ; 223 1b3c2: 52 e0 ldi r21, 0x02 ; 2 1b3c4: ba 01 movw r22, r20 1b3c6: 80 e0 ldi r24, 0x00 ; 0 1b3c8: 0e 94 43 d8 call 0x1b086 ; 0x1b086 MYSERIAL.println(_checked_result); MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; 1b3cc: 10 e0 ldi r17, 0x00 ; 0 } #ifdef THERMAL_MODEL thermal_model_set_enabled(tm_was_enabled); #endif //THERMAL_MODEL manage_heater(); 1b3ce: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 1b3d2: 81 e0 ldi r24, 0x01 ; 1 1b3d4: 0e 94 ad 8a call 0x1155a ; 0x1155a return _stepresult; } 1b3d8: 81 2f mov r24, r17 1b3da: df 91 pop r29 1b3dc: cf 91 pop r28 1b3de: 1f 91 pop r17 1b3e0: 0f 91 pop r16 1b3e2: ff 90 pop r15 1b3e4: ef 90 pop r14 1b3e6: df 90 pop r13 1b3e8: cf 90 pop r12 1b3ea: bf 90 pop r11 1b3ec: af 90 pop r10 1b3ee: 9f 90 pop r9 1b3f0: 8f 90 pop r8 1b3f2: 08 95 ret target_temperature[0] = 0; target_temperature_bed = 0; manage_heater(); int _checked_result = (_isbed) ? degBed() - _checked_snapshot : degHotend(0) - _checked_snapshot; 1b3f4: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1b3f8: 9b 01 movw r18, r22 1b3fa: ac 01 movw r20, r24 1b3fc: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1b400: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1b404: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1b408: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1b40c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1b410: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1b414: eb 01 movw r28, r22 int _opposite_result = (_isbed) ? degHotend(0) - _opposite_snapshot : degBed() - _opposite_snapshot; 1b416: c5 01 movw r24, r10 1b418: b4 01 movw r22, r8 1b41a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1b41e: 9b 01 movw r18, r22 1b420: ac 01 movw r20, r24 1b422: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1b426: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1b42a: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1b42e: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1b432: b2 cf rjmp .-156 ; 0x1b398 */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) { if (!Stopped && _checked_result >= ((_isbed) ? 9 : 30)) 1b434: 89 e0 ldi r24, 0x09 ; 9 1b436: 90 e0 ldi r25, 0x00 ; 0 MYSERIAL.print("Opposite result:"); MYSERIAL.println(_opposite_result); */ bool _stepresult = false; if (Stopped || _opposite_result < ((_isbed) ? 30 : 9)) 1b438: 6e 31 cpi r22, 0x1E ; 30 1b43a: 71 05 cpc r23, r1 1b43c: 0c f4 brge .+2 ; 0x1b440 1b43e: bc cf rjmp .-136 ; 0x1b3b8 else lcd_selftest_error(TestError::Heater, "", ""); } else { lcd_selftest_error(TestError::Bed, "", ""); 1b440: 4f ed ldi r20, 0xDF ; 223 1b442: 52 e0 ldi r21, 0x02 ; 2 1b444: ba 01 movw r22, r20 1b446: 81 e0 ldi r24, 0x01 ; 1 1b448: 0e 94 43 d8 call 0x1b086 ; 0x1b086 1b44c: c0 cf rjmp .-128 ; 0x1b3ce 0001b44e : return _stepresult; } static bool lcd_selfcheck_pulleys(int axis) { 1b44e: 2f 92 push r2 1b450: 3f 92 push r3 1b452: 4f 92 push r4 1b454: 5f 92 push r5 1b456: 6f 92 push r6 1b458: 7f 92 push r7 1b45a: 8f 92 push r8 1b45c: 9f 92 push r9 1b45e: af 92 push r10 1b460: bf 92 push r11 1b462: cf 92 push r12 1b464: df 92 push r13 1b466: ef 92 push r14 1b468: ff 92 push r15 1b46a: 0f 93 push r16 1b46c: 1f 93 push r17 1b46e: cf 93 push r28 1b470: df 93 push r29 1b472: 8c 01 movw r16, r24 float current_position_init; float move; bool endstop_triggered = false; int i; unsigned long timeout_counter; refresh_cmd_timeout(); 1b474: 0e 94 92 65 call 0xcb24 ; 0xcb24 manage_inactivity(true); 1b478: 81 e0 ldi r24, 0x01 ; 1 1b47a: 0e 94 ad 8a call 0x1155a ; 0x1155a if (axis == 0) move = 50; //X_AXIS else move = 50; //Y_AXIS current_position_init = current_position[axis]; 1b47e: 18 01 movw r2, r16 1b480: 22 0c add r2, r2 1b482: 33 1c adc r3, r3 1b484: 22 0c add r2, r2 1b486: 33 1c adc r3, r3 1b488: e1 01 movw r28, r2 1b48a: cf 59 subi r28, 0x9F ; 159 1b48c: dd 4e sbci r29, 0xED ; 237 1b48e: 88 80 ld r8, Y 1b490: 99 80 ldd r9, Y+1 ; 0x01 1b492: aa 80 ldd r10, Y+2 ; 0x02 1b494: bb 80 ldd r11, Y+3 ; 0x03 current_position[axis] += 2; 1b496: 20 e0 ldi r18, 0x00 ; 0 1b498: 30 e0 ldi r19, 0x00 ; 0 1b49a: 40 e0 ldi r20, 0x00 ; 0 1b49c: 50 e4 ldi r21, 0x40 ; 64 1b49e: c5 01 movw r24, r10 1b4a0: b4 01 movw r22, r8 1b4a2: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1b4a6: 68 83 st Y, r22 1b4a8: 79 83 std Y+1, r23 ; 0x01 1b4aa: 8a 83 std Y+2, r24 ; 0x02 1b4ac: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b4ae: 60 e0 ldi r22, 0x00 ; 0 1b4b0: 70 e0 ldi r23, 0x00 ; 0 1b4b2: 84 e3 ldi r24, 0x34 ; 52 1b4b4: 92 e4 ldi r25, 0x42 ; 66 1b4b6: 0f 94 0d 4a call 0x2941a ; 0x2941a 1b4ba: 95 e0 ldi r25, 0x05 ; 5 1b4bc: e9 2e mov r14, r25 1b4be: f1 2c mov r15, r1 for (i = 0; i < 5; i++) { refresh_cmd_timeout(); 1b4c0: 0e 94 92 65 call 0xcb24 ; 0xcb24 current_position[axis] = current_position[axis] + move; 1b4c4: 20 e0 ldi r18, 0x00 ; 0 1b4c6: 30 e0 ldi r19, 0x00 ; 0 1b4c8: 48 e4 ldi r20, 0x48 ; 72 1b4ca: 52 e4 ldi r21, 0x42 ; 66 1b4cc: 68 81 ld r22, Y 1b4ce: 79 81 ldd r23, Y+1 ; 0x01 1b4d0: 8a 81 ldd r24, Y+2 ; 0x02 1b4d2: 9b 81 ldd r25, Y+3 ; 0x03 1b4d4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1b4d8: 68 83 st Y, r22 1b4da: 79 83 std Y+1, r23 ; 0x01 1b4dc: 8a 83 std Y+2, r24 ; 0x02 1b4de: 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); 1b4e0: 6c e6 ldi r22, 0x6C ; 108 1b4e2: 70 e0 ldi r23, 0x00 ; 0 1b4e4: 8e e2 ldi r24, 0x2E ; 46 1b4e6: 0e 94 56 d1 call 0x1a2ac ; 0x1a2ac st_current_set(0, 850); //set motor current higher plan_buffer_line_curposXYZE(200); 1b4ea: 60 e0 ldi r22, 0x00 ; 0 1b4ec: 70 e0 ldi r23, 0x00 ; 0 1b4ee: 88 e4 ldi r24, 0x48 ; 72 1b4f0: 93 e4 ldi r25, 0x43 ; 67 1b4f2: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1b4f6: 0f 94 94 18 call 0x23128 ; 0x23128 if (SilentModeMenu != SILENT_MODE_OFF) st_current_set(0, tmp_motor[0]); //set back to normal operation currents 1b4fa: 80 91 bb 03 lds r24, 0x03BB ; 0x8003bb 1b4fe: 62 e2 ldi r22, 0x22 ; 34 1b500: 70 e0 ldi r23, 0x00 ; 0 1b502: 81 11 cpse r24, r1 1b504: 02 c0 rjmp .+4 ; 0x1b50a 1b506: 64 e4 ldi r22, 0x44 ; 68 1b508: 70 e0 ldi r23, 0x00 ; 0 1b50a: 8e e2 ldi r24, 0x2E ; 46 1b50c: 0e 94 56 d1 call 0x1a2ac ; 0x1a2ac else st_current_set(0, tmp_motor_loud[0]); //set motor current back current_position[axis] = current_position[axis] - move; 1b510: 20 e0 ldi r18, 0x00 ; 0 1b512: 30 e0 ldi r19, 0x00 ; 0 1b514: 48 e4 ldi r20, 0x48 ; 72 1b516: 52 e4 ldi r21, 0x42 ; 66 1b518: 68 81 ld r22, Y 1b51a: 79 81 ldd r23, Y+1 ; 0x01 1b51c: 8a 81 ldd r24, Y+2 ; 0x02 1b51e: 9b 81 ldd r25, Y+3 ; 0x03 1b520: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1b524: 68 83 st Y, r22 1b526: 79 83 std Y+1, r23 ; 0x01 1b528: 8a 83 std Y+2, r24 ; 0x02 1b52a: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(50); 1b52c: 60 e0 ldi r22, 0x00 ; 0 1b52e: 70 e0 ldi r23, 0x00 ; 0 1b530: 88 e4 ldi r24, 0x48 ; 72 1b532: 92 e4 ldi r25, 0x42 ; 66 1b534: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1b538: 0f 94 94 18 call 0x23128 ; 0x23128 if (((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1b53c: 1e 99 sbic 0x03, 6 ; 3 1b53e: 3a c0 rjmp .+116 ; 0x1b5b4 1b540: 1d 99 sbic 0x03, 5 ; 3 1b542: 38 c0 rjmp .+112 ; 0x1b5b4 1b544: 21 e0 ldi r18, 0x01 ; 1 1b546: e2 1a sub r14, r18 1b548: 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++) { 1b54a: 09 f0 breq .+2 ; 0x1b54e 1b54c: b9 cf rjmp .-142 ; 0x1b4c0 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1)) { lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } timeout_counter = _millis() + 2500; 1b54e: 0f 94 89 0b call 0x21712 ; 0x21712 1b552: 2b 01 movw r4, r22 1b554: 3c 01 movw r6, r24 1b556: 24 ec ldi r18, 0xC4 ; 196 1b558: 42 0e add r4, r18 1b55a: 29 e0 ldi r18, 0x09 ; 9 1b55c: 52 1e adc r5, r18 1b55e: 61 1c adc r6, r1 1b560: 71 1c adc r7, r1 endstop_triggered = false; manage_inactivity(true); 1b562: 81 e0 ldi r24, 0x01 ; 1 1b564: 0e 94 ad 8a call 0x1155a ; 0x1155a 1b568: e1 01 movw r28, r2 1b56a: cf 59 subi r28, 0x9F ; 159 1b56c: dd 4e sbci r29, 0xED ; 237 1b56e: c8 80 ld r12, Y 1b570: d9 80 ldd r13, Y+1 ; 0x01 1b572: ea 80 ldd r14, Y+2 ; 0x02 1b574: 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]) { 1b576: 20 e0 ldi r18, 0x00 ; 0 1b578: 30 e0 ldi r19, 0x00 ; 0 1b57a: 40 e8 ldi r20, 0x80 ; 128 1b57c: 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) || 1b57e: 1e 99 sbic 0x03, 6 ; 3 1b580: 26 c0 rjmp .+76 ; 0x1b5ce 1b582: 1d 99 sbic 0x03, 5 ; 3 1b584: 24 c0 rjmp .+72 ; 0x1b5ce lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); return(false); } } else { current_position[axis] -= 1; 1b586: c7 01 movw r24, r14 1b588: b6 01 movw r22, r12 1b58a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1b58e: 68 83 st Y, r22 1b590: 79 83 std Y+1, r23 ; 0x01 1b592: 8a 83 std Y+2, r24 ; 0x02 1b594: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b596: 60 e0 ldi r22, 0x00 ; 0 1b598: 70 e0 ldi r23, 0x00 ; 0 1b59a: 84 e3 ldi r24, 0x34 ; 52 1b59c: 92 e4 ldi r25, 0x42 ; 66 1b59e: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1b5a2: 0f 94 94 18 call 0x23128 ; 0x23128 if (_millis() > timeout_counter) { 1b5a6: 0f 94 89 0b call 0x21712 ; 0x21712 1b5aa: 46 16 cp r4, r22 1b5ac: 57 06 cpc r5, r23 1b5ae: 68 06 cpc r6, r24 1b5b0: 79 06 cpc r7, r25 1b5b2: e8 f6 brcc .-70 ; 0x1b56e lcd_selftest_error(TestError::Pulley, (axis == 0) ? "X" : "Y", ""); 1b5b4: 68 ec ldi r22, 0xC8 ; 200 1b5b6: 72 e0 ldi r23, 0x02 ; 2 1b5b8: 01 2b or r16, r17 1b5ba: 11 f0 breq .+4 ; 0x1b5c0 1b5bc: 6a ec ldi r22, 0xCA ; 202 1b5be: 72 e0 ldi r23, 0x02 ; 2 1b5c0: 4f ed ldi r20, 0xDF ; 223 1b5c2: 52 e0 ldi r21, 0x02 ; 2 1b5c4: 87 e0 ldi r24, 0x07 ; 7 1b5c6: 0e 94 43 d8 call 0x1b086 ; 0x1b086 return(false); 1b5ca: 80 e0 ldi r24, 0x00 ; 0 1b5cc: 30 c0 rjmp .+96 ; 0x1b62e 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]) { 1b5ce: c5 01 movw r24, r10 1b5d0: b4 01 movw r22, r8 1b5d2: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1b5d6: a7 01 movw r20, r14 1b5d8: 96 01 movw r18, r12 1b5da: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1b5de: 18 16 cp r1, r24 1b5e0: 4c f3 brlt .-46 ; 0x1b5b4 1b5e2: 20 e0 ldi r18, 0x00 ; 0 1b5e4: 30 e0 ldi r19, 0x00 ; 0 1b5e6: 40 e8 ldi r20, 0x80 ; 128 1b5e8: 5f e3 ldi r21, 0x3F ; 63 1b5ea: c5 01 movw r24, r10 1b5ec: b4 01 movw r22, r8 1b5ee: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1b5f2: a7 01 movw r20, r14 1b5f4: 96 01 movw r18, r12 1b5f6: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1b5fa: 87 fd sbrc r24, 7 1b5fc: db cf rjmp .-74 ; 0x1b5b4 current_position[axis] += 10; 1b5fe: e1 01 movw r28, r2 1b600: cf 59 subi r28, 0x9F ; 159 1b602: dd 4e sbci r29, 0xED ; 237 1b604: 20 e0 ldi r18, 0x00 ; 0 1b606: 30 e0 ldi r19, 0x00 ; 0 1b608: 40 e2 ldi r20, 0x20 ; 32 1b60a: 51 e4 ldi r21, 0x41 ; 65 1b60c: c7 01 movw r24, r14 1b60e: b6 01 movw r22, r12 1b610: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1b614: 68 83 st Y, r22 1b616: 79 83 std Y+1, r23 ; 0x01 1b618: 8a 83 std Y+2, r24 ; 0x02 1b61a: 9b 83 std Y+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b61c: 60 e0 ldi r22, 0x00 ; 0 1b61e: 70 e0 ldi r23, 0x00 ; 0 1b620: 84 e3 ldi r24, 0x34 ; 52 1b622: 92 e4 ldi r25, 0x42 ; 66 1b624: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1b628: 0f 94 94 18 call 0x23128 ; 0x23128 return(true); 1b62c: 81 e0 ldi r24, 0x01 ; 1 return(false); } } } return(true); } 1b62e: df 91 pop r29 1b630: cf 91 pop r28 1b632: 1f 91 pop r17 1b634: 0f 91 pop r16 1b636: ff 90 pop r15 1b638: ef 90 pop r14 1b63a: df 90 pop r13 1b63c: cf 90 pop r12 1b63e: bf 90 pop r11 1b640: af 90 pop r10 1b642: 9f 90 pop r9 1b644: 8f 90 pop r8 1b646: 7f 90 pop r7 1b648: 6f 90 pop r6 1b64a: 5f 90 pop r5 1b64c: 4f 90 pop r4 1b64e: 3f 90 pop r3 1b650: 2f 90 pop r2 1b652: 08 95 ret 0001b654 : } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1b654: 2f 92 push r2 1b656: 3f 92 push r3 1b658: 4f 92 push r4 1b65a: 5f 92 push r5 1b65c: 6f 92 push r6 1b65e: 7f 92 push r7 1b660: 8f 92 push r8 1b662: 9f 92 push r9 1b664: af 92 push r10 1b666: bf 92 push r11 1b668: cf 92 push r12 1b66a: df 92 push r13 1b66c: ef 92 push r14 1b66e: ff 92 push r15 1b670: 0f 93 push r16 1b672: 1f 93 push r17 1b674: cf 93 push r28 1b676: df 93 push r29 1b678: 7c 01 movw r14, r24 1b67a: 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); 1b67c: cb 01 movw r24, r22 1b67e: 6a e0 ldi r22, 0x0A ; 10 1b680: 70 e0 ldi r23, 0x00 ; 0 1b682: 0f 94 5e a5 call 0x34abc ; 0x34abc <__divmodhi4> 1b686: 66 0e add r6, r22 1b688: 77 1e adc r7, r23 if (_axis == X_AXIS) { 1b68a: e1 14 cp r14, r1 1b68c: f1 04 cpc r15, r1 1b68e: e1 f4 brne .+56 ; 0x1b6c8 current_position[Z_AXIS] += 17; 1b690: 20 e0 ldi r18, 0x00 ; 0 1b692: 30 e0 ldi r19, 0x00 ; 0 1b694: 48 e8 ldi r20, 0x88 ; 136 1b696: 51 e4 ldi r21, 0x41 ; 65 1b698: 60 91 69 12 lds r22, 0x1269 ; 0x801269 1b69c: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 1b6a0: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 1b6a4: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 1b6a8: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1b6ac: 60 93 69 12 sts 0x1269, r22 ; 0x801269 1b6b0: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1b6b4: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1b6b8: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b6bc: 60 e0 ldi r22, 0x00 ; 0 1b6be: 70 e0 ldi r23, 0x00 ; 0 1b6c0: 84 e3 ldi r24, 0x34 ; 52 1b6c2: 92 e4 ldi r25, 0x42 ; 66 1b6c4: 0f 94 0d 4a call 0x2941a ; 0x2941a } #endif //TMC2130 #ifndef TMC2130 static bool lcd_selfcheck_axis(int _axis, int _travel) { 1b6c8: 10 e0 ldi r17, 0x00 ; 0 1b6ca: 00 e0 ldi r16, 0x00 ; 0 1b6cc: d0 e0 ldi r29, 0x00 ; 0 1b6ce: c0 e0 ldi r28, 0x00 ; 0 1b6d0: d1 2c mov r13, r1 1b6d2: c1 2c mov r12, r1 1b6d4: 31 2c mov r3, r1 1b6d6: 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; 1b6d8: 57 01 movw r10, r14 1b6da: aa 0c add r10, r10 1b6dc: bb 1c adc r11, r11 1b6de: aa 0c add r10, r10 1b6e0: bb 1c adc r11, r11 1b6e2: c5 01 movw r24, r10 1b6e4: 8f 59 subi r24, 0x9F ; 159 1b6e6: 9d 4e sbci r25, 0xED ; 237 1b6e8: 4c 01 movw r8, r24 { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1b6ea: 94 e0 ldi r25, 0x04 ; 4 1b6ec: 29 2e mov r2, r25 1b6ee: 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; 1b6f0: 20 e0 ldi r18, 0x00 ; 0 1b6f2: 30 e0 ldi r19, 0x00 ; 0 1b6f4: 40 e8 ldi r20, 0x80 ; 128 1b6f6: 5f e3 ldi r21, 0x3F ; 63 1b6f8: f4 01 movw r30, r8 1b6fa: 60 81 ld r22, Z 1b6fc: 71 81 ldd r23, Z+1 ; 0x01 1b6fe: 82 81 ldd r24, Z+2 ; 0x02 1b700: 93 81 ldd r25, Z+3 ; 0x03 1b702: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1b706: f4 01 movw r30, r8 1b708: 60 83 st Z, r22 1b70a: 71 83 std Z+1, r23 ; 0x01 1b70c: 82 83 std Z+2, r24 ; 0x02 1b70e: 93 83 std Z+3, r25 ; 0x03 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1b710: 60 e0 ldi r22, 0x00 ; 0 1b712: 70 e0 ldi r23, 0x00 ; 0 1b714: 84 e3 ldi r24, 0x34 ; 52 1b716: 92 e4 ldi r25, 0x42 ; 66 1b718: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1b71c: 0f 94 94 18 call 0x23128 ; 0x23128 if ((READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) || (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) || 1b720: 1e 99 sbic 0x03, 6 ; 3 1b722: 04 c0 rjmp .+8 ; 0x1b72c 1b724: 1d 99 sbic 0x03, 5 ; 3 1b726: 02 c0 rjmp .+4 ; 0x1b72c 1b728: 1c 9b sbis 0x03, 4 ; 3 1b72a: 39 c0 rjmp .+114 ; 0x1b79e (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING)) { if (_axis == 0) { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b72c: 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) 1b72e: e1 14 cp r14, r1 1b730: f1 04 cpc r15, r1 1b732: 51 f4 brne .+20 ; 0x1b748 { _stepresult = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b734: 56 fa bst r5, 6 1b736: 55 24 eor r5, r5 1b738: 50 f8 bld r5, 0 _err_endstop = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? 1 : 2; 1b73a: 1d 99 sbic 0x03, 5 ; 3 1b73c: 8e c0 rjmp .+284 ; 0x1b85a } 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; 1b73e: c2 e0 ldi r28, 0x02 ; 2 1b740: 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; 1b742: 44 24 eor r4, r4 1b744: 43 94 inc r4 1b746: 2c c0 rjmp .+88 ; 0x1b7a0 { _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) 1b748: f1 e0 ldi r31, 0x01 ; 1 1b74a: ef 16 cp r14, r31 1b74c: f1 04 cpc r15, r1 1b74e: 41 f4 brne .+16 ; 0x1b760 { _stepresult = ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b750: 55 fa bst r5, 5 1b752: 55 24 eor r5, r5 1b754: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 2; 1b756: 1e 9b sbis 0x03, 6 ; 3 1b758: f2 cf rjmp .-28 ; 0x1b73e 1b75a: d0 e0 ldi r29, 0x00 ; 0 1b75c: c0 e0 ldi r28, 0x00 ; 0 1b75e: f1 cf rjmp .-30 ; 0x1b742 } if (_axis == 2) { _stepresult = ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) ? true : false; 1b760: 54 fa bst r5, 4 1b762: 55 24 eor r5, r5 1b764: 50 f8 bld r5, 0 _err_endstop = ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) ? 0 : 1; 1b766: 83 b1 in r24, 0x03 ; 3 1b768: 82 95 swap r24 1b76a: 86 95 lsr r24 1b76c: 86 95 lsr r24 1b76e: 83 70 andi r24, 0x03 ; 3 1b770: 21 e0 ldi r18, 0x01 ; 1 1b772: 82 27 eor r24, r18 1b774: 81 70 andi r24, 0x01 ; 1 1b776: c8 2f mov r28, r24 1b778: 80 e0 ldi r24, 0x00 ; 0 1b77a: d8 2f mov r29, r24 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); 1b77c: 8f 93 push r24 1b77e: cf 93 push r28 1b780: 1f 92 push r1 1b782: 5f 92 push r5 1b784: e8 e9 ldi r30, 0x98 ; 152 1b786: f4 e8 ldi r31, 0x84 ; 132 1b788: ff 93 push r31 1b78a: ef 93 push r30 1b78c: 0f 94 43 a3 call 0x34686 ; 0x34686 1b790: 0f 90 pop r0 1b792: 0f 90 pop r0 1b794: 0f 90 pop r0 1b796: 0f 90 pop r0 1b798: 0f 90 pop r0 1b79a: 0f 90 pop r0 1b79c: d2 cf rjmp .-92 ; 0x1b742 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) || 1b79e: 41 2c mov r4, r1 printf_P(PSTR("lcd_selfcheck_axis %d, %d\n"), _stepresult, _err_endstop); } _stepdone = true; } if (_lcd_refresh < 6) 1b7a0: 06 30 cpi r16, 0x06 ; 6 1b7a2: 11 05 cpc r17, r1 1b7a4: 0c f0 brlt .+2 ; 0x1b7a8 1b7a6: 4f c0 rjmp .+158 ; 0x1b846 { _lcd_refresh++; 1b7a8: 0f 5f subi r16, 0xFF ; 255 1b7aa: 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(); 1b7ac: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 1b7b0: 81 e0 ldi r24, 0x01 ; 1 1b7b2: 0e 94 ad 8a call 0x1155a ; 0x1155a (_travel_done <= _travel) ? _travel_done++ : _stepdone = true; 1b7b6: 6c 14 cp r6, r12 1b7b8: 7d 04 cpc r7, r13 1b7ba: 34 f0 brlt .+12 ; 0x1b7c8 1b7bc: 8f ef ldi r24, 0xFF ; 255 1b7be: c8 1a sub r12, r24 1b7c0: d8 0a sbc r13, r24 } while (!_stepdone); 1b7c2: 44 20 and r4, r4 1b7c4: 09 f4 brne .+2 ; 0x1b7c8 1b7c6: 94 cf rjmp .-216 ; 0x1b6f0 if (!_stepresult) 1b7c8: 51 10 cpse r5, r1 1b7ca: 20 c0 rjmp .+64 ; 0x1b80c { const char *_error_1; const char *_error_2; if (_axis == X_AXIS) _error_1 = "X"; if (_axis == Y_AXIS) _error_1 = "Y"; 1b7cc: 6a ec ldi r22, 0xCA ; 202 1b7ce: 72 e0 ldi r23, 0x02 ; 2 1b7d0: 91 e0 ldi r25, 0x01 ; 1 1b7d2: e9 16 cp r14, r25 1b7d4: f1 04 cpc r15, r1 1b7d6: 41 f0 breq .+16 ; 0x1b7e8 if (_axis == Z_AXIS) _error_1 = "Z"; 1b7d8: 6c ec ldi r22, 0xCC ; 204 1b7da: 72 e0 ldi r23, 0x02 ; 2 1b7dc: e2 e0 ldi r30, 0x02 ; 2 1b7de: ee 16 cp r14, r30 1b7e0: f1 04 cpc r15, r1 1b7e2: 11 f0 breq .+4 ; 0x1b7e8 1b7e4: 68 ec ldi r22, 0xC8 ; 200 1b7e6: 72 e0 ldi r23, 0x02 ; 2 if (_err_endstop == 0) _error_2 = "X"; if (_err_endstop == 1) _error_2 = "Y"; 1b7e8: 4a ec ldi r20, 0xCA ; 202 1b7ea: 52 e0 ldi r21, 0x02 ; 2 1b7ec: c1 30 cpi r28, 0x01 ; 1 1b7ee: d1 05 cpc r29, r1 1b7f0: 31 f0 breq .+12 ; 0x1b7fe if (_err_endstop == 2) _error_2 = "Z"; 1b7f2: 4c ec ldi r20, 0xCC ; 204 1b7f4: 52 e0 ldi r21, 0x02 ; 2 1b7f6: 22 97 sbiw r28, 0x02 ; 2 1b7f8: 11 f0 breq .+4 ; 0x1b7fe 1b7fa: 48 ec ldi r20, 0xC8 ; 200 1b7fc: 52 e0 ldi r21, 0x02 ; 2 if (_travel_done >= _travel) { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); 1b7fe: 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) 1b800: c6 14 cp r12, r6 1b802: d7 04 cpc r13, r7 1b804: 0c f4 brge .+2 ; 0x1b808 { lcd_selftest_error(TestError::Endstop, _error_1, _error_2); } else { lcd_selftest_error(TestError::Motor, _error_1, _error_2); 1b806: 83 e0 ldi r24, 0x03 ; 3 1b808: 0e 94 43 d8 call 0x1b086 ; 0x1b086 } } current_position[_axis] = 0; //simulate axis home to avoid negative numbers for axis position, especially Z. 1b80c: f5 01 movw r30, r10 1b80e: ef 59 subi r30, 0x9F ; 159 1b810: fd 4e sbci r31, 0xED ; 237 1b812: 10 82 st Z, r1 1b814: 11 82 std Z+1, r1 ; 0x01 1b816: 12 82 std Z+2, r1 ; 0x02 1b818: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 1b81a: 0f 94 cd 48 call 0x2919a ; 0x2919a return _stepresult; } 1b81e: 85 2d mov r24, r5 1b820: df 91 pop r29 1b822: cf 91 pop r28 1b824: 1f 91 pop r17 1b826: 0f 91 pop r16 1b828: ff 90 pop r15 1b82a: ef 90 pop r14 1b82c: df 90 pop r13 1b82e: cf 90 pop r12 1b830: bf 90 pop r11 1b832: af 90 pop r10 1b834: 9f 90 pop r9 1b836: 8f 90 pop r8 1b838: 7f 90 pop r7 1b83a: 6f 90 pop r6 1b83c: 5f 90 pop r5 1b83e: 4f 90 pop r4 1b840: 3f 90 pop r3 1b842: 2f 90 pop r2 1b844: 08 95 ret { _lcd_refresh++; } else { _progress = lcd_selftest_screen(static_cast(static_cast(TestScreen::AxisX) + _axis), _progress, 3, false, 0); 1b846: 10 e0 ldi r17, 0x00 ; 0 1b848: 00 e0 ldi r16, 0x00 ; 0 1b84a: 20 e0 ldi r18, 0x00 ; 0 1b84c: 43 e0 ldi r20, 0x03 ; 3 1b84e: 63 2d mov r22, r3 1b850: 82 2d mov r24, r2 1b852: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1b856: 38 2e mov r3, r24 1b858: a9 cf rjmp .-174 ; 0x1b7ac (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; 1b85a: c1 e0 ldi r28, 0x01 ; 1 1b85c: d0 e0 ldi r29, 0x00 ; 0 1b85e: 71 cf rjmp .-286 ; 0x1b742 0001b860 : return 0; } bool resume_print_checks() { // reset the lcd status so that a newer error will be shown lcd_return_to_status(); 1b860: 0f 94 6e 05 call 0x20adc ; 0x20adc lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1b864: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> 1b868: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 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() 1b86c: 81 11 cpse r24, r1 1b86e: 39 c0 rjmp .+114 ; 0x1b8e2 } static bool fan_error_selftest() { #ifdef FANCHECK if (!fans_check_enabled) return 0; 1b870: 80 91 40 02 lds r24, 0x0240 ; 0x800240 1b874: 81 11 cpse r24, r1 1b876: 02 c0 rjmp .+4 ; 0x1b87c #endif ) { return false; // abort if error persists } return true; 1b878: 81 e0 ldi r24, 0x01 ; 1 1b87a: 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; 1b87c: 8f ef ldi r24, 0xFF ; 255 1b87e: 80 93 55 12 sts 0x1255, r24 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1b882: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d #endif manage_heater(); 1b886: 0f 94 a8 37 call 0x26f50 ; 0x26f50 { #ifdef FANCHECK if (!fans_check_enabled) return 0; lcd_selftest_setfan(255); setExtruderAutoFanState(3); //force enables the hotend fan 1b88a: 83 e0 ldi r24, 0x03 ; 3 1b88c: 0e 94 00 78 call 0xf000 ; 0xf000 #ifdef FAN_SOFT_PWM extruder_autofan_last_check = _millis(); 1b890: 0f 94 89 0b call 0x21712 ; 0x21712 1b894: 60 93 07 17 sts 0x1707, r22 ; 0x801707 1b898: 70 93 08 17 sts 0x1708, r23 ; 0x801708 1b89c: 80 93 09 17 sts 0x1709, r24 ; 0x801709 1b8a0: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a fan_measuring = true; 1b8a4: 81 e0 ldi r24, 0x01 ; 1 1b8a6: 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) 1b8aa: 68 ee ldi r22, 0xE8 ; 232 1b8ac: 73 e0 ldi r23, 0x03 ; 3 1b8ae: 80 e0 ldi r24, 0x00 ; 0 1b8b0: 90 e0 ldi r25, 0x00 ; 0 1b8b2: 0f 94 56 0b call 0x216ac ; 0x216ac manage_heater(); 1b8b6: 0f 94 a8 37 call 0x26f50 ; 0x26f50 setExtruderAutoFanState(1); //releases lock on the hotend fan 1b8ba: 81 e0 ldi r24, 0x01 ; 1 1b8bc: 0e 94 00 78 call 0xf000 ; 0xf000 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1b8c0: 10 92 55 12 sts 0x1255, r1 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1b8c4: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d #endif manage_heater(); 1b8c8: 0f 94 a8 37 call 0x26f50 ; 0x26f50 _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 1b8cc: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 1b8d0: 90 91 b8 03 lds r25, 0x03B8 ; 0x8003b8 1b8d4: 45 97 sbiw r24, 0x15 ; 21 1b8d6: 84 f6 brge .-96 ; 0x1b878 LCD_ALERTMESSAGERPGM(MSG_FANCHECK_HOTEND); 1b8d8: 62 e0 ldi r22, 0x02 ; 2 1b8da: 8a ec ldi r24, 0xCA ; 202 1b8dc: 98 e6 ldi r25, 0x68 ; 104 1b8de: 0e 94 14 d8 call 0x1b028 ; 0x1b028 if (get_temp_error() #ifdef FANCHECK || fan_error_selftest() #endif ) { return false; // abort if error persists 1b8e2: 80 e0 ldi r24, 0x00 ; 0 } return true; } 1b8e4: 08 95 ret 0001b8e6 : //! @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; 1b8e6: 0e 94 30 dc call 0x1b860 ; 0x1b860 1b8ea: 88 23 and r24, r24 1b8ec: 21 f0 breq .+8 ; 0x1b8f6 // resume the usb host SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); 1b8ee: 80 ef ldi r24, 0xF0 ; 240 1b8f0: 98 e6 ldi r25, 0x68 ; 104 1b8f2: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c } 1b8f6: 08 95 ret 0001b8f8 : void lcd_getstatus(char buf[LCD_WIDTH]) { strncpy(buf, lcd_status_message, LCD_WIDTH); } void lcd_setstatuspgm(const char* message) { 1b8f8: cf 93 push r28 1b8fa: df 93 push r29 1b8fc: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1b8fe: 80 e0 ldi r24, 0x00 ; 0 1b900: 0e 94 fe d7 call 0x1affc ; 0x1affc 1b904: 88 23 and r24, r24 1b906: 31 f0 breq .+12 ; 0x1b914 lcd_updatestatus(message, true); 1b908: 61 e0 ldi r22, 0x01 ; 1 1b90a: ce 01 movw r24, r28 } 1b90c: df 91 pop r29 1b90e: cf 91 pop r28 } void lcd_setstatuspgm(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message, true); 1b910: 0c 94 e3 d7 jmp 0x1afc6 ; 0x1afc6 } 1b914: df 91 pop r29 1b916: cf 91 pop r28 1b918: 08 95 ret 0001b91a : } #endif /* DEBUG_STEPPER_TIMER_MISSED */ static void lcd_colorprint_change() { enquecommand_P(MSG_M600); 1b91a: 61 e0 ldi r22, 0x01 ; 1 1b91c: 82 e0 ldi r24, 0x02 ; 2 1b91e: 9d e6 ldi r25, 0x6D ; 109 1b920: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 custom_message_type = CustomMsg::FilamentLoading; //just print status message 1b924: 82 e0 ldi r24, 0x02 ; 2 1b926: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1b92a: 88 ec ldi r24, 0xC8 ; 200 1b92c: 9a e5 ldi r25, 0x5A ; 90 1b92e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b932: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 lcd_return_to_status(); 1b936: 0f 94 6e 05 call 0x20adc ; 0x20adc lcd_draw_update = 3; 1b93a: 83 e0 ldi r24, 0x03 ; 3 1b93c: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } 1b940: 08 95 ret 0001b942 : //! @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; 1b942: 0e 94 30 dc call 0x1b860 ; 0x1b860 1b946: 88 23 and r24, r24 1b948: 51 f1 breq .+84 ; 0x1b99e cmdqueue_serial_disabled = false; 1b94a: 10 92 93 03 sts 0x0393, r1 ; 0x800393 lcd_setstatuspgm(_T(MSG_FINISHING_MOVEMENTS)); 1b94e: 88 ec ldi r24, 0xC8 ; 200 1b950: 9a e5 ldi r25, 0x5A ; 90 1b952: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1b956: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 st_synchronize(); 1b95a: 0f 94 94 18 call 0x23128 ; 0x23128 custom_message_type = CustomMsg::Resuming; 1b95e: 88 e0 ldi r24, 0x08 ; 8 1b960: 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(); 1b964: 0e 94 f3 77 call 0xefe6 ; 0xefe6 setExtruderAutoFanState(1); 1b968: 81 e0 ldi r24, 0x01 ; 1 1b96a: 0e 94 00 78 call 0xf000 ; 0xf000 // resume processing USB commands again and restore hotend fan state (in case the print was // stopped due to a thermal error) hotendDefaultAutoFanState(); Stopped = false; 1b96e: 10 92 3b 12 sts 0x123B, r1 ; 0x80123b restore_print_from_ram_and_continue(default_retraction); 1b972: 60 e0 ldi r22, 0x00 ; 0 1b974: 70 e0 ldi r23, 0x00 ; 0 1b976: 80 e8 ldi r24, 0x80 ; 128 1b978: 9f e3 ldi r25, 0x3F ; 63 1b97a: 0e 94 09 67 call 0xce12 ; 0xce12 did_pause_print = false; 1b97e: 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(); 1b982: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 1b986: 82 30 cpi r24, 0x02 ; 2 1b988: 11 f4 brne .+4 ; 0x1b98e 1b98a: 0f 94 be 16 call 0x22d7c ; 0x22d7c refresh_cmd_timeout(); 1b98e: 0e 94 92 65 call 0xcb24 ; 0xcb24 SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); 1b992: 8f ed ldi r24, 0xDF ; 223 1b994: 98 e6 ldi r25, 0x68 ; 104 1b996: 0e 94 0e 7d call 0xfa1c ; 0xfa1c custom_message_type = CustomMsg::Status; 1b99a: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d } 1b99e: 08 95 ret 0001b9a0 : // hack lcd_draw_update to 1, i.e. without clear lcd_draw_update = 1; } void lcd_setstatus(const char* message) { 1b9a0: cf 93 push r28 1b9a2: df 93 push r29 1b9a4: ec 01 movw r28, r24 if (lcd_message_check(LCD_STATUS_NONE)) 1b9a6: 80 e0 ldi r24, 0x00 ; 0 1b9a8: 0e 94 fe d7 call 0x1affc ; 0x1affc 1b9ac: 88 23 and r24, r24 1b9ae: 31 f0 breq .+12 ; 0x1b9bc lcd_updatestatus(message); 1b9b0: 60 e0 ldi r22, 0x00 ; 0 1b9b2: ce 01 movw r24, r28 } 1b9b4: df 91 pop r29 1b9b6: cf 91 pop r28 } void lcd_setstatus(const char* message) { if (lcd_message_check(LCD_STATUS_NONE)) lcd_updatestatus(message); 1b9b8: 0c 94 e3 d7 jmp 0x1afc6 ; 0x1afc6 } 1b9bc: df 91 pop r29 1b9be: cf 91 pop r28 1b9c0: 08 95 ret 0001b9c2 : 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) { 1b9c2: cf 93 push r28 1b9c4: df 93 push r29 1b9c6: c8 2f mov r28, r24 softReset(); } void UnconditionalStop() { CRITICAL_SECTION_START; 1b9c8: 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) { 1b9ca: 66 23 and r22, r22 1b9cc: 89 f1 breq .+98 ; 0x1ba30 1b9ce: f8 94 cli // Disable all heaters and unroll the temperature wait loop stack disable_heater(); 1b9d0: 0f 94 9e 0e call 0x21d3c ; 0x21d3c cancel_heatup = true; 1b9d4: 81 e0 ldi r24, 0x01 ; 1 1b9d6: 80 93 5f 0d sts 0x0D5F, r24 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.389> heating_status = HeatingStatus::NO_HEATING; 1b9da: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb // Clear any saved printing state cancel_saved_printing(); 1b9de: 0e 94 58 64 call 0xc8b0 ; 0xc8b0 // Abort the planner planner_abort_hard(); 1b9e2: 0f 94 87 4c call 0x2990e ; 0x2990e // Reset the queue cmdqueue_reset(); 1b9e6: 0e 94 b5 83 call 0x1076a ; 0x1076a cmdqueue_serial_disabled = false; 1b9ea: 10 92 93 03 sts 0x0393, r1 ; 0x800393 st_reset_timer(); 1b9ee: 0f 94 de 18 call 0x231bc ; 0x231bc CRITICAL_SECTION_END; 1b9f2: df bf out 0x3f, r29 ; 63 // clear paused state immediately did_pause_print = false; 1b9f4: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd print_job_timer.stop(); 1b9f8: 0f 94 e2 16 call 0x22dc4 ; 0x22dc4 } else { // Allow lcd_print_stop_finish() to use the heaters when it is safe ConditionalStop(); } if (card.isFileOpen()) { 1b9fc: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 1ba00: 88 23 and r24, r24 1ba02: 21 f0 breq .+8 ; 0x1ba0c // Reset the sd status card.sdprinting = false; 1ba04: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 card.closefile(); 1ba08: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e } SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); 1ba0c: 82 e2 ldi r24, 0x22 ; 34 1ba0e: 99 e6 ldi r25, 0x69 ; 105 1ba10: 0e 94 0e 7d call 0xfa1c ; 0xfa1c #ifdef MESH_BED_LEVELING mbl.active = false; 1ba14: 10 92 09 13 sts 0x1309, r1 ; 0x801309 #endif if (interactive) { 1ba18: c1 11 cpse r28, r1 // acknowledged by the user from the LCD: resume processing USB commands again Stopped = false; 1ba1a: 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; 1ba1e: 81 e0 ldi r24, 0x01 ; 1 1ba20: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e } PrinterState SetPrinterState(PrinterState status) { return printer_state = status; 1ba24: 10 92 61 0d sts 0x0D61, r1 ; 0x800d61 <_ZL13printer_state.lto_priv.384> SetPrinterState(PrinterState::NotReady); //set printer state to show LCD menu after print has been stopped lcd_return_to_status(); } 1ba28: df 91 pop r29 1ba2a: 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(); 1ba2c: 0d 94 6e 05 jmp 0x20adc ; 0x20adc } void ConditionalStop() { CRITICAL_SECTION_START; 1ba30: 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; 1ba32: 81 e0 ldi r24, 0x01 ; 1 1ba34: 80 93 5f 0d sts 0x0D5F, r24 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.389> heating_status = HeatingStatus::NO_HEATING; 1ba38: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb // Clear any saved printing state cancel_saved_printing(); 1ba3c: 0e 94 58 64 call 0xc8b0 ; 0xc8b0 // Abort the planner planner_abort_hard(); 1ba40: 0f 94 87 4c call 0x2990e ; 0x2990e // Reset the queue cmdqueue_reset(); 1ba44: 0e 94 b5 83 call 0x1076a ; 0x1076a cmdqueue_serial_disabled = false; 1ba48: 10 92 93 03 sts 0x0393, r1 ; 0x800393 st_reset_timer(); 1ba4c: 0f 94 de 18 call 0x231bc ; 0x231bc CRITICAL_SECTION_END; 1ba50: df bf out 0x3f, r29 ; 63 1ba52: d4 cf rjmp .-88 ; 0x1b9fc 0001ba54 : } void lcd_print_stop() { print_stop(true); 1ba54: 60 e0 ldi r22, 0x00 ; 0 1ba56: 81 e0 ldi r24, 0x01 ; 1 1ba58: 0c 94 e1 dc jmp 0x1b9c2 ; 0x1b9c2 0001ba5c : lcd_update(2); } #ifndef TMC2130 static void lcd_show_end_stops() { lcd_puts_at_P(0, 0, (PSTR("End stops diag"))); 1ba5c: 45 ee ldi r20, 0xE5 ; 229 1ba5e: 53 e8 ldi r21, 0x83 ; 131 1ba60: 60 e0 ldi r22, 0x00 ; 0 1ba62: 80 e0 ldi r24, 0x00 ; 0 1ba64: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 1, (READ(X_MIN_PIN) ^ (bool)X_MIN_ENDSTOP_INVERTING) ? (PSTR("X1")) : (PSTR("X0"))); 1ba68: 1e 99 sbic 0x03, 6 ; 3 1ba6a: 16 c0 rjmp .+44 ; 0x1ba98 1ba6c: 4f ed ldi r20, 0xDF ; 223 1ba6e: 53 e8 ldi r21, 0x83 ; 131 1ba70: 61 e0 ldi r22, 0x01 ; 1 1ba72: 80 e0 ldi r24, 0x00 ; 0 1ba74: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 1ba78: 1d 9b sbis 0x03, 5 ; 3 1ba7a: 11 c0 rjmp .+34 ; 0x1ba9e 1ba7c: 4c ed ldi r20, 0xDC ; 220 1ba7e: 53 e8 ldi r21, 0x83 ; 131 1ba80: 62 e0 ldi r22, 0x02 ; 2 1ba82: 80 e0 ldi r24, 0x00 ; 0 1ba84: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 1ba88: 1c 9b sbis 0x03, 4 ; 3 1ba8a: 0c c0 rjmp .+24 ; 0x1baa4 1ba8c: 46 ed ldi r20, 0xD6 ; 214 1ba8e: 53 e8 ldi r21, 0x83 ; 131 1ba90: 63 e0 ldi r22, 0x03 ; 3 1ba92: 80 e0 ldi r24, 0x00 ; 0 1ba94: 0c 94 58 70 jmp 0xe0b0 ; 0xe0b0 } #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"))); 1ba98: 42 ee ldi r20, 0xE2 ; 226 1ba9a: 53 e8 ldi r21, 0x83 ; 131 1ba9c: e9 cf rjmp .-46 ; 0x1ba70 lcd_puts_at_P(0, 2, (READ(Y_MIN_PIN) ^ (bool)Y_MIN_ENDSTOP_INVERTING) ? (PSTR("Y1")) : (PSTR("Y0"))); 1ba9e: 49 ed ldi r20, 0xD9 ; 217 1baa0: 53 e8 ldi r21, 0x83 ; 131 1baa2: ee cf rjmp .-36 ; 0x1ba80 lcd_puts_at_P(0, 3, (READ(Z_MIN_PIN) ^ (bool)Z_MIN_ENDSTOP_INVERTING) ? (PSTR("Z1")) : (PSTR("Z0"))); 1baa4: 43 ed ldi r20, 0xD3 ; 211 1baa6: 53 e8 ldi r21, 0x83 ; 131 1baa8: f3 cf rjmp .-26 ; 0x1ba90 0001baaa : } static void menu_show_end_stops() { lcd_show_end_stops(); 1baaa: 0e 94 2e dd call 0x1ba5c ; 0x1ba5c menu_back_if_clicked(); 1baae: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae 0001bab2 : //! @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) { 1bab2: cf 92 push r12 1bab4: df 92 push r13 1bab6: ef 92 push r14 1bab8: ff 92 push r15 1baba: 0f 93 push r16 1babc: 1f 93 push r17 1babe: cf 93 push r28 1bac0: df 93 push r29 1bac2: d8 2f mov r29, r24 1bac4: 6b 01 movw r12, r22 1bac6: 7a 01 movw r14, r20 1bac8: c2 2f mov r28, r18 lcd_putc_at(0, 3, selected == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 1baca: 40 e2 ldi r20, 0x20 ; 32 1bacc: 81 11 cpse r24, r1 1bace: 01 c0 rjmp .+2 ; 0x1bad2 1bad0: 4e e3 ldi r20, 0x3E ; 62 1bad2: 63 e0 ldi r22, 0x03 ; 3 1bad4: 80 e0 ldi r24, 0x00 ; 0 1bad6: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_puts_P(first_choice); 1bada: c6 01 movw r24, r12 1badc: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_putc_at(second_col, 3, selected == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 1bae0: 40 e2 ldi r20, 0x20 ; 32 1bae2: d1 30 cpi r29, 0x01 ; 1 1bae4: 09 f4 brne .+2 ; 0x1bae8 1bae6: 4e e3 ldi r20, 0x3E ; 62 1bae8: 63 e0 ldi r22, 0x03 ; 3 1baea: 8c 2f mov r24, r28 1baec: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_puts_P(second_choice); 1baf0: c7 01 movw r24, r14 1baf2: 0e 94 6e 6f call 0xdedc ; 0xdedc if (third_choice) { 1baf6: 01 15 cp r16, r1 1baf8: 11 05 cpc r17, r1 1bafa: 19 f1 breq .+70 ; 0x1bb42 1bafc: c8 01 movw r24, r16 1bafe: 0f 94 3f a2 call 0x3447e ; 0x3447e <__strlen_P> 1bb02: d8 2e mov r13, r24 1bb04: c7 01 movw r24, r14 1bb06: 0f 94 3f a2 call 0x3447e ; 0x3447e <__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; 1bb0a: 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;} 1bb0c: 93 e1 ldi r25, 0x13 ; 19 1bb0e: 9d 19 sub r25, r13 1bb10: 8c 0f add r24, r28 1bb12: 89 17 cp r24, r25 1bb14: 08 f4 brcc .+2 ; 0x1bb18 1bb16: 89 2f mov r24, r25 1bb18: 83 31 cpi r24, 0x13 ; 19 1bb1a: 08 f0 brcs .+2 ; 0x1bb1e 1bb1c: 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 ? '>': ' '); 1bb1e: 40 e2 ldi r20, 0x20 ; 32 1bb20: d2 30 cpi r29, 0x02 ; 2 1bb22: 09 f4 brne .+2 ; 0x1bb26 1bb24: 4e e3 ldi r20, 0x3E ; 62 1bb26: 63 e0 ldi r22, 0x03 ; 3 1bb28: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_puts_P(third_choice); 1bb2c: c8 01 movw r24, r16 } } 1bb2e: df 91 pop r29 1bb30: cf 91 pop r28 1bb32: 1f 91 pop r17 1bb34: 0f 91 pop r16 1bb36: ff 90 pop r15 1bb38: ef 90 pop r14 1bb3a: df 90 pop r13 1bb3c: 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); 1bb3e: 0c 94 6e 6f jmp 0xdedc ; 0xdedc } } 1bb42: df 91 pop r29 1bb44: cf 91 pop r28 1bb46: 1f 91 pop r17 1bb48: 0f 91 pop r16 1bb4a: ff 90 pop r15 1bb4c: ef 90 pop r14 1bb4e: df 90 pop r13 1bb50: cf 90 pop r12 1bb52: 08 95 ret 0001bb54 : } bool lcd_wait_for_click_delay(uint16_t nDelay) // nDelay :: timeout [s] (0 ~ no timeout) // true ~ clicked, false ~ delayed { 1bb54: 4f 92 push r4 1bb56: 5f 92 push r5 1bb58: 6f 92 push r6 1bb5a: 7f 92 push r7 1bb5c: 8f 92 push r8 1bb5e: 9f 92 push r9 1bb60: af 92 push r10 1bb62: bf 92 push r11 1bb64: cf 92 push r12 1bb66: df 92 push r13 1bb68: ef 92 push r14 1bb6a: ff 92 push r15 1bb6c: 0f 93 push r16 1bb6e: 1f 93 push r17 1bb70: cf 93 push r28 1bb72: 8c 01 movw r16, r24 bool bDelayed; long nTime0 = _millis()/1000; 1bb74: 0f 94 89 0b call 0x21712 ; 0x21712 1bb78: 28 ee ldi r18, 0xE8 ; 232 1bb7a: 33 e0 ldi r19, 0x03 ; 3 1bb7c: 40 e0 ldi r20, 0x00 ; 0 1bb7e: 50 e0 ldi r21, 0x00 ; 0 1bb80: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 1bb84: 69 01 movw r12, r18 1bb86: 7a 01 movw r14, r20 lcd_consume_click(); 1bb88: 0e 94 c1 73 call 0xe782 ; 0xe782 KEEPALIVE_STATE(PAUSED_FOR_USER); 1bb8c: 84 e0 ldi r24, 0x04 ; 4 1bb8e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 for (;;) { manage_heater(); manage_inactivity(true); bDelayed = ((_millis()/1000-nTime0) > nDelay); 1bb92: 88 ee ldi r24, 0xE8 ; 232 1bb94: 88 2e mov r8, r24 1bb96: 83 e0 ldi r24, 0x03 ; 3 1bb98: 98 2e mov r9, r24 1bb9a: a1 2c mov r10, r1 1bb9c: b1 2c mov r11, r1 1bb9e: 28 01 movw r4, r16 1bba0: 71 2c mov r7, r1 1bba2: 61 2c mov r6, r1 bool bDelayed; long nTime0 = _millis()/1000; lcd_consume_click(); KEEPALIVE_STATE(PAUSED_FOR_USER); for (;;) { manage_heater(); 1bba4: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 1bba8: 81 e0 ldi r24, 0x01 ; 1 1bbaa: 0e 94 ad 8a call 0x1155a ; 0x1155a bDelayed = ((_millis()/1000-nTime0) > nDelay); 1bbae: 0f 94 89 0b call 0x21712 ; 0x21712 1bbb2: a5 01 movw r20, r10 1bbb4: 94 01 movw r18, r8 1bbb6: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 1bbba: 2c 19 sub r18, r12 1bbbc: 3d 09 sbc r19, r13 1bbbe: 4e 09 sbc r20, r14 1bbc0: 5f 09 sbc r21, r15 bDelayed = (bDelayed && (nDelay != 0)); // 0 ~ no timeout, always waiting for click 1bbc2: 42 16 cp r4, r18 1bbc4: 53 06 cpc r5, r19 1bbc6: 64 06 cpc r6, r20 1bbc8: 75 06 cpc r7, r21 1bbca: 20 f4 brcc .+8 ; 0x1bbd4 1bbcc: c1 e0 ldi r28, 0x01 ; 1 1bbce: 01 15 cp r16, r1 1bbd0: 11 05 cpc r17, r1 1bbd2: 09 f4 brne .+2 ; 0x1bbd6 1bbd4: c0 e0 ldi r28, 0x00 ; 0 if (lcd_clicked() || bDelayed) { 1bbd6: 0e 94 c6 73 call 0xe78c ; 0xe78c 1bbda: 81 11 cpse r24, r1 1bbdc: 02 c0 rjmp .+4 ; 0x1bbe2 1bbde: cc 23 and r28, r28 1bbe0: 09 f3 breq .-62 ; 0x1bba4 KEEPALIVE_STATE(IN_HANDLER); 1bbe2: 82 e0 ldi r24, 0x02 ; 2 1bbe4: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(!bDelayed); } } } 1bbe8: 81 e0 ldi r24, 0x01 ; 1 1bbea: 8c 27 eor r24, r28 1bbec: cf 91 pop r28 1bbee: 1f 91 pop r17 1bbf0: 0f 91 pop r16 1bbf2: ff 90 pop r15 1bbf4: ef 90 pop r14 1bbf6: df 90 pop r13 1bbf8: cf 90 pop r12 1bbfa: bf 90 pop r11 1bbfc: af 90 pop r10 1bbfe: 9f 90 pop r9 1bc00: 8f 90 pop r8 1bc02: 7f 90 pop r7 1bc04: 6f 90 pop r6 1bc06: 5f 90 pop r5 1bc08: 4f 90 pop r4 1bc0a: 08 95 ret 0001bc0c : * 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) { 1bc0c: af 92 push r10 1bc0e: bf 92 push r11 1bc10: cf 92 push r12 1bc12: df 92 push r13 1bc14: ef 92 push r14 1bc16: ff 92 push r15 1bc18: 0f 93 push r16 1bc1a: 1f 93 push r17 1bc1c: cf 93 push r28 1bc1e: df 93 push r29 1bc20: 6c 01 movw r12, r24 const char *msgend = msg; bool multi_screen = false; lcd_frame_start(); 1bc22: 0e 94 37 6f call 0xde6e ; 0xde6e * @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; 1bc26: e6 01 movw r28, r12 bool multi_screen = false; lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { 1bc28: 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; 1bc2a: e1 2c mov r14, r1 lcd_frame_start(); for (uint8_t row = 0; row < LCD_HEIGHT; ++ row) { lcd_set_cursor(0, row); 1bc2c: 6f 2d mov r22, r15 1bc2e: 80 e0 ldi r24, 0x00 ; 0 1bc30: 0e 94 ab 6f call 0xdf56 ; 0xdf56 // 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) 1bc34: c6 01 movw r24, r12 1bc36: 0e 94 e3 bb call 0x177c6 ; 0x177c6 1bc3a: 88 23 and r24, r24 1bc3c: 29 f0 breq .+10 ; 0x1bc48 1bc3e: 8f ef ldi r24, 0xFF ; 255 1bc40: c8 1a sub r12, r24 1bc42: d8 0a sbc r13, r24 1bc44: 09 f4 brne .+2 ; 0x1bc48 1bc46: 49 c0 rjmp .+146 ; 0x1bcda 1bc48: c6 01 movw r24, r12 1bc4a: 0f 94 3f a2 call 0x3447e ; 0x3447e <__strlen_P> { // End of the message. break; } uint8_t linelen = min(strlen_P(msg), LCD_WIDTH); 1bc4e: 84 31 cpi r24, 0x14 ; 20 1bc50: 91 05 cpc r25, r1 1bc52: 10 f0 brcs .+4 ; 0x1bc58 1bc54: 84 e1 ldi r24, 0x14 ; 20 1bc56: 90 e0 ldi r25, 0x00 ; 0 const char *msgend2 = msg + linelen; 1bc58: e6 01 movw r28, r12 1bc5a: c8 0f add r28, r24 1bc5c: d9 1f adc r29, r25 msgend = msgend2; if (row == 3 && linelen == LCD_WIDTH) { 1bc5e: e3 e0 ldi r30, 0x03 ; 3 1bc60: fe 12 cpse r15, r30 1bc62: 0a c0 rjmp .+20 ; 0x1bc78 1bc64: 84 31 cpi r24, 0x14 ; 20 1bc66: 41 f4 brne .+16 ; 0x1bc78 // 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; 1bc68: fe 01 movw r30, r28 1bc6a: 84 91 lpm r24, Z 1bc6c: e1 2c mov r14, r1 if (multi_screen) 1bc6e: 88 23 and r24, r24 1bc70: 19 f0 breq .+6 ; 0x1bc78 msgend = (msgend2 -= 2); 1bc72: 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; 1bc74: ee 24 eor r14, r14 1bc76: e3 94 inc r14 if (multi_screen) msgend = (msgend2 -= 2); } if (pgm_read_byte(msgend) != 0 && ! pgm_is_whitespace(msgend) && ! pgm_is_interpunction(msgend)) { 1bc78: fe 01 movw r30, r28 1bc7a: 84 91 lpm r24, Z 1bc7c: 88 23 and r24, r24 1bc7e: 09 f4 brne .+2 ; 0x1bc82 1bc80: 40 c0 rjmp .+128 ; 0x1bd02 1bc82: ce 01 movw r24, r28 1bc84: 0e 94 e3 bb call 0x177c6 ; 0x177c6 1bc88: 81 11 cpse r24, r1 1bc8a: 3b c0 rjmp .+118 ; 0x1bd02 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); 1bc8c: fe 01 movw r30, r28 1bc8e: 84 91 lpm r24, Z return c == '.' || c == ',' || c == ':'|| c == ';' || c == '?' || c == '!' || c == '/'; 1bc90: 92 ed ldi r25, 0xD2 ; 210 1bc92: 98 0f add r25, r24 1bc94: 92 30 cpi r25, 0x02 ; 2 1bc96: a8 f1 brcs .+106 ; 0x1bd02 1bc98: 8c 32 cpi r24, 0x2C ; 44 1bc9a: 99 f1 breq .+102 ; 0x1bd02 1bc9c: 96 ec ldi r25, 0xC6 ; 198 1bc9e: 98 0f add r25, r24 1bca0: 92 30 cpi r25, 0x02 ; 2 1bca2: 78 f1 brcs .+94 ; 0x1bd02 1bca4: 8f 33 cpi r24, 0x3F ; 63 1bca6: 69 f1 breq .+90 ; 0x1bd02 1bca8: 81 32 cpi r24, 0x21 ; 33 1bcaa: 59 f1 breq .+86 ; 0x1bd02 1bcac: 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)) 1bcae: c0 16 cp r12, r16 1bcb0: d1 06 cpc r13, r17 1bcb2: 58 f4 brcc .+22 ; 0x1bcca 1bcb4: 58 01 movw r10, r16 1bcb6: f1 e0 ldi r31, 0x01 ; 1 1bcb8: af 1a sub r10, r31 1bcba: b1 08 sbc r11, r1 1bcbc: c5 01 movw r24, r10 1bcbe: 0e 94 e3 bb call 0x177c6 ; 0x177c6 1bcc2: 81 11 cpse r24, r1 1bcc4: 1d c0 rjmp .+58 ; 0x1bd00 -- msgend; 1bcc6: 85 01 movw r16, r10 1bcc8: f2 cf rjmp .-28 ; 0x1bcae if (msgend == msg) 1bcca: c0 16 cp r12, r16 1bccc: d1 06 cpc r13, r17 1bcce: c9 f0 breq .+50 ; 0x1bd02 1bcd0: 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) { 1bcd2: f3 94 inc r15 1bcd4: 84 e0 ldi r24, 0x04 ; 4 1bcd6: f8 12 cpse r15, r24 1bcd8: a9 cf rjmp .-174 ; 0x1bc2c } lcd_print(c); } } if (multi_screen) { 1bcda: ee 20 and r14, r14 1bcdc: f9 f0 breq .+62 ; 0x1bd1c // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); 1bcde: 48 e8 ldi r20, 0x88 ; 136 1bce0: 63 e0 ldi r22, 0x03 ; 3 1bce2: 83 e1 ldi r24, 0x13 ; 19 1bce4: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 } return multi_screen ? msgend : NULL; } 1bce8: ce 01 movw r24, r28 1bcea: df 91 pop r29 1bcec: cf 91 pop r28 1bcee: 1f 91 pop r17 1bcf0: 0f 91 pop r16 1bcf2: ff 90 pop r15 1bcf4: ef 90 pop r14 1bcf6: df 90 pop r13 1bcf8: cf 90 pop r12 1bcfa: bf 90 pop r11 1bcfc: af 90 pop r10 1bcfe: 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)) 1bd00: 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) { 1bd02: cc 16 cp r12, r28 1bd04: dd 06 cpc r13, r29 1bd06: 28 f7 brcc .-54 ; 0x1bcd2 char c = char(pgm_read_byte(msg)); 1bd08: f6 01 movw r30, r12 1bd0a: 84 91 lpm r24, Z if (c == '\n') { 1bd0c: 8a 30 cpi r24, 0x0A ; 10 1bd0e: 09 f3 breq .-62 ; 0x1bcd2 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 1bd10: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 -- msgend; if (msgend == msg) // Found a single long word, which cannot be split. Just cut it. msgend = msgend2; } for (; msg < msgend; ++ msg) { 1bd14: ff ef ldi r31, 0xFF ; 255 1bd16: cf 1a sub r12, r31 1bd18: df 0a sbc r13, r31 1bd1a: f3 cf rjmp .-26 ; 0x1bd02 if (multi_screen) { // Display the double down arrow. lcd_putc_at(19, 3, LCD_STR_ARROW_2_DOWN[0]); } return multi_screen ? msgend : NULL; 1bd1c: d0 e0 ldi r29, 0x00 ; 0 1bd1e: c0 e0 ldi r28, 0x00 ; 0 1bd20: e3 cf rjmp .-58 ; 0x1bce8 0001bd22 : } const char* lcd_display_message_fullscreen_P(const char *msg) { 1bd22: cf 93 push r28 1bd24: df 93 push r29 1bd26: ec 01 movw r28, r24 // Disable update of the screen by the usual lcd_update(0) routine. lcd_update_enable(false); 1bd28: 80 e0 ldi r24, 0x00 ; 0 1bd2a: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_clear(); 1bd2e: 0e 94 77 70 call 0xe0ee ; 0xe0ee return lcd_display_message_fullscreen_nonBlocking_P(msg); 1bd32: ce 01 movw r24, r28 } 1bd34: df 91 pop r29 1bd36: 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); 1bd38: 0c 94 06 de jmp 0x1bc0c ; 0x1bc0c 0001bd3c : { (void)lcd_selftest(); } bool lcd_selftest() { 1bd3c: cf 92 push r12 1bd3e: df 92 push r13 1bd40: ef 92 push r14 1bd42: ff 92 push r15 1bd44: 0f 93 push r16 1bd46: 1f 93 push r17 1bd48: cf 93 push r28 1bd4a: df 93 push r29 1bd4c: 00 d0 rcall .+0 ; 0x1bd4e 1bd4e: 1f 92 push r1 1bd50: cd b7 in r28, 0x3d ; 61 1bd52: 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(); 1bd54: 0f 94 9e 0e call 0x21d3c ; 0x21d3c uint8_t fanSpeedBckp = fanSpeed; 1bd58: d0 90 55 12 lds r13, 0x1255 ; 0x801255 fanSpeed = 255; 1bd5c: 8f ef ldi r24, 0xFF ; 255 1bd5e: 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)); 1bd62: 82 e9 ldi r24, 0x92 ; 146 1bd64: e8 2e mov r14, r24 1bd66: 84 e8 ldi r24, 0x84 ; 132 1bd68: 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()); 1bd6a: 0c e8 ldi r16, 0x8C ; 140 1bd6c: 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)) { 1bd6e: 20 e0 ldi r18, 0x00 ; 0 1bd70: 30 e0 ldi r19, 0x00 ; 0 1bd72: 48 e4 ldi r20, 0x48 ; 72 1bd74: 52 e4 ldi r21, 0x42 ; 66 1bd76: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1bd7a: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1bd7e: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1bd82: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1bd86: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1bd8a: 18 16 cp r1, r24 1bd8c: 8c f0 brlt .+34 ; 0x1bdb0 1bd8e: 20 e0 ldi r18, 0x00 ; 0 1bd90: 30 e0 ldi r19, 0x00 ; 0 1bd92: 48 e4 ldi r20, 0x48 ; 72 1bd94: 52 e4 ldi r21, 0x42 ; 66 1bd96: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1bd9a: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1bd9e: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1bda2: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1bda6: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1bdaa: 18 16 cp r1, r24 1bdac: 0c f0 brlt .+2 ; 0x1bdb0 1bdae: 42 c0 rjmp .+132 ; 0x1be34 lcd_display_message_fullscreen_P(_T(MSG_WAITING_TEMP)); 1bdb0: 80 e0 ldi r24, 0x00 ; 0 1bdb2: 99 e4 ldi r25, 0x49 ; 73 1bdb4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1bdb8: 0e 94 91 de call 0x1bd22 ; 0x1bd22 lcd_putc_at(0, 4, LCD_STR_THERMOMETER[0]); 1bdbc: 42 e8 ldi r20, 0x82 ; 130 1bdbe: 64 e0 ldi r22, 0x04 ; 4 1bdc0: 80 e0 ldi r24, 0x00 ; 0 1bdc2: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_printf_P(PSTR("%3d/0"), (int16_t)degHotend(0)); 1bdc6: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1bdca: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1bdce: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1bdd2: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1bdd6: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1bdda: 7f 93 push r23 1bddc: 6f 93 push r22 1bdde: ff 92 push r15 1bde0: ef 92 push r14 1bde2: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 lcd_putc(LCD_STR_DEGREE[0]); 1bde6: 81 e8 ldi r24, 0x81 ; 129 1bde8: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_putc_at(9, 4, LCD_STR_BEDTEMP[0]); 1bdec: 40 e8 ldi r20, 0x80 ; 128 1bdee: 64 e0 ldi r22, 0x04 ; 4 1bdf0: 89 e0 ldi r24, 0x09 ; 9 1bdf2: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_printf_P(PSTR("%3d/0"), (int16_t)degBed()); 1bdf6: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 1bdfa: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 1bdfe: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 1be02: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 1be06: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1be0a: 7f 93 push r23 1be0c: 6f 93 push r22 1be0e: 1f 93 push r17 1be10: 0f 93 push r16 1be12: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 lcd_putc(LCD_STR_DEGREE[0]); 1be16: 81 e8 ldi r24, 0x81 ; 129 1be18: 0e 94 72 6f call 0xdee4 ; 0xdee4 delay_keep_alive(1000); 1be1c: 88 ee ldi r24, 0xE8 ; 232 1be1e: 93 e0 ldi r25, 0x03 ; 3 1be20: 0e 94 07 8d call 0x11a0e ; 0x11a0e serialecho_temperatures(); 1be24: 0e 94 23 7b call 0xf646 ; 0xf646 1be28: 0f b6 in r0, 0x3f ; 63 1be2a: f8 94 cli 1be2c: de bf out 0x3e, r29 ; 62 1be2e: 0f be out 0x3f, r0 ; 63 1be30: cd bf out 0x3d, r28 ; 61 1be32: 9d cf rjmp .-198 ; 0x1bd6e } fanSpeed = fanSpeedBckp; 1be34: d0 92 55 12 sts 0x1255, r13 ; 0x801255 lcd_update_enable(true); 1be38: 81 e0 ldi r24, 0x01 ; 1 1be3a: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_detect_IRsensor(); } } #endif lcd_wait_for_cool_down(); lcd_clear(); 1be3e: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_START)); 1be42: 83 e3 ldi r24, 0x33 ; 51 1be44: 99 e4 ldi r25, 0x49 ; 73 1be46: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1be4a: ac 01 movw r20, r24 1be4c: 60 e0 ldi r22, 0x00 ; 0 1be4e: 80 e0 ldi r24, 0x00 ; 0 1be50: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 #ifdef TMC2130 FORCE_HIGH_POWER_START; #endif // TMC2130 FORCE_BL_ON_START; _delay(2000); 1be54: 60 ed ldi r22, 0xD0 ; 208 1be56: 77 e0 ldi r23, 0x07 ; 7 1be58: 80 e0 ldi r24, 0x00 ; 0 1be5a: 90 e0 ldi r25, 0x00 ; 0 1be5c: 0f 94 56 0b call 0x216ac ; 0x216ac KEEPALIVE_STATE(IN_HANDLER); 1be60: 82 e0 ldi r24, 0x02 ; 2 1be62: 80 93 78 02 sts 0x0278, r24 ; 0x800278 _progress = lcd_selftest_screen(TestScreen::ExtruderFan, _progress, 3, true, 2000); 1be66: 00 ed ldi r16, 0xD0 ; 208 1be68: 17 e0 ldi r17, 0x07 ; 7 1be6a: 21 e0 ldi r18, 0x01 ; 1 1be6c: 43 e0 ldi r20, 0x03 ; 3 1be6e: 60 e0 ldi r22, 0x00 ; 0 1be70: 80 e0 ldi r24, 0x00 ; 0 1be72: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1be76: 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 1be78: 83 e0 ldi r24, 0x03 ; 3 1be7a: 0e 94 00 78 call 0xf000 ; 0xf000 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 1be7e: 10 92 55 12 sts 0x1255, r1 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 1be82: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d #endif manage_heater(); 1be86: 0f 94 a8 37 call 0x26f50 ; 0x26f50 // 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]); 1be8a: 4d e2 ldi r20, 0x2D ; 45 1be8c: 62 e0 ldi r22, 0x02 ; 2 1be8e: 82 e1 ldi r24, 0x12 ; 18 1be90: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 delay_keep_alive(1000 / sizeof(symbols)); 1be94: 84 ef ldi r24, 0xF4 ; 244 1be96: 91 e0 ldi r25, 0x01 ; 1 1be98: 0e 94 07 8d call 0x11a0e ; 0x11a0e // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1be9c: 4c e7 ldi r20, 0x7C ; 124 1be9e: 62 e0 ldi r22, 0x02 ; 2 1bea0: 82 e1 ldi r24, 0x12 ; 18 1bea2: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 delay_keep_alive(1000 / sizeof(symbols)); 1bea6: 84 ef ldi r24, 0xF4 ; 244 1bea8: 91 e0 ldi r25, 0x01 ; 1 1beaa: 0e 94 07 8d call 0x11a0e ; 0x11a0e // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1beae: 4d e2 ldi r20, 0x2D ; 45 1beb0: 62 e0 ldi r22, 0x02 ; 2 1beb2: 82 e1 ldi r24, 0x12 ; 18 1beb4: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 delay_keep_alive(1000 / sizeof(symbols)); 1beb8: 84 ef ldi r24, 0xF4 ; 244 1beba: 91 e0 ldi r25, 0x01 ; 1 1bebc: 0e 94 07 8d call 0x11a0e ; 0x11a0e // spin-up delay static char symbols[] = {'-', '|'}; static_assert(1000 / sizeof(symbols) * sizeof(symbols) == 1000); while(delay--) { for(uint8_t i = 0; i != sizeof(symbols); ++i) { lcd_putc_at(col, row, symbols[i]); 1bec0: 4c e7 ldi r20, 0x7C ; 124 1bec2: 62 e0 ldi r22, 0x02 ; 2 1bec4: 82 e1 ldi r24, 0x12 ; 18 1bec6: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 delay_keep_alive(1000 / sizeof(symbols)); 1beca: 84 ef ldi r24, 0xF4 ; 244 1becc: 91 e0 ldi r25, 0x01 ; 1 1bece: 0e 94 07 8d call 0x11a0e ; 0x11a0e } } #ifdef FANCHECK extruder_autofan_last_check = _millis(); 1bed2: 0f 94 89 0b call 0x21712 ; 0x21712 1bed6: 60 93 07 17 sts 0x1707, r22 ; 0x801707 1beda: 70 93 08 17 sts 0x1708, r23 ; 0x801708 1bede: 80 93 09 17 sts 0x1709, r24 ; 0x801709 1bee2: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a #endif fan_measuring = true; 1bee6: 81 e0 ldi r24, 0x01 ; 1 1bee8: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 while(fan_measuring) { 1beec: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 1bef0: 88 23 and r24, r24 1bef2: 29 f0 breq .+10 ; 0x1befe delay_keep_alive(100); 1bef4: 84 e6 ldi r24, 0x64 ; 100 1bef6: 90 e0 ldi r25, 0x00 ; 0 1bef8: 0e 94 07 8d call 0x11a0e ; 0x11a0e 1befc: f7 cf rjmp .-18 ; 0x1beec } gcode_M123(); 1befe: 0e 94 66 65 call 0xcacc ; 0xcacc 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 1bf02: 80 e0 ldi r24, 0x00 ; 0 1bf04: 0e 94 00 78 call 0xf000 ; 0xf000 if (fan_speed[0] < failThr) { 1bf08: c0 90 b7 03 lds r12, 0x03B7 ; 0x8003b7 1bf0c: d0 90 b8 03 lds r13, 0x03B8 ; 0x8003b8 1bf10: 94 e1 ldi r25, 0x14 ; 20 1bf12: c9 16 cp r12, r25 1bf14: d1 04 cpc r13, r1 1bf16: 54 f1 brlt .+84 ; 0x1bf6c lcd_selftest_error(TestError::ExtruderFan, "", ""); } if (_result) { _progress = lcd_selftest_screen(TestScreen::PrintFan, _progress, 3, true, 2000); 1bf18: 00 ed ldi r16, 0xD0 ; 208 1bf1a: 17 e0 ldi r17, 0x07 ; 7 1bf1c: 21 e0 ldi r18, 0x01 ; 1 1bf1e: 43 e0 ldi r20, 0x03 ; 3 1bf20: 6f 2d mov r22, r15 1bf22: 81 e0 ldi r24, 0x01 ; 1 1bf24: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1bf28: f8 2e mov r15, r24 default: _result = false; break; } #else //defined(TACH_1) _result = lcd_selftest_manual_fan_check(1, false); 1bf2a: 60 e0 ldi r22, 0x00 ; 0 1bf2c: 80 e0 ldi r24, 0x00 ; 0 1bf2e: 0f 94 72 8f call 0x31ee4 ; 0x31ee4 #endif //defined(TACH_1) if (!_result) 1bf32: 81 11 cpse r24, r1 1bf34: 3a c0 rjmp .+116 ; 0x1bfaa { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning 1bf36: 4f ed ldi r20, 0xDF ; 223 1bf38: 52 e0 ldi r21, 0x02 ; 2 1bf3a: ba 01 movw r22, r20 1bf3c: 85 e0 ldi r24, 0x05 ; 5 1bf3e: 0e 94 43 d8 call 0x1b086 ; 0x1b086 } } if (_swapped_fan) { 1bf42: 86 e4 ldi r24, 0x46 ; 70 1bf44: c8 16 cp r12, r24 1bf46: d1 04 cpc r13, r1 1bf48: bc f0 brlt .+46 ; 0x1bf78 //turn on print fan and check that left hotend fan is not spinning _result = lcd_selftest_manual_fan_check(1, true); 1bf4a: 60 e0 ldi r22, 0x00 ; 0 1bf4c: 81 e0 ldi r24, 0x01 ; 1 1bf4e: 0f 94 72 8f call 0x31ee4 ; 0x31ee4 if (_result) { 1bf52: 88 23 and r24, r24 1bf54: d9 f0 breq .+54 ; 0x1bf8c //print fan is stil turned on; check that it is spinning _result = lcd_selftest_manual_fan_check(1, false, true); 1bf56: 61 e0 ldi r22, 0x01 ; 1 1bf58: 80 e0 ldi r24, 0x00 ; 0 1bf5a: 0f 94 72 8f call 0x31ee4 ; 0x31ee4 if (!_result){ 1bf5e: 81 11 cpse r24, r1 1bf60: 28 c0 rjmp .+80 ; 0x1bfb2 lcd_selftest_error(TestError::PrintFan, "", ""); 1bf62: 4f ed ldi r20, 0xDF ; 223 1bf64: 52 e0 ldi r21, 0x02 ; 2 1bf66: ba 01 movw r22, r20 1bf68: 85 e0 ldi r24, 0x05 ; 5 1bf6a: 04 c0 rjmp .+8 ; 0x1bf74 #else //defined(TACH_0) _result = lcd_selftest_manual_fan_check(0, false); #endif //defined(TACH_0) if (!_result) { lcd_selftest_error(TestError::ExtruderFan, "", ""); 1bf6c: 4f ed ldi r20, 0xDF ; 223 1bf6e: 52 e0 ldi r21, 0x02 ; 2 1bf70: ba 01 movw r22, r20 1bf72: 86 e0 ldi r24, 0x06 ; 6 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1bf74: 0e 94 43 d8 call 0x1b086 ; 0x1b086 { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct } else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); 1bf78: 08 e8 ldi r16, 0x88 ; 136 1bf7a: 13 e1 ldi r17, 0x13 ; 19 1bf7c: 21 e0 ldi r18, 0x01 ; 1 1bf7e: 43 e0 ldi r20, 0x03 ; 3 1bf80: 6f 2d mov r22, r15 1bf82: 8d e0 ldi r24, 0x0D ; 13 1bf84: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1bf88: e1 2c mov r14, r1 1bf8a: 75 c1 rjmp .+746 ; 0x1c276 lcd_selftest_error(TestError::PrintFan, "", ""); } } else { // fans are swapped lcd_selftest_error(TestError::SwappedFan, "", ""); 1bf8c: 4f ed ldi r20, 0xDF ; 223 1bf8e: 52 e0 ldi r21, 0x02 ; 2 1bf90: ba 01 movw r22, r20 1bf92: 89 e0 ldi r24, 0x09 ; 9 1bf94: ef cf rjmp .-34 ; 0x1bf74 #endif //not defined TMC2130 static bool lcd_selfcheck_endstops() { bool _result = true; 1bf96: 11 e0 ldi r17, 0x01 ; 1 1bf98: 96 c0 rjmp .+300 ; 0x1c0c6 lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); lcd_return_to_status(); } else { LCD_ALERTMESSAGERPGM(_T(MSG_SELFTEST_FAILED)); 1bf9a: 85 e5 ldi r24, 0x55 ; 85 1bf9c: 9a e4 ldi r25, 0x4A ; 74 1bf9e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1bfa2: 62 e0 ldi r22, 0x02 ; 2 1bfa4: 0e 94 14 d8 call 0x1b028 ; 0x1b028 1bfa8: 7e c1 rjmp .+764 ; 0x1c2a6 { lcd_selftest_error(TestError::PrintFan, "", ""); //print fan not spinning } } if (_swapped_fan) { 1bfaa: 96 e4 ldi r25, 0x46 ; 70 1bfac: c9 16 cp r12, r25 1bfae: d1 04 cpc r13, r1 1bfb0: 64 f6 brge .-104 ; 0x1bf4a } } if (_result) { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); 1bfb2: 00 ed ldi r16, 0xD0 ; 208 1bfb4: 17 e0 ldi r17, 0x07 ; 7 1bfb6: 21 e0 ldi r18, 0x01 ; 1 1bfb8: 43 e0 ldi r20, 0x03 ; 3 1bfba: 6f 2d mov r22, r15 1bfbc: 82 e0 ldi r24, 0x02 ; 2 1bfbe: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1bfc2: 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) || 1bfc4: 1e 99 sbic 0x03, 6 ; 3 1bfc6: 04 c0 rjmp .+8 ; 0x1bfd0 { bool _result = true; if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1bfc8: 1d 99 sbic 0x03, 5 ; 3 1bfca: 02 c0 rjmp .+4 ; 0x1bfd0 ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1bfcc: 1c 9b sbis 0x03, 4 ; 3 1bfce: 48 c0 rjmp .+144 ; 0x1c060 #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; 1bfd0: 1e 9b sbis 0x03, 6 ; 3 1bfd2: 16 c0 rjmp .+44 ; 0x1c000 1bfd4: 20 e0 ldi r18, 0x00 ; 0 1bfd6: 30 e0 ldi r19, 0x00 ; 0 1bfd8: 40 e2 ldi r20, 0x20 ; 32 1bfda: 51 e4 ldi r21, 0x41 ; 65 1bfdc: 60 91 61 12 lds r22, 0x1261 ; 0x801261 1bfe0: 70 91 62 12 lds r23, 0x1262 ; 0x801262 1bfe4: 80 91 63 12 lds r24, 0x1263 ; 0x801263 1bfe8: 90 91 64 12 lds r25, 0x1264 ; 0x801264 1bfec: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1bff0: 60 93 61 12 sts 0x1261, r22 ; 0x801261 1bff4: 70 93 62 12 sts 0x1262, r23 ; 0x801262 1bff8: 80 93 63 12 sts 0x1263, r24 ; 0x801263 1bffc: 90 93 64 12 sts 0x1264, r25 ; 0x801264 if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) current_position[1] += 10; 1c000: 1d 9b sbis 0x03, 5 ; 3 1c002: 16 c0 rjmp .+44 ; 0x1c030 1c004: 20 e0 ldi r18, 0x00 ; 0 1c006: 30 e0 ldi r19, 0x00 ; 0 1c008: 40 e2 ldi r20, 0x20 ; 32 1c00a: 51 e4 ldi r21, 0x41 ; 65 1c00c: 60 91 65 12 lds r22, 0x1265 ; 0x801265 1c010: 70 91 66 12 lds r23, 0x1266 ; 0x801266 1c014: 80 91 67 12 lds r24, 0x1267 ; 0x801267 1c018: 90 91 68 12 lds r25, 0x1268 ; 0x801268 1c01c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1c020: 60 93 65 12 sts 0x1265, r22 ; 0x801265 1c024: 70 93 66 12 sts 0x1266, r23 ; 0x801266 1c028: 80 93 67 12 sts 0x1267, r24 ; 0x801267 1c02c: 90 93 68 12 sts 0x1268, r25 ; 0x801268 #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) current_position[2] += 10; 1c030: 1c 9b sbis 0x03, 4 ; 3 1c032: 16 c0 rjmp .+44 ; 0x1c060 1c034: 20 e0 ldi r18, 0x00 ; 0 1c036: 30 e0 ldi r19, 0x00 ; 0 1c038: 40 e2 ldi r20, 0x20 ; 32 1c03a: 51 e4 ldi r21, 0x41 ; 65 1c03c: 60 91 69 12 lds r22, 0x1269 ; 0x801269 1c040: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 1c044: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 1c048: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 1c04c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1c050: 60 93 69 12 sts 0x1269, r22 ; 0x801269 1c054: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1c058: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1c05c: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c } plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1c060: 60 e0 ldi r22, 0x00 ; 0 1c062: 70 e0 ldi r23, 0x00 ; 0 1c064: 84 e3 ldi r24, 0x34 ; 52 1c066: 92 e4 ldi r25, 0x42 ; 66 1c068: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1c06c: 0f 94 94 18 call 0x23128 ; 0x23128 if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1c070: 1e 99 sbic 0x03, 6 ; 3 1c072: 04 c0 rjmp .+8 ; 0x1c07c plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); st_synchronize(); if ( #ifndef TMC2130 ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) || 1c074: 1d 99 sbic 0x03, 5 ; 3 1c076: 02 c0 rjmp .+4 ; 0x1c07c ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) || 1c078: 1c 9b sbis 0x03, 4 ; 3 1c07a: 8d cf rjmp .-230 ; 0x1bf96 #endif //!TMC2130 ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1)) { _result = false; char _error[4] = ""; 1c07c: 1a 82 std Y+2, r1 ; 0x02 1c07e: 19 82 std Y+1, r1 ; 0x01 1c080: 1c 82 std Y+4, r1 ; 0x04 1c082: 1b 82 std Y+3, r1 ; 0x03 #ifndef TMC2130 if ((READ(X_MIN_PIN) ^ X_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "X"); 1c084: 1e 9b sbis 0x03, 6 ; 3 1c086: 06 c0 rjmp .+12 ; 0x1c094 1c088: 68 ec ldi r22, 0xC8 ; 200 1c08a: 72 e0 ldi r23, 0x02 ; 2 1c08c: ce 01 movw r24, r28 1c08e: 01 96 adiw r24, 0x01 ; 1 1c090: 0f 94 cd aa call 0x3559a ; 0x3559a if ((READ(Y_MIN_PIN) ^ Y_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Y"); 1c094: 1d 9b sbis 0x03, 5 ; 3 1c096: 06 c0 rjmp .+12 ; 0x1c0a4 1c098: 6a ec ldi r22, 0xCA ; 202 1c09a: 72 e0 ldi r23, 0x02 ; 2 1c09c: ce 01 movw r24, r28 1c09e: 01 96 adiw r24, 0x01 ; 1 1c0a0: 0f 94 cd aa call 0x3559a ; 0x3559a #endif //!TMC2130 if ((READ(Z_MIN_PIN) ^ Z_MIN_ENDSTOP_INVERTING) == 1) strcat(_error, "Z"); 1c0a4: 1c 9b sbis 0x03, 4 ; 3 1c0a6: 06 c0 rjmp .+12 ; 0x1c0b4 1c0a8: 6c ec ldi r22, 0xCC ; 204 1c0aa: 72 e0 ldi r23, 0x02 ; 2 1c0ac: ce 01 movw r24, r28 1c0ae: 01 96 adiw r24, 0x01 ; 1 1c0b0: 0f 94 cd aa call 0x3559a ; 0x3559a lcd_selftest_error(TestError::Endstops, _error, ""); 1c0b4: 4f ed ldi r20, 0xDF ; 223 1c0b6: 52 e0 ldi r21, 0x02 ; 2 1c0b8: be 01 movw r22, r28 1c0ba: 6f 5f subi r22, 0xFF ; 255 1c0bc: 7f 4f sbci r23, 0xFF ; 255 1c0be: 82 e0 ldi r24, 0x02 ; 2 1c0c0: 0e 94 43 d8 call 0x1b086 ; 0x1b086 ((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; 1c0c4: 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(); 1c0c6: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 1c0ca: 81 e0 ldi r24, 0x01 ; 1 1c0cc: 0e 94 ad 8a call 0x1155a ; 0x1155a { _progress = lcd_selftest_screen(TestScreen::FansOk, _progress, 3, true, 2000); _result = lcd_selfcheck_endstops(); //With TMC2130, only the Z probe is tested. } if (_result) 1c0d0: 11 23 and r17, r17 1c0d2: 09 f4 brne .+2 ; 0x1c0d6 1c0d4: 51 cf rjmp .-350 ; 0x1bf78 { //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); 1c0d6: 00 ed ldi r16, 0xD0 ; 208 1c0d8: 17 e0 ldi r17, 0x07 ; 7 1c0da: 21 e0 ldi r18, 0x01 ; 1 1c0dc: 43 e0 ldi r20, 0x03 ; 3 1c0de: 6f 2d mov r22, r15 1c0e0: 84 e0 ldi r24, 0x04 ; 4 1c0e2: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1c0e6: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(X_AXIS); #else _result = lcd_selfcheck_axis(X_AXIS, X_MAX_POS); 1c0e8: 6a ef ldi r22, 0xFA ; 250 1c0ea: 70 e0 ldi r23, 0x00 ; 0 1c0ec: 90 e0 ldi r25, 0x00 ; 0 1c0ee: 80 e0 ldi r24, 0x00 ; 0 1c0f0: 0e 94 2a db call 0x1b654 ; 0x1b654 } if (_result) 1c0f4: 88 23 and r24, r24 1c0f6: 09 f4 brne .+2 ; 0x1c0fa 1c0f8: 3f cf rjmp .-386 ; 0x1bf78 { _progress = lcd_selftest_screen(TestScreen::AxisX, _progress, 3, true, 0); 1c0fa: 10 e0 ldi r17, 0x00 ; 0 1c0fc: 00 e0 ldi r16, 0x00 ; 0 1c0fe: 21 e0 ldi r18, 0x01 ; 1 1c100: 43 e0 ldi r20, 0x03 ; 3 1c102: 6f 2d mov r22, r15 1c104: 84 e0 ldi r24, 0x04 ; 4 1c106: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1c10a: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(X_AXIS); 1c10c: 90 e0 ldi r25, 0x00 ; 0 1c10e: 80 e0 ldi r24, 0x00 ; 0 1c110: 0e 94 27 da call 0x1b44e ; 0x1b44e #endif } if (_result) 1c114: 88 23 and r24, r24 1c116: 09 f4 brne .+2 ; 0x1c11a 1c118: 2f cf rjmp .-418 ; 0x1bf78 { _progress = lcd_selftest_screen(TestScreen::AxisY, _progress, 3, true, 1500); 1c11a: 0c ed ldi r16, 0xDC ; 220 1c11c: 15 e0 ldi r17, 0x05 ; 5 1c11e: 21 e0 ldi r18, 0x01 ; 1 1c120: 43 e0 ldi r20, 0x03 ; 3 1c122: 6f 2d mov r22, r15 1c124: 85 e0 ldi r24, 0x05 ; 5 1c126: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1c12a: f8 2e mov r15, r24 #ifdef TMC2130 _result = lcd_selfcheck_axis_sg(Y_AXIS); #else _result = lcd_selfcheck_axis(Y_AXIS, Y_MAX_POS); 1c12c: 62 ed ldi r22, 0xD2 ; 210 1c12e: 70 e0 ldi r23, 0x00 ; 0 1c130: 81 e0 ldi r24, 0x01 ; 1 1c132: 90 e0 ldi r25, 0x00 ; 0 1c134: 0e 94 2a db call 0x1b654 ; 0x1b654 #endif // TMC2130 } if (_result) 1c138: 88 23 and r24, r24 1c13a: 09 f4 brne .+2 ; 0x1c13e 1c13c: 1d cf rjmp .-454 ; 0x1bf78 { _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 0); 1c13e: 10 e0 ldi r17, 0x00 ; 0 1c140: 00 e0 ldi r16, 0x00 ; 0 1c142: 21 e0 ldi r18, 0x01 ; 1 1c144: 43 e0 ldi r20, 0x03 ; 3 1c146: 6f 2d mov r22, r15 1c148: 86 e0 ldi r24, 0x06 ; 6 1c14a: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1c14e: f8 2e mov r15, r24 #ifndef TMC2130 _result = lcd_selfcheck_pulleys(Y_AXIS); 1c150: 81 e0 ldi r24, 0x01 ; 1 1c152: 90 e0 ldi r25, 0x00 ; 0 1c154: 0e 94 27 da call 0x1b44e ; 0x1b44e #endif // TMC2130 } if (_result) 1c158: 88 23 and r24, r24 1c15a: 09 f4 brne .+2 ; 0x1c15e 1c15c: 0d cf rjmp .-486 ; 0x1bf78 enable_endstops(false); #endif //homeaxis(X_AXIS); //homeaxis(Y_AXIS); current_position[X_AXIS] = pgm_read_float(bed_ref_points_4); 1c15e: e1 e0 ldi r30, 0x01 ; 1 1c160: fd e9 ldi r31, 0x9D ; 157 1c162: 85 91 lpm r24, Z+ 1c164: 95 91 lpm r25, Z+ 1c166: a5 91 lpm r26, Z+ 1c168: b4 91 lpm r27, Z 1c16a: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1c16e: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1c172: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1c176: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4+1); 1c17a: e5 e0 ldi r30, 0x05 ; 5 1c17c: fd e9 ldi r31, 0x9D ; 157 1c17e: 85 91 lpm r24, Z+ 1c180: 95 91 lpm r25, Z+ 1c182: a5 91 lpm r26, Z+ 1c184: b4 91 lpm r27, Z 1c186: 80 93 65 12 sts 0x1265, r24 ; 0x801265 1c18a: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1c18e: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1c192: 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); 1c196: 60 e0 ldi r22, 0x00 ; 0 1c198: 70 e0 ldi r23, 0x00 ; 0 1c19a: 80 e2 ldi r24, 0x20 ; 32 1c19c: 91 e4 ldi r25, 0x41 ; 65 1c19e: 0e 94 e5 6c call 0xd9ca ; 0xd9ca set_destination_to_current(); 1c1a2: 0e 94 ff 66 call 0xcdfe ; 0xcdfe _progress = lcd_selftest_screen(TestScreen::AxisZ, _progress, 3, true, 1500); 1c1a6: 0c ed ldi r16, 0xDC ; 220 1c1a8: 15 e0 ldi r17, 0x05 ; 5 1c1aa: 21 e0 ldi r18, 0x01 ; 1 1c1ac: 43 e0 ldi r20, 0x03 ; 3 1c1ae: 6f 2d mov r22, r15 1c1b0: 86 e0 ldi r24, 0x06 ; 6 1c1b2: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1c1b6: 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); 1c1b8: 62 ed ldi r22, 0xD2 ; 210 1c1ba: 70 e0 ldi r23, 0x00 ; 0 1c1bc: 82 e0 ldi r24, 0x02 ; 2 1c1be: 90 e0 ldi r25, 0x00 ; 0 1c1c0: 0e 94 2a db call 0x1b654 ; 0x1b654 1c1c4: 18 2f mov r17, r24 #endif //TMC2130 //raise Z to not damage the bed during and hotend testing raise_z(20); 1c1c6: 60 e0 ldi r22, 0x00 ; 0 1c1c8: 70 e0 ldi r23, 0x00 ; 0 1c1ca: 80 ea ldi r24, 0xA0 ; 160 1c1cc: 91 e4 ldi r25, 0x41 ; 65 1c1ce: 0e 94 e5 6c call 0xd9ca ; 0xd9ca eeprom_update_byte_notify((uint8_t*)EEPROM_TMC2130_HOME_ENABLED, 1); _result = bres; } #endif //TMC2130 if (_result) 1c1d2: 11 23 and r17, r17 1c1d4: 09 f4 brne .+2 ; 0x1c1d8 1c1d6: d0 ce rjmp .-608 ; 0x1bf78 { _progress = lcd_selftest_screen(TestScreen::Bed, _progress, 3, true, 2000); 1c1d8: 00 ed ldi r16, 0xD0 ; 208 1c1da: 17 e0 ldi r17, 0x07 ; 7 1c1dc: 21 e0 ldi r18, 0x01 ; 1 1c1de: 43 e0 ldi r20, 0x03 ; 3 1c1e0: 6f 2d mov r22, r15 1c1e2: 87 e0 ldi r24, 0x07 ; 7 1c1e4: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1c1e8: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(true); 1c1ea: 81 e0 ldi r24, 0x01 ; 1 1c1ec: 0e 94 31 d9 call 0x1b262 ; 0x1b262 } if (_result) 1c1f0: 88 23 and r24, r24 1c1f2: 09 f4 brne .+2 ; 0x1c1f6 1c1f4: c1 ce rjmp .-638 ; 0x1bf78 { _progress = lcd_selftest_screen(TestScreen::Hotend, _progress, 3, true, 1000); 1c1f6: 08 ee ldi r16, 0xE8 ; 232 1c1f8: 13 e0 ldi r17, 0x03 ; 3 1c1fa: 21 e0 ldi r18, 0x01 ; 1 1c1fc: 43 e0 ldi r20, 0x03 ; 3 1c1fe: 6f 2d mov r22, r15 1c200: 88 e0 ldi r24, 0x08 ; 8 1c202: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1c206: f8 2e mov r15, r24 _result = lcd_selfcheck_check_heater(false); 1c208: 80 e0 ldi r24, 0x00 ; 0 1c20a: 0e 94 31 d9 call 0x1b262 ; 0x1b262 1c20e: e8 2e mov r14, r24 } if (_result) 1c210: 88 23 and r24, r24 1c212: 09 f4 brne .+2 ; 0x1c216 1c214: b1 ce rjmp .-670 ; 0x1bf78 { _progress = lcd_selftest_screen(TestScreen::HotendOk, _progress, 3, true, 2000); //nozzle ok 1c216: 00 ed ldi r16, 0xD0 ; 208 1c218: 17 e0 ldi r17, 0x07 ; 7 1c21a: 21 e0 ldi r18, 0x01 ; 1 1c21c: 43 e0 ldi r20, 0x03 ; 3 1c21e: 6f 2d mov r22, r15 1c220: 89 e0 ldi r24, 0x09 ; 9 1c222: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 } } 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 1c226: 21 e0 ldi r18, 0x01 ; 1 1c228: 43 e0 ldi r20, 0x03 ; 3 1c22a: 68 2f mov r22, r24 1c22c: 8a e0 ldi r24, 0x0A ; 10 1c22e: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 1c232: f8 2e mov r15, r24 #ifdef FILAMENT_SENSOR #if FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125 static bool lcd_selftest_fsensor(void) { fsensor.init(); 1c234: 0f 94 7a 6d call 0x2daf4 ; 0x2daf4 if (fsensor.isError()) 1c238: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1c23c: 83 30 cpi r24, 0x03 ; 3 1c23e: 31 f4 brne .+12 ; 0x1c24c { lcd_selftest_error(TestError::WiringFsensor, "", ""); 1c240: 4f ed ldi r20, 0xDF ; 223 1c242: 52 e0 ldi r21, 0x02 ; 2 1c244: ba 01 movw r22, r20 1c246: 8a e0 ldi r24, 0x0A ; 10 1c248: 0e 94 43 d8 call 0x1b086 ; 0x1b086 #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) 1c24c: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1c250: 83 30 cpi r24, 0x03 ; 3 1c252: 09 f4 brne .+2 ; 0x1c256 1c254: 91 ce rjmp .-734 ; 0x1bf78 { _progress = lcd_selftest_screen(TestScreen::FsensorOk, _progress, 3, true, 2000); //fil sensor OK 1c256: 00 ed ldi r16, 0xD0 ; 208 1c258: 17 e0 ldi r17, 0x07 ; 7 1c25a: 21 e0 ldi r18, 0x01 ; 1 1c25c: 43 e0 ldi r20, 0x03 ; 3 1c25e: 6f 2d mov r22, r15 1c260: 8b e0 ldi r24, 0x0B ; 11 1c262: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 } } #endif //FILAMENT_SENSOR if (_result) { _progress = lcd_selftest_screen(TestScreen::AllCorrect, _progress, 3, true, 5000); //all correct 1c266: 08 e8 ldi r16, 0x88 ; 136 1c268: 13 e1 ldi r17, 0x13 ; 19 1c26a: 21 e0 ldi r18, 0x01 ; 1 1c26c: 43 e0 ldi r20, 0x03 ; 3 1c26e: 68 2f mov r22, r24 1c270: 8c e0 ldi r24, 0x0C ; 12 1c272: 0e 94 e1 c2 call 0x185c2 ; 0x185c2 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1c276: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> else { _progress = lcd_selftest_screen(TestScreen::Failed, _progress, 3, true, 5000); } lcd_reset_alert_level(); enquecommand_P(MSG_M84); 1c27a: 61 e0 ldi r22, 0x01 ; 1 1c27c: 88 e6 ldi r24, 0x68 ; 104 1c27e: 99 e6 ldi r25, 0x69 ; 105 1c280: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 lcd_update_enable(true); 1c284: 81 e0 ldi r24, 0x01 ; 1 1c286: 0e 94 89 70 call 0xe112 ; 0xe112 if (_result) 1c28a: ee 20 and r14, r14 1c28c: 09 f4 brne .+2 ; 0x1c290 1c28e: 85 ce rjmp .-758 ; 0x1bf9a { calibration_status_set(CALIBRATION_STATUS_SELFTEST); 1c290: 81 e0 ldi r24, 0x01 ; 1 1c292: 0e 94 36 d5 call 0x1aa6c ; 0x1aa6c lcd_setstatuspgm(_T(MSG_SELFTEST_OK)); 1c296: 85 e2 ldi r24, 0x25 ; 37 1c298: 99 e4 ldi r25, 0x49 ; 73 1c29a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c29e: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 lcd_return_to_status(); 1c2a2: 0f 94 6e 05 call 0x20adc ; 0x20adc FORCE_HIGH_POWER_END; #endif // TMC2130 FORCE_BL_ON_END; KEEPALIVE_STATE(NOT_BUSY); 1c2a6: 81 e0 ldi r24, 0x01 ; 1 1c2a8: 80 93 78 02 sts 0x0278, r24 ; 0x800278 return(_result); } 1c2ac: 8e 2d mov r24, r14 1c2ae: 0f 90 pop r0 1c2b0: 0f 90 pop r0 1c2b2: 0f 90 pop r0 1c2b4: 0f 90 pop r0 1c2b6: df 91 pop r29 1c2b8: cf 91 pop r28 1c2ba: 1f 91 pop r17 1c2bc: 0f 91 pop r16 1c2be: ff 90 pop r15 1c2c0: ef 90 pop r14 1c2c2: df 90 pop r13 1c2c4: cf 90 pop r12 1c2c6: 08 95 ret 0001c2c8 : } #endif //defined(FILAMENT_SENSOR) && (FILAMENT_SENSOR_TYPE == FSENSOR_IR_ANALOG) static void lcd_selftest_v() { (void)lcd_selftest(); 1c2c8: 0c 94 9e de jmp 0x1bd3c ; 0x1bd3c 0001c2cc : } /// @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) { 1c2cc: cf 92 push r12 1c2ce: df 92 push r13 1c2d0: ef 92 push r14 1c2d2: ff 92 push r15 1c2d4: cf 93 push r28 1c2d6: 6b 01 movw r12, r22 1c2d8: 7c 01 movw r14, r24 custom_message_type = CustomMsg::FilamentLoading; 1c2da: 82 e0 ldi r24, 0x02 ; 2 1c2dc: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d lcd_setstatuspgm(_T(MSG_UNLOADING_FILAMENT)); 1c2e0: 8b e6 ldi r24, 0x6B ; 107 1c2e2: 9a e5 ldi r25, 0x5A ; 90 1c2e4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c2e8: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 FSensorBlockRunout fsBlockRunout; 1c2ec: 0f 94 c9 78 call 0x2f192 ; 0x2f192 current_position[E_AXIS] -= FILAMENT_UNLOAD_FAST_RETRACT_LENGTH; 1c2f0: 20 e0 ldi r18, 0x00 ; 0 1c2f2: 30 e0 ldi r19, 0x00 ; 0 1c2f4: 44 e3 ldi r20, 0x34 ; 52 1c2f6: 52 e4 ldi r21, 0x42 ; 66 1c2f8: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1c2fc: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 1c300: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 1c304: 90 91 70 12 lds r25, 0x1270 ; 0x801270 1c308: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1c30c: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1c310: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1c314: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1c318: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_FAST_RETRACT_FEEDRATE); 1c31c: 6a e0 ldi r22, 0x0A ; 10 1c31e: 77 e5 ldi r23, 0x57 ; 87 1c320: 8d ea ldi r24, 0xAD ; 173 1c322: 92 e4 ldi r25, 0x42 ; 66 1c324: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1c328: 0f 94 94 18 call 0x23128 ; 0x23128 current_position[E_AXIS] -= FILAMENT_UNLOAD_SLOW_RETRACT_LENGTH; 1c32c: 20 e0 ldi r18, 0x00 ; 0 1c32e: 30 e0 ldi r19, 0x00 ; 0 1c330: 4c e0 ldi r20, 0x0C ; 12 1c332: 52 e4 ldi r21, 0x42 ; 66 1c334: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1c338: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 1c33c: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 1c340: 90 91 70 12 lds r25, 0x1270 ; 0x801270 1c344: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1c348: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1c34c: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1c350: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1c354: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENT_UNLOAD_SLOW_RETRACT_FEEDRATE); 1c358: 69 e2 ldi r22, 0x29 ; 41 1c35a: 7c e5 ldi r23, 0x5C ; 92 1c35c: 85 e8 ldi r24, 0x85 ; 133 1c35e: 91 e4 ldi r25, 0x41 ; 65 1c360: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1c364: 0f 94 94 18 call 0x23128 ; 0x23128 // Configurable length, by default it's 0. // only plan the move if the length is set to a non-zero value if (unloadLength) 1c368: 20 e0 ldi r18, 0x00 ; 0 1c36a: 30 e0 ldi r19, 0x00 ; 0 1c36c: a9 01 movw r20, r18 1c36e: c7 01 movw r24, r14 1c370: b6 01 movw r22, r12 1c372: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1c376: 88 23 and r24, r24 1c378: e1 f0 breq .+56 ; 0x1c3b2 { current_position[E_AXIS] += unloadLength; 1c37a: a7 01 movw r20, r14 1c37c: 96 01 movw r18, r12 1c37e: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 1c382: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 1c386: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 1c38a: 90 91 70 12 lds r25, 0x1270 ; 0x801270 1c38e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1c392: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 1c396: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 1c39a: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 1c39e: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_buffer_line_curposXYZE(FILAMENT_CHANGE_UNLOAD_FEEDRATE); 1c3a2: 60 e0 ldi r22, 0x00 ; 0 1c3a4: 70 e0 ldi r23, 0x00 ; 0 1c3a6: 80 e2 ldi r24, 0x20 ; 32 1c3a8: 91 e4 ldi r25, 0x41 ; 65 1c3aa: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1c3ae: 0f 94 94 18 call 0x23128 ; 0x23128 } lcd_display_message_fullscreen_P(_T(MSG_PULL_OUT_FILAMENT)); 1c3b2: 81 e9 ldi r24, 0x91 ; 145 1c3b4: 96 e4 ldi r25, 0x46 ; 70 1c3b6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c3ba: 0e 94 91 de call 0x1bd22 ; 0x1bd22 //disable extruder steppers so filament can be removed disable_e0(); 1c3be: 14 9a sbi 0x02, 4 ; 2 _delay(100); 1c3c0: 64 e6 ldi r22, 0x64 ; 100 1c3c2: 70 e0 ldi r23, 0x00 ; 0 1c3c4: 80 e0 ldi r24, 0x00 ; 0 1c3c6: 90 e0 ldi r25, 0x00 ; 0 1c3c8: 0f 94 56 0b call 0x216ac ; 0x216ac Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 1c3cc: 82 e0 ldi r24, 0x02 ; 2 1c3ce: 0f 94 3f 23 call 0x2467e ; 0x2467e 1c3d2: c3 e3 ldi r28, 0x33 ; 51 uint8_t counterBeep = 0; while (!lcd_clicked() && (counterBeep < 50)) { 1c3d4: 0e 94 c6 73 call 0xe78c ; 0xe78c 1c3d8: 81 11 cpse r24, r1 1c3da: 07 c0 rjmp .+14 ; 0x1c3ea 1c3dc: c1 50 subi r28, 0x01 ; 1 1c3de: 29 f0 breq .+10 ; 0x1c3ea delay_keep_alive(100); 1c3e0: 84 e6 ldi r24, 0x64 ; 100 1c3e2: 90 e0 ldi r25, 0x00 ; 0 1c3e4: 0e 94 07 8d call 0x11a0e ; 0x11a0e 1c3e8: f5 cf rjmp .-22 ; 0x1c3d4 counterBeep++; } st_synchronize(); 1c3ea: 0f 94 94 18 call 0x23128 ; 0x23128 while (lcd_clicked()) delay_keep_alive(100); 1c3ee: 0e 94 c6 73 call 0xe78c ; 0xe78c 1c3f2: 88 23 and r24, r24 1c3f4: 29 f0 breq .+10 ; 0x1c400 1c3f6: 84 e6 ldi r24, 0x64 ; 100 1c3f8: 90 e0 ldi r25, 0x00 ; 0 1c3fa: 0e 94 07 8d call 0x11a0e ; 0x11a0e 1c3fe: f7 cf rjmp .-18 ; 0x1c3ee lcd_update_enable(true); 1c400: 81 e0 ldi r24, 0x01 ; 1 1c402: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_setstatuspgm(MSG_WELCOME); 1c406: 8a e8 ldi r24, 0x8A ; 138 1c408: 9c e6 ldi r25, 0x6C ; 108 1c40a: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 custom_message_type = CustomMsg::Status; 1c40e: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d clearFilamentAction(); 1c412: 0f 94 6f 09 call 0x212de ; 0x212de } 1c416: cf 91 pop r28 1c418: ff 90 pop r15 1c41a: ef 90 pop r14 1c41c: df 90 pop r13 1c41e: cf 90 pop r12 #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 1c420: 0d 94 33 6d jmp 0x2da66 ; 0x2da66 0001c424 : lang_select(LANG_ID_PRI); } #endif static void wait_preheat() { 1c424: cf 92 push r12 1c426: df 92 push r13 1c428: ef 92 push r14 1c42a: ff 92 push r15 current_position[Z_AXIS] = 100; //move in z axis to make space for loading filament 1c42c: 80 e0 ldi r24, 0x00 ; 0 1c42e: 90 e0 ldi r25, 0x00 ; 0 1c430: a8 ec ldi r26, 0xC8 ; 200 1c432: b2 e4 ldi r27, 0x42 ; 66 1c434: 80 93 69 12 sts 0x1269, r24 ; 0x801269 1c438: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 1c43c: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 1c440: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 1c444: 65 e5 ldi r22, 0x55 ; 85 1c446: 75 e5 ldi r23, 0x55 ; 85 1c448: 85 e5 ldi r24, 0x55 ; 85 1c44a: 91 e4 ldi r25, 0x41 ; 65 1c44c: 0f 94 0d 4a call 0x2941a ; 0x2941a delay_keep_alive(2000); 1c450: 80 ed ldi r24, 0xD0 ; 208 1c452: 97 e0 ldi r25, 0x07 ; 7 1c454: 0e 94 07 8d call 0x11a0e ; 0x11a0e lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c458: 82 e9 ldi r24, 0x92 ; 146 1c45a: 9d e3 ldi r25, 0x3D ; 61 1c45c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c460: 0e 94 91 de call 0x1bd22 ; 0x1bd22 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 1c464: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 1c468: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 1c46c: 07 2e mov r0, r23 1c46e: 00 0c add r0, r0 1c470: 88 0b sbc r24, r24 1c472: 99 0b sbc r25, r25 1c474: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1c478: 9b 01 movw r18, r22 1c47a: ac 01 movw r20, r24 while (fabs(degHotend(0) - degTargetHotend(0)) > TEMP_HYSTERESIS) { 1c47c: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1c480: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1c484: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1c488: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1c48c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1c490: 9f 77 andi r25, 0x7F ; 127 1c492: 20 e0 ldi r18, 0x00 ; 0 1c494: 30 e0 ldi r19, 0x00 ; 0 1c496: 40 ea ldi r20, 0xA0 ; 160 1c498: 50 e4 ldi r21, 0x40 ; 64 1c49a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1c49e: 18 16 cp r1, r24 1c4a0: b4 f5 brge .+108 ; 0x1c50e lcd_display_message_fullscreen_P(_T(MSG_WIZARD_HEATING)); 1c4a2: 82 e9 ldi r24, 0x92 ; 146 1c4a4: 9d e3 ldi r25, 0x3D ; 61 1c4a6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c4aa: 0e 94 91 de call 0x1bd22 ; 0x1bd22 lcd_set_cursor(0, 4); 1c4ae: 64 e0 ldi r22, 0x04 ; 4 1c4b0: 80 e0 ldi r24, 0x00 ; 0 1c4b2: 0e 94 ab 6f call 0xdf56 ; 0xdf56 1c4b6: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 1c4ba: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 1c4be: 07 2e mov r0, r23 1c4c0: 00 0c add r0, r0 1c4c2: 88 0b sbc r24, r24 1c4c4: 99 0b sbc r25, r25 1c4c6: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__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)); 1c4ca: 20 e0 ldi r18, 0x00 ; 0 1c4cc: 30 e0 ldi r19, 0x00 ; 0 1c4ce: 40 e0 ldi r20, 0x00 ; 0 1c4d0: 5f e3 ldi r21, 0x3F ; 63 1c4d2: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1c4d6: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1c4da: 6b 01 movw r12, r22 1c4dc: 20 e0 ldi r18, 0x00 ; 0 1c4de: 30 e0 ldi r19, 0x00 ; 0 1c4e0: 40 e0 ldi r20, 0x00 ; 0 1c4e2: 5f e3 ldi r21, 0x3F ; 63 1c4e4: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 1c4e8: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 1c4ec: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 1c4f0: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 1c4f4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1c4f8: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1c4fc: a6 01 movw r20, r12 1c4fe: 82 e8 ldi r24, 0x82 ; 130 1c500: 0f 94 34 0a call 0x21468 ; 0x21468 delay_keep_alive(1000); 1c504: 88 ee ldi r24, 0xE8 ; 232 1c506: 93 e0 ldi r25, 0x03 ; 3 1c508: 0e 94 07 8d call 0x11a0e ; 0x11a0e 1c50c: ab cf rjmp .-170 ; 0x1c464 } } 1c50e: ff 90 pop r15 1c510: ef 90 pop r14 1c512: df 90 pop r13 1c514: cf 90 pop r12 1c516: 08 95 ret 0001c518 : //! @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 ) { 1c518: 2f 92 push r2 1c51a: 3f 92 push r3 1c51c: 4f 92 push r4 1c51e: 5f 92 push r5 1c520: 6f 92 push r6 1c522: 7f 92 push r7 1c524: 8f 92 push r8 1c526: 9f 92 push r9 1c528: af 92 push r10 1c52a: bf 92 push r11 1c52c: cf 92 push r12 1c52e: df 92 push r13 1c530: ef 92 push r14 1c532: ff 92 push r15 1c534: 0f 93 push r16 1c536: 1f 93 push r17 1c538: cf 93 push r28 1c53a: df 93 push r29 1c53c: 00 d0 rcall .+0 ; 0x1c53e 1c53e: 00 d0 rcall .+0 ; 0x1c540 1c540: cd b7 in r28, 0x3d ; 61 1c542: de b7 in r29, 0x3e ; 62 1c544: 5c 01 movw r10, r24 1c546: 6c 83 std Y+4, r22 ; 0x04 1c548: 34 2e mov r3, r20 1c54a: 3b 83 std Y+3, r19 ; 0x03 1c54c: 2a 83 std Y+2, r18 ; 0x02 1c54e: 48 01 movw r8, r16 1c550: 2c 2c mov r2, r12 const char *msg_next = msg ? lcd_display_message_fullscreen_P(msg) : NULL; 1c552: 00 97 sbiw r24, 0x00 ; 0 1c554: 09 f0 breq .+2 ; 0x1c558 1c556: 51 c0 rjmp .+162 ; 0x1c5fa 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); 1c558: 87 01 movw r16, r14 1c55a: 22 2d mov r18, r2 1c55c: a4 01 movw r20, r8 1c55e: 6a 81 ldd r22, Y+2 ; 0x02 1c560: 7b 81 ldd r23, Y+3 ; 0x03 1c562: 83 2d mov r24, r3 1c564: 0e 94 59 dd call 0x1bab2 ; 0x1bab2 1c568: d1 2c mov r13, r1 1c56a: c1 2c mov r12, r1 } // Wait for user confirmation or a timeout. unsigned long previous_millis_cmd = _millis(); 1c56c: 0f 94 89 0b call 0x21712 ; 0x21712 1c570: 2b 01 movw r4, r22 1c572: 3c 01 movw r6, r24 lcd_consume_click(); 1c574: 0e 94 c1 73 call 0xe782 ; 0xe782 KEEPALIVE_STATE(PAUSED_FOR_USER); 1c578: 84 e0 ldi r24, 0x04 ; 4 1c57a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 1c57e: de 82 std Y+6, r13 ; 0x06 1c580: cd 82 std Y+5, r12 ; 0x05 1c582: 24 e6 ldi r18, 0x64 ; 100 1c584: 29 83 std Y+1, r18 ; 0x01 for (;;) { for (uint8_t i = 0; i < 100; ++i) { delay_keep_alive(50); 1c586: 82 e3 ldi r24, 0x32 ; 50 1c588: 90 e0 ldi r25, 0x00 ; 0 1c58a: 0e 94 07 8d call 0x11a0e ; 0x11a0e if (allow_timeouting && _millis() - previous_millis_cmd > LCD_TIMEOUT_TO_STATUS) { 1c58e: 3c 81 ldd r19, Y+4 ; 0x04 1c590: 31 11 cpse r19, r1 1c592: 3a c0 rjmp .+116 ; 0x1c608 current_selection = LCD_BUTTON_TIMEOUT; goto exit; } if (lcd_encoder) { 1c594: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1c598: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1c59c: 00 97 sbiw r24, 0x00 ; 0 1c59e: 09 f0 breq .+2 ; 0x1c5a2 1c5a0: 42 c0 rjmp .+132 ; 0x1c626 } else { Sound_MakeSound(e_SOUND_TYPE_BlindAlert); break; // turning knob skips waiting loop } } if (lcd_clicked()) { 1c5a2: 0e 94 c6 73 call 0xe78c ; 0xe78c 1c5a6: 88 23 and r24, r24 1c5a8: 09 f4 brne .+2 ; 0x1c5ac 1c5aa: 67 c0 rjmp .+206 ; 0x1c67a if (msg_next == NULL) { 1c5ac: 8d 81 ldd r24, Y+5 ; 0x05 1c5ae: 9e 81 ldd r25, Y+6 ; 0x06 1c5b0: 89 2b or r24, r25 1c5b2: 09 f0 breq .+2 ; 0x1c5b6 1c5b4: 5e c0 rjmp .+188 ; 0x1c672 if (msg_next == NULL) { lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); } } exit: KEEPALIVE_STATE(IN_HANDLER); 1c5b6: 82 e0 ldi r24, 0x02 ; 2 1c5b8: 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; 1c5bc: 91 e0 ldi r25, 0x01 ; 1 1c5be: 90 93 5a 02 sts 0x025A, r25 ; 0x80025a lcd_draw_update = 2; 1c5c2: 80 93 59 02 sts 0x0259, r24 ; 0x800259 return current_selection; } 1c5c6: 83 2d mov r24, r3 1c5c8: 26 96 adiw r28, 0x06 ; 6 1c5ca: 0f b6 in r0, 0x3f ; 63 1c5cc: f8 94 cli 1c5ce: de bf out 0x3e, r29 ; 62 1c5d0: 0f be out 0x3f, r0 ; 63 1c5d2: cd bf out 0x3d, r28 ; 61 1c5d4: df 91 pop r29 1c5d6: cf 91 pop r28 1c5d8: 1f 91 pop r17 1c5da: 0f 91 pop r16 1c5dc: ff 90 pop r15 1c5de: ef 90 pop r14 1c5e0: df 90 pop r13 1c5e2: cf 90 pop r12 1c5e4: bf 90 pop r11 1c5e6: af 90 pop r10 1c5e8: 9f 90 pop r9 1c5ea: 8f 90 pop r8 1c5ec: 7f 90 pop r7 1c5ee: 6f 90 pop r6 1c5f0: 5f 90 pop r5 1c5f2: 4f 90 pop r4 1c5f4: 3f 90 pop r3 1c5f6: 2f 90 pop r2 1c5f8: 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; 1c5fa: 0e 94 91 de call 0x1bd22 ; 0x1bd22 1c5fe: 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) { 1c600: 89 2b or r24, r25 1c602: 09 f0 breq .+2 ; 0x1c606 1c604: b3 cf rjmp .-154 ; 0x1c56c 1c606: a8 cf rjmp .-176 ; 0x1c558 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) { 1c608: 0f 94 89 0b call 0x21712 ; 0x21712 1c60c: 64 19 sub r22, r4 1c60e: 75 09 sbc r23, r5 1c610: 86 09 sbc r24, r6 1c612: 97 09 sbc r25, r7 1c614: 61 33 cpi r22, 0x31 ; 49 1c616: 75 47 sbci r23, 0x75 ; 117 1c618: 81 05 cpc r24, r1 1c61a: 91 05 cpc r25, r1 1c61c: 08 f4 brcc .+2 ; 0x1c620 1c61e: ba cf rjmp .-140 ; 0x1c594 current_selection = LCD_BUTTON_TIMEOUT; 1c620: 33 24 eor r3, r3 1c622: 3a 94 dec r3 1c624: c8 cf rjmp .-112 ; 0x1c5b6 goto exit; } if (lcd_encoder) { if (msg_next == NULL) { 1c626: 2d 81 ldd r18, Y+5 ; 0x05 1c628: 3e 81 ldd r19, Y+6 ; 0x06 1c62a: 23 2b or r18, r19 1c62c: f9 f4 brne .+62 ; 0x1c66c if (third_choice) { // third_choice is not nullptr, safe to dereference 1c62e: e1 14 cp r14, r1 1c630: f1 04 cpc r15, r1 1c632: b1 f0 breq .+44 ; 0x1c660 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 1c634: 97 ff sbrs r25, 7 1c636: 0f c0 rjmp .+30 ; 0x1c656 1c638: 31 10 cpse r3, r1 // Rotating knob counter clockwise current_selection--; 1c63a: 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); 1c63c: 87 01 movw r16, r14 1c63e: 22 2d mov r18, r2 1c640: a4 01 movw r20, r8 1c642: 6a 81 ldd r22, Y+2 ; 0x02 1c644: 7b 81 ldd r23, Y+3 ; 0x03 1c646: 83 2d mov r24, r3 1c648: 0e 94 59 dd call 0x1bab2 ; 0x1bab2 lcd_encoder = 0; 1c64c: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1c650: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e 1c654: a6 cf rjmp .-180 ; 0x1c5a2 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) { 1c656: 32 e0 ldi r19, 0x02 ; 2 1c658: 33 16 cp r3, r19 1c65a: 81 f3 breq .-32 ; 0x1c63c // Rotating knob clockwise current_selection++; 1c65c: 33 94 inc r3 1c65e: ee cf rjmp .-36 ; 0x1c63c } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 1c660: 39 2e mov r3, r25 1c662: 30 94 com r3 1c664: 33 1c adc r3, r3 1c666: 33 24 eor r3, r3 1c668: 33 1c adc r3, r3 1c66a: e8 cf rjmp .-48 ; 0x1c63c } } 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); 1c66c: 87 e0 ldi r24, 0x07 ; 7 1c66e: 0f 94 3f 23 call 0x2467e ; 0x2467e goto exit; } else break; } } if (multi_screen) { 1c672: c1 14 cp r12, r1 1c674: d1 04 cpc r13, r1 1c676: 79 f4 brne .+30 ; 0x1c696 1c678: 84 cf rjmp .-248 ; 0x1c582 1c67a: 99 81 ldd r25, Y+1 ; 0x01 1c67c: 91 50 subi r25, 0x01 ; 1 1c67e: 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) { 1c680: 91 11 cpse r25, r1 1c682: 81 cf rjmp .-254 ; 0x1c586 goto exit; } else break; } } if (multi_screen) { 1c684: c1 14 cp r12, r1 1c686: d1 04 cpc r13, r1 1c688: 61 f0 breq .+24 ; 0x1c6a2 if (msg_next == NULL) { 1c68a: 2d 81 ldd r18, Y+5 ; 0x05 1c68c: 3e 81 ldd r19, Y+6 ; 0x06 1c68e: 23 2b or r18, r19 1c690: 11 f4 brne .+4 ; 0x1c696 1c692: be 82 std Y+6, r11 ; 0x06 1c694: ad 82 std Y+5, r10 ; 0x05 msg_next = msg; } msg_next = lcd_display_message_fullscreen_P(msg_next); 1c696: 8d 81 ldd r24, Y+5 ; 0x05 1c698: 9e 81 ldd r25, Y+6 ; 0x06 1c69a: 0e 94 91 de call 0x1bd22 ; 0x1bd22 1c69e: 9e 83 std Y+6, r25 ; 0x06 1c6a0: 8d 83 std Y+5, r24 ; 0x05 } if (msg_next == NULL) { 1c6a2: 8d 81 ldd r24, Y+5 ; 0x05 1c6a4: 9e 81 ldd r25, Y+6 ; 0x06 1c6a6: 89 2b or r24, r25 1c6a8: 09 f0 breq .+2 ; 0x1c6ac 1c6aa: 6b cf rjmp .-298 ; 0x1c582 lcd_show_choices_prompt_P(current_selection, first_choice, second_choice, second_col, third_choice); 1c6ac: 87 01 movw r16, r14 1c6ae: 22 2d mov r18, r2 1c6b0: a4 01 movw r20, r8 1c6b2: 6a 81 ldd r22, Y+2 ; 0x02 1c6b4: 7b 81 ldd r23, Y+3 ; 0x03 1c6b6: 83 2d mov r24, r3 1c6b8: 0e 94 59 dd call 0x1bab2 ; 0x1bab2 1c6bc: 62 cf rjmp .-316 ; 0x1c582 0001c6be : //! @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) { 1c6be: bf 92 push r11 1c6c0: cf 92 push r12 1c6c2: df 92 push r13 1c6c4: ef 92 push r14 1c6c6: ff 92 push r15 1c6c8: 0f 93 push r16 1c6ca: 1f 93 push r17 1c6cc: cf 93 push r28 1c6ce: df 93 push r29 1c6d0: ec 01 movw r28, r24 1c6d2: d6 2e mov r13, r22 1c6d4: 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); 1c6d6: 88 ea ldi r24, 0xA8 ; 168 1c6d8: 98 e4 ldi r25, 0x48 ; 72 1c6da: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c6de: 8c 01 movw r16, r24 1c6e0: 82 ea ldi r24, 0xA2 ; 162 1c6e2: 98 e4 ldi r25, 0x48 ; 72 1c6e4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c6e8: 2a e0 ldi r18, 0x0A ; 10 1c6ea: c2 2e mov r12, r18 1c6ec: f1 2c mov r15, r1 1c6ee: e1 2c mov r14, r1 1c6f0: 9c 01 movw r18, r24 1c6f2: 4b 2d mov r20, r11 1c6f4: 6d 2d mov r22, r13 1c6f6: ce 01 movw r24, r28 1c6f8: 0e 94 8c e2 call 0x1c518 ; 0x1c518 } 1c6fc: df 91 pop r29 1c6fe: cf 91 pop r28 1c700: 1f 91 pop r17 1c702: 0f 91 pop r16 1c704: ff 90 pop r15 1c706: ef 90 pop r14 1c708: df 90 pop r13 1c70a: cf 90 pop r12 1c70c: bf 90 pop r11 1c70e: 08 95 ret 0001c710 : crashdet_use_eeprom_setting(); } #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) 1c710: cf 93 push r28 1c712: 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) 1c714: 88 ef ldi r24, 0xF8 ; 248 1c716: 9b e4 ldi r25, 0x4B ; 75 1c718: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c71c: 40 e0 ldi r20, 0x00 ; 0 1c71e: 60 e0 ldi r22, 0x00 ; 0 1c720: 0e 94 5f e3 call 0x1c6be ; 0x1c6be 1c724: 81 11 cpse r24, r1 1c726: 20 c0 rjmp .+64 ; 0x1c768 #endif //(LANG_MODE == 0) void lang_boot_update_start(uint8_t lang) { uint8_t cnt = lang_get_count(); 1c728: 0e 94 fc 74 call 0xe9f8 ; 0xe9f8 if ((lang < 2) || (lang > cnt)) return; //only languages from xflash can be selected 1c72c: c2 30 cpi r28, 0x02 ; 2 1c72e: e0 f0 brcs .+56 ; 0x1c768 1c730: 8c 17 cp r24, r28 1c732: d0 f0 brcs .+52 ; 0x1c768 softReset(); } void bootapp_reboot_user0(uint8_t reserved) { cli(); 1c734: f8 94 cli boot_app_magic = BOOT_APP_MAGIC; 1c736: 8a ea ldi r24, 0xAA ; 170 1c738: 95 e5 ldi r25, 0x55 ; 85 1c73a: dc 01 movw r26, r24 1c73c: 80 93 fc 1f sts 0x1FFC, r24 ; 0x801ffc <__bss_end+0x8e5> 1c740: 90 93 fd 1f sts 0x1FFD, r25 ; 0x801ffd <__bss_end+0x8e6> 1c744: a0 93 fe 1f sts 0x1FFE, r26 ; 0x801ffe <__bss_end+0x8e7> 1c748: b0 93 ff 1f sts 0x1FFF, r27 ; 0x801fff <__bss_end+0x8e8> boot_app_flags = BOOT_APP_FLG_USER0; 1c74c: 80 e8 ldi r24, 0x80 ; 128 1c74e: 80 93 fb 1f sts 0x1FFB, r24 ; 0x801ffb <__bss_end+0x8e4> boot_copy_size = 0; 1c752: 10 92 f9 1f sts 0x1FF9, r1 ; 0x801ff9 <__bss_end+0x8e2> 1c756: 10 92 f8 1f sts 0x1FF8, r1 ; 0x801ff8 <__bss_end+0x8e1> bootapp_reboot_user0(lang << 3); 1c75a: cc 0f add r28, r28 1c75c: cc 0f add r28, r28 1c75e: cc 0f add r28, r28 boot_reserved = reserved; 1c760: c0 93 fa 1f sts 0x1FFA, r28 ; 0x801ffa <__bss_end+0x8e3> // bootapp_print_vars(); softReset(); 1c764: 0e 94 70 66 call 0xcce0 ; 0xcce0 lang_boot_update_start(lang); lcd_update_enable(true); 1c768: 81 e0 ldi r24, 0x01 ; 1 1c76a: 0e 94 89 70 call 0xe112 ; 0xe112 menu_goto(lcd_language_menu, 0, true, true); 1c76e: 21 e0 ldi r18, 0x01 ; 1 1c770: 41 e0 ldi r20, 0x01 ; 1 1c772: 70 e0 ldi r23, 0x00 ; 0 1c774: 60 e0 ldi r22, 0x00 ; 0 1c776: 83 ec ldi r24, 0xC3 ; 195 1c778: 93 ee ldi r25, 0xE3 ; 227 1c77a: 0e 94 08 63 call 0xc610 ; 0xc610 1c77e: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout } } 1c782: cf 91 pop r28 1c784: 08 95 ret 0001c786 : } #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { 1c786: cf 93 push r28 1c788: df 93 push r29 MENU_BEGIN(); 1c78a: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 1c78e: 10 92 60 04 sts 0x0460, r1 ; 0x800460 1c792: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1c796: 84 30 cpi r24, 0x04 ; 4 1c798: 08 f0 brcs .+2 ; 0x1c79c 1c79a: 5c c0 rjmp .+184 ; 0x1c854 1c79c: 10 92 63 04 sts 0x0463, r1 ; 0x800463 if (lang_is_selected()) MENU_ITEM_BACK_P(_T(MSG_SETTINGS)); // 1c7a0: 0e 94 7f 74 call 0xe8fe ; 0xe8fe 1c7a4: 88 23 and r24, r24 1c7a6: 31 f0 breq .+12 ; 0x1c7b4 1c7a8: 87 e9 ldi r24, 0x97 ; 151 1c7aa: 98 e4 ldi r25, 0x48 ; 72 1c7ac: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c7b0: 0e 94 1f 73 call 0xe63e ; 0xe63e if (menu_item_text_P(lang_get_name_by_code(lang_get_code(0)))) //primary language 1c7b4: 8e e6 ldi r24, 0x6E ; 110 1c7b6: 95 e6 ldi r25, 0x65 ; 101 1c7b8: 0e 94 95 74 call 0xe92a ; 0xe92a 1c7bc: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1c7c0: 88 23 and r24, r24 1c7c2: 49 f0 breq .+18 ; 0x1c7d6 #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 1c7c4: 80 e0 ldi r24, 0x00 ; 0 1c7c6: 0e 94 1f 75 call 0xea3e ; 0xea3e 1c7ca: 81 11 cpse r24, r1 1c7cc: 43 c0 rjmp .+134 ; 0x1c854 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1c7ce: df 91 pop r29 1c7d0: cf 91 pop r28 1c7d2: 0c 94 88 e3 jmp 0x1c710 ; 0x1c710 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(); 1c7d6: 0e 94 fc 74 call 0xe9f8 ; 0xe9f8 1c7da: 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) 1c7dc: c1 e0 ldi r28, 0x01 ; 1 1c7de: cd 17 cp r28, r29 1c7e0: 60 f5 brcc .+88 ; 0x1c83a 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; 1c7e2: 80 e0 ldi r24, 0x00 ; 0 1c7e4: 91 e0 ldi r25, 0x01 ; 1 uint8_t count = 1; //count = 1 (primary) 1c7e6: 21 e0 ldi r18, 0x01 ; 1 while (pgm_read_dword((uint32_t*)table) == LANG_MAGIC) //magic valid 1c7e8: fc 01 movw r30, r24 1c7ea: 45 91 lpm r20, Z+ 1c7ec: 55 91 lpm r21, Z+ 1c7ee: 65 91 lpm r22, Z+ 1c7f0: 74 91 lpm r23, Z 1c7f2: 45 3a cpi r20, 0xA5 ; 165 1c7f4: 5a 45 sbci r21, 0x5A ; 90 1c7f6: 64 4b sbci r22, 0xB4 ; 180 1c7f8: 7b 44 sbci r23, 0x4B ; 75 1c7fa: 19 f0 breq .+6 ; 0x1c802 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; 1c7fc: 8f e3 ldi r24, 0x3F ; 63 1c7fe: 9f e3 ldi r25, 0x3F ; 63 1c800: 06 c0 rjmp .+12 ; 0x1c80e #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 1c802: fc 01 movw r30, r24 1c804: c2 13 cpse r28, r18 1c806: 10 c0 rjmp .+32 ; 0x1c828 1c808: 3a 96 adiw r30, 0x0a ; 10 1c80a: 85 91 lpm r24, Z+ 1c80c: 94 91 lpm r25, Z #endif //XFLASH if (menu_item_text_P(lang_get_name_by_code(lang_get_code(i)))) 1c80e: 0e 94 95 74 call 0xe92a ; 0xe92a 1c812: 0e 94 72 73 call 0xe6e4 ; 0xe6e4 1c816: 88 23 and r24, r24 1c818: 71 f0 breq .+28 ; 0x1c836 #endif //TMC2130 #if (LANG_MODE != 0) static void menu_setlang(uint8_t lang) { if (!lang_select(lang)) 1c81a: 8c 2f mov r24, r28 1c81c: 0e 94 1f 75 call 0xea3e ; 0xea3e 1c820: 81 11 cpse r24, r1 1c822: 18 c0 rjmp .+48 ; 0x1c854 1c824: 8c 2f mov r24, r28 1c826: d3 cf rjmp .-90 ; 0x1c7ce table += pgm_read_word((uint16_t*)(table + 4)); 1c828: 34 96 adiw r30, 0x04 ; 4 1c82a: 45 91 lpm r20, Z+ 1c82c: 54 91 lpm r21, Z 1c82e: 84 0f add r24, r20 1c830: 95 1f adc r25, r21 count++; 1c832: 2f 5f subi r18, 0xFF ; 255 1c834: d9 cf rjmp .-78 ; 0x1c7e8 } } 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) 1c836: cf 5f subi r28, 0xFF ; 255 1c838: d2 cf rjmp .-92 ; 0x1c7de #ifdef XFLASH MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); 1c83a: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL static void lcd_language_menu() { MENU_BEGIN(); 1c83e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1c842: 8f 5f subi r24, 0xFF ; 255 1c844: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1c848: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1c84c: 8f 5f subi r24, 0xFF ; 255 1c84e: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1c852: 9f cf rjmp .-194 ; 0x1c792 MENU_ITEM_SUBMENU_P(_T(MSG_COMMUNITY_MADE), lcd_community_language_menu); #endif //XFLASH #endif //COMMUNITY_LANGUAGE_SUPPORT && W52X20CL MENU_END(); } 1c854: df 91 pop r29 1c856: cf 91 pop r28 1c858: 08 95 ret 0001c85a : MENU_ITEM_FUNCTION_P(_T(MSG_YES), lcd_print_stop); MENU_END(); } void lcd_sdcard_menu() { 1c85a: 2f 92 push r2 1c85c: 3f 92 push r3 1c85e: 4f 92 push r4 1c860: 5f 92 push r5 1c862: 6f 92 push r6 1c864: 7f 92 push r7 1c866: 8f 92 push r8 1c868: 9f 92 push r9 1c86a: af 92 push r10 1c86c: bf 92 push r11 1c86e: cf 92 push r12 1c870: df 92 push r13 1c872: ef 92 push r14 1c874: ff 92 push r15 1c876: 0f 93 push r16 1c878: 1f 93 push r17 1c87a: cf 93 push r28 1c87c: df 93 push r29 1c87e: cd b7 in r28, 0x3d ; 61 1c880: de b7 in r29, 0x3e ; 62 1c882: 2d 97 sbiw r28, 0x0d ; 13 1c884: 0f b6 in r0, 0x3f ; 63 1c886: f8 94 cli 1c888: de bf out 0x3e, r29 ; 62 1c88a: 0f be out 0x3f, r0 ; 63 1c88c: 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) 1c88e: 80 91 96 03 lds r24, 0x0396 ; 0x800396 1c892: 81 30 cpi r24, 0x01 ; 1 1c894: 51 f1 breq .+84 ; 0x1c8ea 1c896: 30 f0 brcs .+12 ; 0x1c8a4 1c898: 82 30 cpi r24, 0x02 ; 2 1c89a: 09 f4 brne .+2 ; 0x1c89e 1c89c: 88 c2 rjmp .+1296 ; 0x1cdae { _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. 1c89e: 10 92 96 03 sts 0x0396, r1 ; 0x800396 1c8a2: 04 c1 rjmp .+520 ; 0x1caac switch(_md->menuState) { case _uninitialized: //Initialize menu data { if (card.presort_flag == true) //used to force resorting if sorting type is changed. 1c8a4: 80 91 26 14 lds r24, 0x1426 ; 0x801426 1c8a8: 88 23 and r24, r24 1c8aa: 49 f0 breq .+18 ; 0x1c8be { card.presort_flag = false; 1c8ac: 10 92 26 14 sts 0x1426, r1 ; 0x801426 lcd_update_enabled = false; 1c8b0: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a card.presort(); 1c8b4: 0f 94 d0 6e call 0x2dda0 ; 0x2dda0 lcd_update_enabled = true; 1c8b8: 81 e0 ldi r24, 0x01 ; 1 1c8ba: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a } _md->fileCnt = card.getnrfilenames(); 1c8be: 0f 94 ed 6b call 0x2d7da ; 0x2d7da 1c8c2: 90 93 9e 03 sts 0x039E, r25 ; 0x80039e 1c8c6: 80 93 9d 03 sts 0x039D, r24 ; 0x80039d _md->sdSort = farm_mode ? SD_SORT_NONE : eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 1c8ca: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1c8ce: 81 11 cpse r24, r1 1c8d0: e7 c0 rjmp .+462 ; 0x1caa0 1c8d2: 89 e0 ldi r24, 0x09 ; 9 1c8d4: 9f e0 ldi r25, 0x0F ; 15 1c8d6: 0f 94 81 a4 call 0x34902 ; 0x34902 1c8da: 80 93 a0 03 sts 0x03A0, r24 ; 0x8003a0 _md->menuState = _standard; 1c8de: 81 e0 ldi r24, 0x01 ; 1 1c8e0: 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. 1c8e4: 8f ef ldi r24, 0xFF ; 255 1c8e6: 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. 1c8ea: 80 91 a1 03 lds r24, 0x03A1 ; 0x8003a1 1c8ee: 81 11 cpse r24, r1 1c8f0: 07 c0 rjmp .+14 ; 0x1c900 { _md->lcd_scrollTimer.start(); 1c8f2: 81 ea ldi r24, 0xA1 ; 161 1c8f4: 93 e0 ldi r25, 0x03 ; 3 1c8f6: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> lcd_draw_update = 1; 1c8fa: 81 e0 ldi r24, 0x01 ; 1 1c8fc: 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. 1c900: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1c904: 81 11 cpse r24, r1 1c906: 21 c0 rjmp .+66 ; 0x1c94a 1c908: 64 ef ldi r22, 0xF4 ; 244 1c90a: 71 e0 ldi r23, 0x01 ; 1 1c90c: 81 ea ldi r24, 0xA1 ; 161 1c90e: 93 e0 ldi r25, 0x03 ; 3 1c910: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 1c914: 88 23 and r24, r24 1c916: a1 f0 breq .+40 ; 0x1c940 1c918: 80 91 9f 03 lds r24, 0x039F ; 0x80039f 1c91c: 8f 3f cpi r24, 0xFF ; 255 1c91e: 81 f0 breq .+32 ; 0x1c940 { _md->menuState = _scrolling; 1c920: 82 e0 ldi r24, 0x02 ; 2 1c922: 80 93 96 03 sts 0x0396, r24 ; 0x800396 _md->offset = 0; 1c926: 10 92 97 03 sts 0x0397, r1 ; 0x800397 _md->scrollPointer = NULL; 1c92a: 10 92 9a 03 sts 0x039A, r1 ; 0x80039a 1c92e: 10 92 99 03 sts 0x0399, r1 ; 0x800399 _md->lcd_scrollTimer.start(); 1c932: 81 ea ldi r24, 0xA1 ; 161 1c934: 93 e0 ldi r25, 0x03 ; 3 1c936: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> lcd_draw_update = 1; //forces last load before switching to scrolling. 1c93a: 81 e0 ldi r24, 0x01 ; 1 1c93c: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } if (lcd_draw_update == 0 && !lcd_clicked()) 1c940: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1c944: 88 23 and r24, r24 1c946: 09 f4 brne .+2 ; 0x1c94a 1c948: ad c0 rjmp .+346 ; 0x1caa4 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. 1c94a: 8f ef ldi r24, 0xFF ; 255 1c94c: 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(); 1c950: 81 ea ldi r24, 0xA1 ; 161 1c952: 93 e0 ldi r25, 0x03 ; 3 1c954: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> MENU_BEGIN(); 1c958: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 1c95c: 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); 1c960: ce 01 movw r24, r28 1c962: 01 96 adiw r24, 0x01 ; 1 1c964: 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); 1c966: fb e0 ldi r31, 0x0B ; 11 1c968: 2f 2e mov r2, r31 1c96a: fd e6 ldi r31, 0x6D ; 109 1c96c: 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(); 1c96e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1c972: 84 30 cpi r24, 0x04 ; 4 1c974: 08 f0 brcs .+2 ; 0x1c978 1c976: 9a c0 rjmp .+308 ; 0x1caac 1c978: 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 1c97c: 80 91 c9 03 lds r24, 0x03C9 ; 0x8003c9 1c980: 88 23 and r24, r24 1c982: 09 f4 brne .+2 ; 0x1c986 1c984: ac c0 rjmp .+344 ; 0x1cade 1c986: 89 ef ldi r24, 0xF9 ; 249 1c988: 98 e4 ldi r25, 0x48 ; 72 1c98a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c98e: 0e 94 1f 73 call 0xe63e ; 0xe63e 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;}; 1c992: 69 ed ldi r22, 0xD9 ; 217 1c994: 73 e1 ldi r23, 0x13 ; 19 1c996: 82 e8 ldi r24, 0x82 ; 130 1c998: 94 e1 ldi r25, 0x14 ; 20 1c99a: 0f 94 7e 2c call 0x258fc ; 0x258fc card.getWorkDirName(); if (card.filename[0] == '/') 1c99e: 80 91 d9 13 lds r24, 0x13D9 ; 0x8013d9 1c9a2: 8f 32 cpi r24, 0x2F ; 47 1c9a4: 09 f0 breq .+2 ; 0x1c9a8 1c9a6: 9e c0 rjmp .+316 ; 0x1cae4 { #if SDCARDDETECT == -1 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); #else if (card.ToshibaFlashAir_isEnabled()) 1c9a8: 80 91 48 16 lds r24, 0x1648 ; 0x801648 1c9ac: 88 23 and r24, r24 1c9ae: 41 f0 breq .+16 ; 0x1c9c0 MENU_ITEM_FUNCTION_P(_T(MSG_REFRESH), lcd_sd_refresh); //show the refresh option if in flashAir mode. 1c9b0: 8e ee ldi r24, 0xEE ; 238 1c9b2: 98 e4 ldi r25, 0x48 ; 72 1c9b4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1c9b8: 65 e4 ldi r22, 0x45 ; 69 1c9ba: 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. 1c9bc: 0e 94 ee 72 call 0xe5dc ; 0xe5dc for (uint16_t i = _md->fileCnt; i-- > 0;) // Every file, from top to bottom. 1c9c0: c0 90 9d 03 lds r12, 0x039D ; 0x80039d 1c9c4: 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; 1c9c8: 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. 1c9ca: 91 e0 ldi r25, 0x01 ; 1 1c9cc: c9 1a sub r12, r25 1c9ce: d1 08 sbc r13, r1 1c9d0: 08 f4 brcc .+2 ; 0x1c9d4 1c9d2: e0 c1 rjmp .+960 ; 0x1cd94 { if (menu_item == menu_line) //If the file is on the screen. 1c9d4: 80 91 63 04 lds r24, 0x0463 ; 0x800463 1c9d8: 90 91 62 04 lds r25, 0x0462 ; 0x800462 1c9dc: 89 13 cpse r24, r25 1c9de: d6 c1 rjmp .+940 ; 0x1cd8c { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(i, _md->sdSort); 1c9e0: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 1c9e4: c6 01 movw r24, r12 1c9e6: 0f 94 47 77 call 0x2ee8e ; 0x2ee8e #else card.getfilename(i); #endif if (lcd_encoder == menu_item) //If the file is selected. 1c9ea: 80 91 63 04 lds r24, 0x0463 ; 0x800463 1c9ee: 90 e0 ldi r25, 0x00 ; 0 1c9f0: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1c9f4: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1c9f8: 10 91 23 14 lds r17, 0x1423 ; 0x801423 1c9fc: 82 17 cp r24, r18 1c9fe: 93 07 cpc r25, r19 1ca00: 51 f4 brne .+20 ; 0x1ca16 { _md->selectedFileID = i; 1ca02: d0 92 9c 03 sts 0x039C, r13 ; 0x80039c 1ca06: c0 92 9b 03 sts 0x039B, r12 ; 0x80039b _md->isDir = card.filenameIsDir; 1ca0a: 10 93 98 03 sts 0x0398, r17 ; 0x800398 _md->row = menu_row; 1ca0e: 40 91 60 04 lds r20, 0x0460 ; 0x800460 1ca12: 40 93 9f 03 sts 0x039F, r20 ; 0x80039f 1ca16: 40 91 59 02 lds r20, 0x0259 ; 0x800259 } if (card.filenameIsDir) 1ca1a: 11 23 and r17, r17 1ca1c: 09 f4 brne .+2 ; 0x1ca20 1ca1e: 67 c0 rjmp .+206 ; 0x1caee #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) 1ca20: 44 23 and r20, r20 1ca22: e9 f0 breq .+58 ; 0x1ca5e { lcd_implementation_drawmenu_sddirectory(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1ca24: 40 91 ee 13 lds r20, 0x13EE ; 0x8013ee 1ca28: e9 ed ldi r30, 0xD9 ; 217 1ca2a: ae 2e mov r10, r30 1ca2c: e3 e1 ldi r30, 0x13 ; 19 1ca2e: be 2e mov r11, r30 1ca30: 44 23 and r20, r20 1ca32: 21 f0 breq .+8 ; 0x1ca3c 1ca34: 7e ee ldi r23, 0xEE ; 238 1ca36: a7 2e mov r10, r23 1ca38: 73 e1 ldi r23, 0x13 ; 19 1ca3a: b7 2e mov r11, r23 1ca3c: 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)?'>':' '); 1ca40: 4e e3 ldi r20, 0x3E ; 62 1ca42: 82 17 cp r24, r18 1ca44: 93 07 cpc r25, r19 1ca46: 09 f0 breq .+2 ; 0x1ca4a 1ca48: 40 e2 ldi r20, 0x20 ; 32 1ca4a: 80 e0 ldi r24, 0x00 ; 0 1ca4c: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_putc(LCD_STR_FOLDER[0]); 1ca50: 85 e8 ldi r24, 0x85 ; 133 1ca52: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_print_pad(longFilename, len); 1ca56: 62 e1 ldi r22, 0x12 ; 18 1ca58: c5 01 movw r24, r10 1ca5a: 0e 94 98 73 call 0xe730 ; 0xe730 1ca5e: 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)) 1ca62: 90 91 61 04 lds r25, 0x0461 ; 0x800461 1ca66: 99 23 and r25, r25 1ca68: 09 f4 brne .+2 ; 0x1ca6c 1ca6a: 90 c1 rjmp .+800 ; 0x1cd8c 1ca6c: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1ca70: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1ca74: 82 17 cp r24, r18 1ca76: 13 06 cpc r1, r19 1ca78: 09 f0 breq .+2 ; 0x1ca7c 1ca7a: 88 c1 rjmp .+784 ; 0x1cd8c { lcd_update_enabled = false; 1ca7c: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a lcd_return_to_status(); } void menu_action_sddirectory(const char* filename) { card.chdir(filename, true); 1ca80: 61 e0 ldi r22, 0x01 ; 1 1ca82: 89 ed ldi r24, 0xD9 ; 217 1ca84: 93 e1 ldi r25, 0x13 ; 19 1ca86: 0f 94 5a 70 call 0x2e0b4 ; 0x2e0b4 lcd_encoder = 0; 1ca8a: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1ca8e: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e menu_data_reset(); //Forces reloading of cached variables. 1ca92: 0e 94 00 63 call 0xc600 ; 0xc600 } if (menu_clicked && (lcd_encoder == menu_item)) { lcd_update_enabled = false; menu_action_sdfile(str_fn); lcd_update_enabled = true; 1ca96: 00 93 5a 02 sts 0x025A, r16 ; 0x80025a menu_item_ret(); 1ca9a: 0e 94 c4 62 call 0xc588 ; 0xc588 1ca9e: 95 cf rjmp .-214 ; 0x1c9ca 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); 1caa0: 82 e0 ldi r24, 0x02 ; 2 1caa2: 1b cf rjmp .-458 ; 0x1c8da _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()) 1caa4: 0e 94 c6 73 call 0xe78c ; 0xe78c 1caa8: 81 11 cpse r24, r1 1caaa: 4f cf rjmp .-354 ; 0x1c94a _md->menuState = _standard; } } break; default: _md->menuState = _uninitialized; //shouldn't ever happen. Anyways, initialize the menu. } } 1caac: 2d 96 adiw r28, 0x0d ; 13 1caae: 0f b6 in r0, 0x3f ; 63 1cab0: f8 94 cli 1cab2: de bf out 0x3e, r29 ; 62 1cab4: 0f be out 0x3f, r0 ; 63 1cab6: cd bf out 0x3d, r28 ; 61 1cab8: df 91 pop r29 1caba: cf 91 pop r28 1cabc: 1f 91 pop r17 1cabe: 0f 91 pop r16 1cac0: ff 90 pop r15 1cac2: ef 90 pop r14 1cac4: df 90 pop r13 1cac6: cf 90 pop r12 1cac8: bf 90 pop r11 1caca: af 90 pop r10 1cacc: 9f 90 pop r9 1cace: 8f 90 pop r8 1cad0: 7f 90 pop r7 1cad2: 6f 90 pop r6 1cad4: 5f 90 pop r5 1cad6: 4f 90 pop r4 1cad8: 3f 90 pop r3 1cada: 2f 90 pop r2 1cadc: 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 1cade: 82 e0 ldi r24, 0x02 ; 2 1cae0: 9b e4 ldi r25, 0x4B ; 75 1cae2: 53 cf rjmp .-346 ; 0x1c98a 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. 1cae4: 6f e4 ldi r22, 0x4F ; 79 1cae6: 7d ec ldi r23, 0xCD ; 205 1cae8: 88 e8 ldi r24, 0x88 ; 136 1caea: 94 e8 ldi r25, 0x84 ; 132 1caec: 67 cf rjmp .-306 ; 0x1c9bc menu_item++; } static void menu_item_sdfile(const char* str_fn, char* str_fnl) { if (lcd_draw_update) 1caee: 44 23 and r20, r20 1caf0: d1 f0 breq .+52 ; 0x1cb26 { lcd_implementation_drawmenu_sdfile(menu_row, (str_fnl[0] == '\0') ? str_fn : str_fnl); 1caf2: 40 91 ee 13 lds r20, 0x13EE ; 0x8013ee 1caf6: 69 ed ldi r22, 0xD9 ; 217 1caf8: a6 2e mov r10, r22 1cafa: 63 e1 ldi r22, 0x13 ; 19 1cafc: b6 2e mov r11, r22 1cafe: 44 23 and r20, r20 1cb00: 21 f0 breq .+8 ; 0x1cb0a 1cb02: 5e ee ldi r21, 0xEE ; 238 1cb04: a5 2e mov r10, r21 1cb06: 53 e1 ldi r21, 0x13 ; 19 1cb08: b5 2e mov r11, r21 1cb0a: 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)?'>':' '); 1cb0e: 4e e3 ldi r20, 0x3E ; 62 1cb10: 82 17 cp r24, r18 1cb12: 93 07 cpc r25, r19 1cb14: 09 f0 breq .+2 ; 0x1cb18 1cb16: 40 e2 ldi r20, 0x20 ; 32 1cb18: 80 e0 ldi r24, 0x00 ; 0 1cb1a: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_print_pad(longFilename, len); 1cb1e: 63 e1 ldi r22, 0x13 ; 19 1cb20: c5 01 movw r24, r10 1cb22: 0e 94 98 73 call 0xe730 ; 0xe730 1cb26: 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)) 1cb2a: 90 91 61 04 lds r25, 0x0461 ; 0x800461 1cb2e: 99 23 and r25, r25 1cb30: 09 f4 brne .+2 ; 0x1cb34 1cb32: 2c c1 rjmp .+600 ; 0x1cd8c 1cb34: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 1cb38: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 1cb3c: 82 17 cp r24, r18 1cb3e: 13 06 cpc r1, r19 1cb40: 09 f0 breq .+2 ; 0x1cb44 1cb42: 24 c1 rjmp .+584 ; 0x1cd8c { lcd_update_enabled = false; 1cb44: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a return result; } static void menu_action_sdfile(const char* filename) { if(eFilamentAction != FilamentAction::None) return; 1cb48: 80 91 94 03 lds r24, 0x0394 ; 0x800394 1cb4c: 81 11 cpse r24, r1 1cb4e: a3 cf rjmp .-186 ; 0x1ca96 // 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); 1cb50: 69 ed ldi r22, 0xD9 ; 217 1cb52: 73 e1 ldi r23, 0x13 ; 19 1cb54: c7 01 movw r24, r14 1cb56: 0f 94 ec aa call 0x355d8 ; 0x355d8 1cb5a: 47 01 movw r8, r14 1cb5c: 45 e9 ldi r20, 0x95 ; 149 1cb5e: a4 2e mov r10, r20 1cb60: 4f e0 ldi r20, 0x0F ; 15 1cb62: 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] == '.') { 1cb64: f4 01 movw r30, r8 1cb66: 61 91 ld r22, Z+ 1cb68: 4f 01 movw r8, r30 1cb6a: 66 23 and r22, r22 1cb6c: 19 f0 breq .+6 ; 0x1cb74 1cb6e: 6e 32 cpi r22, 0x2E ; 46 1cb70: 09 f0 breq .+2 ; 0x1cb74 1cb72: 4b c0 rjmp .+150 ; 0x1cc0a 1cb74: 60 e0 ldi r22, 0x00 ; 0 1cb76: c5 01 movw r24, r10 1cb78: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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, '.'); 1cb7c: 6e e2 ldi r22, 0x2E ; 46 1cb7e: 70 e0 ldi r23, 0x00 ; 0 1cb80: c7 01 movw r24, r14 1cb82: 0f 94 d8 aa call 0x355b0 ; 0x355b0 1cb86: 3c 01 movw r6, r24 if (extension_ptr) { 1cb88: 89 2b or r24, r25 1cb8a: 19 f0 breq .+6 ; 0x1cb92 extension_ptr++; // skip the '.' 1cb8c: 8f ef ldi r24, 0xFF ; 255 1cb8e: 68 1a sub r6, r24 1cb90: 78 0a sbc r7, r24 1cb92: 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); 1cb94: 31 e9 ldi r19, 0x91 ; 145 1cb96: a3 2e mov r10, r19 1cb98: 3c e0 ldi r19, 0x0C ; 12 1cb9a: 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') { 1cb9c: 61 14 cp r6, r1 1cb9e: 71 04 cpc r7, r1 1cba0: 21 f0 breq .+8 ; 0x1cbaa 1cba2: f4 01 movw r30, r8 1cba4: 60 81 ld r22, Z 1cba6: 61 11 cpse r22, r1 1cba8: 01 c0 rjmp .+2 ; 0x1cbac 1cbaa: 60 e0 ldi r22, 0x00 ; 0 1cbac: c5 01 movw r24, r10 1cbae: 0f 94 a5 a4 call 0x3494a ; 0x3494a 1cbb2: ff ef ldi r31, 0xFF ; 255 1cbb4: af 1a sub r10, r31 1cbb6: bf 0a sbc r11, r31 1cbb8: 2f ef ldi r18, 0xFF ; 255 1cbba: 82 1a sub r8, r18 1cbbc: 92 0a sbc r9, r18 if (extension_ptr) { extension_ptr++; // skip the '.' } for (uint_least8_t i = 0; i < 3; i++) 1cbbe: 84 e9 ldi r24, 0x94 ; 148 1cbc0: a8 16 cp r10, r24 1cbc2: 8c e0 ldi r24, 0x0C ; 12 1cbc4: b8 06 cpc r11, r24 1cbc6: 51 f7 brne .-44 ; 0x1cb9c { workDirParents[level].getFilename(name); } uint8_t CardReader::getWorkDirDepth() { return workDirDepth; 1cbc8: 60 90 77 15 lds r6, 0x1577 ; 0x801577 1cbcc: 66 2d mov r22, r6 1cbce: 8a e5 ldi r24, 0x5A ; 90 1cbd0: 9f e0 ldi r25, 0x0F ; 15 1cbd2: 0f 94 a5 a4 call 0x3494a ; 0x3494a 1cbd6: 85 ed ldi r24, 0xD5 ; 213 1cbd8: 93 e1 ldi r25, 0x13 ; 19 1cbda: 2a e0 ldi r18, 0x0A ; 10 1cbdc: a2 2e mov r10, r18 1cbde: 2f e0 ldi r18, 0x0F ; 15 1cbe0: 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++) { 1cbe2: 71 2c mov r7, r1 1cbe4: 4c 01 movw r8, r24 1cbe6: e9 e0 ldi r30, 0x09 ; 9 1cbe8: 8e 0e add r8, r30 1cbea: 91 1c adc r9, r1 1cbec: 76 14 cp r7, r6 1cbee: d1 f0 breq .+52 ; 0x1cc24 #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); 1cbf0: 48 e0 ldi r20, 0x08 ; 8 1cbf2: 50 e0 ldi r21, 0x00 ; 0 1cbf4: b5 01 movw r22, r10 1cbf6: 8e 5a subi r24, 0xAE ; 174 1cbf8: 9f 4f sbci r25, 0xFF ; 255 1cbfa: 0f 94 95 a4 call 0x3492a ; 0x3492a 1cbfe: 73 94 inc r7 1cc00: f8 e0 ldi r31, 0x08 ; 8 1cc02: af 0e add r10, r31 1cc04: b1 1c adc r11, r1 1cc06: c4 01 movw r24, r8 1cc08: ed cf rjmp .-38 ; 0x1cbe4 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1cc0a: c5 01 movw r24, r10 1cc0c: 0f 94 a5 a4 call 0x3494a ; 0x3494a 1cc10: ff ef ldi r31, 0xFF ; 255 1cc12: af 1a sub r10, r31 1cc14: 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++) { 1cc16: 2d e9 ldi r18, 0x9D ; 157 1cc18: a2 16 cp r10, r18 1cc1a: 2f e0 ldi r18, 0x0F ; 15 1cc1c: b2 06 cpc r11, r18 1cc1e: 09 f0 breq .+2 ; 0x1cc22 1cc20: a1 cf rjmp .-190 ; 0x1cb64 1cc22: ac cf rjmp .-168 ; 0x1cb7c /** End of menus **/ /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; 1cc24: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1cc28: 88 23 and r24, r24 1cc2a: 91 f0 breq .+36 ; 0x1cc50 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); 1cc2c: ff 92 push r15 1cc2e: ef 92 push r14 1cc30: 3f 92 push r3 1cc32: 2f 92 push r2 1cc34: 0e 94 28 8e call 0x11c50 ; 0x11c50 enquecommand_P(MSG_M24); 1cc38: 61 e0 ldi r22, 0x01 ; 1 1cc3a: 87 e0 ldi r24, 0x07 ; 7 1cc3c: 9d e6 ldi r25, 0x6D ; 109 1cc3e: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 1cc42: 0f 90 pop r0 1cc44: 0f 90 pop r0 1cc46: 0f 90 pop r0 1cc48: 0f 90 pop r0 } lcd_return_to_status(); 1cc4a: 0f 94 6e 05 call 0x20adc ; 0x20adc 1cc4e: 23 cf rjmp .-442 ; 0x1ca96 /** Menu action functions **/ static bool check_file(const char* filename) { if (farm_mode) return true; card.openFileReadFilteredGcode(filename, true); 1cc50: 61 e0 ldi r22, 0x01 ; 1 1cc52: c7 01 movw r24, r14 1cc54: 0f 94 91 71 call 0x2e322 ; 0x2e322 } uint32_t CardReader::getFileSize() { return filesize; 1cc58: 40 90 e4 16 lds r4, 0x16E4 ; 0x8016e4 1cc5c: 50 90 e5 16 lds r5, 0x16E5 ; 0x8016e5 1cc60: 60 90 e6 16 lds r6, 0x16E6 ; 0x8016e6 1cc64: 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); 1cc68: 94 2d mov r25, r4 1cc6a: 85 2d mov r24, r5 1cc6c: 21 e0 ldi r18, 0x01 ; 1 1cc6e: 42 16 cp r4, r18 1cc70: 28 e7 ldi r18, 0x78 ; 120 1cc72: 52 06 cpc r5, r18 1cc74: 61 04 cpc r6, r1 1cc76: 71 04 cpc r7, r1 1cc78: 10 f0 brcs .+4 ; 0x1cc7e 1cc7a: 90 e0 ldi r25, 0x00 ; 0 1cc7c: 88 e7 ldi r24, 0x78 ; 120 1cc7e: a9 2e mov r10, r25 1cc80: b8 2e mov r11, r24 if (filesize > END_FILE_SECTION) { 1cc82: 81 e0 ldi r24, 0x01 ; 1 1cc84: 48 16 cp r4, r24 1cc86: 88 e7 ldi r24, 0x78 ; 120 1cc88: 58 06 cpc r5, r24 1cc8a: 61 04 cpc r6, r1 1cc8c: 71 04 cpc r7, r1 1cc8e: 08 f4 brcc .+2 ; 0x1cc92 1cc90: 5d c0 rjmp .+186 ; 0x1cd4c startPos = filesize - END_FILE_SECTION; 1cc92: 98 e7 ldi r25, 0x78 ; 120 1cc94: 59 1a sub r5, r25 1cc96: 61 08 sbc r6, r1 1cc98: 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);}; 1cc9a: 40 92 eb 16 sts 0x16EB, r4 ; 0x8016eb 1cc9e: 50 92 ec 16 sts 0x16EC, r5 ; 0x8016ec 1cca2: 60 92 ed 16 sts 0x16ED, r6 ; 0x8016ed 1cca6: 70 92 ee 16 sts 0x16EE, r7 ; 0x8016ee 1ccaa: c3 01 movw r24, r6 1ccac: b2 01 movw r22, r4 1ccae: 0f 94 b5 67 call 0x2cf6a ; 0x2cf6a card.setIndex(startPos); } cmdqueue_reset(); 1ccb2: 0e 94 b5 83 call 0x1076a ; 0x1076a cmdqueue_serial_disabled = true; 1ccb6: 00 93 93 03 sts 0x0393, r16 ; 0x800393 menu_progressbar_init(bytesToCheck, _T(MSG_CHECKING_FILE)); 1ccba: 8a eb ldi r24, 0xBA ; 186 1ccbc: 98 e4 ldi r25, 0x48 ; 72 1ccbe: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1ccc2: bc 01 movw r22, r24 1ccc4: c5 01 movw r24, r10 1ccc6: 0e 94 62 72 call 0xe4c4 ; 0xe4c4 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; } 1ccca: 80 91 eb 16 lds r24, 0x16EB ; 0x8016eb 1ccce: 90 91 ec 16 lds r25, 0x16EC ; 0x8016ec 1ccd2: a0 91 ed 16 lds r26, 0x16ED ; 0x8016ed 1ccd6: b0 91 ee 16 lds r27, 0x16EE ; 0x8016ee while (!card.eof() && !result) { 1ccda: 40 91 e4 16 lds r20, 0x16E4 ; 0x8016e4 1ccde: 50 91 e5 16 lds r21, 0x16E5 ; 0x8016e5 1cce2: 60 91 e6 16 lds r22, 0x16E6 ; 0x8016e6 1cce6: 70 91 e7 16 lds r23, 0x16E7 ; 0x8016e7 1ccea: 84 17 cp r24, r20 1ccec: 95 07 cpc r25, r21 1ccee: a6 07 cpc r26, r22 1ccf0: b7 07 cpc r27, r23 1ccf2: 80 f5 brcc .+96 ; 0x1cd54 1ccf4: 11 11 cpse r17, r1 1ccf6: 2e c0 rjmp .+92 ; 0x1cd54 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); }; 1ccf8: 20 91 6a 16 lds r18, 0x166A ; 0x80166a 1ccfc: 21 11 cpse r18, r1 1ccfe: 03 c0 rjmp .+6 ; 0x1cd06 1cd00: 80 e0 ldi r24, 0x00 ; 0 1cd02: 90 e0 ldi r25, 0x00 ; 0 1cd04: dc 01 movw r26, r24 menu_progressbar_update(card.get_sdpos() - startPos); 1cd06: 84 19 sub r24, r4 1cd08: 95 09 sbc r25, r5 1cd0a: 0e 94 98 71 call 0xe330 ; 0xe330 card.sdprinting = true; 1cd0e: 00 93 d7 13 sts 0x13D7, r16 ; 0x8013d7 get_command(); 1cd12: 0e 94 1e 86 call 0x10c3c ; 0x10c3c #endif // LIN_ADVANCE bool check_commands() { bool end_command_found = false; while (buflen) 1cd16: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1cd1a: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1cd1e: 89 2b or r24, r25 1cd20: a1 f2 breq .-88 ; 0x1ccca { if ((code_seen_P(MSG_M84)) || (code_seen_P(PSTR("M 84")))) end_command_found = true; 1cd22: 88 e6 ldi r24, 0x68 ; 104 1cd24: 99 e6 ldi r25, 0x69 ; 105 1cd26: 0f 94 ee 39 call 0x273dc ; 0x273dc 1cd2a: 81 11 cpse r24, r1 1cd2c: 05 c0 rjmp .+10 ; 0x1cd38 1cd2e: 83 e8 ldi r24, 0x83 ; 131 1cd30: 94 e8 ldi r25, 0x84 ; 132 1cd32: 0f 94 ee 39 call 0x273dc ; 0x273dc 1cd36: 81 11 cpse r24, r1 1cd38: 11 e0 ldi r17, 0x01 ; 1 if (!cmdbuffer_front_already_processed) 1cd3a: 80 91 53 12 lds r24, 0x1253 ; 0x801253 1cd3e: 81 11 cpse r24, r1 1cd40: 02 c0 rjmp .+4 ; 0x1cd46 cmdqueue_pop_front(); 1cd42: 0e 94 94 79 call 0xf328 ; 0xf328 cmdbuffer_front_already_processed = false; 1cd46: 10 92 53 12 sts 0x1253, r1 ; 0x801253 1cd4a: e5 cf rjmp .-54 ; 0x1cd16 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; 1cd4c: 41 2c mov r4, r1 1cd4e: 51 2c mov r5, r1 1cd50: 32 01 movw r6, r4 1cd52: af cf rjmp .-162 ; 0x1ccb2 // with the CMDBUFFER_DEBUG enabled manage_heater(); #endif // CMDBUFFER_DEBUG } menu_progressbar_finish(); 1cd54: 0e 94 b9 71 call 0xe372 ; 0xe372 cmdqueue_serial_disabled = false; 1cd58: 10 92 93 03 sts 0x0393, r1 ; 0x800393 card.printingHasFinished(); 1cd5c: 0f 94 c9 72 call 0x2e592 ; 0x2e592 lcd_setstatuspgm(MSG_WELCOME); 1cd60: 8a e8 ldi r24, 0x8A ; 138 1cd62: 9c e6 ldi r25, 0x6C ; 108 1cd64: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 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)) { 1cd68: 11 11 cpse r17, r1 1cd6a: 60 cf rjmp .-320 ; 0x1cc2c result = !lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_FILE_INCOMPLETE), false); 1cd6c: 8a ec ldi r24, 0xCA ; 202 1cd6e: 98 e4 ldi r25, 0x48 ; 72 1cd70: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1cd74: 41 e0 ldi r20, 0x01 ; 1 1cd76: 60 e0 ldi r22, 0x00 ; 0 1cd78: 0e 94 5f e3 call 0x1c6be ; 0x1c6be 1cd7c: 18 2f mov r17, r24 lcd_update_enable(true); 1cd7e: 81 e0 ldi r24, 0x01 ; 1 1cd80: 0e 94 89 70 call 0xe112 ; 0xe112 } if (result) { 1cd84: 11 23 and r17, r17 1cd86: 09 f4 brne .+2 ; 0x1cd8a 1cd88: 51 cf rjmp .-350 ; 0x1cc2c 1cd8a: 5f cf rjmp .-322 ; 0x1cc4a lcd_putc_at(LCD_WIDTH - 1, menu_row, type_char); } void menu_item_dummy(void) { menu_item++; 1cd8c: 8f 5f subi r24, 0xFF ; 255 1cd8e: 80 93 63 04 sts 0x0463, r24 ; 0x800463 1cd92: 1b ce rjmp .-970 ; 0x1c9ca else MENU_ITEM_SDFILE(card.filename, card.longFilename); } else MENU_ITEM_DUMMY(); //dummy item that just increments the internal menu counters. } MENU_END(); 1cd94: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 _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(); 1cd98: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1cd9c: 8f 5f subi r24, 0xFF ; 255 1cd9e: 80 93 60 04 sts 0x0460, r24 ; 0x800460 1cda2: 80 91 62 04 lds r24, 0x0462 ; 0x800462 1cda6: 8f 5f subi r24, 0xFF ; 255 1cda8: 80 93 62 04 sts 0x0462, r24 ; 0x800462 1cdac: e0 cd rjmp .-1088 ; 0x1c96e 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. 1cdae: 80 91 95 03 lds r24, 0x0395 ; 0x800395 1cdb2: 11 e0 ldi r17, 0x01 ; 1 1cdb4: 81 11 cpse r24, r1 1cdb6: 05 c0 rjmp .+10 ; 0x1cdc2 1cdb8: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1cdbc: 81 11 cpse r24, r1 1cdbe: 01 c0 rjmp .+2 ; 0x1cdc2 1cdc0: 10 e0 ldi r17, 0x00 ; 0 if (_md->scrollPointer == NULL) 1cdc2: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1cdc6: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1cdca: 89 2b or r24, r25 1cdcc: 91 f4 brne .+36 ; 0x1cdf2 { //load filename to memory. #ifdef SDCARD_SORT_ALPHA card.getfilename_sorted(_md->selectedFileID, _md->sdSort); 1cdce: 60 91 a0 03 lds r22, 0x03A0 ; 0x8003a0 1cdd2: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 1cdd6: 90 91 9c 03 lds r25, 0x039C ; 0x80039c 1cdda: 0f 94 47 77 call 0x2ee8e ; 0x2ee8e #else card.getfilename(_md->selectedFileID); #endif _md->scrollPointer = (card.longFilename[0] == '\0') ? card.filename : card.longFilename; 1cdde: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 1cde2: 81 11 cpse r24, r1 1cde4: 46 c0 rjmp .+140 ; 0x1ce72 1cde6: 89 ed ldi r24, 0xD9 ; 217 1cde8: 93 e1 ldi r25, 0x13 ; 19 1cdea: 90 93 9a 03 sts 0x039A, r25 ; 0x80039a 1cdee: 80 93 99 03 sts 0x0399, r24 ; 0x800399 } if (rewindFlag) 1cdf2: 11 11 cpse r17, r1 _md->offset = 0; //redraw once again from the beginning. 1cdf4: 10 92 97 03 sts 0x0397, r1 ; 0x800397 if (_md->lcd_scrollTimer.expired(300) || rewindFlag) 1cdf8: 6c e2 ldi r22, 0x2C ; 44 1cdfa: 71 e0 ldi r23, 0x01 ; 1 1cdfc: 81 ea ldi r24, 0xA1 ; 161 1cdfe: 93 e0 ldi r25, 0x03 ; 3 1ce00: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 1ce04: 81 11 cpse r24, r1 1ce06: 03 c0 rjmp .+6 ; 0x1ce0e 1ce08: 11 23 and r17, r17 1ce0a: 09 f4 brne .+2 ; 0x1ce0e 1ce0c: 4f ce rjmp .-866 ; 0x1caac { uint8_t len = LCD_WIDTH - ((_md->isDir)? 2 : 1); 1ce0e: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1ce12: 02 e1 ldi r16, 0x12 ; 18 1ce14: 81 11 cpse r24, r1 1ce16: 01 c0 rjmp .+2 ; 0x1ce1a 1ce18: 03 e1 ldi r16, 0x13 ; 19 lcd_putc_at(0, _md->row, '>'); 1ce1a: 4e e3 ldi r20, 0x3E ; 62 1ce1c: 60 91 9f 03 lds r22, 0x039F ; 0x80039f 1ce20: 80 e0 ldi r24, 0x00 ; 0 1ce22: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 if (_md->isDir) 1ce26: 80 91 98 03 lds r24, 0x0398 ; 0x800398 1ce2a: 88 23 and r24, r24 1ce2c: 19 f0 breq .+6 ; 0x1ce34 1ce2e: 85 e8 ldi r24, 0x85 ; 133 1ce30: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 lcd_print(LCD_STR_FOLDER[0]); if( lcd_print_pad(&_md->scrollPointer[_md->offset], len) == 0) 1ce34: 20 91 97 03 lds r18, 0x0397 ; 0x800397 1ce38: 80 91 99 03 lds r24, 0x0399 ; 0x800399 1ce3c: 90 91 9a 03 lds r25, 0x039A ; 0x80039a 1ce40: 60 2f mov r22, r16 1ce42: 82 0f add r24, r18 1ce44: 91 1d adc r25, r1 1ce46: 0e 94 98 73 call 0xe730 ; 0xe730 1ce4a: 81 11 cpse r24, r1 1ce4c: 15 c0 rjmp .+42 ; 0x1ce78 { _md->lcd_scrollTimer.start(); 1ce4e: 81 ea ldi r24, 0xA1 ; 161 1ce50: 93 e0 ldi r25, 0x03 ; 3 1ce52: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> _md->offset++; 1ce56: 80 91 97 03 lds r24, 0x0397 ; 0x800397 1ce5a: 8f 5f subi r24, 0xFF ; 255 1ce5c: 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. 1ce60: 11 23 and r17, r17 1ce62: 09 f4 brne .+2 ; 0x1ce66 1ce64: 23 ce rjmp .-954 ; 0x1caac 1ce66: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 { _md->lcd_scrollTimer.stop(); //forces redraw in _standard state _md->menuState = _standard; 1ce6a: 81 e0 ldi r24, 0x01 ; 1 1ce6c: 80 93 96 03 sts 0x0396, r24 ; 0x800396 1ce70: 1d ce rjmp .-966 ; 0x1caac #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; 1ce72: 8e ee ldi r24, 0xEE ; 238 1ce74: 93 e1 ldi r25, 0x13 ; 19 1ce76: b9 cf rjmp .-142 ; 0x1cdea 1ce78: 10 92 a1 03 sts 0x03A1, r1 ; 0x8003a1 1ce7c: f1 cf rjmp .-30 ; 0x1ce60 0001ce7e : } 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 1ce7e: 41 e0 ldi r20, 0x01 ; 1 1ce80: 61 e0 ldi r22, 0x01 ; 1 1ce82: 89 e6 ldi r24, 0x69 ; 105 1ce84: 94 e8 ldi r25, 0x84 ; 132 1ce86: 0e 94 5f e3 call 0x1c6be ; 0x1c6be if (disable == LCD_LEFT_BUTTON_CHOICE) 1ce8a: 81 11 cpse r24, r1 1ce8c: 07 c0 rjmp .+14 ; 0x1ce9c { enquecommand_P(PSTR("G99")); 1ce8e: 61 e0 ldi r22, 0x01 ; 1 1ce90: 85 e6 ldi r24, 0x65 ; 101 1ce92: 94 e8 ldi r25, 0x84 ; 132 1ce94: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 lcd_return_to_status(); 1ce98: 0f 94 6e 05 call 0x20adc ; 0x20adc } lcd_update_enable(true); 1ce9c: 81 e0 ldi r24, 0x01 ; 1 1ce9e: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_draw_update = 2; 1cea2: 82 e0 ldi r24, 0x02 ; 2 1cea4: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } 1cea8: 08 95 ret 0001ceaa : 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() { 1ceaa: cf 93 push r28 1ceac: df 93 push r29 if (MMU2::mmu2.Enabled()) { 1ceae: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1ceb2: 81 30 cpi r24, 0x01 ; 1 1ceb4: f9 f4 brne .+62 ; 0x1cef4 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 1ceb6: 87 e2 ldi r24, 0x27 ; 39 1ceb8: 9d e3 ldi r25, 0x3D ; 61 1ceba: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1cebe: ec 01 movw r28, r24 } void lcd_v2_calibration() { if (MMU2::mmu2.Enabled()) { const uint8_t filament = choose_menu_P( 1cec0: 84 e1 ldi r24, 0x14 ; 20 1cec2: 9d e3 ldi r25, 0x3D ; 61 1cec4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1cec8: be 01 movw r22, r28 1ceca: 6f 5f subi r22, 0xFF ; 255 1cecc: 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 1cece: 0e 94 b0 cf call 0x19f60 ; 0x19f60 if (filament < MMU_FILAMENT_COUNT) { 1ced2: 85 30 cpi r24, 0x05 ; 5 1ced4: 98 f5 brcc .+102 ; 0x1cf3c lay1cal_filament = filament; 1ced6: 80 93 e1 03 sts 0x03E1, r24 ; 0x8003e1 return; } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; 1ceda: 8a e0 ldi r24, 0x0A ; 10 1cedc: 80 93 94 03 sts 0x0394, r24 ; 0x800394 menu_goto(lcd_generic_preheat_menu, 0, true); 1cee0: 20 e0 ldi r18, 0x00 ; 0 1cee2: 41 e0 ldi r20, 0x01 ; 1 1cee4: 70 e0 ldi r23, 0x00 ; 0 1cee6: 60 e0 ldi r22, 0x00 ; 0 1cee8: 8a e6 ldi r24, 0x6A ; 106 1ceea: 97 e3 ldi r25, 0x37 ; 55 } 1ceec: df 91 pop r29 1ceee: cf 91 pop r28 } } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); 1cef0: 0c 94 08 63 jmp 0xc610 ; 0xc610 menu_back(); return; } } #ifdef FILAMENT_SENSOR else if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1cef4: 8f e5 ldi r24, 0x5F ; 95 1cef6: 9f e0 ldi r25, 0x0F ; 15 1cef8: 0f 94 81 a4 call 0x34902 ; 0x34902 1cefc: 81 11 cpse r24, r1 1cefe: ed cf rjmp .-38 ; 0x1ceda { bool loaded = false; if (fsensor.isReady()) { 1cf00: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1cf04: 82 30 cpi r24, 0x02 ; 2 1cf06: f1 f4 brne .+60 ; 0x1cf44 1cf08: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1cf0c: 81 11 cpse r24, r1 1cf0e: e5 cf rjmp .-54 ; 0x1ceda 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)); 1cf10: 86 ef ldi r24, 0xF6 ; 246 1cf12: 9c e3 ldi r25, 0x3C ; 60 1cf14: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1cf18: 0e 94 91 de call 0x1bd22 ; 0x1bd22 lcd_consume_click(); 1cf1c: 0e 94 c1 73 call 0xe782 ; 0xe782 1cf20: c4 e1 ldi r28, 0x14 ; 20 for (uint_least8_t i = 0; i < 20; i++) { //wait max. 2s delay_keep_alive(100); 1cf22: 84 e6 ldi r24, 0x64 ; 100 1cf24: 90 e0 ldi r25, 0x00 ; 0 1cf26: 0e 94 07 8d call 0x11a0e ; 0x11a0e if (lcd_clicked()) { 1cf2a: 0e 94 c6 73 call 0xe78c ; 0xe78c 1cf2e: 81 11 cpse r24, r1 1cf30: 02 c0 rjmp .+4 ; 0x1cf36 1cf32: 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 1cf34: b1 f7 brne .-20 ; 0x1cf22 delay_keep_alive(100); if (lcd_clicked()) { break; } } lcd_update_enabled = true; 1cf36: 81 e0 ldi r24, 0x01 ; 1 1cf38: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a } #endif //FILAMENT_SENSOR eFilamentAction = FilamentAction::Lay1Cal; menu_goto(lcd_generic_preheat_menu, 0, true); } 1cf3c: df 91 pop r29 1cf3e: cf 91 pop r28 if (lcd_clicked()) { break; } } lcd_update_enabled = true; menu_back(); 1cf40: 0c 94 6c 63 jmp 0xc6d8 ; 0xc6d8 { 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); 1cf44: 8d e2 ldi r24, 0x2D ; 45 1cf46: 92 e4 ldi r25, 0x42 ; 66 1cf48: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1cf4c: 41 e0 ldi r20, 0x01 ; 1 1cf4e: 60 e0 ldi r22, 0x00 ; 0 1cf50: 0e 94 5f e3 call 0x1c6be ; 0x1c6be 1cf54: 91 e0 ldi r25, 0x01 ; 1 1cf56: 81 11 cpse r24, r1 1cf58: 90 e0 ldi r25, 0x00 ; 0 lcd_update_enabled = true; 1cf5a: 81 e0 ldi r24, 0x01 ; 1 1cf5c: 80 93 5a 02 sts 0x025A, r24 ; 0x80025a } if (!loaded) { 1cf60: 91 11 cpse r25, r1 1cf62: bb cf rjmp .-138 ; 0x1ceda 1cf64: d5 cf rjmp .-86 ; 0x1cf10 0001cf66 : } lcd_show_fullscreen_message_and_wait_P( _T(MSG_WIZARD_V2_CAL_2)); } void lcd_z_calibration_prompt(bool allowTimeouting) { 1cf66: cf 93 push r28 1cf68: c8 2f mov r28, r24 uint8_t result = lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_Z_CALIBRATION_PROMPT), allowTimeouting, 0); 1cf6a: 83 ed ldi r24, 0xD3 ; 211 1cf6c: 9f e3 ldi r25, 0x3F ; 63 1cf6e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1cf72: 40 e0 ldi r20, 0x00 ; 0 1cf74: 6c 2f mov r22, r28 1cf76: 0e 94 5f e3 call 0x1c6be ; 0x1c6be if (result == LCD_LEFT_BUTTON_CHOICE) { 1cf7a: 81 11 cpse r24, r1 1cf7c: 03 c0 rjmp .+6 ; 0x1cf84 lcd_mesh_calibration_z(); } } 1cf7e: 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(); 1cf80: 0c 94 63 c2 jmp 0x184c6 ; 0x184c6 } } 1cf84: cf 91 pop r28 1cf86: 08 95 ret 0001cf88 : } eeprom_update_byte_notify((uint8_t*)EEPROM_MBL_PROBE_NR, mbl_z_probe_nr); } static void lcd_mesh_bed_leveling_settings() { 1cf88: bf 92 push r11 1cf8a: cf 92 push r12 1cf8c: df 92 push r13 1cf8e: ef 92 push r14 1cf90: ff 92 push r15 1cf92: 0f 93 push r16 1cf94: 1f 93 push r17 1cf96: cf 93 push r28 1cf98: df 93 push r29 1cf9a: 00 d0 rcall .+0 ; 0x1cf9c 1cf9c: 1f 92 push r1 1cf9e: cd b7 in r28, 0x3d ; 61 1cfa0: de b7 in r29, 0x3e ; 62 bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0); 1cfa2: 8c ea ldi r24, 0xAC ; 172 1cfa4: 9d e0 ldi r25, 0x0D ; 13 1cfa6: 0f 94 81 a4 call 0x34902 ; 0x34902 1cfaa: c8 2e mov r12, r24 uint8_t points_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_POINTS_NR); 1cfac: 8b ea ldi r24, 0xAB ; 171 1cfae: 9d e0 ldi r25, 0x0D ; 13 1cfb0: 0f 94 81 a4 call 0x34902 ; 0x34902 1cfb4: f8 2e mov r15, r24 uint8_t mbl_z_probe_nr = eeprom_read_byte((uint8_t*)EEPROM_MBL_PROBE_NR); 1cfb6: 8a ea ldi r24, 0xAA ; 170 1cfb8: 9d e0 ldi r25, 0x0D ; 13 1cfba: 0f 94 81 a4 call 0x34902 ; 0x34902 1cfbe: 18 2f mov r17, r24 char sToggle[4]; //enough for nxn format MENU_BEGIN(); 1cfc0: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 1cfc4: 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'; 1cfc8: 80 e3 ldi r24, 0x30 ; 48 1cfca: d8 2e mov r13, r24 1cfcc: df 0c add r13, r15 sToggle[1] = 'x'; 1cfce: 98 e7 ldi r25, 0x78 ; 120 1cfd0: 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'; 1cfd2: 20 e3 ldi r18, 0x30 ; 48 1cfd4: e2 2e mov r14, r18 1cfd6: 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(); 1cfd8: 80 91 60 04 lds r24, 0x0460 ; 0x800460 1cfdc: 84 30 cpi r24, 0x04 ; 4 1cfde: 08 f0 brcs .+2 ; 0x1cfe2 1cfe0: 56 c0 rjmp .+172 ; 0x1d08e 1cfe2: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 1cfe6: 0e 94 9d 62 call 0xc53a ; 0xc53a 1cfea: 88 23 and r24, r24 1cfec: 31 f0 breq .+12 ; 0x1cffa 1cfee: 87 e0 ldi r24, 0x07 ; 7 1cff0: f8 12 cpse r15, r24 1cff2: 03 c0 rjmp .+6 ; 0x1cffa 1cff4: 81 e0 ldi r24, 0x01 ; 1 1cff6: 0e 94 b3 e7 call 0x1cf66 ; 0x1cf66 // 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)); 1cffa: 87 e9 ldi r24, 0x97 ; 151 1cffc: 98 e4 ldi r25, 0x48 ; 72 1cffe: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d002: 0e 94 1f 73 call 0xe63e ; 0xe63e sToggle[0] = points_nr + '0'; 1d006: d9 82 std Y+1, r13 ; 0x01 sToggle[1] = 'x'; 1d008: ba 82 std Y+2, r11 ; 0x02 sToggle[2] = points_nr + '0'; 1d00a: db 82 std Y+3, r13 ; 0x03 sToggle[3] = 0; 1d00c: 1c 82 std Y+4, r1 ; 0x04 MENU_ITEM_TOGGLE(_T(MSG_MESH), sToggle, mbl_mesh_toggle); 1d00e: 80 e9 ldi r24, 0x90 ; 144 1d010: 98 e4 ldi r25, 0x48 ; 72 1d012: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d016: 20 e0 ldi r18, 0x00 ; 0 1d018: 49 e0 ldi r20, 0x09 ; 9 1d01a: 5d eb ldi r21, 0xBD ; 189 1d01c: be 01 movw r22, r28 1d01e: 6f 5f subi r22, 0xFF ; 255 1d020: 7f 4f sbci r23, 0xFF ; 255 1d022: 0e 94 af 75 call 0xeb5e ; 0xeb5e sToggle[0] = mbl_z_probe_nr + '0'; 1d026: e9 82 std Y+1, r14 ; 0x01 sToggle[1] = 0; 1d028: 1a 82 std Y+2, r1 ; 0x02 MENU_ITEM_TOGGLE(_T(MSG_Z_PROBE_NR), sToggle, mbl_probe_nr_toggle); 1d02a: 82 e8 ldi r24, 0x82 ; 130 1d02c: 98 e4 ldi r25, 0x48 ; 72 1d02e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d032: 20 e0 ldi r18, 0x00 ; 0 1d034: 4a ef ldi r20, 0xFA ; 250 1d036: 5c eb ldi r21, 0xBC ; 188 1d038: be 01 movw r22, r28 1d03a: 6f 5f subi r22, 0xFF ; 255 1d03c: 7f 4f sbci r23, 0xFF ; 255 1d03e: 0e 94 af 75 call 0xeb5e ; 0xeb5e 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); 1d042: 87 e0 ldi r24, 0x07 ; 7 1d044: f8 12 cpse r15, r24 1d046: 20 c0 rjmp .+64 ; 0x1d088 1d048: 8c e5 ldi r24, 0x5C ; 92 1d04a: 93 e6 ldi r25, 0x63 ; 99 1d04c: c1 10 cpse r12, r1 1d04e: 02 c0 rjmp .+4 ; 0x1d054 1d050: 86 e5 ldi r24, 0x56 ; 86 1d052: 93 e6 ldi r25, 0x63 ; 99 1d054: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d058: 8c 01 movw r16, r24 1d05a: 8c e6 ldi r24, 0x6C ; 108 1d05c: 98 e4 ldi r25, 0x48 ; 72 1d05e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d062: 22 e0 ldi r18, 0x02 ; 2 1d064: 45 e1 ldi r20, 0x15 ; 21 1d066: 5d eb ldi r21, 0xBD ; 189 1d068: b8 01 movw r22, r16 1d06a: 0e 94 af 75 call 0xeb5e ; 0xeb5e MENU_END(); 1d06e: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 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(); 1d072: 90 91 60 04 lds r25, 0x0460 ; 0x800460 1d076: 9f 5f subi r25, 0xFF ; 255 1d078: 90 93 60 04 sts 0x0460, r25 ; 0x800460 1d07c: 90 91 62 04 lds r25, 0x0462 ; 0x800462 1d080: 9f 5f subi r25, 0xFF ; 255 1d082: 90 93 62 04 sts 0x0462, r25 ; 0x800462 1d086: a8 cf rjmp .-176 ; 0x1cfd8 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); 1d088: 8c e7 ldi r24, 0x7C ; 124 1d08a: 98 e4 ldi r25, 0x48 ; 72 1d08c: e3 cf rjmp .-58 ; 0x1d054 MENU_END(); } 1d08e: 0f 90 pop r0 1d090: 0f 90 pop r0 1d092: 0f 90 pop r0 1d094: 0f 90 pop r0 1d096: df 91 pop r29 1d098: cf 91 pop r28 1d09a: 1f 91 pop r17 1d09c: 0f 91 pop r16 1d09e: ff 90 pop r15 1d0a0: ef 90 pop r14 1d0a2: df 90 pop r13 1d0a4: cf 90 pop r12 1d0a6: bf 90 pop r11 1d0a8: 08 95 ret 0001d0aa : * * This function is blocking. * @param msg message to be displayed from PROGMEM */ void lcd_show_fullscreen_message_and_wait_P(const char *msg) { 1d0aa: cf 92 push r12 1d0ac: df 92 push r13 1d0ae: ef 92 push r14 1d0b0: ff 92 push r15 1d0b2: 0f 93 push r16 1d0b4: 1f 93 push r17 1d0b6: cf 93 push r28 1d0b8: df 93 push r29 1d0ba: d8 2e mov r13, r24 1d0bc: 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) 1d0be: 01 e0 ldi r16, 0x01 ; 1 1d0c0: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 1d0c4: 81 11 cpse r24, r1 1d0c6: 01 c0 rjmp .+2 ; 0x1d0ca 1d0c8: 00 e0 ldi r16, 0x00 ; 0 { lcd_update_enabled = false; 1d0ca: 10 92 5a 02 sts 0x025A, r1 ; 0x80025a LcdUpdateDisabler lcdUpdateDisabler; const char *msg_next = lcd_display_message_fullscreen_P(msg); 1d0ce: 8d 2d mov r24, r13 1d0d0: 9c 2d mov r25, r12 1d0d2: 0e 94 91 de call 0x1bd22 ; 0x1bd22 1d0d6: 7c 01 movw r14, r24 bool multi_screen = msg_next != NULL; lcd_consume_click(); 1d0d8: 0e 94 c1 73 call 0xe782 ; 0xe782 KEEPALIVE_STATE(PAUSED_FOR_USER); 1d0dc: 84 e0 ldi r24, 0x04 ; 4 1d0de: 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); 1d0e2: 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) { 1d0e4: 20 97 sbiw r28, 0x00 ; 0 1d0e6: 29 f4 brne .+10 ; 0x1d0f2 // Display the confirm char. lcd_putc_at(19, 3, LCD_STR_CONFIRM[0]); 1d0e8: 49 e8 ldi r20, 0x89 ; 137 1d0ea: 63 e0 ldi r22, 0x03 ; 3 1d0ec: 83 e1 ldi r24, 0x13 ; 19 1d0ee: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 * @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); 1d0f2: 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); 1d0f4: 82 e3 ldi r24, 0x32 ; 50 1d0f6: 90 e0 ldi r25, 0x00 ; 0 1d0f8: 0e 94 07 8d call 0x11a0e ; 0x11a0e if (lcd_clicked()) { 1d0fc: 0e 94 c6 73 call 0xe78c ; 0xe78c 1d100: 88 23 and r24, r24 1d102: 81 f0 breq .+32 ; 0x1d124 if (msg_next == NULL) { 1d104: 20 97 sbiw r28, 0x00 ; 0 1d106: 81 f4 brne .+32 ; 0x1d128 KEEPALIVE_STATE(IN_HANDLER); 1d108: 82 e0 ldi r24, 0x02 ; 2 1d10a: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } ~LcdUpdateDisabler() { lcd_update_enabled = m_updateEnabled; 1d10e: 00 93 5a 02 sts 0x025A, r16 ; 0x80025a if (msg_next == NULL) msg_next = msg; msg_next = lcd_display_message_fullscreen_P(msg_next); } } } 1d112: df 91 pop r29 1d114: cf 91 pop r28 1d116: 1f 91 pop r17 1d118: 0f 91 pop r16 1d11a: ff 90 pop r15 1d11c: ef 90 pop r14 1d11e: df 90 pop r13 1d120: cf 90 pop r12 1d122: 08 95 ret 1d124: 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) { 1d126: 31 f7 brne .-52 ; 0x1d0f4 else { break; } } } if (multi_screen) { 1d128: e1 14 cp r14, r1 1d12a: f1 04 cpc r15, r1 1d12c: d9 f2 breq .-74 ; 0x1d0e4 if (msg_next == NULL) 1d12e: 20 97 sbiw r28, 0x00 ; 0 1d130: 11 f4 brne .+4 ; 0x1d136 msg_next = msg; 1d132: cd 2d mov r28, r13 1d134: dc 2d mov r29, r12 msg_next = lcd_display_message_fullscreen_P(msg_next); 1d136: ce 01 movw r24, r28 1d138: 0e 94 91 de call 0x1bd22 ; 0x1bd22 1d13c: ec 01 movw r28, r24 1d13e: d2 cf rjmp .-92 ; 0x1d0e4 0001d140 : 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' 1d140: 41 30 cpi r20, 0x01 ; 1 1d142: 41 f4 brne .+16 ; 0x1d154 if (lcd_show_multiscreen_message_yes_no_and_wait_P(warning, true, LCD_LEFT_BUTTON_CHOICE) == LCD_MIDDLE_BUTTON_CHOICE) { 1d144: 40 e0 ldi r20, 0x00 ; 0 1d146: 61 e0 ldi r22, 0x01 ; 1 1d148: 0e 94 5f e3 call 0x1c6be ; 0x1c6be 1d14c: 81 30 cpi r24, 0x01 ; 1 1d14e: 41 f4 brne .+16 ; 0x1d160 lcd_print_stop(); } } else if (check == 2) { // Strict, always stop print lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); 1d150: 0c 94 2a dd jmp 0x1ba54 ; 0x1ba54 { 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 1d154: 42 30 cpi r20, 0x02 ; 2 1d156: 21 f4 brne .+8 ; 0x1d160 lcd_show_fullscreen_message_and_wait_P(strict); 1d158: cb 01 movw r24, r22 1d15a: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 1d15e: f8 cf rjmp .-16 ; 0x1d150 lcd_print_stop(); } } 1d160: 08 95 ret 0001d162 : ,_T(MSG_GCODE_NEWER_FIRMWARE_CANCELLED) ,(uint8_t)oCheckVersion ); } bool filament_presence_check() { 1d162: 0f 93 push r16 1d164: 1f 93 push r17 1d166: 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)) { 1d168: 8c ea ldi r24, 0xAC ; 172 1d16a: 9c e0 ldi r25, 0x0C ; 12 1d16c: 0f 94 81 a4 call 0x34902 ; 0x34902 1d170: 81 11 cpse r24, r1 1d172: 23 c0 rjmp .+70 ; 0x1d1ba goto done; } if (fsensor.isEnabled() && !fsensor.getFilamentPresent()) { 1d174: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1d178: 88 23 and r24, r24 1d17a: f9 f0 breq .+62 ; 0x1d1ba 1d17c: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1d180: 81 11 cpse r24, r1 1d182: 1b c0 rjmp .+54 ; 0x1d1ba if (oCheckFilament == ClCheckMode::_None) { 1d184: c0 91 ee 03 lds r28, 0x03EE ; 0x8003ee 1d188: cc 23 and r28, r28 1d18a: b9 f0 breq .+46 ; 0x1d1ba goto done; } render_M862_warnings( 1d18c: 80 ed ldi r24, 0xD0 ; 208 1d18e: 9c e4 ldi r25, 0x4C ; 76 1d190: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d194: 8c 01 movw r16, r24 1d196: 87 ea ldi r24, 0xA7 ; 167 1d198: 9c e4 ldi r25, 0x4C ; 76 1d19a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d19e: 4c 2f mov r20, r28 1d1a0: b8 01 movw r22, r16 1d1a2: 0e 94 a0 e8 call 0x1d140 ; 0x1d140 _T(MSG_MISSING_FILAMENT_CONTINUE) ,_T(MSG_MISSING_FILAMENT_CANCELLED) ,(uint8_t)oCheckFilament ); if (lcd_commands_type == LcdCommands::StopPrint) { 1d1a6: 81 e0 ldi r24, 0x01 ; 1 1d1a8: 90 91 5e 0d lds r25, 0x0D5E ; 0x800d5e 1d1ac: 91 30 cpi r25, 0x01 ; 1 1d1ae: 09 f4 brne .+2 ; 0x1d1b2 1d1b0: 80 e0 ldi r24, 0x00 ; 0 } } done: return true; } 1d1b2: cf 91 pop r28 1d1b4: 1f 91 pop r17 1d1b6: 0f 91 pop r16 1d1b8: 08 95 ret return false; } } done: return true; 1d1ba: 81 e0 ldi r24, 0x01 ; 1 1d1bc: fa cf rjmp .-12 ; 0x1d1b2 0001d1be : lcd_show_fullscreen_message_and_wait_P(strict); lcd_print_stop(); } } void nozzle_diameter_check(uint16_t nDiameter) { 1d1be: 1f 93 push r17 1d1c0: cf 93 push r28 1d1c2: df 93 push r29 uint16_t nDiameter_um; if (oCheckMode == ClCheckMode::_None) 1d1c4: 10 91 ed 03 lds r17, 0x03ED ; 0x8003ed 1d1c8: 11 23 and r17, r17 1d1ca: 19 f1 breq .+70 ; 0x1d212 1d1cc: ec 01 movw r28, r24 return; nDiameter_um = eeprom_read_word((uint16_t *)EEPROM_NOZZLE_DIAMETER_uM); 1d1ce: 85 ea ldi r24, 0xA5 ; 165 1d1d0: 9d e0 ldi r25, 0x0D ; 13 1d1d2: 0f 94 8f a4 call 0x3491e ; 0x3491e if (nDiameter == nDiameter_um) 1d1d6: 8c 17 cp r24, r28 1d1d8: 9d 07 cpc r25, r29 1d1da: d9 f0 breq .+54 ; 0x1d212 // SERIAL_ECHOPGM("actual : "); // SERIAL_ECHOLN((float)(nDiameter_um/1000.0)); // SERIAL_ECHOPGM("expected: "); // SERIAL_ECHOLN((float)(nDiameter/1000.0)); render_M862_warnings( 1d1dc: 87 e4 ldi r24, 0x47 ; 71 1d1de: 9c e4 ldi r25, 0x4C ; 76 1d1e0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d1e4: ec 01 movw r28, r24 1d1e6: 82 e1 ldi r24, 0x12 ; 18 1d1e8: 9c e4 ldi r25, 0x4C ; 76 1d1ea: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d1ee: 41 2f mov r20, r17 1d1f0: be 01 movw r22, r28 1d1f2: 0e 94 a0 e8 call 0x1d140 ; 0x1d140 _T(MSG_NOZZLE_DIFFERS_CONTINUE) ,_T(MSG_NOZZLE_DIFFERS_CANCELLED) ,(uint8_t)oCheckMode ); if (!farm_mode) { 1d1f6: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1d1fa: 81 11 cpse r24, r1 1d1fc: 0a c0 rjmp .+20 ; 0x1d212 bSettings = false; // flag ('fake parameter') for 'lcd_hw_setup_menu()' function 1d1fe: 10 92 ec 03 sts 0x03EC, r1 ; 0x8003ec menu_submenu(lcd_hw_setup_menu); 1d202: 60 e0 ldi r22, 0x00 ; 0 1d204: 84 e4 ldi r24, 0x44 ; 68 1d206: 9f eb ldi r25, 0xBF ; 191 } } 1d208: df 91 pop r29 1d20a: cf 91 pop r28 1d20c: 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); 1d20e: 0c 94 2e 63 jmp 0xc65c ; 0xc65c } } 1d212: df 91 pop r29 1d214: cf 91 pop r28 1d216: 1f 91 pop r17 1d218: 08 95 ret 0001d21a : } static void nozzle_change() { #ifdef FILAMENT_SENSOR if (fsensor.isEnabled() && fsensor.getFilamentPresent()) { 1d21a: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 1d21e: 88 23 and r24, r24 1d220: 61 f0 breq .+24 ; 0x1d23a 1d222: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 1d226: 88 23 and r24, r24 1d228: 41 f0 breq .+16 ; 0x1d23a lcd_show_fullscreen_message_and_wait_P(_T(MSG_UNLOAD_FILAMENT_REPEAT)); 1d22a: 8e ee ldi r24, 0xEE ; 238 1d22c: 94 e4 ldi r25, 0x44 ; 68 1d22e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d232: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa lcd_return_to_status(); return; } #endif //FILAMENT_SENSOR lcd_commands_type = LcdCommands::NozzleCNG; lcd_return_to_status(); 1d236: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 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; 1d23a: 85 e0 ldi r24, 0x05 ; 5 1d23c: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e 1d240: fa cf rjmp .-12 ; 0x1d236 0001d242 : if (result == LCD_LEFT_BUTTON_CHOICE) { lcd_mesh_calibration_z(); } } void prompt_steel_sheet_on_bed(bool wantedState) { 1d242: cf 93 push r28 1d244: 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); 1d246: 86 e2 ldi r24, 0x26 ; 38 1d248: 90 e4 ldi r25, 0x40 ; 64 1d24a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d24e: 41 e0 ldi r20, 0x01 ; 1 1d250: 4c 27 eor r20, r28 1d252: 60 e0 ldi r22, 0x00 ; 0 1d254: 0e 94 5f e3 call 0x1c6be ; 0x1c6be 1d258: 91 e0 ldi r25, 0x01 ; 1 1d25a: 81 11 cpse r24, r1 1d25c: 90 e0 ldi r25, 0x00 ; 0 if (sheetIsOnBed != wantedState) { 1d25e: c9 17 cp r28, r25 1d260: 59 f0 breq .+22 ; 0x1d278 lcd_show_fullscreen_message_and_wait_P(_T(wantedState ? MSG_PLACE_STEEL_SHEET : MSG_REMOVE_STEEL_SHEET)); 1d262: 8c ef ldi r24, 0xFC ; 252 1d264: 9f e3 ldi r25, 0x3F ; 63 1d266: cc 23 and r28, r28 1d268: 11 f0 breq .+4 ; 0x1d26e 1d26a: 85 e9 ldi r24, 0x95 ; 149 1d26c: 90 e6 ldi r25, 0x60 ; 96 1d26e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 } #endif //STEEL_SHEET } 1d272: 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)); 1d274: 0c 94 55 e8 jmp 0x1d0aa ; 0x1d0aa } #endif //STEEL_SHEET } 1d278: cf 91 pop r28 1d27a: 08 95 ret 0001d27c : // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); } static void wizard_lay1cal_message(bool cold) { 1d27c: cf 93 push r28 1d27e: c8 2f mov r28, r24 lcd_show_fullscreen_message_and_wait_P( 1d280: 84 e8 ldi r24, 0x84 ; 132 1d282: 9f e3 ldi r25, 0x3F ; 63 1d284: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d288: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa _T(MSG_WIZARD_V2_CAL)); if (MMU2::mmu2.Enabled()) 1d28c: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d290: 81 30 cpi r24, 0x01 ; 1 1d292: 69 f4 brne .+26 ; 0x1d2ae { lcd_show_fullscreen_message_and_wait_P( 1d294: 8b e2 ldi r24, 0x2B ; 43 1d296: 9f e3 ldi r25, 0x3F ; 63 _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) { lcd_show_fullscreen_message_and_wait_P( 1d298: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d29c: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa _T(MSG_SELECT_TEMP_MATCHES_MATERIAL)); } lcd_show_fullscreen_message_and_wait_P( 1d2a0: 89 e5 ldi r24, 0x59 ; 89 1d2a2: 9e e3 ldi r25, 0x3E ; 62 1d2a4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 _T(MSG_WIZARD_V2_CAL_2)); } 1d2a8: 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( 1d2aa: 0c 94 55 e8 jmp 0x1d0aa ; 0x1d0aa if (MMU2::mmu2.Enabled()) { lcd_show_fullscreen_message_and_wait_P( _T(MSG_SELECT_FIL_1ST_LAYERCAL)); } else if (cold) 1d2ae: cc 23 and r28, r28 1d2b0: b9 f3 breq .-18 ; 0x1d2a0 { lcd_show_fullscreen_message_and_wait_P( 1d2b2: 89 ef ldi r24, 0xF9 ; 249 1d2b4: 9e e3 ldi r25, 0x3E ; 62 1d2b6: f0 cf rjmp .-32 ; 0x1d298 0001d2b8 : } } static void lcd_wizard_load() { if (MMU2::mmu2.Enabled()) { 1d2b8: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d2bc: 81 30 cpi r24, 0x01 ; 1 1d2be: 71 f4 brne .+28 ; 0x1d2dc lcd_show_fullscreen_message_and_wait_P( 1d2c0: 80 e0 ldi r24, 0x00 ; 0 1d2c2: 9e e3 ldi r25, 0x3E ; 62 1d2c4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d2c8: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa _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; 1d2cc: 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; 1d2ce: 80 93 94 03 sts 0x0394, r24 ; 0x800394 } // When MMU is disabled P parameter is ignored enquecommand_P(PSTR("M701 P0")); 1d2d2: 61 e0 ldi r22, 0x01 ; 1 1d2d4: 86 e0 ldi r24, 0x06 ; 6 1d2d6: 94 e8 ldi r25, 0x84 ; 132 1d2d8: 0c 94 62 8d jmp 0x11ac4 ; 0x11ac4 // 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( 1d2dc: 84 eb ldi r24, 0xB4 ; 180 1d2de: 9d e3 ldi r25, 0x3D ; 61 1d2e0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d2e4: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa _T(MSG_WIZARD_LOAD_FILAMENT)); lcd_update_enable(false); 1d2e8: 80 e0 ldi r24, 0x00 ; 0 1d2ea: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_clear(); 1d2ee: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 2, _T(MSG_LOADING_FILAMENT)); 1d2f2: 8f ea ldi r24, 0xAF ; 175 1d2f4: 92 e6 ldi r25, 0x62 ; 98 1d2f6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d2fa: ac 01 movw r20, r24 1d2fc: 62 e0 ldi r22, 0x02 ; 2 1d2fe: 80 e0 ldi r24, 0x00 ; 0 1d300: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 eFilamentAction = FilamentAction::Load; 1d304: 81 e0 ldi r24, 0x01 ; 1 1d306: e3 cf rjmp .-58 ; 0x1d2ce 0001d308 : //! ---------------------- | ---------------- //! 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) { 1d308: af 92 push r10 1d30a: bf 92 push r11 1d30c: cf 92 push r12 1d30e: df 92 push r13 1d310: ef 92 push r14 1d312: ff 92 push r15 1d314: 0f 93 push r16 1d316: 1f 93 push r17 1d318: cf 93 push r28 1d31a: 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); 1d31c: 88 23 and r24, r24 1d31e: 29 f0 breq .+10 ; 0x1d32a 1d320: 61 e0 ldi r22, 0x01 ; 1 1d322: 8f e5 ldi r24, 0x5F ; 95 1d324: 9f e0 ldi r25, 0x0F ; 15 1d326: 0f 94 a5 a4 call 0x3494a ; 0x3494a FORCE_BL_ON_START; while (!end) { printf_P(PSTR("Wizard state: %d\n"), (uint8_t)state); 1d32a: 8e e0 ldi r24, 0x0E ; 14 1d32c: e8 2e mov r14, r24 1d32e: 84 e8 ldi r24, 0x84 ; 132 1d330: 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; 1d332: 97 ed ldi r25, 0xD7 ; 215 1d334: c9 2e mov r12, r25 1d336: d1 2c mov r13, r1 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1d338: 2c e3 ldi r18, 0x3C ; 60 1d33a: a2 2e mov r10, r18 1d33c: b1 2c mov r11, r1 1d33e: 0c 2f mov r16, r28 1d340: 10 e0 ldi r17, 0x00 ; 0 1d342: 1f 92 push r1 1d344: cf 93 push r28 1d346: ff 92 push r15 1d348: ef 92 push r14 1d34a: 0f 94 43 a3 call 0x34686 ; 0x34686 switch (state) { 1d34e: 0f 90 pop r0 1d350: 0f 90 pop r0 1d352: 0f 90 pop r0 1d354: 0f 90 pop r0 1d356: ef ef ldi r30, 0xFF ; 255 1d358: ec 0f add r30, r28 1d35a: ed 30 cpi r30, 0x0D ; 13 1d35c: a0 f4 brcc .+40 ; 0x1d386 1d35e: f0 e0 ldi r31, 0x00 ; 0 1d360: 88 27 eor r24, r24 1d362: ea 54 subi r30, 0x4A ; 74 1d364: f6 41 sbci r31, 0x16 ; 22 1d366: 8f 4f sbci r24, 0xFF ; 255 1d368: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> 1d36c: 11 ea ldi r17, 0xA1 ; 161 1d36e: 31 ea ldi r19, 0xA1 ; 161 1d370: 3d ea ldi r19, 0xAD ; 173 1d372: 47 ea ldi r20, 0xA7 ; 167 1d374: 81 ea ldi r24, 0xA1 ; 161 1d376: 9b ea ldi r25, 0xAB ; 171 1d378: b2 ea ldi r27, 0xA2 ; 162 1d37a: ac ea ldi r26, 0xAC ; 172 1d37c: b6 ea ldi r27, 0xA6 ; 166 1d37e: c4 ea ldi r28, 0xA4 ; 164 1d380: cd ea ldi r28, 0xAD ; 173 1d382: e1 ea ldi r30, 0xA1 ; 161 1d384: e1 ea ldi r30, 0xA1 ; 161 // 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; 1d386: 10 92 73 12 sts 0x1273, r1 ; 0x801273 if( eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)==2){ 1d38a: 8f e5 ldi r24, 0x5F ; 95 1d38c: 9f e0 ldi r25, 0x0F ; 15 1d38e: 0f 94 81 a4 call 0x34902 ; 0x34902 1d392: 82 30 cpi r24, 0x02 ; 2 1d394: 39 f4 brne .+14 ; 0x1d3a4 // printer pre-assembled: finish remaining steps lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_WELCOME_SHIPPING)); 1d396: 8a ec ldi r24, 0xCA ; 202 1d398: 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)); 1d39a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d39e: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 1d3a2: 0f c0 rjmp .+30 ; 0x1d3c2 // 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); 1d3a4: 85 e6 ldi r24, 0x65 ; 101 1d3a6: 93 e4 ldi r25, 0x43 ; 67 1d3a8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d3ac: 40 e0 ldi r20, 0x00 ; 0 1d3ae: 60 e0 ldi r22, 0x00 ; 0 1d3b0: 0e 94 5f e3 call 0x1c6be ; 0x1c6be if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1d3b4: 81 11 cpse r24, r1 1d3b6: 07 c0 rjmp .+14 ; 0x1d3c6 1d3b8: 61 e0 ldi r22, 0x01 ; 1 1d3ba: 8f e5 ldi r24, 0x5F ; 95 1d3bc: 9f e0 ldi r25, 0x0F ; 15 1d3be: 0f 94 a5 a4 call 0x3494a ; 0x3494a state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); state = S::Restore; 1d3c2: c1 e0 ldi r28, 0x01 ; 1 1d3c4: bc cf rjmp .-136 ; 0x1d33e 1d3c6: 60 e0 ldi r22, 0x00 ; 0 1d3c8: 8f e5 ldi r24, 0x5F ; 95 1d3ca: 9f e0 ldi r25, 0x0F ; 15 1d3cc: 0f 94 a5 a4 call 0x3494a ; 0x3494a 1d3d0: 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); 1d3d2: 10 e0 ldi r17, 0x00 ; 0 1d3d4: 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); 1d3d6: 1f 93 push r17 1d3d8: 0f 93 push r16 1d3da: 80 e8 ldi r24, 0x80 ; 128 1d3dc: 98 e6 ldi r25, 0x68 ; 104 1d3de: 9f 93 push r25 1d3e0: 8f 93 push r24 1d3e2: 0f 94 43 a3 call 0x34686 ; 0x34686 switch (state) { 1d3e6: 0f 90 pop r0 1d3e8: 0f 90 pop r0 1d3ea: 0f 90 pop r0 1d3ec: 0f 90 pop r0 1d3ee: cc 30 cpi r28, 0x0C ; 12 1d3f0: 09 f4 brne .+2 ; 0x1d3f4 1d3f2: ed c0 rjmp .+474 ; 0x1d5ce 1d3f4: cd 30 cpi r28, 0x0D ; 13 1d3f6: 09 f4 brne .+2 ; 0x1d3fa 1d3f8: ff c0 rjmp .+510 ; 0x1d5f8 case S::Run: // user interrupted msg = _T(MSG_WIZARD_QUIT); 1d3fa: 84 ec ldi r24, 0xC4 ; 196 1d3fc: 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) { 1d3fe: cc 23 and r28, r28 1d400: 09 f4 brne .+2 ; 0x1d404 1d402: fc c0 rjmp .+504 ; 0x1d5fc break; } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); 1d404: 81 e0 ldi r24, 0x01 ; 1 1d406: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_update(2); 1d40a: 82 e0 ldi r24, 0x02 ; 2 } 1d40c: cf 91 pop r28 1d40e: 1f 91 pop r17 1d410: 0f 91 pop r16 1d412: ff 90 pop r15 1d414: ef 90 pop r14 1d416: df 90 pop r13 1d418: cf 90 pop r12 1d41a: bf 90 pop r11 1d41c: af 90 pop r10 } if (msg) { lcd_show_fullscreen_message_and_wait_P(msg); } lcd_update_enable(true); lcd_update(2); 1d41e: 0c 94 4a 6f jmp 0xde94 ; 0xde94 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1d422: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> 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)) { 1d426: 81 e0 ldi r24, 0x01 ; 1 1d428: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 state = S::Selftest; 1d42c: 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)) { 1d42e: 88 23 and r24, r24 1d430: 09 f4 brne .+2 ; 0x1d434 1d432: 85 cf rjmp .-246 ; 0x1d33e state = S::Selftest; } else if (!calibration_status_get(CALIBRATION_STATUS_XYZ)) { 1d434: 82 e0 ldi r24, 0x02 ; 2 1d436: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 // S::Xyz *includes* S::Z so it needs to come before // to avoid repeating Z alignment state = S::Xyz; 1d43a: 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)) { 1d43c: 88 23 and r24, r24 1d43e: 09 f4 brne .+2 ; 0x1d442 1d440: 7e cf rjmp .-260 ; 0x1d33e // 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)) { 1d442: 84 e0 ldi r24, 0x04 ; 4 1d444: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 state = S::Z; 1d448: 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)) { 1d44a: 88 23 and r24, r24 1d44c: 09 f4 brne .+2 ; 0x1d450 1d44e: 77 cf rjmp .-274 ; 0x1d33e 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)) { 1d450: 80 e1 ldi r24, 0x10 ; 16 1d452: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 state = S::IsFil; 1d456: 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)) { 1d458: 88 23 and r24, r24 1d45a: 09 f4 brne .+2 ; 0x1d45e 1d45c: 70 cf rjmp .-288 ; 0x1d33e state = S::IsFil; } else { // all required steps completed, finish successfully state = S::Finish; 1d45e: cc e0 ldi r28, 0x0C ; 12 1d460: 6e cf rjmp .-292 ; 0x1d33e } break; case S::Selftest: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_SELFTEST)); 1d462: 8c e1 ldi r24, 0x1C ; 28 1d464: 93 e4 ldi r25, 0x43 ; 67 1d466: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d46a: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa wizard_event = lcd_selftest(); 1d46e: 0e 94 9e de call 0x1bd3c ; 0x1bd3c 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); 1d472: 81 11 cpse r24, r1 1d474: a6 cf rjmp .-180 ; 0x1d3c2 } 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); 1d476: cd e0 ldi r28, 0x0D ; 13 1d478: 62 cf rjmp .-316 ; 0x1d33e break; case S::Xyz: lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_XYZ_CAL)); 1d47a: 8e ed ldi r24, 0xDE ; 222 1d47c: 92 e4 ldi r25, 0x42 ; 66 1d47e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d482: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa wizard_event = gcode_M45(false, 0); 1d486: 80 e0 ldi r24, 0x00 ; 0 1d488: 0f 94 bf 7d call 0x2fb7e ; 0x2fb7e 1d48c: f2 cf rjmp .-28 ; 0x1d472 state = (wizard_event ? S::Restore : S::Failed); break; case S::Z: lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_SHIPPING_HELPERS)); 1d48e: 86 eb ldi r24, 0xB6 ; 182 1d490: 92 e4 ldi r25, 0x42 ; 66 1d492: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d496: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa lcd_show_fullscreen_message_and_wait_P(_T(MSG_REMOVE_TEST_PRINT)); 1d49a: 88 e8 ldi r24, 0x88 ; 136 1d49c: 92 e4 ldi r25, 0x42 ; 66 1d49e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d4a2: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_Z_CAL)); 1d4a6: 88 e6 ldi r24, 0x68 ; 104 1d4a8: 92 e4 ldi r25, 0x42 ; 66 1d4aa: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d4ae: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa wizard_event = gcode_M45(true, 0); 1d4b2: 81 e0 ldi r24, 0x01 ; 1 1d4b4: 0f 94 bf 7d call 0x2fb7e ; 0x2fb7e if (!wizard_event) { 1d4b8: 88 23 and r24, r24 1d4ba: e9 f2 breq .-70 ; 0x1d476 state = S::Failed; } else { raise_z_above(MIN_Z_FOR_SWAP); 1d4bc: 60 e0 ldi r22, 0x00 ; 0 1d4be: 70 e0 ldi r23, 0x00 ; 0 1d4c0: 88 ed ldi r24, 0xD8 ; 216 1d4c2: 91 e4 ldi r25, 0x41 ; 65 1d4c4: 0e 94 47 6d call 0xda8e ; 0xda8e if(!MMU2::mmu2.Enabled()) { 1d4c8: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d4cc: 81 30 cpi r24, 0x01 ; 1 1d4ce: 09 f4 brne .+2 ; 0x1d4d2 1d4d0: 78 cf rjmp .-272 ; 0x1d3c2 return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 1d4d2: d0 92 5e 12 sts 0x125E, r13 ; 0x80125e 1d4d6: 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)); 1d4da: 83 e4 ldi r24, 0x43 ; 67 1d4dc: 92 e4 ldi r25, 0x42 ; 66 1d4de: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d4e2: 0e 94 91 de call 0x1bd22 ; 0x1bd22 wait_preheat(); 1d4e6: 0e 94 12 e2 call 0x1c424 ; 0x1c424 unload_filament(FILAMENTCHANGE_FINALRETRACT); // unload current filament 1d4ea: 60 e0 ldi r22, 0x00 ; 0 1d4ec: 70 e0 ldi r23, 0x00 ; 0 1d4ee: cb 01 movw r24, r22 1d4f0: 0e 94 66 e1 call 0x1c2cc ; 0x1c2cc lcd_wizard_load(); // load filament 1d4f4: 0e 94 5c e9 call 0x1d2b8 ; 0x1d2b8 1d4f8: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1d4fc: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d 1d500: 60 cf rjmp .-320 ; 0x1d3c2 1d502: d0 92 5e 12 sts 0x125E, r13 ; 0x80125e 1d506: c0 92 5d 12 sts 0x125D, r12 ; 0x80125d resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1d50a: b0 92 5a 12 sts 0x125A, r11 ; 0x80125a 1d50e: 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); 1d512: 8d e2 ldi r24, 0x2D ; 45 1d514: 92 e4 ldi r25, 0x42 ; 66 1d516: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d51a: 41 e0 ldi r20, 0x01 ; 1 1d51c: 60 e0 ldi r22, 0x00 ; 0 1d51e: 0e 94 5f e3 call 0x1c6be ; 0x1c6be if (wizard_event == LCD_LEFT_BUTTON_CHOICE) { 1d522: 88 23 and r24, r24 1d524: 09 f1 breq .+66 ; 0x1d568 state = S::Lay1CalCold; } else { // MIDDLE_BUTTON_CHOICE if(MMU2::mmu2.Enabled()) state = S::LoadFilCold; 1d526: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1d52a: c7 e0 ldi r28, 0x07 ; 7 1d52c: 81 30 cpi r24, 0x01 ; 1 1d52e: 09 f4 brne .+2 ; 0x1d532 1d530: 06 cf rjmp .-500 ; 0x1d33e else state = S::Preheat; 1d532: c6 e0 ldi r28, 0x06 ; 6 1d534: 04 cf rjmp .-504 ; 0x1d33e } break; case S::Preheat: menu_goto(lcd_preheat_menu, 0, true); 1d536: 20 e0 ldi r18, 0x00 ; 0 1d538: 41 e0 ldi r20, 0x01 ; 1 1d53a: 70 e0 ldi r23, 0x00 ; 0 1d53c: 60 e0 ldi r22, 0x00 ; 0 1d53e: 84 e8 ldi r24, 0x84 ; 132 1d540: 97 e3 ldi r25, 0x37 ; 55 1d542: 0e 94 08 63 call 0xc610 ; 0xc610 lcd_show_fullscreen_message_and_wait_P(_T(MSG_SEL_PREHEAT_TEMP)); 1d546: 8c ee ldi r24, 0xEC ; 236 1d548: 91 e4 ldi r25, 0x41 ; 65 1d54a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d54e: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 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); 1d552: 06 e0 ldi r16, 0x06 ; 6 1d554: 10 e0 ldi r17, 0x00 ; 0 1d556: 3f cf rjmp .-386 ; 0x1d3d6 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(); 1d558: 0e 94 12 e2 call 0x1c424 ; 0x1c424 lcd_wizard_load(); 1d55c: 0e 94 5c e9 call 0x1d2b8 ; 0x1d2b8 state = S::Lay1CalHot; 1d560: ca e0 ldi r28, 0x0A ; 10 1d562: ed ce rjmp .-550 ; 0x1d33e break; case S::LoadFilCold: lcd_wizard_load(); 1d564: 0e 94 5c e9 call 0x1d2b8 ; 0x1d2b8 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; 1d568: c9 e0 ldi r28, 0x09 ; 9 1d56a: e9 ce rjmp .-558 ; 0x1d33e case S::LoadFilCold: lcd_wizard_load(); state = S::Lay1CalCold; break; case S::Lay1CalCold: wizard_lay1cal_message(true); 1d56c: 81 e0 ldi r24, 0x01 ; 1 1d56e: 0e 94 3e e9 call 0x1d27c ; 0x1d27c menu_goto(lcd_v2_calibration, 0, true); 1d572: 20 e0 ldi r18, 0x00 ; 0 1d574: 41 e0 ldi r20, 0x01 ; 1 1d576: 70 e0 ldi r23, 0x00 ; 0 1d578: 60 e0 ldi r22, 0x00 ; 0 1d57a: 85 e5 ldi r24, 0x55 ; 85 1d57c: 97 ee ldi r25, 0xE7 ; 231 1d57e: 0e 94 08 63 call 0xc610 ; 0xc610 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); 1d582: 09 e0 ldi r16, 0x09 ; 9 1d584: 10 e0 ldi r17, 0x00 ; 0 1d586: 27 cf rjmp .-434 ; 0x1d3d6 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); 1d588: 80 e0 ldi r24, 0x00 ; 0 1d58a: 0e 94 3e e9 call 0x1d27c ; 0x1d27c lcd_commands_type = LcdCommands::Layer1Cal; 1d58e: 84 e0 ldi r24, 0x04 ; 4 1d590: 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); 1d594: 0a e0 ldi r16, 0x0A ; 10 1d596: 10 e0 ldi r17, 0x00 ; 0 1d598: 1e cf rjmp .-452 ; 0x1d3d6 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); 1d59a: 89 e9 ldi r24, 0x99 ; 153 1d59c: 91 e4 ldi r25, 0x41 ; 65 1d59e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d5a2: 41 e0 ldi r20, 0x01 ; 1 1d5a4: 60 e0 ldi r22, 0x00 ; 0 1d5a6: 0e 94 5f e3 call 0x1c6be ; 0x1c6be if (wizard_event == LCD_LEFT_BUTTON_CHOICE) 1d5aa: 81 11 cpse r24, r1 1d5ac: 07 c0 rjmp .+14 ; 0x1d5bc { lcd_show_fullscreen_message_and_wait_P(_T(MSG_WIZARD_CLEAN_HEATBED)); 1d5ae: 89 e6 ldi r24, 0x69 ; 105 1d5b0: 91 e4 ldi r25, 0x41 ; 65 1d5b2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d5b6: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 1d5ba: d6 cf rjmp .-84 ; 0x1d568 state = S::Lay1CalCold; } else { lcd_show_fullscreen_message_and_wait_P(_T(MSG_ADDITIONAL_SHEETS)); 1d5bc: 83 e0 ldi r24, 0x03 ; 3 1d5be: 91 e4 ldi r25, 0x41 ; 65 1d5c0: ec ce rjmp .-552 ; 0x1d39a 1d5c2: 60 e0 ldi r22, 0x00 ; 0 1d5c4: 8f e5 ldi r24, 0x5F ; 95 1d5c6: 9f e0 ldi r25, 0x0F ; 15 1d5c8: 0f 94 a5 a4 call 0x3494a ; 0x3494a 1d5cc: 04 cf rjmp .-504 ; 0x1d3d6 msg = _T(MSG_WIZARD_QUIT); break; case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); 1d5ce: 85 ea ldi r24, 0xA5 ; 165 1d5d0: 90 e4 ldi r25, 0x40 ; 64 1d5d2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d5d6: 8c 01 movw r16, r24 lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 1d5d8: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> case S::Finish: // we are successfully finished msg = _T(MSG_WIZARD_DONE); lcd_reset_alert_level(); lcd_setstatuspgm(MSG_WELCOME); 1d5dc: 8a e8 ldi r24, 0x8A ; 138 1d5de: 9c e6 ldi r25, 0x6C ; 108 1d5e0: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 lcd_return_to_status(); 1d5e4: 0f 94 6e 05 call 0x20adc ; 0x20adc default: // exiting for later re-entry break; } if (msg) { 1d5e8: 01 15 cp r16, r1 1d5ea: 11 05 cpc r17, r1 1d5ec: 09 f4 brne .+2 ; 0x1d5f0 1d5ee: 0a cf rjmp .-492 ; 0x1d404 lcd_show_fullscreen_message_and_wait_P(msg); 1d5f0: c8 01 movw r24, r16 1d5f2: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 1d5f6: 06 cf rjmp .-500 ; 0x1d404 lcd_return_to_status(); break; case S::Failed: // aborted due to failure msg = _T(MSG_WIZARD_CALIBRATION_FAILED); 1d5f8: 83 e4 ldi r24, 0x43 ; 67 1d5fa: 90 e4 ldi r25, 0x40 ; 64 1d5fc: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1d600: 8c 01 movw r16, r24 1d602: f2 cf rjmp .-28 ; 0x1d5e8 0001d604
: void setupUSB() __attribute__((weak)); void setupUSB() { } int main(void) { 1d604: cf 93 push r28 1d606: df 93 push r29 1d608: 00 d0 rcall .+0 ; 0x1d60a 1d60a: 00 d0 rcall .+0 ; 0x1d60c 1d60c: 00 d0 rcall .+0 ; 0x1d60e 1d60e: 1f 92 push r1 1d610: cd b7 in r28, 0x3d ; 61 1d612: de b7 in r29, 0x3e ; 62 void init() { // this needs to be called before setup() or some functions won't // work there sei(); 1d614: 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); 1d616: 84 b5 in r24, 0x24 ; 36 1d618: 82 60 ori r24, 0x02 ; 2 1d61a: 84 bd out 0x24, r24 ; 36 sbi(TCCR0A, WGM00); 1d61c: 84 b5 in r24, 0x24 ; 36 1d61e: 81 60 ori r24, 0x01 ; 1 1d620: 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); 1d622: 85 b5 in r24, 0x25 ; 37 1d624: 82 60 ori r24, 0x02 ; 2 1d626: 85 bd out 0x25, r24 ; 37 sbi(TCCR0B, CS00); 1d628: 85 b5 in r24, 0x25 ; 37 1d62a: 81 60 ori r24, 0x01 ; 1 1d62c: 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); 1d62e: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1d632: 81 60 ori r24, 0x01 ; 1 1d634: 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; 1d638: 10 92 81 00 sts 0x0081, r1 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // set timer 1 prescale factor to 64 sbi(TCCR1B, CS11); 1d63c: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1d640: 82 60 ori r24, 0x02 ; 2 1d642: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> #if F_CPU >= 8000000L sbi(TCCR1B, CS10); 1d646: 80 91 81 00 lds r24, 0x0081 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> 1d64a: 81 60 ori r24, 0x01 ; 1 1d64c: 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); 1d650: 80 91 80 00 lds r24, 0x0080 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> 1d654: 81 60 ori r24, 0x01 ; 1 1d656: 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); 1d65a: 80 91 b1 00 lds r24, 0x00B1 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> 1d65e: 84 60 ori r24, 0x04 ; 4 1d660: 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); 1d664: 80 91 b0 00 lds r24, 0x00B0 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> 1d668: 81 60 ori r24, 0x01 ; 1 1d66a: 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 1d66e: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1d672: 82 60 ori r24, 0x02 ; 2 1d674: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> sbi(TCCR3B, CS30); 1d678: 80 91 91 00 lds r24, 0x0091 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> 1d67c: 81 60 ori r24, 0x01 ; 1 1d67e: 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 1d682: 80 91 90 00 lds r24, 0x0090 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> 1d686: 81 60 ori r24, 0x01 ; 1 1d688: 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 1d68c: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1d690: 82 60 ori r24, 0x02 ; 2 1d692: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> sbi(TCCR4B, CS40); 1d696: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 1d69a: 81 60 ori r24, 0x01 ; 1 1d69c: 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 1d6a0: 80 91 a0 00 lds r24, 0x00A0 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> 1d6a4: 81 60 ori r24, 0x01 ; 1 1d6a6: 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 1d6aa: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1d6ae: 82 60 ori r24, 0x02 ; 2 1d6b0: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> sbi(TCCR5B, CS50); 1d6b4: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 1d6b8: 81 60 ori r24, 0x01 ; 1 1d6ba: 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 1d6be: 80 91 20 01 lds r24, 0x0120 ; 0x800120 <__TEXT_REGION_LENGTH__+0x7c2120> 1d6c2: 81 60 ori r24, 0x01 ; 1 1d6c4: 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); 1d6c8: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d6cc: 84 60 ori r24, 0x04 ; 4 1d6ce: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS1); 1d6d2: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d6d6: 82 60 ori r24, 0x02 ; 2 1d6d8: 80 93 7a 00 sts 0x007A, r24 ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> sbi(ADCSRA, ADPS0); 1d6dc: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d6e0: 81 60 ori r24, 0x01 ; 1 1d6e2: 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); 1d6e6: 80 91 7a 00 lds r24, 0x007A ; 0x80007a <__TEXT_REGION_LENGTH__+0x7c207a> 1d6ea: 80 68 ori r24, 0x80 ; 128 1d6ec: 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; 1d6f0: 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) { 1d6f4: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1d6f6: f8 94 cli wdt_reset(); 1d6f8: a8 95 wdr MCUSR &= ~_BV(WDRF); 1d6fa: 84 b7 in r24, 0x34 ; 52 1d6fc: 87 7f andi r24, 0xF7 ; 247 1d6fe: 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" ); 1d700: 0f b6 in r0, 0x3f ; 63 1d702: f8 94 cli 1d704: a8 95 wdr 1d706: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d70a: 88 61 ori r24, 0x18 ; 24 1d70c: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d710: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1d714: 0f be out 0x3f, r0 ; 63 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1d716: 9f bf out 0x3f, r25 ; 63 CRITICAL_SECTION_END; } void timer2_init(void) { CRITICAL_SECTION_START; 1d718: 9f b7 in r25, 0x3f ; 63 1d71a: 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 1d71c: 10 92 b0 00 sts 0x00B0, r1 ; 0x8000b0 <__TEXT_REGION_LENGTH__+0x7c20b0> TCCR2B = (4 << CS20); //WGM_2=0, CS_0-2=011 1d720: 84 e0 ldi r24, 0x04 ; 4 1d722: 80 93 b1 00 sts 0x00B1, r24 ; 0x8000b1 <__TEXT_REGION_LENGTH__+0x7c20b1> //mask timer2 interrupts - enable OVF, disable others TIMSK2 |= (1< 1d72a: 81 60 ori r24, 0x01 ; 1 1d72c: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1d734: 8d 7f andi r24, 0xFD ; 253 1d736: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> TIMSK2 &= ~(1< 1d73e: 8b 7f andi r24, 0xFB ; 251 1d740: 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; 1d744: 10 92 b3 00 sts 0x00B3, r1 ; 0x8000b3 <__TEXT_REGION_LENGTH__+0x7c20b3> CRITICAL_SECTION_END; 1d748: 9f bf out 0x3f, r25 ; 63 return 0; } void lcd_init(void) { WRITE(LCD_PINS_ENABLE,LOW); 1d74a: 5b 98 cbi 0x0b, 3 ; 11 SET_OUTPUT(LCD_PINS_RS); 1d74c: 55 9a sbi 0x0a, 5 ; 10 SET_OUTPUT(LCD_PINS_ENABLE); 1d74e: 53 9a sbi 0x0a, 3 ; 10 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); 1d750: 52 9a sbi 0x0a, 2 ; 10 SET_OUTPUT(LCD_PINS_D5); 1d752: 9c 9a sbi 0x13, 4 ; 19 SET_OUTPUT(LCD_PINS_D6); 1d754: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1d758: 80 68 ori r24, 0x80 ; 128 1d75a: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> SET_OUTPUT(LCD_PINS_D7); 1d75e: 9b 9a sbi 0x13, 3 ; 19 #ifdef LCD_8BIT lcd_displayfunction |= LCD_8BITMODE; #endif lcd_displayfunction |= LCD_2LINE; 1d760: 80 91 00 04 lds r24, 0x0400 ; 0x800400 <_ZL19lcd_displayfunction.lto_priv.510> 1d764: 88 60 ori r24, 0x08 ; 8 1d766: 80 93 00 04 sts 0x0400, r24 ; 0x800400 <_ZL19lcd_displayfunction.lto_priv.510> 1d76a: 2f ef ldi r18, 0xFF ; 255 1d76c: 30 e7 ldi r19, 0x70 ; 112 1d76e: 82 e0 ldi r24, 0x02 ; 2 1d770: 21 50 subi r18, 0x01 ; 1 1d772: 30 40 sbci r19, 0x00 ; 0 1d774: 80 40 sbci r24, 0x00 ; 0 1d776: e1 f7 brne .-8 ; 0x1d770 1d778: 00 c0 rjmp .+0 ; 0x1d77a 1d77a: 00 00 nop _delay_us(50000); lcd_begin(1); //first time init 1d77c: 81 e0 ldi r24, 0x01 ; 1 1d77e: 0e 94 af 70 call 0xe15e ; 0xe15e fdev_setup_stream(lcdout, lcd_putchar, NULL, _FDEV_SETUP_WRITE); //setup lcdout stream 1d782: 8c eb ldi r24, 0xBC ; 188 1d784: 93 e7 ldi r25, 0x73 ; 115 1d786: 90 93 fb 03 sts 0x03FB, r25 ; 0x8003fb <_lcdout+0x9> 1d78a: 80 93 fa 03 sts 0x03FA, r24 ; 0x8003fa <_lcdout+0x8> 1d78e: 10 92 fd 03 sts 0x03FD, r1 ; 0x8003fd <_lcdout+0xb> 1d792: 10 92 fc 03 sts 0x03FC, r1 ; 0x8003fc <_lcdout+0xa> 1d796: 12 e0 ldi r17, 0x02 ; 2 1d798: 10 93 f5 03 sts 0x03F5, r17 ; 0x8003f5 <_lcdout+0x3> 1d79c: 10 92 ff 03 sts 0x03FF, r1 ; 0x8003ff <_lcdout+0xd> 1d7a0: 10 92 fe 03 sts 0x03FE, r1 ; 0x8003fe <_lcdout+0xc> void ultralcd_init() { backlight_init(); lcd_init(); lcd_refresh(); 1d7a4: 0e 94 f0 70 call 0xe1e0 ; 0xe1e0 lcd_longpress_func = menu_lcd_longpress_func; 1d7a8: 84 e5 ldi r24, 0x54 ; 84 1d7aa: 96 ec ldi r25, 0xC6 ; 198 1d7ac: 90 93 07 04 sts 0x0407, r25 ; 0x800407 1d7b0: 80 93 06 04 sts 0x0406, r24 ; 0x800406 lcd_lcdupdate_func = menu_lcd_lcdupdate_func; 1d7b4: 81 e6 ldi r24, 0x61 ; 97 1d7b6: 98 ef ldi r25, 0xF8 ; 248 1d7b8: 90 93 05 04 sts 0x0405, r25 ; 0x800405 1d7bc: 80 93 04 04 sts 0x0404, r24 ; 0x800404 menu_menu = lcd_status_screen; 1d7c0: 82 e4 ldi r24, 0x42 ; 66 1d7c2: 97 e3 ldi r25, 0x37 ; 55 1d7c4: 90 93 03 04 sts 0x0403, r25 ; 0x800403 1d7c8: 80 93 02 04 sts 0x0402, r24 ; 0x800402 SET_INPUT(BTN_EN1); 1d7cc: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d7d0: 8b 7f andi r24, 0xFB ; 251 1d7d2: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> SET_INPUT(BTN_EN2); 1d7d6: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d7da: 8d 7f andi r24, 0xFD ; 253 1d7dc: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(BTN_EN1, HIGH); 1d7e0: 9f b7 in r25, 0x3f ; 63 1d7e2: f8 94 cli 1d7e4: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d7e8: 84 60 ori r24, 0x04 ; 4 1d7ea: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d7ee: 9f bf out 0x3f, r25 ; 63 WRITE(BTN_EN2, HIGH); 1d7f0: 9f b7 in r25, 0x3f ; 63 1d7f2: f8 94 cli 1d7f4: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d7f8: 82 60 ori r24, 0x02 ; 2 1d7fa: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d7fe: 9f bf out 0x3f, r25 ; 63 #if BTN_ENC > 0 SET_INPUT(BTN_ENC); 1d800: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1d804: 8f 7b andi r24, 0xBF ; 191 1d806: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BTN_ENC, HIGH); 1d80a: 9f b7 in r25, 0x3f ; 63 1d80c: f8 94 cli 1d80e: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1d812: 80 64 ori r24, 0x40 ; 64 1d814: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1d818: 9f bf out 0x3f, r25 ; 63 #endif #if defined (SDSUPPORT) && defined(SDCARDDETECT) && (SDCARDDETECT > 0) SET_INPUT(SDCARDDETECT); 1d81a: 80 91 04 01 lds r24, 0x0104 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> 1d81e: 8e 7f andi r24, 0xFE ; 254 1d820: 80 93 04 01 sts 0x0104, r24 ; 0x800104 <__TEXT_REGION_LENGTH__+0x7c2104> WRITE(SDCARDDETECT, HIGH); 1d824: 9f b7 in r25, 0x3f ; 63 1d826: f8 94 cli 1d828: 80 91 05 01 lds r24, 0x0105 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d82c: 81 60 ori r24, 0x01 ; 1 1d82e: 80 93 05 01 sts 0x0105, r24 ; 0x800105 <__TEXT_REGION_LENGTH__+0x7c2105> 1d832: 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); 1d834: af e9 ldi r26, 0x9F ; 159 1d836: bf e0 ldi r27, 0x0F ; 15 1d838: 11 97 sbiw r26, 0x01 ; 1 1d83a: f1 f7 brne .-4 ; 0x1d838 1d83c: 00 c0 rjmp .+0 ; 0x1d83e 1d83e: 00 00 nop _delay_ms(1); //wait for the pullups to raise the line lcd_oldcardstatus = IS_SD_INSERTED; 1d840: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1d844: 80 95 com r24 1d846: 81 70 andi r24, 0x01 ; 1 1d848: 80 93 01 04 sts 0x0401, r24 ; 0x800401 #endif//(SDCARDDETECT > 0) // Initialise status line strncpy_P(lcd_status_message, MSG_WELCOME, LCD_WIDTH); 1d84c: 44 e1 ldi r20, 0x14 ; 20 1d84e: 50 e0 ldi r21, 0x00 ; 0 1d850: 6a e8 ldi r22, 0x8A ; 138 1d852: 7c e6 ldi r23, 0x6C ; 108 1d854: 85 e6 ldi r24, 0x65 ; 101 1d856: 94 e0 ldi r25, 0x04 ; 4 1d858: 0f 94 6e a2 call 0x344dc ; 0x344dc extern "C" { #endif //defined(__cplusplus) static inline void spi_init() { DDRB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1d85c: 84 b1 in r24, 0x04 ; 4 1d85e: 81 7f andi r24, 0xF1 ; 241 1d860: 84 b9 out 0x04, r24 ; 4 DDRB |= (1 << DD_SS) | (1 << DD_SCK) | (1 << DD_MOSI); 1d862: 84 b1 in r24, 0x04 ; 4 1d864: 87 60 ori r24, 0x07 ; 7 1d866: 84 b9 out 0x04, r24 ; 4 PORTB &= ~((1 << DD_SCK) | (1 << DD_MOSI) | (1 << DD_MISO)); 1d868: 85 b1 in r24, 0x05 ; 5 1d86a: 81 7f andi r24, 0xF1 ; 241 1d86c: 85 b9 out 0x05, r24 ; 5 PORTB |= (1 << DD_SS); 1d86e: 28 9a sbi 0x05, 0 ; 5 SPCR = SPI_SPCR(0, 0, 0, 1, 0); //SPE=1, MSTR=1 (0x50) 1d870: 80 e5 ldi r24, 0x50 ; 80 1d872: 8c bd out 0x2c, r24 ; 44 SPSR = 0x00; 1d874: 1d bc out 0x2d, r1 ; 45 } void lcd_splash() { lcd_clear(); // clears display and homes screen 1d876: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_printf_P(PSTR("\n Original Prusa i3\n Prusa Research\n%20.20S"), PSTR(FW_VERSION)); 1d87a: 81 e6 ldi r24, 0x61 ; 97 1d87c: 97 e8 ldi r25, 0x87 ; 135 1d87e: 9f 93 push r25 1d880: 8f 93 push r24 1d882: 88 e6 ldi r24, 0x68 ; 104 1d884: 97 e8 ldi r25, 0x87 ; 135 1d886: 9f 93 push r25 1d888: 8f 93 push r24 1d88a: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 static void Sound_DoSound_Encoder_Move(void); static void Sound_DoSound_Blind_Alert(void); void Sound_Init(void) { SET_OUTPUT(BEEPER); 1d88e: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1d892: 84 60 ori r24, 0x04 ; 4 1d894: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> eSoundMode = static_cast(eeprom_init_default_byte((uint8_t*)EEPROM_SOUND_MODE, e_SOUND_MODE_DEFAULT)); 1d898: 60 e0 ldi r22, 0x00 ; 0 1d89a: 87 ed ldi r24, 0xD7 ; 215 1d89c: 9e e0 ldi r25, 0x0E ; 14 1d89e: 0e 94 ae 78 call 0xf15c ; 0xf15c 1d8a2: 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); 1d8a6: 60 e0 ldi r22, 0x00 ; 0 1d8a8: 88 e0 ldi r24, 0x08 ; 8 1d8aa: 9f e0 ldi r25, 0x0F ; 15 1d8ac: 0e 94 ae 78 call 0xf15c ; 0xf15c 1d8b0: 80 93 1c 06 sts 0x061C, r24 ; 0x80061c MYSERIAL.begin(BAUDRATE); 1d8b4: 0f 94 9c 90 call 0x32138 ; 0x32138 fdev_setup_stream(uartout, uart_putchar, NULL, _FDEV_SETUP_WRITE); //setup uart out stream 1d8b8: 80 e1 ldi r24, 0x10 ; 16 1d8ba: 9b e7 ldi r25, 0x7B ; 123 1d8bc: 90 93 59 04 sts 0x0459, r25 ; 0x800459 <_uartout+0x9> 1d8c0: 80 93 58 04 sts 0x0458, r24 ; 0x800458 <_uartout+0x8> 1d8c4: 10 92 5b 04 sts 0x045B, r1 ; 0x80045b <_uartout+0xb> 1d8c8: 10 92 5a 04 sts 0x045A, r1 ; 0x80045a <_uartout+0xa> 1d8cc: 10 93 53 04 sts 0x0453, r17 ; 0x800453 <_uartout+0x3> 1d8d0: 10 92 5d 04 sts 0x045D, r1 ; 0x80045d <_uartout+0xd> 1d8d4: 10 92 5c 04 sts 0x045C, r1 ; 0x80045c <_uartout+0xc> stdout = uartout; 1d8d8: 80 e5 ldi r24, 0x50 ; 80 1d8da: 94 e0 ldi r25, 0x04 ; 4 1d8dc: 90 93 14 17 sts 0x1714, r25 ; 0x801714 <__iob+0x3> 1d8e0: 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); 1d8e4: 60 e0 ldi r22, 0x00 ; 0 1d8e6: 84 ec ldi r24, 0xC4 ; 196 1d8e8: 9f e0 ldi r25, 0x0F ; 15 1d8ea: 0e 94 ae 78 call 0xf15c ; 0xf15c 1d8ee: 80 93 60 0d sts 0x0D60, r24 ; 0x800d60 if (farm_mode) { 1d8f2: 0f 90 pop r0 1d8f4: 0f 90 pop r0 1d8f6: 0f 90 pop r0 1d8f8: 0f 90 pop r0 1d8fa: 88 23 and r24, r24 1d8fc: 79 f0 breq .+30 ; 0x1d91c no_response = true; //we need confirmation by recieving PRUSA thx 1d8fe: 81 e0 ldi r24, 0x01 ; 1 1d900: 80 93 08 04 sts 0x0408, r24 ; 0x800408 <_ZL11no_response.lto_priv.490> prusa_statistics(8); 1d904: 88 e0 ldi r24, 0x08 ; 8 1d906: 0f 94 05 30 call 0x2600a ; 0x2600a #ifdef HAS_SECOND_SERIAL_PORT selectedSerialPort = 1; #endif //HAS_SECOND_SERIAL_PORT MYSERIAL.begin(BAUDRATE); 1d90a: 0f 94 9c 90 call 0x32138 ; 0x32138 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 1d90e: 10 92 f2 16 sts 0x16F2, r1 ; 0x8016f2 1d912: 61 e0 ldi r22, 0x01 ; 1 1d914: 87 e8 ldi r24, 0x87 ; 135 1d916: 9f e0 ldi r25, 0x0F ; 15 1d918: 0f 94 a5 a4 call 0x3494a ; 0x3494a } #endif //PRUSA_SN_SUPPORT #ifndef XFLASH SERIAL_PROTOCOLLNPGM("start"); 1d91c: 89 e5 ldi r24, 0x59 ; 89 1d91e: 98 e8 ldi r25, 0x88 ; 136 1d920: 0e 94 0e 7d call 0xfa1c ; 0xfa1c #else if ((optiboot_status != 0) || (selectedSerialPort != 0)) SERIAL_PROTOCOLLNPGM("start"); #endif SERIAL_ECHO_START; 1d924: 84 ee ldi r24, 0xE4 ; 228 1d926: 92 ea ldi r25, 0xA2 ; 162 1d928: 0e 94 15 7b call 0xf62a ; 0xf62a puts_P(PSTR(" " FW_VERSION_FULL "_" FW_COMMIT_HASH)); 1d92c: 82 e4 ldi r24, 0x42 ; 66 1d92e: 98 e8 ldi r25, 0x88 ; 136 1d930: 0f 94 6a a3 call 0x346d4 ; 0x346d4 // by default the MMU shall remain disabled - PFW-1418 if (eeprom_init_default_byte((uint8_t *)EEPROM_MMU_ENABLED, 0)) { 1d934: 60 e0 ldi r22, 0x00 ; 0 1d936: 8c ea ldi r24, 0xAC ; 172 1d938: 9c e0 ldi r25, 0x0C ; 12 1d93a: 0e 94 ae 78 call 0xf15c ; 0xf15c 1d93e: 81 11 cpse r24, r1 MMU2::mmu2.Start(); 1d940: 0f 94 21 96 call 0x32c42 ; 0x32c42 } MMU2::mmu2.Status(); 1d944: 0f 94 4b 65 call 0x2ca96 ; 0x2ca96 } void SpoolJoin::initSpoolJoinStatus() { // Useful information to see during bootup SERIAL_ECHOPGM("SpoolJoin is "); 1d948: 86 e9 ldi r24, 0x96 ; 150 1d94a: 97 e8 ldi r25, 0x87 ; 135 1d94c: 0e 94 15 7b call 0xf62a ; 0xf62a uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_SPOOL_JOIN, (uint8_t)EEPROM::Disabled); 1d950: 62 e0 ldi r22, 0x02 ; 2 1d952: 86 ed ldi r24, 0xD6 ; 214 1d954: 9e e0 ldi r25, 0x0E ; 14 1d956: 0e 94 ae 78 call 0xf15c ; 0xf15c if (status == (uint8_t)EEPROM::Enabled) 1d95a: 81 30 cpi r24, 0x01 ; 1 1d95c: 09 f0 breq .+2 ; 0x1d960 1d95e: 74 c0 rjmp .+232 ; 0x1da48 { SERIAL_ECHOLNRPGM(_O(MSG_ON)); 1d960: 8e e5 ldi r24, 0x5E ; 94 1d962: 93 e6 ldi r25, 0x63 ; 99 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 1d964: 0e 94 0e 7d call 0xfa1c ; 0xfa1c #endif #endif //DEBUG_SEC_LANG // Check startup - does nothing if bootloader sets MCUSR to 0 byte mcu = MCUSR; 1d968: 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); 1d96a: 10 ff sbrs r17, 0 1d96c: 04 c0 rjmp .+8 ; 0x1d976 1d96e: 80 e6 ldi r24, 0x60 ; 96 1d970: 9a e6 ldi r25, 0x6A ; 106 1d972: 0f 94 6a a3 call 0x346d4 ; 0x346d4 if (mcu & 2) puts_P(MSG_EXTERNAL_RESET); 1d976: 11 ff sbrs r17, 1 1d978: 04 c0 rjmp .+8 ; 0x1d982 1d97a: 80 e5 ldi r24, 0x50 ; 80 1d97c: 9a e6 ldi r25, 0x6A ; 106 1d97e: 0f 94 6a a3 call 0x346d4 ; 0x346d4 if (mcu & 4) puts_P(MSG_BROWNOUT_RESET); 1d982: 12 ff sbrs r17, 2 1d984: 04 c0 rjmp .+8 ; 0x1d98e 1d986: 8f e3 ldi r24, 0x3F ; 63 1d988: 9a e6 ldi r25, 0x6A ; 106 1d98a: 0f 94 6a a3 call 0x346d4 ; 0x346d4 if (mcu & 8) puts_P(MSG_WATCHDOG_RESET); 1d98e: 13 ff sbrs r17, 3 1d990: 04 c0 rjmp .+8 ; 0x1d99a 1d992: 8f e2 ldi r24, 0x2F ; 47 1d994: 9a e6 ldi r25, 0x6A ; 106 1d996: 0f 94 6a a3 call 0x346d4 ; 0x346d4 if (mcu & 32) puts_P(MSG_SOFTWARE_RESET); 1d99a: 15 ff sbrs r17, 5 1d99c: 04 c0 rjmp .+8 ; 0x1d9a6 1d99e: 8f e1 ldi r24, 0x1F ; 31 1d9a0: 9a e6 ldi r25, 0x6A ; 106 1d9a2: 0f 94 6a a3 call 0x346d4 ; 0x346d4 MCUSR = 0; 1d9a6: 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; 1d9a8: 84 ee ldi r24, 0xE4 ; 228 1d9aa: 92 ea ldi r25, 0xA2 ; 162 1d9ac: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(_n(" Last Updated: "));////MSG_CONFIGURATION_VER 1d9b0: 8f e0 ldi r24, 0x0F ; 15 1d9b2: 9a e6 ldi r25, 0x6A ; 106 1d9b4: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPGM(STRING_VERSION_CONFIG_H); 1d9b8: 8e e2 ldi r24, 0x2E ; 46 1d9ba: 98 e8 ldi r25, 0x88 ; 136 1d9bc: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(_n(" | Author: "));////MSG_AUTHOR 1d9c0: 83 e0 ldi r24, 0x03 ; 3 1d9c2: 9a e6 ldi r25, 0x6A ; 106 1d9c4: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNPGM(STRING_CONFIG_H_AUTHOR); 1d9c8: 86 e2 ldi r24, 0x26 ; 38 1d9ca: 98 e8 ldi r25, 0x88 ; 136 1d9cc: 0e 94 0e 7d call 0xfa1c ; 0xfa1c #endif #endif SERIAL_ECHO_START; 1d9d0: 84 ee ldi r24, 0xE4 ; 228 1d9d2: 92 ea ldi r25, 0xA2 ; 162 1d9d4: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(_n(" Free Memory: "));////MSG_FREE_MEMORY 1d9d8: 84 ef ldi r24, 0xF4 ; 244 1d9da: 99 e6 ldi r25, 0x69 ; 105 1d9dc: 0e 94 15 7b call 0xf62a ; 0xf62a /** Amount of free RAM * \return The number of free bytes. */ int SdFatUtil::FreeRam() { char top; return __brkval ? &top - __brkval : &top - &__bss_end; 1d9e0: 80 91 0d 17 lds r24, 0x170D ; 0x80170d <__brkval> 1d9e4: 90 91 0e 17 lds r25, 0x170E ; 0x80170e <__brkval+0x1> 1d9e8: fe 01 movw r30, r28 1d9ea: 31 96 adiw r30, 0x01 ; 1 1d9ec: 7f 01 movw r14, r30 1d9ee: bf 01 movw r22, r30 1d9f0: 00 97 sbiw r24, 0x00 ; 0 1d9f2: 69 f1 breq .+90 ; 0x1da4e 1d9f4: 68 1b sub r22, r24 1d9f6: 79 0b sbc r23, r25 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 1d9f8: 07 2e mov r0, r23 1d9fa: 00 0c add r0, r0 1d9fc: 88 0b sbc r24, r24 1d9fe: 99 0b sbc r25, r25 1da00: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_ECHO(freeMemory()); SERIAL_ECHORPGM(_n(" PlannerBufferBytes: "));////MSG_PLANNER_BUFFER_BYTES 1da04: 8d ed ldi r24, 0xDD ; 221 1da06: 99 e6 ldi r25, 0x69 ; 105 1da08: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN((int)sizeof(block_t)*BLOCK_BUFFER_SIZE); 1da0c: 80 ee ldi r24, 0xE0 ; 224 1da0e: 96 e0 ldi r25, 0x06 ; 6 1da10: 0f 94 5d 65 call 0x2caba ; 0x2caba #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); 1da14: 6a ef ldi r22, 0xFA ; 250 1da16: 70 e0 ldi r23, 0x00 ; 0 1da18: 8e ee ldi r24, 0xEE ; 238 1da1a: 9e e0 ldi r25, 0x0E ; 14 1da1c: 0e 94 96 78 call 0xf12c ; 0xf12c 1da20: 8c 01 movw r16, r24 uint16_t motherboard = eeprom_init_default_word((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); 1da22: 6b ec ldi r22, 0xCB ; 203 1da24: 70 e0 ldi r23, 0x00 ; 0 1da26: 8c ee ldi r24, 0xEC ; 236 1da28: 9e e0 ldi r25, 0x0E ; 14 1da2a: 0e 94 96 78 call 0xf12c ; 0xf12c if (printer_type != PRINTER_TYPE) version_changed |= 0b10; 1da2e: 0a 3f cpi r16, 0xFA ; 250 1da30: 11 05 cpc r17, r1 1da32: 09 f0 breq .+2 ; 0x1da36 1da34: 2c c6 rjmp .+3160 ; 0x1e68e if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1da36: 01 e0 ldi r16, 0x01 ; 1 1da38: 8b 3c cpi r24, 0xCB ; 203 1da3a: 91 05 cpc r25, r1 1da3c: 09 f4 brne .+2 ; 0x1da40 1da3e: 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(); 1da40: 0e 94 7d 85 call 0x10afa ; 0x10afa 1da44: b8 2e mov r11, r24 1da46: 2b c6 rjmp .+3158 ; 0x1e69e 1da48: 88 e5 ldi r24, 0x58 ; 88 1da4a: 93 e6 ldi r25, 0x63 ; 99 1da4c: 8b cf rjmp .-234 ; 0x1d964 1da4e: 67 51 subi r22, 0x17 ; 23 1da50: 77 41 sbci r23, 0x17 ; 23 1da52: d2 cf rjmp .-92 ; 0x1d9f8 minttemp_raw[0] -= OVERSAMPLENR; #endif } #endif //MINTEMP #ifdef HEATER_0_MAXTEMP maxttemp[0] = HEATER_0_MAXTEMP; 1da54: 81 e3 ldi r24, 0x31 ; 49 1da56: 91 e0 ldi r25, 0x01 ; 1 1da58: 90 93 55 02 sts 0x0255, r25 ; 0x800255 <_ZL8maxttemp.lto_priv.434+0x1> 1da5c: 80 93 54 02 sts 0x0254, r24 ; 0x800254 <_ZL8maxttemp.lto_priv.434> while(analog2temp(maxttemp_raw[0], 0) > HEATER_0_MAXTEMP) { 1da60: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL12maxttemp_raw.lto_priv.428> 1da64: 90 91 0c 04 lds r25, 0x040C ; 0x80040c <_ZL12maxttemp_raw.lto_priv.428+0x1> 1da68: 0f 94 07 90 call 0x3200e ; 0x3200e 1da6c: 20 e0 ldi r18, 0x00 ; 0 1da6e: 30 e8 ldi r19, 0x80 ; 128 1da70: 48 e9 ldi r20, 0x98 ; 152 1da72: 53 e4 ldi r21, 0x43 ; 67 1da74: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1da78: 18 16 cp r1, r24 1da7a: 54 f4 brge .+20 ; 0x1da90 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP maxttemp_raw[0] -= OVERSAMPLENR; #else maxttemp_raw[0] += OVERSAMPLENR; 1da7c: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL12maxttemp_raw.lto_priv.428> 1da80: 90 91 0c 04 lds r25, 0x040C ; 0x80040c <_ZL12maxttemp_raw.lto_priv.428+0x1> 1da84: 40 96 adiw r24, 0x10 ; 16 1da86: 90 93 0c 04 sts 0x040C, r25 ; 0x80040c <_ZL12maxttemp_raw.lto_priv.428+0x1> 1da8a: 80 93 0b 04 sts 0x040B, r24 ; 0x80040b <_ZL12maxttemp_raw.lto_priv.428> 1da8e: e8 cf rjmp .-48 ; 0x1da60 #endif } #endif //MAXTEMP #ifdef BED_MINTEMP while(analog2tempBed(bed_minttemp_raw) < BED_MINTEMP) { 1da90: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.426> 1da94: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.426+0x1> 1da98: 0f 94 5b 12 call 0x224b6 ; 0x224b6 1da9c: 20 e0 ldi r18, 0x00 ; 0 1da9e: 30 e0 ldi r19, 0x00 ; 0 1daa0: 40 ef ldi r20, 0xF0 ; 240 1daa2: 51 e4 ldi r21, 0x41 ; 65 1daa4: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1daa8: 87 ff sbrs r24, 7 1daaa: 0a c0 rjmp .+20 ; 0x1dac0 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_minttemp_raw += OVERSAMPLENR; #else bed_minttemp_raw -= OVERSAMPLENR; 1daac: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.426> 1dab0: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.426+0x1> 1dab4: 40 97 sbiw r24, 0x10 ; 16 1dab6: 90 93 51 02 sts 0x0251, r25 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.426+0x1> 1daba: 80 93 50 02 sts 0x0250, r24 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.426> 1dabe: e8 cf rjmp .-48 ; 0x1da90 #endif } #endif //BED_MINTEMP #ifdef BED_MAXTEMP while(analog2tempBed(bed_maxttemp_raw) > BED_MAXTEMP) { 1dac0: 80 91 09 04 lds r24, 0x0409 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.429> 1dac4: 90 91 0a 04 lds r25, 0x040A ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.429+0x1> 1dac8: 0f 94 5b 12 call 0x224b6 ; 0x224b6 1dacc: 20 e0 ldi r18, 0x00 ; 0 1dace: 30 e0 ldi r19, 0x00 ; 0 1dad0: 4a ef ldi r20, 0xFA ; 250 1dad2: 52 e4 ldi r21, 0x42 ; 66 1dad4: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1dad8: 18 16 cp r1, r24 1dada: 54 f4 brge .+20 ; 0x1daf0 #if HEATER_BED_RAW_LO_TEMP < HEATER_BED_RAW_HI_TEMP bed_maxttemp_raw -= OVERSAMPLENR; #else bed_maxttemp_raw += OVERSAMPLENR; 1dadc: 80 91 09 04 lds r24, 0x0409 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.429> 1dae0: 90 91 0a 04 lds r25, 0x040A ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.429+0x1> 1dae4: 40 96 adiw r24, 0x10 ; 16 1dae6: 90 93 0a 04 sts 0x040A, r25 ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.429+0x1> 1daea: 80 93 09 04 sts 0x0409, r24 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.429> 1daee: e8 cf rjmp .-48 ; 0x1dac0 #include #include "macros.h" void timer0_init(void) { CRITICAL_SECTION_START; 1daf0: 9f b7 in r25, 0x3f ; 63 1daf2: f8 94 cli TCNT0 = 0; 1daf4: 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; 1daf6: 8f ef ldi r24, 0xFF ; 255 1daf8: 88 bd out 0x28, r24 ; 40 // Set fast PWM mode and inverting mode. TCCR0A = (1 << WGM01) | (1 << WGM00) | (1 << COM0B1) | (1 << COM0B0); 1dafa: 83 e3 ldi r24, 0x33 ; 51 1dafc: 84 bd out 0x24, r24 ; 36 TCCR0B = (1 << CS01); // CLK/8 prescaling 1dafe: 12 e0 ldi r17, 0x02 ; 2 1db00: 15 bd out 0x25, r17 ; 37 TIMSK0 |= (1 << TOIE0); // enable timer overflow interrupt 1db02: 80 91 6e 00 lds r24, 0x006E ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> 1db06: 81 60 ori r24, 0x01 ; 1 1db08: 80 93 6e 00 sts 0x006E, r24 ; 0x80006e <__TEXT_REGION_LENGTH__+0x7c206e> CRITICAL_SECTION_END; 1db0c: 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; 1db0e: 80 e8 ldi r24, 0x80 ; 128 1db10: 80 93 b4 00 sts 0x00B4, r24 ; 0x8000b4 <__TEXT_REGION_LENGTH__+0x7c20b4> ENABLE_SOFT_PWM_INTERRUPT(); 1db14: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 1db18: 84 60 ori r24, 0x04 ; 4 1db1a: 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; 1db1e: 2f b7 in r18, 0x3f ; 63 1db20: f8 94 cli SET_OUTPUT(BEEPER); 1db22: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1db26: 84 60 ori r24, 0x04 ; 4 1db28: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> WRITE(BEEPER, LOW); 1db2c: 9f b7 in r25, 0x3f ; 63 1db2e: f8 94 cli 1db30: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1db34: 8b 7f andi r24, 0xFB ; 251 1db36: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1db3a: 9f bf out 0x3f, r25 ; 63 SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN); 1db3c: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1db40: 80 62 ori r24, 0x20 ; 32 1db42: 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); 1db46: 81 e0 ldi r24, 0x01 ; 1 1db48: 80 93 a0 00 sts 0x00A0, r24 ; 0x8000a0 <__TEXT_REGION_LENGTH__+0x7c20a0> TCCR4B = _BV(WGM43) | _BV(CS42) | _BV(CS40); 1db4c: 85 e1 ldi r24, 0x15 ; 21 1db4e: 80 93 a1 00 sts 0x00A1, r24 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> OCR4A = 255U; 1db52: 8f ef ldi r24, 0xFF ; 255 1db54: 90 e0 ldi r25, 0x00 ; 0 1db56: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 1db5a: 80 93 a8 00 sts 0x00A8, r24 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> OCR4B = 255U; 1db5e: 90 93 ab 00 sts 0x00AB, r25 ; 0x8000ab <__TEXT_REGION_LENGTH__+0x7c20ab> 1db62: 80 93 aa 00 sts 0x00AA, r24 ; 0x8000aa <__TEXT_REGION_LENGTH__+0x7c20aa> OCR4C = 255U; 1db66: 90 93 ad 00 sts 0x00AD, r25 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 1db6a: 80 93 ac 00 sts 0x00AC, r24 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> TIMSK4 = 0; 1db6e: 10 92 72 00 sts 0x0072, r1 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 1db72: 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")); 1db74: 84 ea ldi r24, 0xA4 ; 164 1db76: 97 e8 ldi r25, 0x87 ; 135 1db78: 0f 94 6a a3 call 0x346d4 ; 0x346d4 DIDR0 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) & 0xff); //disable digital inputs PORTF 1db7c: 8f e5 ldi r24, 0x5F ; 95 1db7e: 80 93 7e 00 sts 0x007E, r24 ; 0x80007e <__TEXT_REGION_LENGTH__+0x7c207e> DIDR2 = ((ADC_CHAN_MSK & ADC_DIDR_MSK) >> 8); //disable digital inputs PORTK 1db82: 10 93 7d 00 sts 0x007D, r17 ; 0x80007d <__TEXT_REGION_LENGTH__+0x7c207d> ADMUX |= (1 << REFS0); //use AVCC as reference 1db86: 80 91 7c 00 lds r24, 0x007C ; 0x80007c <__TEXT_REGION_LENGTH__+0x7c207c> 1db8a: 80 64 ori r24, 0x40 ; 64 1db8c: 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); 1db90: 8f e9 ldi r24, 0x9F ; 159 1db92: 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(); 1db96: 0e 94 b8 ba call 0x17570 ; 0x17570 // initialize temperature timer ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1db9a: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1db9c: f8 94 cli // CTC TCCRxB &= ~(1< 1dba2: 8f 7e andi r24, 0xEF ; 239 1dba4: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB |= (1< 1dbac: 88 60 ori r24, 0x08 ; 8 1dbae: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxA &= ~(1< 1dbb6: 8d 7f andi r24, 0xFD ; 253 1dbb8: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(1< 1dbc0: 8e 7f andi r24, 0xFE ; 254 1dbc2: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // output mode = 00 (disconnected) TCCRxA &= ~(3< 1dbca: 8f 73 andi r24, 0x3F ; 63 1dbcc: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> TCCRxA &= ~(3< 1dbd4: 8f 7c andi r24, 0xCF ; 207 1dbd6: 80 93 90 00 sts 0x0090, r24 ; 0x800090 <__TEXT_REGION_LENGTH__+0x7c2090> // x/256 prescaler TCCRxB |= (1< 1dbde: 84 60 ori r24, 0x04 ; 4 1dbe0: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1dbe8: 8d 7f andi r24, 0xFD ; 253 1dbea: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> TCCRxB &= ~(1< 1dbf2: 8e 7f andi r24, 0xFE ; 254 1dbf4: 80 93 91 00 sts 0x0091, r24 ; 0x800091 <__TEXT_REGION_LENGTH__+0x7c2091> // reset counter TCNTx = 0; 1dbf8: 10 92 95 00 sts 0x0095, r1 ; 0x800095 <__TEXT_REGION_LENGTH__+0x7c2095> 1dbfc: 10 92 94 00 sts 0x0094, r1 ; 0x800094 <__TEXT_REGION_LENGTH__+0x7c2094> OCRxA = TEMP_TIM_OCRA_OVF; 1dc00: 2b ee ldi r18, 0xEB ; 235 1dc02: 31 e4 ldi r19, 0x41 ; 65 1dc04: 30 93 99 00 sts 0x0099, r19 ; 0x800099 <__TEXT_REGION_LENGTH__+0x7c2099> 1dc08: 20 93 98 00 sts 0x0098, r18 ; 0x800098 <__TEXT_REGION_LENGTH__+0x7c2098> // clear pending interrupts, enable COMPA TEMP_MGR_INT_FLAG_CLEAR(); 1dc0c: c1 9a sbi 0x18, 1 ; 24 ENABLE_TEMP_MGR_INTERRUPT(); 1dc0e: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1dc12: 82 60 ori r24, 0x02 ; 2 1dc14: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1dc18: 9f bf out 0x3f, r25 ; 63 // SERIAL_ECHOLNPGM("planner_recalculate - 4"); } void plan_init() { block_buffer_head = 0; 1dc1a: 10 92 3e 0d sts 0x0D3E, r1 ; 0x800d3e block_buffer_tail = 0; 1dc1e: 10 92 3f 0d sts 0x0D3F, r1 ; 0x800d3f memset(position, 0, sizeof(position)); // clear position 1dc22: 80 e1 ldi r24, 0x10 ; 16 1dc24: ec e3 ldi r30, 0x3C ; 60 1dc26: f6 e0 ldi r31, 0x06 ; 6 1dc28: df 01 movw r26, r30 1dc2a: 28 2f mov r18, r24 1dc2c: 1d 92 st X+, r1 1dc2e: 2a 95 dec r18 1dc30: e9 f7 brne .-6 ; 0x1dc2c #ifdef LIN_ADVANCE memset(position_float, 0, sizeof(position_float)); // clear position 1dc32: e6 e3 ldi r30, 0x36 ; 54 1dc34: f4 e0 ldi r31, 0x04 ; 4 1dc36: df 01 movw r26, r30 1dc38: 28 2f mov r18, r24 1dc3a: 1d 92 st X+, r1 1dc3c: 2a 95 dec r18 1dc3e: e9 f7 brne .-6 ; 0x1dc3a #endif memset(previous_speed, 0, sizeof(previous_speed)); 1dc40: e6 e2 ldi r30, 0x26 ; 38 1dc42: f4 e0 ldi r31, 0x04 ; 4 1dc44: df 01 movw r26, r30 1dc46: 1d 92 st X+, r1 1dc48: 8a 95 dec r24 1dc4a: e9 f7 brne .-6 ; 0x1dc46 previous_nominal_speed = 0.0; 1dc4c: 10 92 22 04 sts 0x0422, r1 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.443> 1dc50: 10 92 23 04 sts 0x0423, r1 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.443+0x1> 1dc54: 10 92 24 04 sts 0x0424, r1 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.443+0x2> 1dc58: 10 92 25 04 sts 0x0425, r1 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.443+0x3> plan_reset_next_e_queue = false; 1dc5c: 10 92 21 04 sts 0x0421, r1 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.441> plan_reset_next_e_sched = false; 1dc60: 10 92 20 04 sts 0x0420, r1 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.442> } void factory_reset() { KEEPALIVE_STATE(PAUSED_FOR_USER); 1dc64: 84 e0 ldi r24, 0x04 ; 4 1dc66: 80 93 78 02 sts 0x0278, r24 ; 0x800278 if (!READ(BTN_ENC)) 1dc6a: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1dc6e: 86 fd sbrc r24, 6 1dc70: c6 c0 rjmp .+396 ; 0x1ddfe 1dc72: bf ef ldi r27, 0xFF ; 255 1dc74: e3 ed ldi r30, 0xD3 ; 211 1dc76: f0 e3 ldi r31, 0x30 ; 48 1dc78: b1 50 subi r27, 0x01 ; 1 1dc7a: e0 40 sbci r30, 0x00 ; 0 1dc7c: f0 40 sbci r31, 0x00 ; 0 1dc7e: e1 f7 brne .-8 ; 0x1dc78 1dc80: 00 c0 rjmp .+0 ; 0x1dc82 1dc82: 00 00 nop { _delay_ms(1000); if (!READ(BTN_ENC)) 1dc84: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1dc88: 86 fd sbrc r24, 6 1dc8a: b9 c0 rjmp .+370 ; 0x1ddfe { lcd_clear(); 1dc8c: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_P(PSTR("Factory RESET")); 1dc90: 8e ef ldi r24, 0xFE ; 254 1dc92: 97 e8 ldi r25, 0x87 ; 135 1dc94: 0e 94 6e 6f call 0xdedc ; 0xdedc SET_OUTPUT(BEEPER); 1dc98: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1dc9c: 84 60 ori r24, 0x04 ; 4 1dc9e: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> if(eSoundMode!=e_SOUND_MODE_SILENT) 1dca2: 80 91 47 04 lds r24, 0x0447 ; 0x800447 1dca6: 82 30 cpi r24, 0x02 ; 2 1dca8: 41 f0 breq .+16 ; 0x1dcba WRITE(BEEPER, HIGH); 1dcaa: 9f b7 in r25, 0x3f ; 63 1dcac: f8 94 cli 1dcae: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1dcb2: 84 60 ori r24, 0x04 ; 4 1dcb4: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1dcb8: 9f bf out 0x3f, r25 ; 63 while (!READ(BTN_ENC)); 1dcba: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 1dcbe: 86 ff sbrs r24, 6 1dcc0: fc cf rjmp .-8 ; 0x1dcba WRITE(BEEPER, LOW); 1dcc2: 9f b7 in r25, 0x3f ; 63 1dcc4: f8 94 cli 1dcc6: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1dcca: 8b 7f andi r24, 0xFB ; 251 1dccc: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1dcd0: 9f bf out 0x3f, r25 ; 63 1dcd2: 2f ef ldi r18, 0xFF ; 255 1dcd4: 37 ea ldi r19, 0xA7 ; 167 1dcd6: 81 e6 ldi r24, 0x61 ; 97 1dcd8: 21 50 subi r18, 0x01 ; 1 1dcda: 30 40 sbci r19, 0x00 ; 0 1dcdc: 80 40 sbci r24, 0x00 ; 0 1dcde: e1 f7 brne .-8 ; 0x1dcd8 1dce0: 00 c0 rjmp .+0 ; 0x1dce2 1dce2: 00 00 nop PSTR("Language"), PSTR("Statistics"), PSTR("Shipping prep"), PSTR("Service prep"), PSTR("All Data"), }; 1dce4: 84 ee ldi r24, 0xE4 ; 228 1dce6: 97 e8 ldi r25, 0x87 ; 135 1dce8: 9a 83 std Y+2, r25 ; 0x02 1dcea: 89 83 std Y+1, r24 ; 0x01 1dcec: 89 ed ldi r24, 0xD9 ; 217 1dcee: 97 e8 ldi r25, 0x87 ; 135 1dcf0: 9c 83 std Y+4, r25 ; 0x04 1dcf2: 8b 83 std Y+3, r24 ; 0x03 1dcf4: 8b ec ldi r24, 0xCB ; 203 1dcf6: 97 e8 ldi r25, 0x87 ; 135 1dcf8: 9e 83 std Y+6, r25 ; 0x06 1dcfa: 8d 83 std Y+5, r24 ; 0x05 1dcfc: 8e eb ldi r24, 0xBE ; 190 1dcfe: 97 e8 ldi r25, 0x87 ; 135 1dd00: 98 87 std Y+8, r25 ; 0x08 1dd02: 8f 83 std Y+7, r24 ; 0x07 1dd04: 85 eb ldi r24, 0xB5 ; 181 1dd06: 97 e8 ldi r25, 0x87 ; 135 1dd08: 9a 87 std Y+10, r25 ; 0x0a 1dd0a: 89 87 std Y+9, r24 ; 0x09 lcd_clear(); 1dd0c: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_putc_at(0, 0, '>'); 1dd10: 4e e3 ldi r20, 0x3E ; 62 1dd12: 60 e0 ldi r22, 0x00 ; 0 1dd14: 80 e0 ldi r24, 0x00 ; 0 1dd16: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_consume_click(); 1dd1a: 0e 94 c1 73 call 0xe782 ; 0xe782 } } char reset_menu() { static int8_t first = 0; char cursor_pos = 0; 1dd1e: 10 e0 ldi r17, 0x00 ; 0 1dd20: d1 2c mov r13, r1 1dd22: 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]); 1dd24: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1dd28: f6 01 movw r30, r12 1dd2a: e8 0f add r30, r24 1dd2c: f1 1d adc r31, r1 1dd2e: 87 fd sbrc r24, 7 1dd30: fa 95 dec r31 1dd32: ee 0f add r30, r30 1dd34: ff 1f adc r31, r31 1dd36: ee 0d add r30, r14 1dd38: ff 1d adc r31, r15 1dd3a: 40 81 ld r20, Z 1dd3c: 51 81 ldd r21, Z+1 ; 0x01 1dd3e: 6c 2d mov r22, r12 1dd40: 81 e0 ldi r24, 0x01 ; 1 1dd42: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 1dd46: 9f ef ldi r25, 0xFF ; 255 1dd48: c9 1a sub r12, r25 1dd4a: 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++) { 1dd4c: a4 e0 ldi r26, 0x04 ; 4 1dd4e: ca 16 cp r12, r26 1dd50: d1 04 cpc r13, r1 1dd52: 41 f7 brne .-48 ; 0x1dd24 lcd_puts_at_P(1, i, item[first + i]); } manage_heater(); 1dd54: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 1dd58: 81 e0 ldi r24, 0x01 ; 1 1dd5a: 0e 94 ad 8a call 0x1155a ; 0x1155a if (lcd_encoder) { 1dd5e: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1dd62: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1dd66: 00 97 sbiw r24, 0x00 ; 0 1dd68: 71 f1 breq .+92 ; 0x1ddc6 if (lcd_encoder < 0) { 1dd6a: 97 ff sbrs r25, 7 1dd6c: 12 c0 rjmp .+36 ; 0x1dd92 cursor_pos--; 1dd6e: 11 50 subi r17, 0x01 ; 1 if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { 1dd70: 14 30 cpi r17, 0x04 ; 4 1dd72: 0c f4 brge .+2 ; 0x1dd76 1dd74: 3a c2 rjmp .+1140 ; 0x1e1ea cursor_pos = 3; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1dd76: 87 e0 ldi r24, 0x07 ; 7 1dd78: 0f 94 3f 23 call 0x2467e ; 0x2467e if (first < (uint8_t)(sizeof(item) / sizeof(item[0])) - 4) { 1dd7c: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1dd80: 18 16 cp r1, r24 1dd82: 2c f0 brlt .+10 ; 0x1dd8e first++; 1dd84: 8f 5f subi r24, 0xFF ; 255 1dd86: 80 93 46 04 sts 0x0446, r24 ; 0x800446 lcd_clear(); 1dd8a: 0e 94 77 70 call 0xe0ee ; 0xe0ee if (lcd_encoder > 0) { cursor_pos++; } if (cursor_pos > 3) { cursor_pos = 3; 1dd8e: 13 e0 ldi r17, 0x03 ; 3 1dd90: 03 c0 rjmp .+6 ; 0x1dd98 if (lcd_encoder < 0) { cursor_pos--; } if (lcd_encoder > 0) { cursor_pos++; 1dd92: 1f 5f subi r17, 0xFF ; 255 } if (cursor_pos > 3) { 1dd94: 14 30 cpi r17, 0x04 ; 4 1dd96: 78 f7 brcc .-34 ; 0x1dd76 if (first > 0) { first--; lcd_clear(); } } lcd_puts_at_P(0, 0, PSTR(" \n \n \n ")); 1dd98: 4d ea ldi r20, 0xAD ; 173 1dd9a: 57 e8 ldi r21, 0x87 ; 135 1dd9c: 60 e0 ldi r22, 0x00 ; 0 1dd9e: 80 e0 ldi r24, 0x00 ; 0 1dda0: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(0, cursor_pos); 1dda4: 61 2f mov r22, r17 1dda6: 80 e0 ldi r24, 0x00 ; 0 1dda8: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_putc('>'); 1ddac: 8e e3 ldi r24, 0x3E ; 62 1ddae: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_encoder = 0; 1ddb2: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1ddb6: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e _delay(100); 1ddba: 64 e6 ldi r22, 0x64 ; 100 1ddbc: 70 e0 ldi r23, 0x00 ; 0 1ddbe: 80 e0 ldi r24, 0x00 ; 0 1ddc0: 90 e0 ldi r25, 0x00 ; 0 1ddc2: 0f 94 56 0b call 0x216ac ; 0x216ac } if (lcd_clicked()) { 1ddc6: 0e 94 c6 73 call 0xe78c ; 0xe78c 1ddca: 88 23 and r24, r24 1ddcc: 09 f4 brne .+2 ; 0x1ddd0 1ddce: a8 cf rjmp .-176 ; 0x1dd20 return(cursor_pos + first); 1ddd0: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1ddd4: 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(); 1ddd6: 0e 94 77 70 call 0xe0ee ; 0xe0ee Sound_MakeCustom(100,0,false); 1ddda: 40 e0 ldi r20, 0x00 ; 0 1dddc: 70 e0 ldi r23, 0x00 ; 0 1ddde: 60 e0 ldi r22, 0x00 ; 0 1dde0: 84 e6 ldi r24, 0x64 ; 100 1dde2: 90 e0 ldi r25, 0x00 ; 0 1dde4: 0f 94 4a 25 call 0x24a94 ; 0x24a94 switch (level) { 1dde8: 12 30 cpi r17, 0x02 ; 2 1ddea: 09 f4 brne .+2 ; 0x1ddee 1ddec: 35 c2 rjmp .+1130 ; 0x1e258 1ddee: 08 f0 brcs .+2 ; 0x1ddf2 1ddf0: 0d c2 rjmp .+1050 ; 0x1e20c 1ddf2: 11 23 and r17, r17 1ddf4: 09 f4 brne .+2 ; 0x1ddf8 1ddf6: 28 c2 rjmp .+1104 ; 0x1e248 1ddf8: 11 30 cpi r17, 0x01 ; 1 1ddfa: 09 f4 brne .+2 ; 0x1ddfe 1ddfc: 28 c2 rjmp .+1104 ; 0x1e24e case 4: _delay_ms(0); break; } } } KEEPALIVE_STATE(IN_HANDLER); 1ddfe: 82 e0 ldi r24, 0x02 ; 2 1de00: 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); 1de04: 60 e0 ldi r22, 0x00 ; 0 1de06: 8f ef ldi r24, 0xFF ; 255 1de08: 9f e0 ldi r25, 0x0F ; 15 1de0a: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_byte((uint8_t*)EEPROM_WIZARD_ACTIVE, 1); //run wizard if uninitialized 1de0e: 61 e0 ldi r22, 0x01 ; 1 1de10: 8f e5 ldi r24, 0x5F ; 95 1de12: 9f e0 ldi r25, 0x0F ; 15 1de14: 0e 94 ae 78 call 0xf15c ; 0xf15c void st_init() { #ifdef TMC2130 tmc2130_init(TMCInitParams(false, FarmOrUserECool())); #else st_current_init(); //Initialize Digipot Motor Current 1de18: 0f 94 1d 18 call 0x2303a ; 0x2303a 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; 1de1c: 85 e0 ldi r24, 0x05 ; 5 1de1e: e8 eb ldi r30, 0xB8 ; 184 1de20: f2 e0 ldi r31, 0x02 ; 2 1de22: d7 01 movw r26, r14 1de24: 01 90 ld r0, Z+ 1de26: 0d 92 st X+, r0 1de28: 8a 95 dec r24 1de2a: e1 f7 brne .-8 ; 0x1de24 SET_OUTPUT(X_MS1_PIN); 1de2c: 99 9a sbi 0x13, 1 ; 19 SET_OUTPUT(X_MS2_PIN); 1de2e: 98 9a sbi 0x13, 0 ; 19 SET_OUTPUT(Y_MS1_PIN); 1de30: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de34: 80 68 ori r24, 0x80 ; 128 1de36: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Y_MS2_PIN); 1de3a: 9a 9a sbi 0x13, 2 ; 19 SET_OUTPUT(Z_MS1_PIN); 1de3c: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de40: 80 64 ori r24, 0x40 ; 64 1de42: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(Z_MS2_PIN); 1de46: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de4a: 80 62 ori r24, 0x20 ; 32 1de4c: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS1_PIN); 1de50: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de54: 88 60 ori r24, 0x08 ; 8 1de56: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> SET_OUTPUT(E0_MS2_PIN); 1de5a: 80 91 07 01 lds r24, 0x0107 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de5e: 80 61 ori r24, 0x10 ; 16 1de60: 80 93 07 01 sts 0x0107, r24 ; 0x800107 <__TEXT_REGION_LENGTH__+0x7c2107> 1de64: 67 01 movw r12, r14 1de66: 10 e0 ldi r17, 0x00 ; 0 for(int i=0;i<=4;i++) microstep_mode(i,microstep_modes[i]); 1de68: f6 01 movw r30, r12 1de6a: 61 91 ld r22, Z+ 1de6c: 6f 01 movw r12, r30 1de6e: 81 2f mov r24, r17 1de70: 0f 94 e0 17 call 0x22fc0 ; 0x22fc0 1de74: 1f 5f subi r17, 0xFF ; 255 1de76: 15 30 cpi r17, 0x05 ; 5 1de78: b9 f7 brne .-18 ; 0x1de68 microstep_init(); //Initialize Microstepping Pins #endif //TMC2130 //Initialize Dir Pins #if defined(X_DIR_PIN) && X_DIR_PIN > -1 SET_OUTPUT(X_DIR_PIN); 1de7a: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de7e: 82 60 ori r24, 0x02 ; 2 1de80: 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); 1de84: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de88: 81 60 ori r24, 0x01 ; 1 1de8a: 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); 1de8e: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de92: 84 60 ori r24, 0x04 ; 4 1de94: 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); 1de98: 80 91 0a 01 lds r24, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 1de9c: 80 64 ori r24, 0x40 ; 64 1de9e: 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); 1dea2: 0f 9a sbi 0x01, 7 ; 1 if(!X_ENABLE_ON) WRITE(X_ENABLE_PIN,HIGH); 1dea4: 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); 1dea6: 0e 9a sbi 0x01, 6 ; 1 if(!Y_ENABLE_ON) WRITE(Y_ENABLE_PIN,HIGH); 1dea8: 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); 1deaa: 0d 9a sbi 0x01, 5 ; 1 if(!Z_ENABLE_ON) WRITE(Z_ENABLE_PIN,HIGH); 1deac: 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); 1deae: 0c 9a sbi 0x01, 4 ; 1 if(!E_ENABLE_ON) WRITE(E0_ENABLE_PIN,HIGH); 1deb0: 14 9a sbi 0x02, 4 ; 2 #endif //endstops and pullups #if defined(X_MIN_PIN) && X_MIN_PIN > -1 SET_INPUT(X_MIN_PIN); 1deb2: 26 98 cbi 0x04, 6 ; 4 #ifdef ENDSTOPPULLUP_XMIN WRITE(X_MIN_PIN,HIGH); 1deb4: 2e 9a sbi 0x05, 6 ; 5 #endif #endif #if defined(Y_MIN_PIN) && Y_MIN_PIN > -1 SET_INPUT(Y_MIN_PIN); 1deb6: 25 98 cbi 0x04, 5 ; 4 #ifdef ENDSTOPPULLUP_YMIN WRITE(Y_MIN_PIN,HIGH); 1deb8: 2d 9a sbi 0x05, 5 ; 5 #endif #endif #if defined(Z_MIN_PIN) && Z_MIN_PIN > -1 SET_INPUT(Z_MIN_PIN); 1deba: 24 98 cbi 0x04, 4 ; 4 #ifdef ENDSTOPPULLUP_ZMIN WRITE(Z_MIN_PIN,HIGH); 1debc: 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); 1debe: 09 98 cbi 0x01, 1 ; 1 #ifdef ENDSTOPPULLUP_ZMAX WRITE(Z_MAX_PIN,HIGH); 1dec0: 11 9a sbi 0x02, 1 ; 2 #endif #endif #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) SET_INPUT(TACH_0); 1dec2: 3f 98 cbi 0x07, 7 ; 7 #ifdef TACH0PULLUP WRITE(TACH_0, HIGH); 1dec4: 47 9a sbi 0x08, 7 ; 8 #endif //Initialize Step Pins #if defined(X_STEP_PIN) && (X_STEP_PIN > -1) SET_OUTPUT(X_STEP_PIN); 1dec6: 38 9a sbi 0x07, 0 ; 7 WRITE(X_STEP_PIN,INVERT_X_STEP_PIN); 1dec8: 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(); 1deca: 17 9a sbi 0x02, 7 ; 2 1decc: 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); 1ded0: 39 9a sbi 0x07, 1 ; 7 WRITE(Y_STEP_PIN,INVERT_Y_STEP_PIN); 1ded2: 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(); 1ded4: 16 9a sbi 0x02, 6 ; 2 1ded6: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a #endif #if defined(Z_STEP_PIN) && (Z_STEP_PIN > -1) SET_OUTPUT(Z_STEP_PIN); 1deda: 3a 9a sbi 0x07, 2 ; 7 WRITE(Z_STEP_PIN,INVERT_Z_STEP_PIN); 1dedc: 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); 1dede: 3b 9a sbi 0x07, 3 ; 7 WRITE(E0_STEP_PIN,INVERT_E_STEP_PIN); 1dee0: 43 98 cbi 0x08, 3 ; 8 disable_e0(); 1dee2: 14 9a sbi 0x02, 4 ; 2 #endif // waveform generation = 0100 = CTC TCCR1B &= ~(1< 1dee8: 8f 7e andi r24, 0xEF ; 239 1deea: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1B |= (1< 1def2: 88 60 ori r24, 0x08 ; 8 1def4: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> TCCR1A &= ~(1< 1defc: 8d 7f andi r24, 0xFD ; 253 1defe: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(1< 1df06: 8e 7f andi r24, 0xFE ; 254 1df08: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> // output mode = 00 (disconnected) TCCR1A &= ~(3< 1df10: 8f 73 andi r24, 0x3F ; 63 1df12: 80 93 80 00 sts 0x0080, r24 ; 0x800080 <__TEXT_REGION_LENGTH__+0x7c2080> TCCR1A &= ~(3< 1df1a: 8f 7c andi r24, 0xCF ; 207 1df1c: 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< 1df24: 88 7f andi r24, 0xF8 ; 248 1df26: 82 60 ori r24, 0x02 ; 2 1df28: 80 93 81 00 sts 0x0081, r24 ; 0x800081 <__TEXT_REGION_LENGTH__+0x7c2081> // Plan the first interrupt after 8ms from now. OCR1A = 0x4000; 1df2c: 80 e0 ldi r24, 0x00 ; 0 1df2e: 90 e4 ldi r25, 0x40 ; 64 1df30: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 1df34: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> TCNT1 = 0; 1df38: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 1df3c: 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; 1df40: 10 92 4f 04 sts 0x044F, r1 ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 1df44: 10 92 4e 04 sts 0x044E, r1 ; 0x80044e <_ZL11nextMainISR.lto_priv.436> nextAdvanceISR = ADV_NEVER; 1df48: 8f ef ldi r24, 0xFF ; 255 1df4a: 9f ef ldi r25, 0xFF ; 255 1df4c: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 1df50: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> main_Rate = ADV_NEVER; 1df54: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.438+0x1> 1df58: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.438> current_adv_steps = 0; 1df5c: 10 92 49 04 sts 0x0449, r1 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 1df60: 10 92 48 04 sts 0x0448, r1 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> } bool enable_endstops(bool check) { bool old = check_endstops; check_endstops = check; 1df64: 81 e0 ldi r24, 0x01 ; 1 1df66: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.385> current_adv_steps = 0; #endif enable_endstops(true); // Start with endstops active. After homing they can be disabled ENABLE_STEPPER_DRIVER_INTERRUPT(); 1df6a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 1df6e: 82 60 ori r24, 0x02 ; 2 1df70: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> sei(); 1df74: 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(); 1df76: 0e 94 45 62 call 0xc48a ; 0xc48a // Initialize current_position accounting for software endstops to // avoid unexpected initial shifts on the first move clamp_to_software_endstops(current_position); 1df7a: 81 e6 ldi r24, 0x61 ; 97 1df7c: 92 e1 ldi r25, 0x12 ; 18 1df7e: 0e 94 cd 6a call 0xd59a ; 0xd59a plan_set_position_curposXYZE(); 1df82: 0f 94 cd 48 call 0x2919a ; 0x2919a } #define KILL_PENDING_FLAG 0x42 static void fw_kill_init() { if (eeprom_read_byte((uint8_t*)EEPROM_KILL_PENDING_FLAG) == KILL_PENDING_FLAG) { 1df86: 84 e9 ldi r24, 0x94 ; 148 1df88: 9c e0 ldi r25, 0x0C ; 12 1df8a: 0f 94 81 a4 call 0x34902 ; 0x34902 1df8e: 82 34 cpi r24, 0x42 ; 66 1df90: 59 f4 brne .+22 ; 0x1dfa8 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); 1df92: 6f ef ldi r22, 0xFF ; 255 1df94: 84 e9 ldi r24, 0x94 ; 148 1df96: 9c e0 ldi r25, 0x0C ; 12 1df98: 0f 94 c9 a4 call 0x34992 ; 0x34992 // 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); 1df9c: 85 e9 ldi r24, 0x95 ; 149 1df9e: 9c e0 ldi r25, 0x0C ; 12 1dfa0: 0f 94 8f a4 call 0x3491e ; 0x3491e lcd_show_fullscreen_message_and_wait_P(kill_msg); 1dfa4: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa // report kill() events fw_kill_init(); #ifdef FILAMENT_SENSOR fsensor.init(); 1dfa8: 0f 94 7a 6d call 0x2daf4 ; 0x2daf4 #endif setup_homepin(); #if defined(Z_AXIS_ALWAYS_ON) enable_z(); 1dfac: 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); 1dfae: 88 e0 ldi r24, 0x08 ; 8 1dfb0: 0f 94 05 30 call 0x2600a ; 0x2600a // Enable Toshiba FlashAir SD card / WiFi enahanced card. card.ToshibaFlashAir_enable(eeprom_read_byte((unsigned char*)EEPROM_TOSHIBA_FLASH_AIR_COMPATIBLITY) == 1); 1dfb4: 8b eb ldi r24, 0xBB ; 187 1dfb6: 9f e0 ldi r25, 0x0F ; 15 1dfb8: 0f 94 81 a4 call 0x34902 ; 0x34902 1dfbc: 91 e0 ldi r25, 0x01 ; 1 1dfbe: 81 30 cpi r24, 0x01 ; 1 1dfc0: 09 f0 breq .+2 ; 0x1dfc4 1dfc2: 90 e0 ldi r25, 0x00 ; 0 1dfc4: 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(); 1dfc8: 81 e0 ldi r24, 0x01 ; 1 1dfca: 0f 94 08 73 call 0x2e610 ; 0x2e610 #include #include void eeprom_init() { eeprom_init_default_byte((uint8_t*)EEPROM_POWER_COUNT, 0); 1dfce: 60 e0 ldi r22, 0x00 ; 0 1dfd0: 84 e6 ldi r24, 0x64 ; 100 1dfd2: 9f e0 ldi r25, 0x0F ; 15 1dfd4: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_X, 0); 1dfd8: 60 e0 ldi r22, 0x00 ; 0 1dfda: 86 e6 ldi r24, 0x66 ; 102 1dfdc: 9f e0 ldi r25, 0x0F ; 15 1dfde: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_byte((uint8_t*)EEPROM_CRASH_COUNT_Y, 0); 1dfe2: 60 e0 ldi r22, 0x00 ; 0 1dfe4: 88 e6 ldi r24, 0x68 ; 104 1dfe6: 9f e0 ldi r25, 0x0F ; 15 1dfe8: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_byte((uint8_t*)EEPROM_FERROR_COUNT, 0); 1dfec: 60 e0 ldi r22, 0x00 ; 0 1dfee: 85 e6 ldi r24, 0x65 ; 101 1dff0: 9f e0 ldi r25, 0x0F ; 15 1dff2: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_word((uint16_t*)EEPROM_POWER_COUNT_TOT, 0); 1dff6: 70 e0 ldi r23, 0x00 ; 0 1dff8: 60 e0 ldi r22, 0x00 ; 0 1dffa: 8f ef ldi r24, 0xFF ; 255 1dffc: 9e e0 ldi r25, 0x0E ; 14 1dffe: 0e 94 96 78 call 0xf12c ; 0xf12c eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_X_TOT, 0); 1e002: 70 e0 ldi r23, 0x00 ; 0 1e004: 60 e0 ldi r22, 0x00 ; 0 1e006: 85 e0 ldi r24, 0x05 ; 5 1e008: 9f e0 ldi r25, 0x0F ; 15 1e00a: 0e 94 96 78 call 0xf12c ; 0xf12c eeprom_init_default_word((uint16_t*)EEPROM_CRASH_COUNT_Y_TOT, 0); 1e00e: 70 e0 ldi r23, 0x00 ; 0 1e010: 60 e0 ldi r22, 0x00 ; 0 1e012: 83 e0 ldi r24, 0x03 ; 3 1e014: 9f e0 ldi r25, 0x0F ; 15 1e016: 0e 94 96 78 call 0xf12c ; 0xf12c eeprom_init_default_word((uint16_t*)EEPROM_FERROR_COUNT_TOT, 0); 1e01a: 70 e0 ldi r23, 0x00 ; 0 1e01c: 60 e0 ldi r22, 0x00 ; 0 1e01e: 81 e0 ldi r24, 0x01 ; 1 1e020: 9f e0 ldi r25, 0x0F ; 15 1e022: 0e 94 96 78 call 0xf12c ; 0xf12c eeprom_init_default_word((uint16_t*)EEPROM_MMU_FAIL_TOT, 0); 1e026: 70 e0 ldi r23, 0x00 ; 0 1e028: 60 e0 ldi r22, 0x00 ; 0 1e02a: 83 ed ldi r24, 0xD3 ; 211 1e02c: 9e e0 ldi r25, 0x0E ; 14 1e02e: 0e 94 96 78 call 0xf12c ; 0xf12c eeprom_init_default_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, 0); 1e032: 70 e0 ldi r23, 0x00 ; 0 1e034: 60 e0 ldi r22, 0x00 ; 0 1e036: 80 ed ldi r24, 0xD0 ; 208 1e038: 9e e0 ldi r25, 0x0E ; 14 1e03a: 0e 94 96 78 call 0xf12c ; 0xf12c eeprom_init_default_byte((uint8_t*)EEPROM_MMU_FAIL, 0); 1e03e: 60 e0 ldi r22, 0x00 ; 0 1e040: 82 ed ldi r24, 0xD2 ; 210 1e042: 9e e0 ldi r25, 0x0E ; 14 1e044: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, 0); 1e048: 60 e0 ldi r22, 0x00 ; 0 1e04a: 8f ec ldi r24, 0xCF ; 207 1e04c: 9e e0 ldi r25, 0x0E ; 14 1e04e: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES, 0); 1e052: 88 ea ldi r24, 0xA8 ; 168 1e054: 9c e0 ldi r25, 0x0C ; 12 1e056: 0f 94 76 6c call 0x2d8ec ; 0x2d8ec if (eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)) == EEPROM_EMPTY_VALUE) 1e05a: 81 ea ldi r24, 0xA1 ; 161 1e05c: 9d e0 ldi r25, 0x0D ; 13 1e05e: 0f 94 81 a4 call 0x34902 ; 0x34902 1e062: 8f 3f cpi r24, 0xFF ; 255 1e064: 71 f4 brne .+28 ; 0x1e082 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e066: 60 e0 ldi r22, 0x00 ; 0 1e068: 81 ea ldi r24, 0xA1 ; 161 1e06a: 9d e0 ldi r25, 0x0D ; 13 1e06c: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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); 1e070: 88 ef ldi r24, 0xF8 ; 248 1e072: 9f e0 ldi r25, 0x0F ; 15 1e074: 0f 94 8f a4 call 0x3491e ; 0x3491e eeprom_update_word(reinterpret_cast(&(EEPROM_Sheets_base->s[0].z_offset)), last_babystep); 1e078: bc 01 movw r22, r24 1e07a: 80 e5 ldi r24, 0x50 ; 80 1e07c: 9d e0 ldi r25, 0x0D ; 13 1e07e: 0f 94 c3 a4 call 0x34986 ; 0x34986 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); 1e082: 49 e4 ldi r20, 0x49 ; 73 1e084: c4 2e mov r12, r20 1e086: 4d e0 ldi r20, 0x0D ; 13 1e088: d4 2e mov r13, r20 1e08a: 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); 1e08c: b7 01 movw r22, r14 1e08e: 81 2f mov r24, r17 1e090: 0e 94 09 79 call 0xf212 ; 0xf212 eeprom_init_default_block(EEPROM_Sheets_base->s[i].name, (sizeof(Sheet::name)/sizeof(Sheet::name[0])), sheetName.c); 1e094: a7 01 movw r20, r14 1e096: 67 e0 ldi r22, 0x07 ; 7 1e098: 70 e0 ldi r23, 0x00 ; 0 1e09a: c6 01 movw r24, r12 1e09c: 0e 94 77 78 call 0xf0ee ; 0xf0ee 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++) { 1e0a0: 1f 5f subi r17, 0xFF ; 255 1e0a2: fb e0 ldi r31, 0x0B ; 11 1e0a4: cf 0e add r12, r31 1e0a6: d1 1c adc r13, r1 1e0a8: 18 30 cpi r17, 0x08 ; 8 1e0aa: 81 f7 brne .-32 ; 0x1e08c 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)))) 1e0ac: 81 ea ldi r24, 0xA1 ; 161 1e0ae: 9d e0 ldi r25, 0x0D ; 13 1e0b0: 0f 94 81 a4 call 0x34902 ; 0x34902 1e0b4: 0e 94 d9 78 call 0xf1b2 ; 0xf1b2 1e0b8: 81 11 cpse r24, r1 1e0ba: 02 c0 rjmp .+4 ; 0x1e0c0 { eeprom_switch_to_next_sheet(); 1e0bc: 0e 94 fb 78 call 0xf1f6 ; 0xf1f6 } check_babystep(); 1e0c0: 0e 94 6d 7d call 0xfada ; 0xfada // initialize custom mendel name in eeprom if (eeprom_read_byte((uint8_t*)EEPROM_CUSTOM_MENDEL_NAME) == EEPROM_EMPTY_VALUE) { 1e0c4: 80 e8 ldi r24, 0x80 ; 128 1e0c6: 9c e0 ldi r25, 0x0C ; 12 1e0c8: 0f 94 81 a4 call 0x34902 ; 0x34902 1e0cc: 8f 3f cpi r24, 0xFF ; 255 1e0ce: 41 f4 brne .+16 ; 0x1e0e0 #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); 1e0d0: 4f e0 ldi r20, 0x0F ; 15 1e0d2: 50 e0 ldi r21, 0x00 ; 0 1e0d4: 60 e8 ldi r22, 0x80 ; 128 1e0d6: 7c e0 ldi r23, 0x0C ; 12 1e0d8: 8e ec ldi r24, 0xCE ; 206 1e0da: 92 e0 ldi r25, 0x02 ; 2 1e0dc: 0f 94 95 a4 call 0x3492a ; 0x3492a //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); 1e0e0: 60 e0 ldi r22, 0x00 ; 0 1e0e2: 89 e2 ldi r24, 0x29 ; 41 1e0e4: 9d e0 ldi r25, 0x0D ; 13 1e0e6: 0e 94 ae 78 call 0xf15c ; 0xf15c #endif //PINDA_TEMP_COMP eeprom_init_default_dword((uint32_t*)EEPROM_JOB_ID, 0); 1e0ea: 85 e0 ldi r24, 0x05 ; 5 1e0ec: 9d e0 ldi r25, 0x0D ; 13 1e0ee: 0f 94 76 6c call 0x2d8ec ; 0x2d8ec eeprom_init_default_dword((uint32_t*)EEPROM_TOTALTIME, 0); 1e0f2: 8d ee ldi r24, 0xED ; 237 1e0f4: 9f e0 ldi r25, 0x0F ; 15 1e0f6: 0f 94 76 6c call 0x2d8ec ; 0x2d8ec eeprom_init_default_dword((uint32_t*)EEPROM_FILAMENTUSED, 0); 1e0fa: 81 ef ldi r24, 0xF1 ; 241 1e0fc: 9f e0 ldi r25, 0x0F ; 15 1e0fe: 0f 94 76 6c call 0x2d8ec ; 0x2d8ec eeprom_init_default_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 0); 1e102: 60 e0 ldi r22, 0x00 ; 0 1e104: 8e ec ldi r24, 0xCE ; 206 1e106: 9e e0 ldi r25, 0x0E ; 14 1e108: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT, 1); 1e10c: 61 e0 ldi r22, 0x01 ; 1 1e10e: 87 ea ldi r24, 0xA7 ; 167 1e110: 9c e0 ldi r25, 0x0C ; 12 1e112: 0e 94 ae 78 call 0xf15c ; 0xf15c putchar('\n'); list_sec_lang_from_external_flash(); #endif //DEBUG_XFLASH // lang_reset(); if (!lang_select(eeprom_read_byte((uint8_t*)EEPROM_LANG))) 1e116: 8e ef ldi r24, 0xFE ; 254 1e118: 9f e0 ldi r25, 0x0F ; 15 1e11a: 0f 94 81 a4 call 0x34902 ; 0x34902 1e11e: 0e 94 1f 75 call 0xea3e ; 0xea3e 1e122: 81 11 cpse r24, r1 1e124: 02 c0 rjmp .+4 ; 0x1e12a lcd_language(); 1e126: 0e 94 32 c2 call 0x18464 ; 0x18464 lang_print_sec_lang(); #endif //DEBUG_SEC_LANG #endif //(LANG_MODE != 0) eeprom_init_default_byte((uint8_t*)EEPROM_TEMP_CAL_ACTIVE, 0); 1e12a: 60 e0 ldi r22, 0x00 ; 0 1e12c: 8f ea ldi r24, 0xAF ; 175 1e12e: 9f e0 ldi r25, 0x0F ; 15 1e130: 0e 94 ae 78 call 0xf15c ; 0xf15c if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_PINDA) == 255) { 1e134: 86 ea ldi r24, 0xA6 ; 166 1e136: 9f e0 ldi r25, 0x0F ; 15 1e138: 0f 94 81 a4 call 0x34902 ; 0x34902 1e13c: 8f 3f cpi r24, 0xFF ; 255 1e13e: d9 f4 brne .+54 ; 0x1e176 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e140: 61 e0 ldi r22, 0x01 ; 1 1e142: 86 ea ldi r24, 0xA6 ; 166 1e144: 9f e0 ldi r25, 0x0F ; 15 1e146: 0f 94 a5 a4 call 0x3494a ; 0x3494a 1e14a: 30 eb ldi r19, 0xB0 ; 176 1e14c: e3 2e mov r14, r19 1e14e: 3f e0 ldi r19, 0x0F ; 15 1e150: 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); 1e152: 70 e0 ldi r23, 0x00 ; 0 1e154: 60 e0 ldi r22, 0x00 ; 0 1e156: c7 01 movw r24, r14 1e158: 0f 94 c3 a4 call 0x34986 ; 0x34986 1e15c: 22 e0 ldi r18, 0x02 ; 2 1e15e: e2 0e add r14, r18 1e160: 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++) { 1e162: 3a eb ldi r19, 0xBA ; 186 1e164: e3 16 cp r14, r19 1e166: 3f e0 ldi r19, 0x0F ; 15 1e168: f3 06 cpc r15, r19 1e16a: 99 f7 brne .-26 ; 0x1e152 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e16c: 60 e0 ldi r22, 0x00 ; 0 1e16e: 8f ea ldi r24, 0xAF ; 175 1e170: 9f e0 ldi r25, 0x0F ; 15 1e172: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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); 1e176: 60 e0 ldi r22, 0x00 ; 0 1e178: 85 ea ldi r24, 0xA5 ; 165 1e17a: 9f e0 ldi r25, 0x0F ; 15 1e17c: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_byte((uint8_t*)EEPROM_UVLO_Z_LIFTED, 0); 1e180: 60 e0 ldi r22, 0x00 ; 0 1e182: 8f e7 ldi r24, 0x7F ; 127 1e184: 9c e0 ldi r25, 0x0C ; 12 1e186: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_byte((uint8_t*)EEPROM_SD_SORT, 0); 1e18a: 60 e0 ldi r22, 0x00 ; 0 1e18c: 89 e0 ldi r24, 0x09 ; 9 1e18e: 9f e0 ldi r25, 0x0F ; 15 1e190: 0e 94 ae 78 call 0xf15c ; 0xf15c } 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); 1e194: 61 e0 ldi r22, 0x01 ; 1 1e196: 8c ea ldi r24, 0xAC ; 172 1e198: 9d e0 ldi r25, 0x0D ; 13 1e19a: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_byte((uint8_t*)EEPROM_MBL_POINTS_NR, 3); 1e19e: 63 e0 ldi r22, 0x03 ; 3 1e1a0: 8b ea ldi r24, 0xAB ; 171 1e1a2: 9d e0 ldi r25, 0x0D ; 13 1e1a4: 0e 94 ae 78 call 0xf15c ; 0xf15c eeprom_init_default_byte((uint8_t*)EEPROM_MBL_PROBE_NR, 3); 1e1a8: 63 e0 ldi r22, 0x03 ; 3 1e1aa: 8a ea ldi r24, 0xAA ; 170 1e1ac: 9d e0 ldi r25, 0x0D ; 13 1e1ae: 0e 94 ae 78 call 0xf15c ; 0xf15c //mbl_mode_init(); mbl_settings_init(); eeprom_init_default_byte((uint8_t*)EEPROM_MMU_STEALTH, 1); 1e1b2: 61 e0 ldi r22, 0x01 ; 1 1e1b4: 89 ea ldi r24, 0xA9 ; 169 1e1b6: 9d e0 ldi r25, 0x0D ; 13 1e1b8: 0e 94 ae 78 call 0xf15c ; 0xf15c #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); 1e1bc: 84 e0 ldi r24, 0x04 ; 4 1e1be: 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) { 1e1c2: 02 30 cpi r16, 0x02 ; 2 1e1c4: 09 f4 brne .+2 ; 0x1e1c8 1e1c6: 81 c0 rjmp .+258 ; 0x1e2ca 1e1c8: 03 30 cpi r16, 0x03 ; 3 1e1ca: 09 f4 brne .+2 ; 0x1e1ce 1e1cc: 22 c1 rjmp .+580 ; 0x1e412 1e1ce: 01 30 cpi r16, 0x01 ; 1 1e1d0: 09 f0 breq .+2 ; 0x1e1d4 1e1d2: 87 c0 rjmp .+270 ; 0x1e2e2 //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)); 1e1d4: 82 ec ldi r24, 0xC2 ; 194 1e1d6: 9e e4 ldi r25, 0x4E ; 78 1e1d8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1e1dc: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 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); 1e1e0: 6b ec ldi r22, 0xCB ; 203 1e1e2: 70 e0 ldi r23, 0x00 ; 0 1e1e4: 8c ee ldi r24, 0xEC ; 236 1e1e6: 9e e0 ldi r25, 0x0E ; 14 1e1e8: 7a c0 rjmp .+244 ; 0x1e2de first++; lcd_clear(); } } if (cursor_pos < 0) { 1e1ea: 1f 3f cpi r17, 0xFF ; 255 1e1ec: 09 f0 breq .+2 ; 0x1e1f0 1e1ee: d4 cd rjmp .-1112 ; 0x1dd98 cursor_pos = 0; Sound_MakeSound(e_SOUND_TYPE_BlindAlert); 1e1f0: 87 e0 ldi r24, 0x07 ; 7 1e1f2: 0f 94 3f 23 call 0x2467e ; 0x2467e if (first > 0) { 1e1f6: 80 91 46 04 lds r24, 0x0446 ; 0x800446 1e1fa: 18 16 cp r1, r24 1e1fc: 2c f4 brge .+10 ; 0x1e208 first--; 1e1fe: 81 50 subi r24, 0x01 ; 1 1e200: 80 93 46 04 sts 0x0446, r24 ; 0x800446 lcd_clear(); 1e204: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_clear(); } } if (cursor_pos < 0) { cursor_pos = 0; 1e208: 10 e0 ldi r17, 0x00 ; 0 1e20a: c6 cd rjmp .-1140 ; 0x1dd98 // Level input parameter sets depth of reset static void factory_reset(char level) { lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { 1e20c: 13 30 cpi r17, 0x03 ; 3 1e20e: 31 f1 breq .+76 ; 0x1e25c 1e210: 14 30 cpi r17, 0x04 ; 4 1e212: 09 f0 breq .+2 ; 0x1e216 1e214: f4 cd rjmp .-1048 ; 0x1ddfe #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) #endif //FILAMENT_SENSOR break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); 1e216: 6d ee ldi r22, 0xED ; 237 1e218: 77 e8 ldi r23, 0x87 ; 135 1e21a: 80 e0 ldi r24, 0x00 ; 0 1e21c: 90 e1 ldi r25, 0x10 ; 16 1e21e: 0e 94 62 72 call 0xe4c4 ; 0xe4c4 // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1e222: 10 e0 ldi r17, 0x00 ; 0 1e224: 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); 1e226: 6f ef ldi r22, 0xFF ; 255 1e228: c8 01 movw r24, r16 1e22a: 0f 94 a5 a4 call 0x3494a ; 0x3494a eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); 1e22e: c8 01 movw r24, r16 1e230: 0e 94 98 71 call 0xe330 ; 0xe330 break; case 4: menu_progressbar_init(EEPROM_TOP, PSTR("ERASING all data")); // Erase EEPROM for (uint16_t i = 0; i < EEPROM_TOP; i++) { 1e234: 0f 5f subi r16, 0xFF ; 255 1e236: 1f 4f sbci r17, 0xFF ; 255 1e238: 01 15 cp r16, r1 1e23a: b0 e1 ldi r27, 0x10 ; 16 1e23c: 1b 07 cpc r17, r27 1e23e: 99 f7 brne .-26 ; 0x1e226 eeprom_update_byte_notify((uint8_t*)i, 0xFF); menu_progressbar_update(i); } menu_progressbar_finish(); 1e240: 0e 94 b9 71 call 0xe372 ; 0xe372 softReset(); 1e244: 0e 94 70 66 call 0xcce0 ; 0xcce0 lcd_clear(); Sound_MakeCustom(100,0,false); switch (level) { case 0: // Level 0: Language reset lang_reset(); 1e248: 0e 94 8e 74 call 0xe91c ; 0xe91c 1e24c: d8 cd rjmp .-1104 ; 0x1ddfe break; case 1: //Level 1: Reset statistics factory_reset_stats(); 1e24e: 0e 94 35 66 call 0xcc6a ; 0xcc6a lcd_menu_statistics(); 1e252: 0f 94 38 15 call 0x22a70 ; 0x22a70 1e256: d3 cd rjmp .-1114 ; 0x1ddfe break; case 2: // Level 2: Prepare for shipping factory_reset_stats(); 1e258: 0e 94 35 66 call 0xcc6a ; 0xcc6a // FALLTHRU case 3: // Level 3: Preparation after being serviced // Force language selection at the next boot up. lang_reset(); 1e25c: 0e 94 8e 74 call 0xe91c ; 0xe91c // Force the wizard in "Follow calibration flow" mode at the next boot up calibration_status_clear(CALIBRATION_FORCE_PREP); 1e260: 84 e0 ldi r24, 0x04 ; 4 1e262: 0e 94 e1 d4 call 0x1a9c2 ; 0x1a9c2 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); 1e266: 62 e0 ldi r22, 0x02 ; 2 1e268: 8f e5 ldi r24, 0x5F ; 95 1e26a: 9f e0 ldi r25, 0x0F ; 15 1e26c: 0f 94 c9 a4 call 0x34992 ; 0x34992 lcd_update(2); fCheckModeInit(); // alternatively invoke printer reset } void farm_disable() { farm_mode = false; 1e270: 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); 1e274: 60 e0 ldi r22, 0x00 ; 0 1e276: 84 ec ldi r24, 0xC4 ; 196 1e278: 9f e0 ldi r25, 0x0F ; 15 1e27a: 0f 94 a5 a4 call 0x3494a ; 0x3494a eeprom_write_byte_notify((uint8_t*)EEPROM_WIZARD_ACTIVE, 2); farm_disable(); #ifdef FILAMENT_SENSOR fsensor.setEnabled(true); 1e27e: 81 e0 ldi r24, 0x01 ; 1 1e280: 0e 94 e1 77 call 0xefc2 ; 0xefc2 1e284: 11 e0 ldi r17, 0x01 ; 1 1e286: 10 93 f2 16 sts 0x16F2, r17 ; 0x8016f2 1e28a: 61 e0 ldi r22, 0x01 ; 1 1e28c: 87 e0 ldi r24, 0x07 ; 7 1e28e: 9f e0 ldi r25, 0x0F ; 15 1e290: 0f 94 a5 a4 call 0x3494a ; 0x3494a eeprom_update_byte_notify((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED, state); } } void Filament_sensor::setRunoutEnabled(bool state, bool updateEEPROM) { runoutEnabled = state; 1e294: 10 93 f3 16 sts 0x16F3, r17 ; 0x8016f3 1e298: 61 e0 ldi r22, 0x01 ; 1 1e29a: 85 ed ldi r24, 0xD5 ; 213 1e29c: 9e e0 ldi r25, 0x0E ; 14 1e29e: 0f 94 a5 a4 call 0x3494a ; 0x3494a return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 1e2a2: 10 93 ff 16 sts 0x16FF, r17 ; 0x8016ff oldPos = pat9125_y; 1e2a6: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 1e2aa: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 1e2ae: 90 93 01 17 sts 0x1701, r25 ; 0x801701 1e2b2: 80 93 00 17 sts 0x1700, r24 ; 0x801700 resetStepCount(); 1e2b6: 0f 94 2b 6d call 0x2da56 ; 0x2da56 jamErrCnt = 0; 1e2ba: 10 92 06 17 sts 0x1706, r1 ; 0x801706 1e2be: 61 e0 ldi r22, 0x01 ; 1 1e2c0: 8d ea ldi r24, 0xAD ; 173 1e2c2: 9c e0 ldi r25, 0x0C ; 12 1e2c4: 0f 94 a5 a4 call 0x3494a ; 0x3494a 1e2c8: 9a cd rjmp .-1228 ; 0x1ddfe 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)); 1e2ca: 81 ea ldi r24, 0xA1 ; 161 1e2cc: 9e e4 ldi r25, 0x4E ; 78 1e2ce: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1e2d2: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 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); 1e2d6: 6a ef ldi r22, 0xFA ; 250 1e2d8: 70 e0 ldi r23, 0x00 ; 0 1e2da: 8e ee ldi r24, 0xEE ; 238 1e2dc: 9e e0 ldi r25, 0x0E ; 14 1e2de: 0f 94 df a4 call 0x349be ; 0x349be eeprom_write_word_notify((uint16_t*)EEPROM_BOARD_TYPE, MOTHERBOARD); break; default: break; //no change, show no message } if (!previous_settings_retrieved) { 1e2e2: b1 10 cpse r11, r1 1e2e4: 08 c0 rjmp .+16 ; 0x1e2f6 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 1e2e6: 8a e2 ldi r24, 0x2A ; 42 1e2e8: 9e e4 ldi r25, 0x4E ; 78 1e2ea: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1e2ee: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa Config_StoreSettings(); 1e2f2: 0e 94 f8 85 call 0x10bf0 ; 0x10bf0 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { 1e2f6: 80 e8 ldi r24, 0x80 ; 128 1e2f8: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 1e2fc: 88 23 and r24, r24 1e2fe: c9 f0 breq .+50 ; 0x1e332 CalibrationStatus calibration_status = 0; if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1e300: 87 ef ldi r24, 0xF7 ; 247 1e302: 9f e0 ldi r25, 0x0F ; 15 1e304: 0f 94 81 a4 call 0x34902 ; 0x34902 } // handle FW and calibration status upgrade bool run_wizard = false; if (calibration_status_get(CALIBRATION_STATUS_UNKNOWN)) { CalibrationStatus calibration_status = 0; 1e308: 60 e0 ldi r22, 0x00 ; 0 if (eeprom_read_byte((uint8_t*)EEPROM_CALIBRATION_STATUS_V1) == 1) { 1e30a: 81 30 cpi r24, 0x01 ; 1 1e30c: 71 f4 brne .+28 ; 0x1e32a // 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)) { 1e30e: 8e e1 ldi r24, 0x1E ; 30 1e310: 98 e8 ldi r25, 0x88 ; 136 1e312: 0e 94 d5 bd call 0x17baa ; 0x17baa 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); 1e316: 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)) { 1e318: 88 23 and r24, r24 1e31a: 39 f0 breq .+14 ; 0x1e32a // printer upgraded from FW<3.2.0.4 and requires re-running selftest lcd_show_fullscreen_message_and_wait_P(_T(MSG_FORCE_SELFTEST)); 1e31c: 88 ee ldi r24, 0xE8 ; 232 1e31e: 9d e4 ldi r25, 0x4D ; 77 1e320: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1e324: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa calibration_status &= ~CALIBRATION_STATUS_SELFTEST; 1e328: 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); 1e32a: 86 ea ldi r24, 0xA6 ; 166 1e32c: 9c e0 ldi r25, 0x0C ; 12 1e32e: 0f 94 a5 a4 call 0x3494a ; 0x3494a } } eeprom_update_byte_notify((uint8_t*)EEPROM_CALIBRATION_STATUS_V2, calibration_status); } if (eeprom_fw_version_older_than_p(FW_VERSION_NR)) { 1e332: 86 e1 ldi r24, 0x16 ; 22 1e334: 98 e8 ldi r25, 0x88 ; 136 1e336: 0e 94 d5 bd call 0x17baa ; 0x17baa 1e33a: 18 2f mov r17, r24 1e33c: 88 23 and r24, r24 1e33e: 29 f0 breq .+10 ; 0x1e34a if (!calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 1e340: 87 e1 ldi r24, 0x17 ; 23 1e342: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 1e346: 11 e0 ldi r17, 0x01 ; 1 1e348: 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; 1e34a: f1 2c mov r15, r1 1e34c: 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)); 1e34e: f7 01 movw r30, r14 1e350: e4 5f subi r30, 0xF4 ; 244 1e352: f7 47 sbci r31, 0x77 ; 119 1e354: 64 91 lpm r22, Z 1e356: c7 01 movw r24, r14 1e358: 0f 94 a5 a4 call 0x3494a ; 0x3494a 1e35c: 8f ef ldi r24, 0xFF ; 255 1e35e: e8 1a sub r14, r24 1e360: 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){ 1e362: 9a e0 ldi r25, 0x0A ; 10 1e364: e9 16 cp r14, r25 1e366: f1 04 cpc r15, r1 1e368: 91 f7 brne .-28 ; 0x1e34e 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])); 1e36a: e6 e1 ldi r30, 0x16 ; 22 1e36c: f8 e8 ldi r31, 0x88 ; 136 1e36e: 65 91 lpm r22, Z+ 1e370: 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); 1e372: 8a e0 ldi r24, 0x0A ; 10 1e374: 90 e0 ldi r25, 0x00 ; 0 1e376: 0f 94 c3 a4 call 0x34986 ; 0x34986 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_MINOR, (uint16_t)pgm_read_word(&FW_VERSION_NR[1])); 1e37a: e8 e1 ldi r30, 0x18 ; 24 1e37c: f8 e8 ldi r31, 0x88 ; 136 1e37e: 65 91 lpm r22, Z+ 1e380: 74 91 lpm r23, Z 1e382: 8c e0 ldi r24, 0x0C ; 12 1e384: 90 e0 ldi r25, 0x00 ; 0 1e386: 0f 94 c3 a4 call 0x34986 ; 0x34986 eeprom_update_word_notify((uint16_t*)EEPROM_FIRMWARE_VERSION_REVISION, (uint16_t)pgm_read_word(&FW_VERSION_NR[2])); 1e38a: ea e1 ldi r30, 0x1A ; 26 1e38c: f8 e8 ldi r31, 0x88 ; 136 1e38e: 65 91 lpm r22, Z+ 1e390: 74 91 lpm r23, Z 1e392: 8e e0 ldi r24, 0x0E ; 14 1e394: 90 e0 ldi r25, 0x00 ; 0 1e396: 0f 94 c3 a4 call 0x34986 ; 0x34986 // 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])); 1e39a: ec e1 ldi r30, 0x1C ; 28 1e39c: f8 e8 ldi r31, 0x88 ; 136 1e39e: 65 91 lpm r22, Z+ 1e3a0: 74 91 lpm r23, Z 1e3a2: 80 e1 ldi r24, 0x10 ; 16 1e3a4: 90 e0 ldi r25, 0x00 ; 0 1e3a6: 0f 94 c3 a4 call 0x34986 ; 0x34986 run_wizard = true; } } update_current_firmware_version_to_eeprom(); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) { 1e3aa: 8f e5 ldi r24, 0x5F ; 95 1e3ac: 9f e0 ldi r25, 0x0F ; 15 1e3ae: 0f 94 81 a4 call 0x34902 ; 0x34902 1e3b2: 88 23 and r24, r24 1e3b4: d9 f1 breq .+118 ; 0x1e42c // first time run of wizard or service prep lcd_wizard(WizState::Run); 1e3b6: 80 e0 ldi r24, 0x00 ; 0 } else if (run_wizard) { // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); 1e3b8: 0e 94 84 e9 call 0x1d308 ; 0x1d308 lcd_show_fullscreen_message_and_wait_P(_T(MSG_TM_NOT_CAL)); #endif //THERMAL_MODEL } } KEEPALIVE_STATE(IN_PROCESS); 1e3bc: 83 e0 ldi r24, 0x03 ; 3 1e3be: 80 93 78 02 sts 0x0278, r24 ; 0x800278 #endif //DEBUG_DISABLE_STARTMSGS lcd_update_enable(true); 1e3c2: 81 e0 ldi r24, 0x01 ; 1 1e3c4: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_clear(); 1e3c8: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_update(2); 1e3cc: 82 e0 ldi r24, 0x02 ; 2 1e3ce: 0e 94 4a 6f call 0xde94 ; 0xde94 "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); 1e3d2: 83 e0 ldi r24, 0x03 ; 3 1e3d4: 9d e0 ldi r25, 0x0D ; 13 1e3d6: 0f 94 81 a4 call 0x34902 ; 0x34902 1e3da: 18 2f mov r17, r24 if(crash_reason != dump_crash_reason::manual && (uint8_t)crash_reason != 0xFF) 1e3dc: 8f ef ldi r24, 0xFF ; 255 1e3de: 81 0f add r24, r17 1e3e0: 8e 3f cpi r24, 0xFE ; 254 1e3e2: 08 f0 brcs .+2 ; 0x1e3e6 1e3e4: 49 c0 rjmp .+146 ; 0x1e478 } return clicked; } void lcd_beeper_quick_feedback(void) { Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 1e3e6: 80 e0 ldi r24, 0x00 ; 0 1e3e8: 0f 94 3f 23 call 0x2467e ; 0x2467e { lcd_beeper_quick_feedback(); lcd_clear(); 1e3ec: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); 1e3f0: 8e eb ldi r24, 0xBE ; 190 1e3f2: 99 e6 ldi r25, 0x69 ; 105 1e3f4: 0e 94 6e 6f call 0xdedc ; 0xdedc switch(crash_reason) 1e3f8: 12 30 cpi r17, 0x02 ; 2 1e3fa: b1 f1 breq .+108 ; 0x1e468 1e3fc: 13 30 cpi r17, 0x03 ; 3 1e3fe: 09 f4 brne .+2 ; 0x1e402 1e400: 16 c1 rjmp .+556 ; 0x1e62e { case dump_crash_reason::stack_error: lcd_puts_P(_n("Static memory has\nbeen overwritten")); 1e402: 8b e9 ldi r24, 0x9B ; 155 1e404: 99 e6 ldi r25, 0x69 ; 105 { lcd_beeper_quick_feedback(); lcd_clear(); lcd_puts_P(_n("FIRMWARE CRASH!\nCrash reason:\n")); switch(crash_reason) 1e406: 11 30 cpi r17, 0x01 ; 1 1e408: 89 f1 breq .+98 ; 0x1e46c } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 1e40a: 81 2f mov r24, r17 1e40c: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 1e410: 2f c0 rjmp .+94 ; 0x1e470 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)); 1e412: 86 e6 ldi r24, 0x66 ; 102 1e414: 9e e4 ldi r25, 0x4E ; 78 1e416: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1e41a: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 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); 1e41e: 6a ef ldi r22, 0xFA ; 250 1e420: 70 e0 ldi r23, 0x00 ; 0 1e422: 8e ee ldi r24, 0xEE ; 238 1e424: 9e e0 ldi r25, 0x0E ; 14 1e426: 0f 94 df a4 call 0x349be ; 0x349be 1e42a: da ce rjmp .-588 ; 0x1e1e0 // 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); 1e42c: 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) { 1e42e: 11 11 cpse r17, r1 1e430: c3 cf rjmp .-122 ; 0x1e3b8 // some wizard steps required by the upgrade checks lcd_wizard(WizState::Restore); } else { if (!calibration_status_get(CALIBRATION_STATUS_SELFTEST)) { 1e432: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 1e436: 81 11 cpse r24, r1 1e438: 07 c0 rjmp .+14 ; 0x1e448 // aborted or missing wizard: show a single warning lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_CALIBRATION_FLOW)); 1e43a: 88 e7 ldi r24, 0x78 ; 120 1e43c: 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)); 1e43e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1e442: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 1e446: ba cf rjmp .-140 ; 0x1e3bc 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)) { 1e448: 84 e0 ldi r24, 0x04 ; 4 1e44a: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 1e44e: 81 11 cpse r24, r1 1e450: 03 c0 rjmp .+6 ; 0x1e458 // wizard reset after service prep lcd_show_fullscreen_message_and_wait_P(_T(MSG_FOLLOW_Z_CALIBRATION_FLOW)); 1e452: 80 e0 ldi r24, 0x00 ; 0 1e454: 9d e4 ldi r25, 0x4D ; 77 1e456: f3 cf rjmp .-26 ; 0x1e43e } else { // warn about other important steps individually if (!calibration_status_get(CALIBRATION_STATUS_LIVE_ADJUST)) 1e458: 80 e1 ldi r24, 0x10 ; 16 1e45a: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 1e45e: 81 11 cpse r24, r1 1e460: ad cf rjmp .-166 ; 0x1e3bc lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 1e462: 8c eb ldi r24, 0xBC ; 188 1e464: 90 e6 ldi r25, 0x60 ; 96 1e466: eb cf rjmp .-42 ; 0x1e43e { 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")); 1e468: 8a e8 ldi r24, 0x8A ; 138 1e46a: 99 e6 ldi r25, 0x69 ; 105 1e46c: 0e 94 6e 6f call 0xdedc ; 0xdedc } } void lcd_wait_for_click() { lcd_wait_for_click_delay(0); 1e470: 90 e0 ldi r25, 0x00 ; 0 1e472: 80 e0 ldi r24, 0x00 ; 0 1e474: 0e 94 aa dd call 0x1bb54 ; 0x1bb54 if (previous_value != value) { eeprom_byte_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_byte(dst, value); 1e478: 6f ef ldi r22, 0xFF ; 255 1e47a: 83 e0 ldi r24, 0x03 ; 3 1e47c: 9d e0 ldi r25, 0x0D ; 13 1e47e: 0f 94 a5 a4 call 0x3494a ; 0x3494a // 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(); 1e482: 0e 94 46 d7 call 0x1ae8c ; 0x1ae8c KEEPALIVE_STATE(NOT_BUSY); 1e486: 81 e0 ldi r24, 0x01 ; 1 1e488: 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" ); 1e48c: 88 e1 ldi r24, 0x18 ; 24 1e48e: 98 e2 ldi r25, 0x28 ; 40 1e490: 0f b6 in r0, 0x3f ; 63 1e492: f8 94 cli 1e494: a8 95 wdr 1e496: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1e49a: 0f be out 0x3f, r0 ; 63 1e49c: 90 93 60 00 sts 0x0060, r25 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #ifdef WATCHDOG wdt_enable(WDTO_4S); #ifdef EMERGENCY_HANDLERS WDTCSR |= (1 << WDIE); 1e4a0: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 1e4a4: 80 64 ori r24, 0x40 ; 64 1e4a6: 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; 1e4aa: 85 e0 ldi r24, 0x05 ; 5 1e4ac: d8 2e mov r13, r24 setup(); for (;;) { loop(); if (serialEventRun) serialEventRun(); 1e4ae: 90 e0 ldi r25, 0x00 ; 0 1e4b0: e9 2e mov r14, r25 1e4b2: 90 e0 ldi r25, 0x00 ; 0 1e4b4: 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); 1e4b6: cc 24 eor r12, r12 1e4b8: 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); 1e4ba: 24 e0 ldi r18, 0x04 ; 4 1e4bc: 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; 1e4be: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 if(Stopped) { 1e4c2: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 1e4c6: 88 23 and r24, r24 1e4c8: 09 f4 brne .+2 ; 0x1e4cc 1e4ca: b4 c0 rjmp .+360 ; 0x1e634 // 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); 1e4cc: 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. 1e4d0: 0e 94 86 66 call 0xcd0c ; 0xcd0c 1e4d4: 88 23 and r24, r24 1e4d6: 09 f4 brne .+2 ; 0x1e4da 1e4d8: b0 c0 rjmp .+352 ; 0x1e63a 1e4da: 80 91 79 02 lds r24, 0x0279 ; 0x800279 1e4de: 81 30 cpi r24, 0x01 ; 1 1e4e0: 09 f0 breq .+2 ; 0x1e4e4 1e4e2: ab c0 rjmp .+342 ; 0x1e63a usb_timer.start(); 1e4e4: 82 e4 ldi r24, 0x42 ; 66 1e4e6: 92 e1 ldi r25, 0x12 ; 18 1e4e8: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> } else #endif { get_command(); 1e4ec: 0e 94 1e 86 call 0x10c3c ; 0x10c3c // 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) 1e4f0: 80 91 56 02 lds r24, 0x0256 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.512> 1e4f4: 88 23 and r24, r24 1e4f6: 89 f0 breq .+34 ; 0x1e51a return; if(autostart_atmillis.expired(5000)) 1e4f8: 68 e8 ldi r22, 0x88 ; 136 1e4fa: 73 e1 ldi r23, 0x13 ; 19 1e4fc: 88 ee ldi r24, 0xE8 ; 232 1e4fe: 96 e1 ldi r25, 0x16 ; 22 1e500: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 1e504: 81 11 cpse r24, r1 1e506: 09 c0 rjmp .+18 ; 0x1e51a return; } autostart_stilltocheck = false; 1e508: 10 92 56 02 sts 0x0256, r1 ; 0x800256 <_ZZN10CardReader14checkautostartEbE22autostart_stilltocheck.lto_priv.512> if(!mounted) 1e50c: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1e510: 88 23 and r24, r24 1e512: 09 f4 brne .+2 ; 0x1e516 1e514: 9e c0 rjmp .+316 ; 0x1e652 1e516: 0f 94 d0 67 call 0x2cfa0 ; 0x2cfa0 #ifdef SDSUPPORT card.checkautostart(false); #endif if(buflen) 1e51a: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1e51e: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1e522: 89 2b or r24, r25 1e524: 09 f4 brne .+2 ; 0x1e528 1e526: 63 c0 rjmp .+198 ; 0x1e5ee { cmdbuffer_front_already_processed = false; 1e528: 10 92 53 12 sts 0x1253, r1 ; 0x801253 #ifdef SDSUPPORT if(card.saving) 1e52c: 80 91 d5 13 lds r24, 0x13D5 ; 0x8013d5 1e530: 88 23 and r24, r24 1e532: c1 f1 breq .+112 ; 0x1e5a4 { // 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) { 1e534: 00 91 38 12 lds r16, 0x1238 ; 0x801238 1e538: 10 91 39 12 lds r17, 0x1239 ; 0x801239 1e53c: 02 5b subi r16, 0xB2 ; 178 1e53e: 1f 4e sbci r17, 0xEF ; 239 1e540: 6f e5 ldi r22, 0x5F ; 95 1e542: 78 e8 ldi r23, 0x88 ; 136 1e544: c8 01 movw r24, r16 1e546: 0f 94 88 a2 call 0x34510 ; 0x34510 1e54a: 89 2b or r24, r25 1e54c: 09 f0 breq .+2 ; 0x1e550 1e54e: 8e c0 rjmp .+284 ; 0x1e66c else SERIAL_PROTOCOLLNPGM("Not SD printing"); } void CardReader::write_command(char *buf) { file.writeError = false; 1e550: 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)); 1e554: f8 01 movw r30, r16 1e556: 01 90 ld r0, Z+ 1e558: 00 20 and r0, r0 1e55a: e9 f7 brne .-6 ; 0x1e556 1e55c: 31 97 sbiw r30, 0x01 ; 1 1e55e: bf 01 movw r22, r30 1e560: 60 1b sub r22, r16 1e562: 71 0b sbc r23, r17 1e564: c8 01 movw r24, r16 1e566: 0f 94 a7 75 call 0x2eb4e ; 0x2eb4e 1e56a: 62 e0 ldi r22, 0x02 ; 2 1e56c: 70 e0 ldi r23, 0x00 ; 0 1e56e: 8d ed ldi r24, 0xDD ; 221 1e570: 92 e0 ldi r25, 0x02 ; 2 1e572: 0f 94 a7 75 call 0x2eb4e ; 0x2eb4e file.write(buf); //write command file.write("\r\n"); //write line termination if (file.writeError) 1e576: 80 91 67 16 lds r24, 0x1667 ; 0x801667 1e57a: 88 23 and r24, r24 1e57c: 41 f0 breq .+16 ; 0x1e58e { SERIAL_ERROR_START; 1e57e: 87 ec ldi r24, 0xC7 ; 199 1e580: 92 ea ldi r25, 0xA2 ; 162 1e582: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORLNRPGM(MSG_SD_ERR_WRITE_TO_FILE); 1e586: 88 e6 ldi r24, 0x68 ; 104 1e588: 9a e6 ldi r25, 0x6A ; 106 1e58a: 0e 94 0e 7d call 0xfa1c ; 0xfa1c card.write_command(CMDBUFFER_CURRENT_STRING); if(card.logging) 1e58e: 80 91 d6 13 lds r24, 0x13D6 ; 0x8013d6 1e592: 88 23 and r24, r24 1e594: 09 f4 brne .+2 ; 0x1e598 1e596: 65 c0 rjmp .+202 ; 0x1e662 */ void process_commands() { if (!buflen) return; //empty command 1e598: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1e59c: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1e5a0: 89 2b or r24, r25 1e5a2: 11 f0 breq .+4 ; 0x1e5a8 1e5a4: 0e 94 4d 8e call 0x11c9a ; 0x11c9a } #else process_commands(); #endif //SDSUPPORT if (! cmdbuffer_front_already_processed && buflen) 1e5a8: 80 91 53 12 lds r24, 0x1253 ; 0x801253 1e5ac: 81 11 cpse r24, r1 1e5ae: 19 c0 rjmp .+50 ; 0x1e5e2 1e5b0: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1e5b4: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1e5b8: 89 2b or r24, r25 1e5ba: 99 f0 breq .+38 ; 0x1e5e2 { // 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; 1e5bc: e0 91 38 12 lds r30, 0x1238 ; 0x801238 1e5c0: f0 91 39 12 lds r31, 0x1239 ; 0x801239 1e5c4: e5 5b subi r30, 0xB5 ; 181 1e5c6: ff 4e sbci r31, 0xEF ; 239 if (*ptr == CMDBUFFER_CURRENT_TYPE_SDCARD) { 1e5c8: 80 81 ld r24, Z 1e5ca: 82 30 cpi r24, 0x02 ; 2 1e5cc: 09 f0 breq .+2 ; 0x1e5d0 1e5ce: 53 c0 rjmp .+166 ; 0x1e676 { // 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(); 1e5d0: 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; 1e5d2: 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); 1e5d4: 81 81 ldd r24, Z+1 ; 0x01 1e5d6: 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); 1e5d8: 0f 94 19 3a call 0x27432 ; 0x27432 sei(); 1e5dc: 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(); 1e5de: 0e 94 94 79 call 0xf328 ; 0xf328 */ void host_keepalive() { #ifndef HOST_KEEPALIVE_FEATURE return; #endif //HOST_KEEPALIVE_FEATURE if (farm_mode) return; 1e5e2: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1e5e6: 81 11 cpse r24, r1 1e5e8: 02 c0 rjmp .+4 ; 0x1e5ee 1e5ea: 0e 94 12 7d call 0xfa24 ; 0xfa24 } host_keepalive(); } } //check heater every n milliseconds manage_heater(); 1e5ee: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(printingIsPaused()); 1e5f2: 0e 94 86 66 call 0xcd0c ; 0xcd0c 1e5f6: 0e 94 ad 8a call 0x1155a ; 0x1155a //=============================functions ============================ //=========================================================================== void checkHitEndstops() { if(endstop_hit) { 1e5fa: 80 91 5e 04 lds r24, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.440> 1e5fe: 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; 1e600: 10 92 5e 04 sts 0x045E, r1 ; 0x80045e <_ZL11endstop_hit.lto_priv.440> checkHitEndstops(); lcd_update(0); 1e604: 80 e0 ldi r24, 0x00 ; 0 1e606: 0e 94 4a 6f call 0xde94 ; 0xde94 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) { 1e60a: 80 91 5f 04 lds r24, 0x045F ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.500> 1e60e: 81 11 cpse r24, r1 1e610: 07 c0 rjmp .+14 ; 0x1e620 return; } avoidRecursion = true; 1e612: c0 92 5f 04 sts 0x045F, r12 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.500> mmu_loop_inner(true); 1e616: 81 e0 ldi r24, 0x01 ; 1 1e618: 0f 94 d9 97 call 0x32fb2 ; 0x32fb2 avoidRecursion = false; 1e61c: 10 92 5f 04 sts 0x045F, r1 ; 0x80045f <_ZZN4MMU24MMU28mmu_loopEvE14avoidRecursion.lto_priv.500> 1e620: e1 14 cp r14, r1 1e622: f1 04 cpc r15, r1 1e624: 09 f4 brne .+2 ; 0x1e628 1e626: 4b cf rjmp .-362 ; 0x1e4be 1e628: 0e 94 00 00 call 0 ; 0x0 <__vectors> 1e62c: 48 cf rjmp .-368 ; 0x1e4be 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")); 1e62e: 8c e7 ldi r24, 0x7C ; 124 1e630: 99 e6 ldi r25, 0x69 ; 105 1e632: 1c cf rjmp .-456 ; 0x1e46c // 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); 1e634: c0 92 78 02 sts 0x0278, r12 ; 0x800278 1e638: 4b cf rjmp .-362 ; 0x1e4d0 } 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. 1e63a: 60 e1 ldi r22, 0x10 ; 16 1e63c: 77 e2 ldi r23, 0x27 ; 39 1e63e: 82 e4 ldi r24, 0x42 ; 66 1e640: 92 e1 ldi r25, 0x12 ; 18 1e642: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 1e646: 88 23 and r24, r24 1e648: 09 f4 brne .+2 ; 0x1e64c 1e64a: 50 cf rjmp .-352 ; 0x1e4ec 1e64c: b0 92 61 0d sts 0x0D61, r11 ; 0x800d61 <_ZL13printer_state.lto_priv.384> 1e650: 4d cf rjmp .-358 ; 0x1e4ec return; } autostart_stilltocheck = false; if(!mounted) { mount(); 1e652: 81 e0 ldi r24, 0x01 ; 1 1e654: 0f 94 08 73 call 0x2e610 ; 0x2e610 if(!mounted) //fail 1e658: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1e65c: 81 11 cpse r24, r1 1e65e: 5b cf rjmp .-330 ; 0x1e516 1e660: 5c cf rjmp .-328 ; 0x1e51a 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); 1e662: 80 e9 ldi r24, 0x90 ; 144 1e664: 9a e6 ldi r25, 0x6A ; 106 } else { card.closefile(); SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1e666: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 1e66a: 9e cf rjmp .-196 ; 0x1e5a8 if(card.logging) process_commands(); else SERIAL_PROTOCOLLNRPGM(MSG_OK); } else { card.closefile(); 1e66c: 0f 94 97 65 call 0x2cb2e ; 0x2cb2e SERIAL_PROTOCOLLNRPGM(MSG_FILE_SAVED); 1e670: 8e e7 ldi r24, 0x7E ; 126 1e672: 9a e6 ldi r25, 0x6A ; 106 1e674: f8 cf rjmp .-16 ; 0x1e666 // 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){ 1e676: 86 30 cpi r24, 0x06 ; 6 1e678: 09 f0 breq .+2 ; 0x1e67c 1e67a: b1 cf rjmp .-158 ; 0x1e5de 1e67c: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 1e680: 81 11 cpse r24, r1 1e682: ad cf rjmp .-166 ; 0x1e5de cli(); 1e684: f8 94 cli *ptr ++ = CMDBUFFER_CURRENT_TYPE_TO_BE_REMOVED; 1e686: d0 82 st Z, r13 // and one for each command to previous block in the planner queue. planner_add_sd_length(1); 1e688: 81 e0 ldi r24, 0x01 ; 1 1e68a: 90 e0 ldi r25, 0x00 ; 0 1e68c: a5 cf rjmp .-182 ; 0x1e5d8 { 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; 1e68e: 02 e0 ldi r16, 0x02 ; 2 if (motherboard != MOTHERBOARD) version_changed |= 0b01; 1e690: 8b 3c cpi r24, 0xCB ; 203 1e692: 91 05 cpc r25, r1 1e694: 09 f0 breq .+2 ; 0x1e698 1e696: 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(); 1e698: 0e 94 67 85 call 0x10ace ; 0x10ace 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; 1e69c: 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; 1e69e: 82 ea ldi r24, 0xA2 ; 162 1e6a0: 92 ea ldi r25, 0xA2 ; 162 1e6a2: a0 e0 ldi r26, 0x00 ; 0 1e6a4: b0 e0 ldi r27, 0x00 ; 0 1e6a6: 80 93 37 17 sts 0x1737, r24 ; 0x801737 <__bss_end+0x20> 1e6aa: 90 93 38 17 sts 0x1738, r25 ; 0x801738 <__bss_end+0x21> 1e6ae: a0 93 39 17 sts 0x1739, r26 ; 0x801739 <__bss_end+0x22> 1e6b2: 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; 1e6b6: 10 92 1c 04 sts 0x041C, r1 ; 0x80041c <_ZL14iState_sum_min.lto_priv.432> 1e6ba: 10 92 1d 04 sts 0x041D, r1 ; 0x80041d <_ZL14iState_sum_min.lto_priv.432+0x1> 1e6be: 10 92 1e 04 sts 0x041E, r1 ; 0x80041e <_ZL14iState_sum_min.lto_priv.432+0x2> 1e6c2: 10 92 1f 04 sts 0x041F, r1 ; 0x80041f <_ZL14iState_sum_min.lto_priv.432+0x3> iState_sum_max[e] = PID_INTEGRAL_DRIVE_MAX / cs.Ki; 1e6c6: 20 91 d3 0d lds r18, 0x0DD3 ; 0x800dd3 1e6ca: 30 91 d4 0d lds r19, 0x0DD4 ; 0x800dd4 1e6ce: 40 91 d5 0d lds r20, 0x0DD5 ; 0x800dd5 1e6d2: 50 91 d6 0d lds r21, 0x0DD6 ; 0x800dd6 1e6d6: 60 e0 ldi r22, 0x00 ; 0 1e6d8: 70 e0 ldi r23, 0x00 ; 0 1e6da: 8f e7 ldi r24, 0x7F ; 127 1e6dc: 93 e4 ldi r25, 0x43 ; 67 1e6de: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1e6e2: 60 93 18 04 sts 0x0418, r22 ; 0x800418 <_ZL14iState_sum_max.lto_priv.433> 1e6e6: 70 93 19 04 sts 0x0419, r23 ; 0x800419 <_ZL14iState_sum_max.lto_priv.433+0x1> 1e6ea: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14iState_sum_max.lto_priv.433+0x2> 1e6ee: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14iState_sum_max.lto_priv.433+0x3> #endif //PIDTEMP #ifdef PIDTEMPBED temp_iState_min_bed = 0.0; 1e6f2: 10 92 14 04 sts 0x0414, r1 ; 0x800414 <_ZL19temp_iState_min_bed.lto_priv.430> 1e6f6: 10 92 15 04 sts 0x0415, r1 ; 0x800415 <_ZL19temp_iState_min_bed.lto_priv.430+0x1> 1e6fa: 10 92 16 04 sts 0x0416, r1 ; 0x800416 <_ZL19temp_iState_min_bed.lto_priv.430+0x2> 1e6fe: 10 92 17 04 sts 0x0417, r1 ; 0x800417 <_ZL19temp_iState_min_bed.lto_priv.430+0x3> temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 1e702: 20 91 df 0d lds r18, 0x0DDF ; 0x800ddf 1e706: 30 91 e0 0d lds r19, 0x0DE0 ; 0x800de0 1e70a: 40 91 e1 0d lds r20, 0x0DE1 ; 0x800de1 1e70e: 50 91 e2 0d lds r21, 0x0DE2 ; 0x800de2 1e712: 60 e0 ldi r22, 0x00 ; 0 1e714: 70 e0 ldi r23, 0x00 ; 0 1e716: 8f e7 ldi r24, 0x7F ; 127 1e718: 93 e4 ldi r25, 0x43 ; 67 1e71a: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1e71e: 60 93 10 04 sts 0x0410, r22 ; 0x800410 <_ZL19temp_iState_max_bed.lto_priv.431> 1e722: 70 93 11 04 sts 0x0411, r23 ; 0x800411 <_ZL19temp_iState_max_bed.lto_priv.431+0x1> 1e726: 80 93 12 04 sts 0x0412, r24 ; 0x800412 <_ZL19temp_iState_max_bed.lto_priv.431+0x2> 1e72a: 90 93 13 04 sts 0x0413, r25 ; 0x800413 <_ZL19temp_iState_max_bed.lto_priv.431+0x3> #endif //PIDTEMPBED } #if defined(HEATER_0_PIN) && (HEATER_0_PIN > -1) SET_OUTPUT(HEATER_0_PIN); 1e72e: 6d 9a sbi 0x0d, 5 ; 13 #endif #if defined(HEATER_BED_PIN) && (HEATER_BED_PIN > -1) SET_OUTPUT(HEATER_BED_PIN); 1e730: 9d 9a sbi 0x13, 5 ; 19 #endif #if defined(FAN_PIN) && (FAN_PIN > -1) SET_OUTPUT(FAN_PIN); 1e732: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 1e736: 88 60 ori r24, 0x08 ; 8 1e738: 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)); 1e73c: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 1e740: 90 e0 ldi r25, 0x00 ; 0 1e742: 64 e0 ldi r22, 0x04 ; 4 1e744: 95 95 asr r25 1e746: 87 95 ror r24 1e748: 6a 95 dec r22 1e74a: e1 f7 brne .-8 ; 0x1e744 1e74c: 80 93 0f 04 sts 0x040F, r24 ; 0x80040f <_ZL12soft_pwm_fan.lto_priv.435> pinMode(MAX6675_SS, OUTPUT); digitalWrite(MAX6675_SS,1); #endif #ifdef HEATER_0_MINTEMP minttemp[0] = HEATER_0_MINTEMP; 1e750: 8e e1 ldi r24, 0x1E ; 30 1e752: 90 e0 ldi r25, 0x00 ; 0 1e754: 90 93 0e 04 sts 0x040E, r25 ; 0x80040e <_ZL8minttemp.lto_priv.425+0x1> 1e758: 80 93 0d 04 sts 0x040D, r24 ; 0x80040d <_ZL8minttemp.lto_priv.425> while(analog2temp(minttemp_raw[0], 0) < HEATER_0_MINTEMP) { 1e75c: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.427> 1e760: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.427+0x1> 1e764: 0f 94 07 90 call 0x3200e ; 0x3200e 1e768: 20 e0 ldi r18, 0x00 ; 0 1e76a: 30 e0 ldi r19, 0x00 ; 0 1e76c: 40 ef ldi r20, 0xF0 ; 240 1e76e: 51 e4 ldi r21, 0x41 ; 65 1e770: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1e774: 87 ff sbrs r24, 7 1e776: 6e c9 rjmp .-3364 ; 0x1da54 #if HEATER_0_RAW_LO_TEMP < HEATER_0_RAW_HI_TEMP minttemp_raw[0] += OVERSAMPLENR; #else minttemp_raw[0] -= OVERSAMPLENR; 1e778: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.427> 1e77c: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.427+0x1> 1e780: 40 97 sbiw r24, 0x10 ; 16 1e782: 90 93 53 02 sts 0x0253, r25 ; 0x800253 <_ZL12minttemp_raw.lto_priv.427+0x1> 1e786: 80 93 52 02 sts 0x0252, r24 ; 0x800252 <_ZL12minttemp_raw.lto_priv.427> 1e78a: e8 cf rjmp .-48 ; 0x1e75c 0001e78c : } } void lcd_print_stop_finish(); void lcd_commands() 1e78c: 2f 92 push r2 1e78e: 3f 92 push r3 1e790: 4f 92 push r4 1e792: 5f 92 push r5 1e794: 6f 92 push r6 1e796: 7f 92 push r7 1e798: 8f 92 push r8 1e79a: 9f 92 push r9 1e79c: af 92 push r10 1e79e: bf 92 push r11 1e7a0: cf 92 push r12 1e7a2: df 92 push r13 1e7a4: ef 92 push r14 1e7a6: ff 92 push r15 1e7a8: 0f 93 push r16 1e7aa: 1f 93 push r17 1e7ac: cf 93 push r28 1e7ae: df 93 push r29 1e7b0: 00 d0 rcall .+0 ; 0x1e7b2 1e7b2: 1f 92 push r1 1e7b4: 1f 92 push r1 1e7b6: cd b7 in r28, 0x3d ; 61 1e7b8: 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) 1e7ba: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1e7be: 81 30 cpi r24, 0x01 ; 1 1e7c0: 09 f0 breq .+2 ; 0x1e7c4 1e7c2: 61 c0 rjmp .+194 ; 0x1e886 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); 1e7c4: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1e7c8: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f { if (!blocks_queued() && !homing_flag) 1e7cc: 98 13 cpse r25, r24 1e7ce: 5b c0 rjmp .+182 ; 0x1e886 1e7d0: 80 91 71 12 lds r24, 0x1271 ; 0x801271 1e7d4: 81 11 cpse r24, r1 1e7d6: 57 c0 rjmp .+174 ; 0x1e886 { custom_message_type = CustomMsg::Status; 1e7d8: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d lcd_setstatuspgm(_T(MSG_PRINT_ABORTED)); 1e7dc: 88 ee ldi r24, 0xE8 ; 232 1e7de: 9b e4 ldi r25, 0x4B ; 75 1e7e0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1e7e4: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 lcd_commands_type = LcdCommands::Idle; 1e7e8: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1e7ec: 82 e0 ldi r24, 0x02 ; 2 1e7ee: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.384> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1e7f2: 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(); 1e7f6: 0f 94 e2 16 call 0x22dc4 ; 0x22dc4 save_statistics(); 1e7fa: 0e 94 01 65 call 0xca02 ; 0xca02 // lift Z raise_z(10); 1e7fe: 60 e0 ldi r22, 0x00 ; 0 1e800: 70 e0 ldi r23, 0x00 ; 0 1e802: 80 e2 ldi r24, 0x20 ; 32 1e804: 91 e4 ldi r25, 0x41 ; 65 1e806: 0e 94 e5 6c call 0xd9ca ; 0xd9ca // if axis are homed, move to parking position. if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1e80a: 80 91 39 06 lds r24, 0x0639 ; 0x800639 1e80e: 88 23 and r24, r24 1e810: 21 f1 breq .+72 ; 0x1e85a 1e812: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 1e816: 88 23 and r24, r24 1e818: 01 f1 breq .+64 ; 0x1e85a current_position[X_AXIS] = X_CANCEL_POS; 1e81a: 80 e0 ldi r24, 0x00 ; 0 1e81c: 90 e0 ldi r25, 0x00 ; 0 1e81e: a8 e4 ldi r26, 0x48 ; 72 1e820: b2 e4 ldi r27, 0x42 ; 66 1e822: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1e826: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1e82a: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1e82e: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = Y_CANCEL_POS; 1e832: 80 e0 ldi r24, 0x00 ; 0 1e834: 90 e0 ldi r25, 0x00 ; 0 1e836: ae e3 ldi r26, 0x3E ; 62 1e838: b3 e4 ldi r27, 0x43 ; 67 1e83a: 80 93 65 12 sts 0x1265, r24 ; 0x801265 1e83e: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1e842: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1e846: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(manual_feedrate[0] / 60); 1e84a: 60 e0 ldi r22, 0x00 ; 0 1e84c: 70 e0 ldi r23, 0x00 ; 0 1e84e: 84 e3 ldi r24, 0x34 ; 52 1e850: 92 e4 ldi r25, 0x42 ; 66 1e852: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 1e856: 0f 94 94 18 call 0x23128 ; 0x23128 temp_error_state.assert = true; } bool get_temp_error() { return temp_error_state.v; 1e85a: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> // 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()) { 1e85e: 88 23 and r24, r24 1e860: 09 f4 brne .+2 ; 0x1e864 1e862: c9 c0 rjmp .+402 ; 0x1e9f6 // time to stop the error beep WRITE(BEEPER, LOW); 1e864: 9f b7 in r25, 0x3f ; 63 1e866: f8 94 cli 1e868: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1e86c: 8b 7f andi r24, 0xFB ; 251 1e86e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1e872: 9f bf out 0x3f, r25 ; 63 MMU2::mmu2.unload(); // M702 } } } lcd_cooldown(); //turns off heaters and fan; goes to status screen. 1e874: 0f 94 b3 0e call 0x21d66 ; 0x21d66 finishAndDisableSteppers(); //M84 1e878: 0e 94 ce 84 call 0x1099c ; 0x1099c axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative 1e87c: 88 e0 ldi r24, 0x08 ; 8 1e87e: 80 93 57 12 sts 0x1257, r24 ; 0x801257 did_pause_print = false; // Clear pause state in case the print was aborted while paused 1e882: 10 92 cd 03 sts 0x03CD, r1 ; 0x8003cd lcd_commands_step = 0; lcd_print_stop_finish(); } } if (lcd_commands_type == LcdCommands::LongPause) 1e886: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1e88a: 82 30 cpi r24, 0x02 ; 2 1e88c: 09 f0 breq .+2 ; 0x1e890 1e88e: 6a c0 rjmp .+212 ; 0x1e964 1e890: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1e894: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f { if (!blocks_queued() && !homing_flag) 1e898: 98 13 cpse r25, r24 1e89a: 64 c0 rjmp .+200 ; 0x1e964 1e89c: 80 91 71 12 lds r24, 0x1271 ; 0x801271 1e8a0: 81 11 cpse r24, r1 1e8a2: 60 c0 rjmp .+192 ; 0x1e964 { if (custom_message_type != CustomMsg::M117) 1e8a4: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 1e8a8: 87 30 cpi r24, 0x07 ; 7 1e8aa: 41 f0 breq .+16 ; 0x1e8bc { custom_message_type = CustomMsg::Status; 1e8ac: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d lcd_setstatuspgm(_T(MSG_PRINT_PAUSED)); 1e8b0: 89 ed ldi r24, 0xD9 ; 217 1e8b2: 9b e4 ldi r25, 0x4B ; 75 1e8b4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1e8b8: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 } lcd_commands_type = LcdCommands::Idle; 1e8bc: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1e8c0: 82 e0 ldi r24, 0x02 ; 2 1e8c2: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.384> SetPrinterState(PrinterState::Idle); lcd_commands_step = 0; 1e8c6: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 } #endif //PINDA_THERMISTOR void long_pause() //long pause print { st_synchronize(); 1e8ca: 0f 94 94 18 call 0x23128 ; 0x23128 // Stop heaters heating_status = HeatingStatus::NO_HEATING; 1e8ce: 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; 1e8d2: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1e8d6: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d setTargetHotend(0); // Lift z raise_z(pause_position[Z_AXIS]); 1e8da: 60 91 4a 02 lds r22, 0x024A ; 0x80024a <_ZL14pause_position.lto_priv.488+0x8> 1e8de: 70 91 4b 02 lds r23, 0x024B ; 0x80024b <_ZL14pause_position.lto_priv.488+0x9> 1e8e2: 80 91 4c 02 lds r24, 0x024C ; 0x80024c <_ZL14pause_position.lto_priv.488+0xa> 1e8e6: 90 91 4d 02 lds r25, 0x024D ; 0x80024d <_ZL14pause_position.lto_priv.488+0xb> 1e8ea: 0e 94 e5 6c call 0xd9ca ; 0xd9ca // Move XY to side if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]) { 1e8ee: 80 91 39 06 lds r24, 0x0639 ; 0x800639 1e8f2: 88 23 and r24, r24 1e8f4: 51 f1 breq .+84 ; 0x1e94a 1e8f6: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 1e8fa: 88 23 and r24, r24 1e8fc: 31 f1 breq .+76 ; 0x1e94a current_position[X_AXIS] = pause_position[X_AXIS]; 1e8fe: 80 91 42 02 lds r24, 0x0242 ; 0x800242 <_ZL14pause_position.lto_priv.488> 1e902: 90 91 43 02 lds r25, 0x0243 ; 0x800243 <_ZL14pause_position.lto_priv.488+0x1> 1e906: a0 91 44 02 lds r26, 0x0244 ; 0x800244 <_ZL14pause_position.lto_priv.488+0x2> 1e90a: b0 91 45 02 lds r27, 0x0245 ; 0x800245 <_ZL14pause_position.lto_priv.488+0x3> 1e90e: 80 93 61 12 sts 0x1261, r24 ; 0x801261 1e912: 90 93 62 12 sts 0x1262, r25 ; 0x801262 1e916: a0 93 63 12 sts 0x1263, r26 ; 0x801263 1e91a: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pause_position[Y_AXIS]; 1e91e: 80 91 46 02 lds r24, 0x0246 ; 0x800246 <_ZL14pause_position.lto_priv.488+0x4> 1e922: 90 91 47 02 lds r25, 0x0247 ; 0x800247 <_ZL14pause_position.lto_priv.488+0x5> 1e926: a0 91 48 02 lds r26, 0x0248 ; 0x800248 <_ZL14pause_position.lto_priv.488+0x6> 1e92a: b0 91 49 02 lds r27, 0x0249 ; 0x800249 <_ZL14pause_position.lto_priv.488+0x7> 1e92e: 80 93 65 12 sts 0x1265, r24 ; 0x801265 1e932: 90 93 66 12 sts 0x1266, r25 ; 0x801266 1e936: a0 93 67 12 sts 0x1267, r26 ; 0x801267 1e93a: b0 93 68 12 sts 0x1268, r27 ; 0x801268 plan_buffer_line_curposXYZE(50); 1e93e: 60 e0 ldi r22, 0x00 ; 0 1e940: 70 e0 ldi r23, 0x00 ; 0 1e942: 88 e4 ldi r24, 0x48 ; 72 1e944: 92 e4 ldi r25, 0x42 ; 66 1e946: 0f 94 0d 4a call 0x2941a ; 0x2941a 1e94a: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> } // did we come here from a thermal error? if(get_temp_error()) { 1e94e: 88 23 and r24, r24 1e950: 09 f4 brne .+2 ; 0x1e954 1e952: 7b c0 rjmp .+246 ; 0x1ea4a // time to stop the error beep WRITE(BEEPER, LOW); 1e954: 9f b7 in r25, 0x3f ; 63 1e956: f8 94 cli 1e958: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1e95c: 8b 7f andi r24, 0xFB ; 251 1e95e: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 1e962: 9f bf out 0x3f, r25 ; 63 long_pause(); } } if (lcd_commands_type == LcdCommands::Layer1Cal) 1e964: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1e968: 84 30 cpi r24, 0x04 ; 4 1e96a: 09 f0 breq .+2 ; 0x1e96e 1e96c: ad c0 rjmp .+346 ; 0x1eac8 { const uint16_t nozzle_dia = eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM); 1e96e: 85 ea ldi r24, 0xA5 ; 165 1e970: 9d e0 ldi r25, 0x0D ; 13 1e972: 0f 94 8f a4 call 0x3491e ; 0x3491e 1e976: 30 91 3e 0d lds r19, 0x0D3E ; 0x800d3e 1e97a: 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) 1e97e: 32 13 cpse r19, r18 1e980: 7c c1 rjmp .+760 ; 0x1ec7a 1e982: 20 91 3c 12 lds r18, 0x123C ; 0x80123c 1e986: 30 91 3d 12 lds r19, 0x123D ; 0x80123d 1e98a: 23 2b or r18, r19 1e98c: 09 f0 breq .+2 ; 0x1e990 1e98e: 75 c1 rjmp .+746 ; 0x1ec7a 1e990: 20 91 73 12 lds r18, 0x1273 ; 0x801273 1e994: 29 83 std Y+1, r18 ; 0x01 1e996: 21 11 cpse r18, r1 1e998: 70 c1 rjmp .+736 ; 0x1ec7a { if (lcd_commands_step == 0) 1e99a: 20 91 e2 03 lds r18, 0x03E2 ; 0x8003e2 1e99e: 21 11 cpse r18, r1 1e9a0: 57 c0 rjmp .+174 ; 0x1ea50 lcd_commands_step = 12; 1e9a2: 2c e0 ldi r18, 0x0C ; 12 else lcd_commands_step--; 1e9a4: 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; 1e9a8: 44 96 adiw r24, 0x14 ; 20 1e9aa: bc 01 movw r22, r24 1e9ac: 90 e0 ldi r25, 0x00 ; 0 1e9ae: 80 e0 ldi r24, 0x00 ; 0 1e9b0: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 1e9b4: 20 e0 ldi r18, 0x00 ; 0 1e9b6: 30 e0 ldi r19, 0x00 ; 0 1e9b8: 4a e7 ldi r20, 0x7A ; 122 1e9ba: 54 e4 ldi r21, 0x44 ; 68 1e9bc: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1e9c0: 6b 01 movw r12, r22 1e9c2: 7c 01 movw r14, r24 if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; switch(lcd_commands_step) 1e9c4: e0 91 e2 03 lds r30, 0x03E2 ; 0x8003e2 1e9c8: e1 50 subi r30, 0x01 ; 1 1e9ca: ec 30 cpi r30, 0x0C ; 12 1e9cc: 08 f0 brcs .+2 ; 0x1e9d0 1e9ce: 7c c0 rjmp .+248 ; 0x1eac8 1e9d0: f0 e0 ldi r31, 0x00 ; 0 1e9d2: 88 27 eor r24, r24 1e9d4: e1 51 subi r30, 0x11 ; 17 1e9d6: fb 40 sbci r31, 0x0B ; 11 1e9d8: 8f 4f sbci r24, 0xFF ; 255 1e9da: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> 1e9de: 03 f8 bld r0, 3 1e9e0: ed f7 brhc .-6 ; 0x1e9dc 1e9e2: e9 f7 brne .-6 ; 0x1e9de 1e9e4: e5 f7 brhc .-8 ; 0x1e9de 1e9e6: e1 f7 brne .-8 ; 0x1e9e0 1e9e8: db f7 brvc .-10 ; 0x1e9e0 1e9ea: 66 f7 brtc .-40 ; 0x1e9c4 1e9ec: e1 f6 brne .-72 ; 0x1e9a6 1e9ee: dd f6 brhc .-74 ; 0x1e9a6 1e9f0: 76 f6 brtc .-100 ; 0x1e98e 1e9f2: 30 f5 brcc .+76 ; 0x1ea40 1e9f4: 2a f5 brpl .+74 ; 0x1ea40 if(get_temp_error()) { // time to stop the error beep WRITE(BEEPER, LOW); } else { // Turn off the print fan fanSpeed = 0; 1e9f6: 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(); 1e9fa: 0e 94 f3 77 call 0xefe6 ; 0xefe6 setExtruderAutoFanState(1); 1e9fe: 81 e0 ldi r24, 0x01 ; 1 1ea00: 0e 94 00 78 call 0xf000 ; 0xf000 // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ea04: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1ea08: 81 30 cpi r24, 0x01 ; 1 1ea0a: 09 f0 breq .+2 ; 0x1ea0e 1ea0c: 33 cf rjmp .-410 ; 0x1e874 fanSpeed = 0; // restore the auto hotend state hotendDefaultAutoFanState(); if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament() 1ea0e: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 1ea12: 88 23 and r24, r24 1ea14: 09 f4 brne .+2 ; 0x1ea18 1ea16: 2e cf rjmp .-420 ; 0x1e874 #ifdef FANCHECK && fan_check_error != EFCE_REPORTED 1ea18: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 1ea1c: 82 30 cpi r24, 0x02 ; 2 1ea1e: 09 f4 brne .+2 ; 0x1ea22 1ea20: 29 cf rjmp .-430 ; 0x1e874 #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()) 1ea22: 0e 94 86 66 call 0xcd0c ; 0xcd0c 1ea26: 81 11 cpse r24, r1 { // Restore temperature saved in ram after pausing print restore_extruder_temperature_from_ram(); 1ea28: 0e 94 74 64 call 0xc8e8 ; 0xc8e8 } // 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) { 1ea2c: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 1ea30: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 1ea34: 80 91 57 02 lds r24, 0x0257 ; 0x800257 1ea38: 90 91 58 02 lds r25, 0x0258 ; 0x800258 1ea3c: 28 17 cp r18, r24 1ea3e: 39 07 cpc r19, r25 1ea40: 0c f4 brge .+2 ; 0x1ea44 1ea42: 18 cf rjmp .-464 ; 0x1e874 MMU2::mmu2.unload(); // M702 1ea44: 0f 94 12 9e call 0x33c24 ; 0x33c24 1ea48: 15 cf rjmp .-470 ; 0x1e874 } else { // Turn off the print fan fanSpeed = 0; 1ea4a: 10 92 55 12 sts 0x1255, r1 ; 0x801255 1ea4e: 8a cf rjmp .-236 ; 0x1e964 if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) { if (lcd_commands_step == 0) lcd_commands_step = 12; else lcd_commands_step--; 1ea50: 21 50 subi r18, 0x01 ; 1 1ea52: a8 cf rjmp .-176 ; 0x1e9a4 preheat_cmd_3, preheat_cmd_4, zero_extrusion }; lay1cal_common_enqueue_loop(preheat_cmd, sizeof(preheat_cmd)/sizeof(preheat_cmd[0])); 1ea54: 65 e0 ldi r22, 0x05 ; 5 1ea56: 8d e7 ldi r24, 0x7D ; 125 1ea58: 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]))); 1ea5a: 0e 94 11 8e call 0x11c22 ; 0x11c22 1ea5e: 34 c0 rjmp .+104 ; 0x1eac8 //! @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()) 1ea60: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1ea64: 81 30 cpi r24, 0x01 ; 1 1ea66: 69 f5 brne .+90 ; 0x1eac2 { case 12: lay1cal_wait_preheat(); break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); 1ea68: 30 91 e1 03 lds r19, 0x03E1 ; 0x8003e1 1ea6c: 3b 83 std Y+3, r19 ; 0x03 { enquecommand_P(MSG_M83); 1ea6e: 61 e0 ldi r22, 0x01 ; 1 1ea70: 87 e5 ldi r24, 0x57 ; 87 1ea72: 9d e6 ldi r25, 0x6D ; 109 1ea74: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 enquecommand_P(PSTR("G1 Y-3 F1000")); 1ea78: 61 e0 ldi r22, 0x01 ; 1 1ea7a: 80 e7 ldi r24, 0x70 ; 112 1ea7c: 95 e8 ldi r25, 0x85 ; 133 1ea7e: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 enquecommand_P(PSTR("G1 Z0.4 F1000")); 1ea82: 61 e0 ldi r22, 0x01 ; 1 1ea84: 82 e6 ldi r24, 0x62 ; 98 1ea86: 95 e8 ldi r25, 0x85 ; 133 1ea88: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 uint8_t currentTool = MMU2::mmu2.get_current_tool(); 1ea8c: 0f 94 45 65 call 0x2ca8a ; 0x2ca8a if(currentTool == filament ){ 1ea90: 9b 81 ldd r25, Y+3 ; 0x03 1ea92: 98 17 cp r25, r24 1ea94: b1 f0 breq .+44 ; 0x1eac2 // already have the correct tool loaded - do nothing return false; } else if( currentTool != (uint8_t)MMU2::FILAMENT_UNKNOWN){ 1ea96: 8f 3f cpi r24, 0xFF ; 255 1ea98: 29 f0 breq .+10 ; 0x1eaa4 // some other slot is loaded, perform an unload first enquecommand_P(MSG_M702); 1ea9a: 61 e0 ldi r22, 0x01 ; 1 1ea9c: 8c e6 ldi r24, 0x6C ; 108 1ea9e: 99 e6 ldi r25, 0x69 ; 105 1eaa0: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 } // perform a toolchange enquecommandf_P(PSTR("T%d"), filament); 1eaa4: 1f 92 push r1 1eaa6: 2b 81 ldd r18, Y+3 ; 0x03 1eaa8: 2f 93 push r18 1eaaa: 8e e5 ldi r24, 0x5E ; 94 1eaac: 95 e8 ldi r25, 0x85 ; 133 1eaae: 9f 93 push r25 1eab0: 8f 93 push r24 1eab2: 0e 94 28 8e call 0x11c50 ; 0x11c50 1eab6: 0f 90 pop r0 1eab8: 0f 90 pop r0 1eaba: 0f 90 pop r0 1eabc: 0f 90 pop r0 return true; 1eabe: 31 e0 ldi r19, 0x01 ; 1 1eac0: 39 83 std Y+1, r19 ; 0x01 1eac2: 89 81 ldd r24, Y+1 ; 0x01 1eac4: 80 93 e0 03 sts 0x03E0, r24 ; 0x8003e0 break; } } } if (lcd_commands_type == LcdCommands::PidExtruder) { 1eac8: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1eacc: 83 30 cpi r24, 0x03 ; 3 1eace: 09 f0 breq .+2 ; 0x1ead2 1ead0: d4 c0 rjmp .+424 ; 0x1ec7a if (lcd_commands_step == 0) { 1ead2: 90 91 e2 03 lds r25, 0x03E2 ; 0x8003e2 1ead6: 91 11 cpse r25, r1 1ead8: 09 c0 rjmp .+18 ; 0x1eaec custom_message_type = CustomMsg::PidCal; 1eada: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d custom_message_state = 1; 1eade: 91 e0 ldi r25, 0x01 ; 1 1eae0: 90 93 de 03 sts 0x03DE, r25 ; 0x8003de lcd_draw_update = 3; 1eae4: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_commands_step = 3; 1eae8: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 } if (lcd_commands_step == 3 && !blocks_queued()) { //PID calibration 1eaec: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1eaf0: 83 30 cpi r24, 0x03 ; 3 1eaf2: 19 f5 brne .+70 ; 0x1eb3a 1eaf4: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1eaf8: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 1eafc: 98 13 cpse r25, r24 1eafe: 1d c0 rjmp .+58 ; 0x1eb3a return !pid_tuning_finished; } void preparePidTuning() { // ensure heaters are disabled before we switch off PID management! disable_heater(); 1eb00: 0f 94 9e 0e call 0x21d3c ; 0x21d3c pid_tuning_finished = false; 1eb04: 10 92 41 02 sts 0x0241, r1 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.424> 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); 1eb08: 80 91 4f 02 lds r24, 0x024F ; 0x80024f 1eb0c: 8f 93 push r24 1eb0e: 80 91 4e 02 lds r24, 0x024E ; 0x80024e 1eb12: 8f 93 push r24 1eb14: 82 ef ldi r24, 0xF2 ; 242 1eb16: 95 e8 ldi r25, 0x85 ; 133 1eb18: 9f 93 push r25 1eb1a: 8f 93 push r24 1eb1c: 0e 94 28 8e call 0x11c50 ; 0x11c50 lcd_setstatuspgm(_T(MSG_PID_RUNNING)); 1eb20: 8e ec ldi r24, 0xCE ; 206 1eb22: 9b e4 ldi r25, 0x4B ; 75 1eb24: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1eb28: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 lcd_commands_step = 2; 1eb2c: 82 e0 ldi r24, 0x02 ; 2 1eb2e: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 1eb32: 0f 90 pop r0 1eb34: 0f 90 pop r0 1eb36: 0f 90 pop r0 1eb38: 0f 90 pop r0 } if (lcd_commands_step == 2 && !pidTuningRunning()) { //saving to eeprom 1eb3a: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1eb3e: 82 30 cpi r24, 0x02 ; 2 1eb40: 09 f0 breq .+2 ; 0x1eb44 1eb42: 7c c0 rjmp .+248 ; 0x1ec3c 1eb44: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.424> 1eb48: 88 23 and r24, r24 1eb4a: 09 f4 brne .+2 ; 0x1eb4e 1eb4c: 77 c0 rjmp .+238 ; 0x1ec3c custom_message_state = 0; 1eb4e: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de lcd_setstatuspgm(_T(MSG_PID_FINISHED)); 1eb52: 8a eb ldi r24, 0xBA ; 186 1eb54: 9b e4 ldi r25, 0x4B ; 75 1eb56: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1eb5a: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 1eb5e: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1eb62: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d setTargetHotend(0); if (_Kp != 0 || _Ki != 0 || _Kd != 0) { 1eb66: 30 91 da 03 lds r19, 0x03DA ; 0x8003da <_Kp> 1eb6a: 39 83 std Y+1, r19 ; 0x01 1eb6c: 80 91 db 03 lds r24, 0x03DB ; 0x8003db <_Kp+0x1> 1eb70: 8b 83 std Y+3, r24 ; 0x03 1eb72: 10 91 dc 03 lds r17, 0x03DC ; 0x8003dc <_Kp+0x2> 1eb76: 00 91 dd 03 lds r16, 0x03DD ; 0x8003dd <_Kp+0x3> 1eb7a: 20 e0 ldi r18, 0x00 ; 0 1eb7c: 30 e0 ldi r19, 0x00 ; 0 1eb7e: a9 01 movw r20, r18 1eb80: b9 81 ldd r27, Y+1 ; 0x01 1eb82: f8 01 movw r30, r16 1eb84: 6b 2f mov r22, r27 1eb86: 78 2f mov r23, r24 1eb88: 8f 2f mov r24, r31 1eb8a: 9e 2f mov r25, r30 1eb8c: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1eb90: 81 11 cpse r24, r1 1eb92: 1f c0 rjmp .+62 ; 0x1ebd2 1eb94: 20 e0 ldi r18, 0x00 ; 0 1eb96: 30 e0 ldi r19, 0x00 ; 0 1eb98: a9 01 movw r20, r18 1eb9a: 60 91 d6 03 lds r22, 0x03D6 ; 0x8003d6 <_Ki> 1eb9e: 70 91 d7 03 lds r23, 0x03D7 ; 0x8003d7 <_Ki+0x1> 1eba2: 80 91 d8 03 lds r24, 0x03D8 ; 0x8003d8 <_Ki+0x2> 1eba6: 90 91 d9 03 lds r25, 0x03D9 ; 0x8003d9 <_Ki+0x3> 1ebaa: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1ebae: 81 11 cpse r24, r1 1ebb0: 10 c0 rjmp .+32 ; 0x1ebd2 1ebb2: 20 e0 ldi r18, 0x00 ; 0 1ebb4: 30 e0 ldi r19, 0x00 ; 0 1ebb6: a9 01 movw r20, r18 1ebb8: 60 91 d2 03 lds r22, 0x03D2 ; 0x8003d2 <_Kd> 1ebbc: 70 91 d3 03 lds r23, 0x03D3 ; 0x8003d3 <_Kd+0x1> 1ebc0: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 <_Kd+0x2> 1ebc4: 90 91 d5 03 lds r25, 0x03D5 ; 0x8003d5 <_Kd+0x3> 1ebc8: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1ebcc: 88 23 and r24, r24 1ebce: 09 f4 brne .+2 ; 0x1ebd2 1ebd0: 30 c2 rjmp .+1120 ; 0x1f032 enquecommandf_P(PSTR("M301 P%.2f I%.2f D%.2f"), _Kp, _Ki, _Kd); 1ebd2: 80 91 d5 03 lds r24, 0x03D5 ; 0x8003d5 <_Kd+0x3> 1ebd6: 8f 93 push r24 1ebd8: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 <_Kd+0x2> 1ebdc: 8f 93 push r24 1ebde: 80 91 d3 03 lds r24, 0x03D3 ; 0x8003d3 <_Kd+0x1> 1ebe2: 8f 93 push r24 1ebe4: 80 91 d2 03 lds r24, 0x03D2 ; 0x8003d2 <_Kd> 1ebe8: 8f 93 push r24 1ebea: 80 91 d9 03 lds r24, 0x03D9 ; 0x8003d9 <_Ki+0x3> 1ebee: 8f 93 push r24 1ebf0: 80 91 d8 03 lds r24, 0x03D8 ; 0x8003d8 <_Ki+0x2> 1ebf4: 8f 93 push r24 1ebf6: 80 91 d7 03 lds r24, 0x03D7 ; 0x8003d7 <_Ki+0x1> 1ebfa: 8f 93 push r24 1ebfc: 80 91 d6 03 lds r24, 0x03D6 ; 0x8003d6 <_Ki> 1ec00: 8f 93 push r24 1ec02: 0f 93 push r16 1ec04: 1f 93 push r17 1ec06: 9b 81 ldd r25, Y+3 ; 0x03 1ec08: 9f 93 push r25 1ec0a: 29 81 ldd r18, Y+1 ; 0x01 1ec0c: 2f 93 push r18 1ec0e: 8b ed ldi r24, 0xDB ; 219 1ec10: 95 e8 ldi r25, 0x85 ; 133 1ec12: 9f 93 push r25 1ec14: 8f 93 push r24 1ec16: 0e 94 28 8e call 0x11c50 ; 0x11c50 enquecommand_P(MSG_M500); 1ec1a: 61 e0 ldi r22, 0x01 ; 1 1ec1c: 87 e7 ldi r24, 0x77 ; 119 1ec1e: 99 e6 ldi r25, 0x69 ; 105 1ec20: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 1ec24: 0f b6 in r0, 0x3f ; 63 1ec26: f8 94 cli 1ec28: de bf out 0x3e, r29 ; 62 1ec2a: 0f be out 0x3f, r0 ; 63 1ec2c: cd bf out 0x3d, r28 ; 61 } else { SERIAL_ECHOPGM("Invalid PID cal. results. Not stored to EEPROM."); } display_time.start(); 1ec2e: 8f ec ldi r24, 0xCF ; 207 1ec30: 93 e0 ldi r25, 0x03 ; 3 1ec32: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> lcd_commands_step = 1; 1ec36: 81 e0 ldi r24, 0x01 ; 1 1ec38: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 } if ((lcd_commands_step == 1) && display_time.expired(2000)) { //calibration finished message 1ec3c: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1ec40: 81 30 cpi r24, 0x01 ; 1 1ec42: d9 f4 brne .+54 ; 0x1ec7a 1ec44: 60 ed ldi r22, 0xD0 ; 208 1ec46: 77 e0 ldi r23, 0x07 ; 7 1ec48: 8f ec ldi r24, 0xCF ; 207 1ec4a: 93 e0 ldi r25, 0x03 ; 3 1ec4c: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 1ec50: 88 23 and r24, r24 1ec52: 99 f0 breq .+38 ; 0x1ec7a lcd_setstatuspgm(MSG_WELCOME); 1ec54: 8a e8 ldi r24, 0x8A ; 138 1ec56: 9c e6 ldi r25, 0x6C ; 108 1ec58: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 custom_message_type = CustomMsg::Status; 1ec5c: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d pid_temp = DEFAULT_PID_TEMP; 1ec60: 82 ed ldi r24, 0xD2 ; 210 1ec62: 90 e0 ldi r25, 0x00 ; 0 1ec64: 90 93 4f 02 sts 0x024F, r25 ; 0x80024f 1ec68: 80 93 4e 02 sts 0x024E, r24 ; 0x80024e lcd_commands_step = 0; 1ec6c: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_commands_type = LcdCommands::Idle; 1ec70: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1ec74: 82 e0 ldi r24, 0x02 ; 2 1ec76: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.384> break; } } #endif //THERMAL_MODEL if (lcd_commands_type == LcdCommands::NozzleCNG) 1ec7a: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1ec7e: 85 30 cpi r24, 0x05 ; 5 1ec80: e9 f4 brne .+58 ; 0x1ecbc 1ec82: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1ec86: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f { if (!blocks_queued() && cmd_buffer_empty() && !saved_printing) 1ec8a: 98 13 cpse r25, r24 1ec8c: 17 c0 rjmp .+46 ; 0x1ecbc 1ec8e: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 1ec92: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 1ec96: 89 2b or r24, r25 1ec98: 89 f4 brne .+34 ; 0x1ecbc 1ec9a: 80 91 73 12 lds r24, 0x1273 ; 0x801273 1ec9e: 81 11 cpse r24, r1 1eca0: 0d c0 rjmp .+26 ; 0x1ecbc #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) 1eca2: 80 91 e2 03 lds r24, 0x03E2 ; 0x8003e2 1eca6: 81 30 cpi r24, 0x01 ; 1 1eca8: 09 f4 brne .+2 ; 0x1ecac 1ecaa: f8 c1 rjmp .+1008 ; 0x1f09c 1ecac: 08 f4 brcc .+2 ; 0x1ecb0 1ecae: c6 c1 rjmp .+908 ; 0x1f03c 1ecb0: 82 30 cpi r24, 0x02 ; 2 1ecb2: 09 f4 brne .+2 ; 0x1ecb6 1ecb4: de c1 rjmp .+956 ; 0x1f072 1ecb6: 83 30 cpi r24, 0x03 ; 3 1ecb8: 09 f4 brne .+2 ; 0x1ecbc 1ecba: c4 c1 rjmp .+904 ; 0x1f044 menu_depth = 3; break; } } } } 1ecbc: 0f 90 pop r0 1ecbe: 0f 90 pop r0 1ecc0: 0f 90 pop r0 1ecc2: 0f 90 pop r0 1ecc4: 0f 90 pop r0 1ecc6: df 91 pop r29 1ecc8: cf 91 pop r28 1ecca: 1f 91 pop r17 1eccc: 0f 91 pop r16 1ecce: ff 90 pop r15 1ecd0: ef 90 pop r14 1ecd2: df 90 pop r13 1ecd4: cf 90 pop r12 1ecd6: bf 90 pop r11 1ecd8: af 90 pop r10 1ecda: 9f 90 pop r9 1ecdc: 8f 90 pop r8 1ecde: 7f 90 pop r7 1ece0: 6f 90 pop r6 1ece2: 5f 90 pop r5 1ece4: 4f 90 pop r4 1ece6: 3f 90 pop r3 1ece8: 2f 90 pop r2 1ecea: 08 95 ret break; case 11: extraPurgeNeeded = lay1cal_load_filament(lay1cal_filament); break; case 10: lcd_clear(); 1ecec: 0e 94 77 70 call 0xe0ee ; 0xe0ee menu_depth = 0; 1ecf0: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df menu_submenu(lcd_babystep_z, true); 1ecf4: 61 e0 ldi r22, 0x01 ; 1 1ecf6: 80 e5 ldi r24, 0x50 ; 80 1ecf8: 95 ed ldi r25, 0xD5 ; 213 1ecfa: 0e 94 2e 63 call 0xc65c ; 0xc65c cmd_intro_mmu_10, cmd_intro_mmu_11, cmd_intro_mmu_12, }; if (MMU2::mmu2.Enabled()) 1ecfe: 80 91 01 13 lds r24, 0x1301 ; 0x801301 1ed02: 81 30 cpi r24, 0x01 ; 1 1ed04: f1 f4 brne .+60 ; 0x1ed42 { for (uint8_t i = (extraPurgeNeeded ? 0 : 2); i < (sizeof(intro_mmu_cmd)/sizeof(intro_mmu_cmd[0])); ++i) 1ed06: 80 91 e0 03 lds r24, 0x03E0 ; 0x8003e0 1ed0a: 10 e0 ldi r17, 0x00 ; 0 1ed0c: 81 11 cpse r24, r1 1ed0e: 01 c0 rjmp .+2 ; 0x1ed12 1ed10: 12 e0 ldi r17, 0x02 ; 2 1ed12: 21 2f mov r18, r17 1ed14: 30 e0 ldi r19, 0x00 ; 0 1ed16: 22 0f add r18, r18 1ed18: 33 1f adc r19, r19 1ed1a: 26 5b subi r18, 0xB6 ; 182 1ed1c: 3a 47 sbci r19, 0x7A ; 122 1ed1e: 3a 83 std Y+2, r19 ; 0x02 1ed20: 29 83 std Y+1, r18 ; 0x01 { enquecommand_P(static_cast(pgm_read_ptr(&intro_mmu_cmd[i]))); 1ed22: e9 81 ldd r30, Y+1 ; 0x01 1ed24: fa 81 ldd r31, Y+2 ; 0x02 1ed26: 85 91 lpm r24, Z+ 1ed28: 94 91 lpm r25, Z 1ed2a: 61 e0 ldi r22, 0x01 ; 1 1ed2c: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 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) 1ed30: 1f 5f subi r17, 0xFF ; 255 1ed32: 89 81 ldd r24, Y+1 ; 0x01 1ed34: 9a 81 ldd r25, Y+2 ; 0x02 1ed36: 02 96 adiw r24, 0x02 ; 2 1ed38: 9a 83 std Y+2, r25 ; 0x02 1ed3a: 89 83 std Y+1, r24 ; 0x01 1ed3c: 1a 30 cpi r17, 0x0A ; 10 1ed3e: 89 f7 brne .-30 ; 0x1ed22 1ed40: c3 ce rjmp .-634 ; 0x1eac8 } } 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)); 1ed42: 20 e0 ldi r18, 0x00 ; 0 1ed44: 30 e0 ldi r19, 0x00 ; 0 1ed46: 40 e8 ldi r20, 0x80 ; 128 1ed48: 50 e4 ldi r21, 0x40 ; 64 1ed4a: c7 01 movw r24, r14 1ed4c: b6 01 movw r22, r12 1ed4e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1ed52: 20 e0 ldi r18, 0x00 ; 0 1ed54: 30 e0 ldi r19, 0x00 ; 0 1ed56: 40 e7 ldi r20, 0x70 ; 112 1ed58: 52 e4 ldi r21, 0x42 ; 66 1ed5a: 0f 94 dc 78 call 0x2f1b8 ; 0x2f1b8 1ed5e: 9f 93 push r25 1ed60: 8f 93 push r24 1ed62: 7f 93 push r23 1ed64: 6f 93 push r22 1ed66: 1f 92 push r1 1ed68: 8c e3 ldi r24, 0x3C ; 60 1ed6a: 8f 93 push r24 1ed6c: 26 e3 ldi r18, 0x36 ; 54 1ed6e: 35 e8 ldi r19, 0x85 ; 133 1ed70: 3f 93 push r19 1ed72: 2f 93 push r18 1ed74: 0e 94 28 8e call 0x11c50 ; 0x11c50 enquecommandf_P(fmt1, 100, count_e(layer_height, extrusion_width * 8.f, 40)); 1ed78: 20 e0 ldi r18, 0x00 ; 0 1ed7a: 30 e0 ldi r19, 0x00 ; 0 1ed7c: 40 e0 ldi r20, 0x00 ; 0 1ed7e: 51 e4 ldi r21, 0x41 ; 65 1ed80: c7 01 movw r24, r14 1ed82: b6 01 movw r22, r12 1ed84: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1ed88: 20 e0 ldi r18, 0x00 ; 0 1ed8a: 30 e0 ldi r19, 0x00 ; 0 1ed8c: 40 e2 ldi r20, 0x20 ; 32 1ed8e: 52 e4 ldi r21, 0x42 ; 66 1ed90: 0f 94 dc 78 call 0x2f1b8 ; 0x2f1b8 1ed94: 9f 93 push r25 1ed96: 8f 93 push r24 1ed98: 7f 93 push r23 1ed9a: 6f 93 push r22 1ed9c: 1f 92 push r1 1ed9e: 84 e6 ldi r24, 0x64 ; 100 1eda0: 8f 93 push r24 1eda2: 26 e3 ldi r18, 0x36 ; 54 1eda4: 35 e8 ldi r19, 0x85 ; 133 1eda6: 3f 93 push r19 1eda8: 2f 93 push r18 1edaa: 0e 94 28 8e call 0x11c50 ; 0x11c50 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)); 1edae: 0f b6 in r0, 0x3f ; 63 1edb0: f8 94 cli 1edb2: de bf out 0x3e, r29 ; 62 1edb4: 0f be out 0x3f, r0 ; 63 1edb6: cd bf out 0x3d, r28 ; 61 1edb8: 87 ce rjmp .-754 ; 0x1eac8 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]))); 1edba: 67 e0 ldi r22, 0x07 ; 7 1edbc: 88 e2 ldi r24, 0x28 ; 40 1edbe: 95 e8 ldi r25, 0x85 ; 133 1edc0: 4c ce rjmp .-872 ; 0x1ea5a } //! @brief Print meander start void lay1cal_meander_start(float layer_height, float extrusion_width) { enquecommand_P(PSTR("G1 X50 Y155")); 1edc2: 61 e0 ldi r22, 0x01 ; 1 1edc4: 8c e1 ldi r24, 0x1C ; 28 1edc6: 95 e8 ldi r25, 0x85 ; 133 1edc8: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 static const char fmt1[] PROGMEM = "G1 Z%-.3f F7200"; enquecommandf_P(fmt1, layer_height); 1edcc: 8e e3 ldi r24, 0x3E ; 62 1edce: 8f 93 push r24 1edd0: 8c e4 ldi r24, 0x4C ; 76 1edd2: 8f 93 push r24 1edd4: 8c ec ldi r24, 0xCC ; 204 1edd6: 8f 93 push r24 1edd8: 8d ec ldi r24, 0xCD ; 205 1edda: 8f 93 push r24 1eddc: 8c e0 ldi r24, 0x0C ; 12 1edde: 95 e8 ldi r25, 0x85 ; 133 1ede0: 9f 93 push r25 1ede2: 8f 93 push r24 1ede4: 0e 94 28 8e call 0x11c50 ; 0x11c50 enquecommand_P(PSTR("G1 F1080")); 1ede8: 61 e0 ldi r22, 0x01 ; 1 1edea: 83 e0 ldi r24, 0x03 ; 3 1edec: 95 e8 ldi r25, 0x85 ; 133 1edee: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 enquecommandf_P(extrude_fmt, 75, 155, count_e(layer_height, extrusion_width * 4.f, 25)); 1edf2: 20 e0 ldi r18, 0x00 ; 0 1edf4: 30 e0 ldi r19, 0x00 ; 0 1edf6: 40 e8 ldi r20, 0x80 ; 128 1edf8: 50 e4 ldi r21, 0x40 ; 64 1edfa: c7 01 movw r24, r14 1edfc: b6 01 movw r22, r12 1edfe: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1ee02: 20 e0 ldi r18, 0x00 ; 0 1ee04: 30 e0 ldi r19, 0x00 ; 0 1ee06: 48 ec ldi r20, 0xC8 ; 200 1ee08: 51 e4 ldi r21, 0x41 ; 65 1ee0a: 0f 94 dc 78 call 0x2f1b8 ; 0x2f1b8 1ee0e: 9f 93 push r25 1ee10: 8f 93 push r24 1ee12: 7f 93 push r23 1ee14: 6f 93 push r22 1ee16: 1f 92 push r1 1ee18: 1b e9 ldi r17, 0x9B ; 155 1ee1a: 1f 93 push r17 1ee1c: 1f 92 push r1 1ee1e: 8b e4 ldi r24, 0x4B ; 75 1ee20: 8f 93 push r24 1ee22: 81 ef ldi r24, 0xF1 ; 241 1ee24: 94 e8 ldi r25, 0x84 ; 132 1ee26: 9f 93 push r25 1ee28: 8f 93 push r24 1ee2a: 0e 94 28 8e call 0x11c50 ; 0x11c50 enquecommandf_P(extrude_fmt, 100, 155, count_e(layer_height, extrusion_width * 2.f, 25)); 1ee2e: a7 01 movw r20, r14 1ee30: 96 01 movw r18, r12 1ee32: c7 01 movw r24, r14 1ee34: b6 01 movw r22, r12 1ee36: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1ee3a: 20 e0 ldi r18, 0x00 ; 0 1ee3c: 30 e0 ldi r19, 0x00 ; 0 1ee3e: 48 ec ldi r20, 0xC8 ; 200 1ee40: 51 e4 ldi r21, 0x41 ; 65 1ee42: 0f 94 dc 78 call 0x2f1b8 ; 0x2f1b8 1ee46: 9f 93 push r25 1ee48: 8f 93 push r24 1ee4a: 7f 93 push r23 1ee4c: 6f 93 push r22 1ee4e: 1f 92 push r1 1ee50: 1f 93 push r17 1ee52: 1f 92 push r1 1ee54: 84 e6 ldi r24, 0x64 ; 100 1ee56: 8f 93 push r24 1ee58: 81 ef ldi r24, 0xF1 ; 241 1ee5a: 94 e8 ldi r25, 0x84 ; 132 1ee5c: 9f 93 push r25 1ee5e: 8f 93 push r24 1ee60: 0e 94 28 8e call 0x11c50 ; 0x11c50 enquecommandf_P(extrude_fmt, 200, 155, count_e(layer_height, extrusion_width, 100)); 1ee64: 20 e0 ldi r18, 0x00 ; 0 1ee66: 30 e0 ldi r19, 0x00 ; 0 1ee68: 48 ec ldi r20, 0xC8 ; 200 1ee6a: 52 e4 ldi r21, 0x42 ; 66 1ee6c: c7 01 movw r24, r14 1ee6e: b6 01 movw r22, r12 1ee70: 0f 94 dc 78 call 0x2f1b8 ; 0x2f1b8 1ee74: 9f 93 push r25 1ee76: 8f 93 push r24 1ee78: 7f 93 push r23 1ee7a: 6f 93 push r22 1ee7c: 1f 92 push r1 1ee7e: 1f 93 push r17 1ee80: 1f 92 push r1 1ee82: 18 ec ldi r17, 0xC8 ; 200 1ee84: 1f 93 push r17 1ee86: 81 ef ldi r24, 0xF1 ; 241 1ee88: 94 e8 ldi r25, 0x84 ; 132 1ee8a: 9f 93 push r25 1ee8c: 8f 93 push r24 1ee8e: 0e 94 28 8e call 0x11c50 ; 0x11c50 enquecommandf_P(extrude_fmt, 200, 135, count_e(layer_height, extrusion_width, 20)); 1ee92: 0f b6 in r0, 0x3f ; 63 1ee94: f8 94 cli 1ee96: de bf out 0x3e, r29 ; 62 1ee98: 0f be out 0x3f, r0 ; 63 1ee9a: cd bf out 0x3d, r28 ; 61 1ee9c: 20 e0 ldi r18, 0x00 ; 0 1ee9e: 30 e0 ldi r19, 0x00 ; 0 1eea0: 40 ea ldi r20, 0xA0 ; 160 1eea2: 51 e4 ldi r21, 0x41 ; 65 1eea4: c7 01 movw r24, r14 1eea6: b6 01 movw r22, r12 1eea8: 0f 94 dc 78 call 0x2f1b8 ; 0x2f1b8 1eeac: 9f 93 push r25 1eeae: 8f 93 push r24 1eeb0: 7f 93 push r23 1eeb2: 6f 93 push r22 1eeb4: 1f 92 push r1 1eeb6: 87 e8 ldi r24, 0x87 ; 135 1eeb8: 8f 93 push r24 1eeba: 1f 92 push r1 1eebc: 1f 93 push r17 1eebe: 21 ef ldi r18, 0xF1 ; 241 1eec0: 34 e8 ldi r19, 0x84 ; 132 1eec2: 3f 93 push r19 1eec4: 2f 93 push r18 1eec6: 0e 94 28 8e call 0x11c50 ; 0x11c50 1eeca: 71 cf rjmp .-286 ; 0x1edae //! @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); 1eecc: 20 e0 ldi r18, 0x00 ; 0 1eece: 30 e0 ldi r19, 0x00 ; 0 1eed0: 46 e1 ldi r20, 0x16 ; 22 1eed2: 53 e4 ldi r21, 0x43 ; 67 1eed4: c7 01 movw r24, r14 1eed6: b6 01 movw r22, r12 1eed8: 0f 94 dc 78 call 0x2f1b8 ; 0x2f1b8 1eedc: 56 2e mov r5, r22 1eede: 47 2e mov r4, r23 1eee0: 38 2e mov r3, r24 1eee2: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 1eee4: 20 e0 ldi r18, 0x00 ; 0 1eee6: 30 e0 ldi r19, 0x00 ; 0 1eee8: 40 ea ldi r20, 0xA0 ; 160 1eeea: 51 e4 ldi r21, 0x41 ; 65 1eeec: c7 01 movw r24, r14 1eeee: b6 01 movw r22, r12 1eef0: 0f 94 dc 78 call 0x2f1b8 ; 0x2f1b8 1eef4: 6b 83 std Y+3, r22 ; 0x03 1eef6: c7 2e mov r12, r23 1eef8: 78 2e mov r7, r24 1eefa: 69 2e mov r6, r25 1eefc: 85 e0 ldi r24, 0x05 ; 5 1eefe: 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; 1ef00: 81 2c mov r8, r1 1ef02: 91 2c mov r9, r1 1ef04: 96 e1 ldi r25, 0x16 ; 22 1ef06: a9 2e mov r10, r25 1ef08: 93 e4 ldi r25, 0x43 ; 67 1ef0a: 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; 1ef0c: 32 e3 ldi r19, 0x32 ; 50 1ef0e: 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; 1ef10: 87 e8 ldi r24, 0x87 ; 135 1ef12: 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); 1ef14: 01 ef ldi r16, 0xF1 ; 241 1ef16: 14 e8 ldi r17, 0x84 ; 132 1ef18: 9d 81 ldd r25, Y+5 ; 0x05 1ef1a: e9 2e mov r14, r25 1ef1c: f1 2c mov r15, r1 1ef1e: 3c 81 ldd r19, Y+4 ; 0x04 1ef20: 23 2f mov r18, r19 1ef22: 30 e0 ldi r19, 0x00 ; 0 1ef24: 3a 83 std Y+2, r19 ; 0x02 1ef26: 29 83 std Y+1, r18 ; 0x01 1ef28: 2f 92 push r2 1ef2a: 3f 92 push r3 1ef2c: 4f 92 push r4 1ef2e: 5f 92 push r5 1ef30: 1f 92 push r1 1ef32: 9f 93 push r25 1ef34: 1f 92 push r1 1ef36: 8c 81 ldd r24, Y+4 ; 0x04 1ef38: 8f 93 push r24 1ef3a: 1f 93 push r17 1ef3c: 0f 93 push r16 1ef3e: 0e 94 28 8e call 0x11c50 ; 0x11c50 y_pos -= short_length; 1ef42: b7 01 movw r22, r14 1ef44: ff 0c add r15, r15 1ef46: 88 0b sbc r24, r24 1ef48: 99 0b sbc r25, r25 1ef4a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1ef4e: 20 e0 ldi r18, 0x00 ; 0 1ef50: 30 e0 ldi r19, 0x00 ; 0 1ef52: 40 ea ldi r20, 0xA0 ; 160 1ef54: 51 e4 ldi r21, 0x41 ; 65 1ef56: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1ef5a: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 1ef5e: 6d 83 std Y+5, r22 ; 0x05 enquecommandf_P(extrude_fmt, x_pos, y_pos, short_extrusion); 1ef60: 6f 92 push r6 1ef62: 7f 92 push r7 1ef64: cf 92 push r12 1ef66: 9b 81 ldd r25, Y+3 ; 0x03 1ef68: 9f 93 push r25 1ef6a: 1f 92 push r1 1ef6c: 2d 81 ldd r18, Y+5 ; 0x05 1ef6e: 2f 93 push r18 1ef70: 1f 92 push r1 1ef72: 3c 81 ldd r19, Y+4 ; 0x04 1ef74: 3f 93 push r19 1ef76: 1f 93 push r17 1ef78: 0f 93 push r16 1ef7a: 0e 94 28 8e call 0x11c50 ; 0x11c50 x_pos += long_length; 1ef7e: 29 81 ldd r18, Y+1 ; 0x01 1ef80: 3a 81 ldd r19, Y+2 ; 0x02 1ef82: b9 01 movw r22, r18 1ef84: 33 0f add r19, r19 1ef86: 88 0b sbc r24, r24 1ef88: 99 0b sbc r25, r25 1ef8a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1ef8e: a5 01 movw r20, r10 1ef90: 94 01 movw r18, r8 1ef92: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1ef96: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 1ef9a: 6c 83 std Y+4, r22 ; 0x04 long_length = -long_length; 1ef9c: b7 fa bst r11, 7 1ef9e: b0 94 com r11 1efa0: b7 f8 bld r11, 7 1efa2: b0 94 com r11 1efa4: 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) 1efa6: 0f b6 in r0, 0x3f ; 63 1efa8: f8 94 cli 1efaa: de bf out 0x3e, r29 ; 62 1efac: 0f be out 0x3f, r0 ; 63 1efae: cd bf out 0x3d, r28 ; 61 1efb0: d1 10 cpse r13, r1 1efb2: b2 cf rjmp .-156 ; 0x1ef18 1efb4: 89 cd rjmp .-1262 ; 0x1eac8 break; case 7: lay1cal_meander(layer_height, extrusion_width); break; case 6: lay1cal_square(0, layer_height, extrusion_width); 1efb6: b7 01 movw r22, r14 1efb8: a6 01 movw r20, r12 1efba: 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); 1efbc: 0f 94 03 79 call 0x2f206 ; 0x2f206 1efc0: 83 cd rjmp .-1274 ; 0x1eac8 break; case 6: lay1cal_square(0, layer_height, extrusion_width); break; case 5: lay1cal_square(4, layer_height, extrusion_width); 1efc2: b7 01 movw r22, r14 1efc4: a6 01 movw r20, r12 1efc6: 84 e0 ldi r24, 0x04 ; 4 1efc8: f9 cf rjmp .-14 ; 0x1efbc break; case 4: lay1cal_square(8, layer_height, extrusion_width); 1efca: b7 01 movw r22, r14 1efcc: a6 01 movw r20, r12 1efce: 88 e0 ldi r24, 0x08 ; 8 1efd0: f5 cf rjmp .-22 ; 0x1efbc break; case 3: lay1cal_square(12, layer_height, extrusion_width); 1efd2: b7 01 movw r22, r14 1efd4: a6 01 movw r20, r12 1efd6: 8c e0 ldi r24, 0x0C ; 12 1efd8: f1 cf rjmp .-30 ; 0x1efbc 1efda: 90 91 01 13 lds r25, 0x1301 ; 0x801301 1efde: 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]))); 1efe0: 66 e0 ldi r22, 0x06 ; 6 1efe2: 85 ee ldi r24, 0xE5 ; 229 1efe4: 94 e8 ldi r25, 0x84 ; 132 1efe6: 0e 94 11 8e call 0x11c22 ; 0x11c22 if (mmu_enabled) enquecommand_P(MSG_M702); //unload from nozzle 1efea: 29 81 ldd r18, Y+1 ; 0x01 1efec: 21 30 cpi r18, 0x01 ; 1 1efee: 29 f4 brne .+10 ; 0x1effa 1eff0: 61 e0 ldi r22, 0x01 ; 1 1eff2: 8c e6 ldi r24, 0x6C ; 108 1eff4: 99 e6 ldi r25, 0x69 ; 105 1eff6: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 enquecommand_P(MSG_M84);// disable motors 1effa: 61 e0 ldi r22, 0x01 ; 1 1effc: 88 e6 ldi r24, 0x68 ; 104 1effe: 99 e6 ldi r25, 0x69 ; 105 1f000: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 1f004: 61 cd rjmp .-1342 ; 0x1eac8 break; case 2: lay1cal_finish(MMU2::mmu2.Enabled()); break; case 1: lcd_setstatuspgm(MSG_WELCOME); 1f006: 8a e8 ldi r24, 0x8A ; 138 1f008: 9c e6 ldi r25, 0x6C ; 108 1f00a: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 lcd_commands_step = 0; 1f00e: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_commands_type = LcdCommands::Idle; 1f012: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1f016: 82 e0 ldi r24, 0x02 ; 2 1f018: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.384> SetPrinterState(PrinterState::Idle); if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 1f01c: 8f e5 ldi r24, 0x5F ; 95 1f01e: 9f e0 ldi r25, 0x0F ; 15 1f020: 0f 94 81 a4 call 0x34902 ; 0x34902 1f024: 88 23 and r24, r24 1f026: 09 f4 brne .+2 ; 0x1f02a 1f028: 28 ce rjmp .-944 ; 0x1ec7a lcd_wizard(WizState::RepeatLay1Cal); 1f02a: 8b e0 ldi r24, 0x0B ; 11 1f02c: 0e 94 84 e9 call 0x1d308 ; 0x1d308 1f030: 4b cd rjmp .-1386 ; 0x1eac8 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."); 1f032: 8b ea ldi r24, 0xAB ; 171 1f034: 95 e8 ldi r25, 0x85 ; 133 1f036: 0e 94 15 7b call 0xf62a ; 0xf62a 1f03a: f9 cd rjmp .-1038 ; 0x1ec2e #endif //THERMAL_MODEL #endif //QUICK_NOZZLE_CHANGE switch(lcd_commands_step) { case 0: lcd_commands_step = 3; 1f03c: 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; 1f03e: 80 93 e2 03 sts 0x03E2, r24 ; 0x8003e2 1f042: 3c ce rjmp .-904 ; 0x1ecbc 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)); 1f044: 83 e8 ldi r24, 0x83 ; 131 1f046: 9b e4 ldi r25, 0x4B ; 75 1f048: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1f04c: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa enquecommand_P(G28W); 1f050: 61 e0 ldi r22, 0x01 ; 1 1f052: 81 e7 ldi r24, 0x71 ; 113 1f054: 99 e6 ldi r25, 0x69 ; 105 1f056: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 enquecommand_P(PSTR("G1 X125 Z200 F1000")); 1f05a: 61 e0 ldi r22, 0x01 ; 1 1f05c: 88 e9 ldi r24, 0x98 ; 152 1f05e: 95 e8 ldi r25, 0x85 ; 133 1f060: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 enquecommand_P(PSTR("M109 S280")); 1f064: 61 e0 ldi r22, 0x01 ; 1 1f066: 8e e8 ldi r24, 0x8E ; 142 1f068: 95 e8 ldi r25, 0x85 ; 133 1f06a: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 } } enquecommand_P(G28W); //home enquecommand_P(PSTR("G1 X125 Z200 F1000")); //move to top center #endif //QUICK_NOZZLE_CHANGE lcd_commands_step = 2; 1f06e: 82 e0 ldi r24, 0x02 ; 2 1f070: e6 cf rjmp .-52 ; 0x1f03e break; case 2: enquecommand_P(PSTR("M84 XY")); 1f072: 61 e0 ldi r22, 0x01 ; 1 1f074: 87 e8 ldi r24, 0x87 ; 135 1f076: 95 e8 ldi r25, 0x85 ; 133 1f078: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 if (lcd_show_multiscreen_message_yes_no_and_wait_P(_T(MSG_NOZZLE_CNG_CHANGED), false) == LCD_LEFT_BUTTON_CHOICE) { 1f07c: 8a e4 ldi r24, 0x4A ; 74 1f07e: 9b e4 ldi r25, 0x4B ; 75 1f080: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1f084: 41 e0 ldi r20, 0x01 ; 1 1f086: 60 e0 ldi r22, 0x00 ; 0 1f088: 0e 94 5f e3 call 0x1c6be ; 0x1c6be 1f08c: 81 11 cpse r24, r1 1f08e: 16 ce rjmp .-980 ; 0x1ecbc 1f090: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 1f094: 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; 1f098: 81 e0 ldi r24, 0x01 ; 1 1f09a: d1 cf rjmp .-94 ; 0x1f03e } break; case 1: lcd_commands_step = 0; 1f09c: 10 92 e2 03 sts 0x03E2, r1 ; 0x8003e2 lcd_commands_type = LcdCommands::Idle; 1f0a0: 10 92 5e 0d sts 0x0D5E, r1 ; 0x800d5e 1f0a4: 82 e0 ldi r24, 0x02 ; 2 1f0a6: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.384> SetPrinterState(PrinterState::Idle); menu_goto(lcd_hw_setup_menu, 2, true); 1f0aa: 20 e0 ldi r18, 0x00 ; 0 1f0ac: 41 e0 ldi r20, 0x01 ; 1 1f0ae: 62 e0 ldi r22, 0x02 ; 2 1f0b0: 70 e0 ldi r23, 0x00 ; 0 1f0b2: 84 e4 ldi r24, 0x44 ; 68 1f0b4: 9f eb ldi r25, 0xBF ; 191 1f0b6: 0e 94 08 63 call 0xc610 ; 0xc610 menu_depth = 3; 1f0ba: 83 e0 ldi r24, 0x03 ; 3 1f0bc: 80 93 df 03 sts 0x03DF, r24 ; 0x8003df 1f0c0: fd cd rjmp .-1030 ; 0x1ecbc 0001f0c2 : && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); } void menu_lcd_lcdupdate_func(void) { 1f0c2: 0f 93 push r16 1f0c4: 1f 93 push r17 #if (SDCARDDETECT > 0) if ((IS_SD_INSERTED != lcd_oldcardstatus)) 1f0c6: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f0ca: 80 95 com r24 1f0cc: 81 70 andi r24, 0x01 ; 1 1f0ce: 90 91 01 04 lds r25, 0x0401 ; 0x800401 1f0d2: 89 17 cp r24, r25 1f0d4: 89 f1 breq .+98 ; 0x1f138 { if(menu_menu == lcd_sdcard_menu) { 1f0d6: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1f0da: 90 91 03 04 lds r25, 0x0403 ; 0x800403 1f0de: 8d 52 subi r24, 0x2D ; 45 1f0e0: 94 4e sbci r25, 0xE4 ; 228 1f0e2: 11 f4 brne .+4 ; 0x1f0e8 // 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(); 1f0e4: 0e 94 6c 63 call 0xc6d8 ; 0xc6d8 } lcd_draw_update = 2; 1f0e8: 82 e0 ldi r24, 0x02 ; 2 1f0ea: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_oldcardstatus = IS_SD_INSERTED; 1f0ee: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 1f0f2: 80 95 com r24 1f0f4: 81 70 andi r24, 0x01 ; 1 1f0f6: 80 93 01 04 sts 0x0401, r24 ; 0x800401 lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 1f0fa: 0e 94 f0 70 call 0xe1e0 ; 0xe1e0 backlight_wake(); if (lcd_oldcardstatus) 1f0fe: 80 91 01 04 lds r24, 0x0401 ; 0x800401 1f102: 88 23 and r24, r24 1f104: 09 f4 brne .+2 ; 0x1f108 1f106: 88 c0 rjmp .+272 ; 0x1f218 { if (!card.mounted) 1f108: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 1f10c: 81 11 cpse r24, r1 1f10e: 05 c0 rjmp .+10 ; 0x1f11a { card.mount(false); //delay the sorting to the sd menu. Otherwise, removing the SD card while sorting will not menu_back() 1f110: 0f 94 08 73 call 0x2e610 ; 0x2e610 card.presort_flag = true; //force sorting of the SD menu 1f114: 81 e0 ldi r24, 0x01 ; 1 1f116: 80 93 26 14 sts 0x1426, r24 ; 0x801426 } LCD_MESSAGERPGM(MSG_WELCOME); 1f11a: 8a e8 ldi r24, 0x8A ; 138 1f11c: 9c e6 ldi r25, 0x6C ; 108 1f11e: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 bMain=false; // flag (i.e. 'fake parameter') for 'lcd_sdcard_menu()' function 1f122: 10 92 c9 03 sts 0x03C9, r1 ; 0x8003c9 menu_submenu(lcd_sdcard_menu, true); 1f126: 61 e0 ldi r22, 0x01 ; 1 1f128: 8d e2 ldi r24, 0x2D ; 45 1f12a: 94 ee ldi r25, 0xE4 ; 228 1f12c: 0e 94 2e 63 call 0xc65c ; 0xc65c lcd_timeoutToStatus.start(); 1f130: 83 ee ldi r24, 0xE3 ; 227 1f132: 93 e0 ldi r25, 0x03 ; 3 1f134: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); } } #endif//CARDINSERTED if (lcd_next_update_millis < _millis()) 1f138: 0f 94 89 0b call 0x21712 ; 0x21712 1f13c: 00 91 c5 03 lds r16, 0x03C5 ; 0x8003c5 1f140: 10 91 c6 03 lds r17, 0x03C6 ; 0x8003c6 1f144: 20 91 c7 03 lds r18, 0x03C7 ; 0x8003c7 1f148: 30 91 c8 03 lds r19, 0x03C8 ; 0x8003c8 1f14c: 06 17 cp r16, r22 1f14e: 17 07 cpc r17, r23 1f150: 28 07 cpc r18, r24 1f152: 39 07 cpc r19, r25 1f154: e8 f5 brcc .+122 ; 0x1f1d0 { if (lcd_draw_update) { 1f156: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1f15a: 88 23 and r24, r24 1f15c: 31 f0 breq .+12 ; 0x1f16a lcd_timeoutToStatus.start(); 1f15e: 83 ee ldi r24, 0xE3 ; 227 1f160: 93 e0 ldi r25, 0x03 ; 3 1f162: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> lcd_frame_start(); 1f166: 0e 94 37 6f call 0xde6e ; 0xde6e } (*menu_menu)(); 1f16a: e0 91 02 04 lds r30, 0x0402 ; 0x800402 1f16e: f0 91 03 04 lds r31, 0x0403 ; 0x800403 1f172: 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)))); 1f174: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1f178: 90 91 03 04 lds r25, 0x0403 ; 0x800403 1f17c: 80 55 subi r24, 0x50 ; 80 1f17e: 95 4d sbci r25, 0xD5 ; 213 1f180: 09 f4 brne .+2 ; 0x1f184 1f182: 5d c0 rjmp .+186 ; 0x1f23e } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen 1f184: 80 91 02 04 lds r24, 0x0402 ; 0x800402 1f188: 90 91 03 04 lds r25, 0x0403 ; 0x800403 && menu_menu != lcd_babystep_z && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1f18c: 27 e3 ldi r18, 0x37 ; 55 1f18e: 82 34 cpi r24, 0x42 ; 66 1f190: 92 07 cpc r25, r18 1f192: 09 f0 breq .+2 ; 0x1f196 1f194: 75 c0 rjmp .+234 ; 0x1f280 } lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); 1f196: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1f19a: 82 30 cpi r24, 0x02 ; 2 1f19c: 21 f4 brne .+8 ; 0x1f1a6 #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 1f19e: 0e 94 f0 70 call 0xe1e0 ; 0xe1e0 lcd_status_message_idx = 0; // Re-draw message from beginning 1f1a2: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.417> lcd_clear(); lcd_return_to_status(); lcd_draw_update = 2; } if (lcd_draw_update == 2) lcdui_refresh(); if (lcd_draw_update) lcd_draw_update--; 1f1a6: 80 91 59 02 lds r24, 0x0259 ; 0x800259 1f1aa: 88 23 and r24, r24 1f1ac: 19 f0 breq .+6 ; 0x1f1b4 1f1ae: 81 50 subi r24, 0x01 ; 1 1f1b0: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_next_update_millis = _millis() + LCD_UPDATE_INTERVAL; 1f1b4: 0f 94 89 0b call 0x21712 ; 0x21712 1f1b8: 6c 59 subi r22, 0x9C ; 156 1f1ba: 7f 4f sbci r23, 0xFF ; 255 1f1bc: 8f 4f sbci r24, 0xFF ; 255 1f1be: 9f 4f sbci r25, 0xFF ; 255 1f1c0: 60 93 c5 03 sts 0x03C5, r22 ; 0x8003c5 1f1c4: 70 93 c6 03 sts 0x03C6, r23 ; 0x8003c6 1f1c8: 80 93 c7 03 sts 0x03C7, r24 ; 0x8003c7 1f1cc: 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))) { 1f1d0: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 1f1d4: 88 23 and r24, r24 1f1d6: 99 f0 breq .+38 ; 0x1f1fe 1f1d8: 80 91 08 04 lds r24, 0x0408 ; 0x800408 <_ZL11no_response.lto_priv.490> 1f1dc: 88 23 and r24, r24 1f1de: 79 f0 breq .+30 ; 0x1f1fe 1f1e0: 60 e1 ldi r22, 0x10 ; 16 1f1e2: 77 e2 ldi r23, 0x27 ; 39 1f1e4: 81 ec ldi r24, 0xC1 ; 193 1f1e6: 93 e0 ldi r25, 0x03 ; 3 1f1e8: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 1f1ec: 88 23 and r24, r24 1f1ee: 39 f0 breq .+14 ; 0x1f1fe //send important status messages periodicaly prusa_statistics(8); 1f1f0: 88 e0 ldi r24, 0x08 ; 8 1f1f2: 0f 94 05 30 call 0x2600a ; 0x2600a NcTime.start(); 1f1f6: 81 ec ldi r24, 0xC1 ; 193 1f1f8: 93 e0 ldi r25, 0x03 ; 3 1f1fa: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> } prusa_statistics_update_from_lcd_update(); if (lcd_commands_type == LcdCommands::Layer1Cal) lcd_commands(); 1f1fe: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1f202: 84 30 cpi r24, 0x04 ; 4 1f204: 09 f0 breq .+2 ; 0x1f208 1f206: 53 c0 rjmp .+166 ; 0x1f2ae 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) { 1f208: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1f20c: 81 11 cpse r24, r1 1f20e: 4f c0 rjmp .+158 ; 0x1f2ae 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(); } 1f210: 1f 91 pop r17 1f212: 0f 91 pop r16 1f214: 0c 94 c6 f3 jmp 0x1e78c ; 0x1e78c presort_flag = true; #endif } void CardReader::release() { sdprinting = false; 1f218: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 mounted = false; 1f21c: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 SERIAL_ECHO_START; 1f220: 84 ee ldi r24, 0xE4 ; 228 1f222: 92 ea ldi r25, 0xA2 ; 162 1f224: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED 1f228: 88 e4 ldi r24, 0x48 ; 72 1f22a: 99 e6 ldi r25, 0x69 ; 105 1f22c: 0e 94 0e 7d call 0xfa1c ; 0xfa1c lcd_timeoutToStatus.start(); } else { card.release(); LCD_MESSAGERPGM(_T(MSG_SD_REMOVED)); 1f230: 83 ef ldi r24, 0xF3 ; 243 1f232: 9a e4 ldi r25, 0x4A ; 74 1f234: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1f238: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 1f23c: 7d cf rjmp .-262 ; 0x1f138 // 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)))); 1f23e: 0e 94 a0 66 call 0xcd40 ; 0xcd40 1f242: 81 11 cpse r24, r1 1f244: 0e c0 rjmp .+28 ; 0x1f262 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) 1f246: e0 91 02 04 lds r30, 0x0402 ; 0x800402 1f24a: f0 91 03 04 lds r31, 0x0403 ; 0x800403 1f24e: 30 97 sbiw r30, 0x00 ; 0 1f250: 39 f5 brne .+78 ; 0x1f2a0 { menu_leaving = 1; (*menu_menu)(); menu_leaving = 0; } lcd_clear(); 1f252: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_return_to_status(); 1f256: 0f 94 6e 05 call 0x20adc ; 0x20adc lcd_draw_update = 2; 1f25a: 82 e0 ldi r24, 0x02 ; 2 1f25c: 80 93 59 02 sts 0x0259, r24 ; 0x800259 1f260: 9a cf rjmp .-204 ; 0x1f196 // 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)))); 1f262: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 1f266: 81 11 cpse r24, r1 1f268: 8d cf rjmp .-230 ; 0x1f184 1f26a: 40 e9 ldi r20, 0x90 ; 144 1f26c: 5f e5 ldi r21, 0x5F ; 95 1f26e: 61 e0 ldi r22, 0x01 ; 1 1f270: 70 e0 ldi r23, 0x00 ; 0 1f272: 83 ee ldi r24, 0xE3 ; 227 1f274: 93 e0 ldi r25, 0x03 ; 3 1f276: 0f 94 21 0c call 0x21842 ; 0x21842 ::expired(unsigned long)> 1f27a: 81 11 cpse r24, r1 1f27c: e4 cf rjmp .-56 ; 0x1f246 1f27e: 82 cf rjmp .-252 ; 0x1f184 } static inline bool other_menu_expired() { return (menu_menu != lcd_status_screen && menu_menu != lcd_babystep_z 1f280: 80 55 subi r24, 0x50 ; 80 1f282: 95 4d sbci r25, 0xD5 ; 213 1f284: 09 f4 brne .+2 ; 0x1f288 1f286: 87 cf rjmp .-242 ; 0x1f196 && lcd_timeoutToStatus.expired(LCD_TIMEOUT_TO_STATUS)); 1f288: 40 e3 ldi r20, 0x30 ; 48 1f28a: 55 e7 ldi r21, 0x75 ; 117 1f28c: 60 e0 ldi r22, 0x00 ; 0 1f28e: 70 e0 ldi r23, 0x00 ; 0 1f290: 83 ee ldi r24, 0xE3 ; 227 1f292: 93 e0 ldi r25, 0x03 ; 3 1f294: 0f 94 21 0c call 0x21842 ; 0x21842 ::expired(unsigned long)> 1f298: 88 23 and r24, r24 1f29a: 09 f4 brne .+2 ; 0x1f29e 1f29c: 7c cf rjmp .-264 ; 0x1f196 1f29e: d3 cf rjmp .-90 ; 0x1f246 // 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; 1f2a0: 81 e0 ldi r24, 0x01 ; 1 1f2a2: 80 93 c4 03 sts 0x03C4, r24 ; 0x8003c4 (*menu_menu)(); 1f2a6: 19 95 eicall menu_leaving = 0; 1f2a8: 10 92 c4 03 sts 0x03C4, r1 ; 0x8003c4 1f2ac: d2 cf rjmp .-92 ; 0x1f252 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(); } 1f2ae: 1f 91 pop r17 1f2b0: 0f 91 pop r16 1f2b2: 08 95 ret 0001f2b4 : menu_goto(lcd_generic_preheat_menu, 0, true); } void lcd_wizard() { bool result = true; if (calibration_status_get(CALIBRATION_WIZARD_STEPS)) { 1f2b4: 87 e1 ldi r24, 0x17 ; 23 1f2b6: 0e 94 43 d5 call 0x1aa86 ; 0x1aa86 1f2ba: 81 11 cpse r24, r1 1f2bc: 06 c0 rjmp .+12 ; 0x1f2ca // 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); 1f2be: 87 e1 ldi r24, 0x17 ; 23 1f2c0: 0e 94 e1 d4 call 0x1a9c2 ; 0x1a9c2 lcd_wizard(WizState::Run); 1f2c4: 80 e0 ldi r24, 0x00 ; 0 1f2c6: 0c 94 84 e9 jmp 0x1d308 ; 0x1d308 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); 1f2ca: 81 e3 ldi r24, 0x31 ; 49 1f2cc: 9d e3 ldi r25, 0x3D ; 61 1f2ce: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1f2d2: 41 e0 ldi r20, 0x01 ; 1 1f2d4: 60 e0 ldi r22, 0x00 ; 0 1f2d6: 0e 94 5f e3 call 0x1c6be ; 0x1c6be } if (result) { 1f2da: 88 23 and r24, r24 1f2dc: 81 f3 breq .-32 ; 0x1f2be calibration_status_clear(CALIBRATION_WIZARD_STEPS); lcd_wizard(WizState::Run); } else { lcd_return_to_status(); 1f2de: 0f 94 6e 05 call 0x20adc ; 0x20adc lcd_update_enable(true); 1f2e2: 81 e0 ldi r24, 0x01 ; 1 1f2e4: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_update(2); 1f2e8: 82 e0 ldi r24, 0x02 ; 2 1f2ea: 0c 94 4a 6f jmp 0xde94 ; 0xde94 0001f2ee : lcd_show_fullscreen_message_and_wait_P(msg); } } } void lcd_temp_cal_show_result(bool result) { 1f2ee: cf 93 push r28 1f2f0: c8 2f mov r28, r24 custom_message_type = CustomMsg::Status; 1f2f2: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d disable_x(); 1f2f6: 17 9a sbi 0x02, 7 ; 2 1f2f8: 10 92 39 06 sts 0x0639, r1 ; 0x800639 disable_y(); 1f2fc: 16 9a sbi 0x02, 6 ; 2 1f2fe: 10 92 3a 06 sts 0x063A, r1 ; 0x80063a disable_z(); disable_e0(); 1f302: 14 9a sbi 0x02, 4 ; 2 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 1f304: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 1f308: 10 92 59 12 sts 0x1259, r1 ; 0x801259 1f30c: 68 2f mov r22, r24 1f30e: 86 ea ldi r24, 0xA6 ; 166 1f310: 9f e0 ldi r25, 0x0F ; 15 1f312: 0f 94 a5 a4 call 0x3494a ; 0x3494a 1f316: 6c 2f mov r22, r28 1f318: 8f ea ldi r24, 0xAF ; 175 1f31a: 9f e0 ldi r25, 0x0F ; 15 1f31c: 0f 94 a5 a4 call 0x3494a ; 0x3494a // 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) { 1f320: cc 23 and r28, r28 1f322: 89 f0 breq .+34 ; 0x1f346 SERIAL_ECHOLNPGM("PINDA calibration done. Continue with pressing the knob."); 1f324: 8a e9 ldi r24, 0x9A ; 154 1f326: 93 e8 ldi r25, 0x83 ; 131 1f328: 0e 94 0e 7d call 0xfa1c ; 0xfa1c lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CALIBRATION_DONE)); 1f32c: 81 e4 ldi r24, 0x41 ; 65 1f32e: 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)); 1f330: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1f334: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa } lcd_update_enable(true); 1f338: 81 e0 ldi r24, 0x01 ; 1 1f33a: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_update(2); 1f33e: 82 e0 ldi r24, 0x02 ; 2 } 1f340: 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); 1f342: 0c 94 4a 6f jmp 0xde94 ; 0xde94 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."); 1f346: 8f e5 ldi r24, 0x5F ; 95 1f348: 93 e8 ldi r25, 0x83 ; 131 1f34a: 0e 94 0e 7d call 0xfa1c ; 0xfa1c lcd_show_fullscreen_message_and_wait_P(_T(MSG_PINDA_CAL_FAILED)); 1f34e: 86 e2 ldi r24, 0x26 ; 38 1f350: 9c e3 ldi r25, 0x3C ; 60 1f352: ee cf rjmp .-36 ; 0x1f330 0001f354 : // 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) { 1f354: 9f 92 push r9 1f356: af 92 push r10 1f358: bf 92 push r11 1f35a: cf 92 push r12 1f35c: df 92 push r13 1f35e: ef 92 push r14 1f360: ff 92 push r15 1f362: 0f 93 push r16 1f364: 1f 93 push r17 1f366: cf 93 push r28 1f368: df 93 push r29 1f36a: 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; 1f36c: 10 92 69 12 sts 0x1269, r1 ; 0x801269 1f370: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 1f374: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 1f378: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c plan_set_position_curposXYZE(); 1f37c: 0f 94 cd 48 call 0x2919a ; 0x2919a // Until confirmed by the confirmation dialog. for (;;) { const char *msg = only_z ? _T(MSG_MOVE_CARRIAGE_TO_THE_TOP_Z) 1f380: 85 ec ldi r24, 0xC5 ; 197 1f382: 9b e3 ldi r25, 0x3B ; 59 1f384: 91 10 cpse r9, r1 1f386: 02 c0 rjmp .+4 ; 0x1f38c 1f388: 82 e6 ldi r24, 0x62 ; 98 1f38a: 9b e3 ldi r25, 0x3B ; 59 1f38c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1f390: b8 2e mov r11, r24 1f392: a9 2e mov r10, r25 : _T(MSG_MOVE_CARRIAGE_TO_THE_TOP); const char *msg_next = lcd_display_message_fullscreen_P(msg); 1f394: 0e 94 91 de call 0x1bd22 ; 0x1bd22 1f398: 8c 01 movw r16, r24 const bool multi_screen = msg_next != NULL; unsigned long previous_millis_msg = _millis(); 1f39a: 0f 94 89 0b call 0x21712 ; 0x21712 1f39e: 6b 01 movw r12, r22 1f3a0: 7c 01 movw r14, r24 // Until the user finishes the z up movement. lcd_encoder = 0; 1f3a2: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1f3a6: 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); 1f3aa: 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(); 1f3ac: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 1f3b0: 81 e0 ldi r24, 0x01 ; 1 1f3b2: 0e 94 ad 8a call 0x1155a ; 0x1155a if (lcd_encoder) { 1f3b6: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 1f3ba: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 1f3be: 89 2b or r24, r25 1f3c0: d9 f1 breq .+118 ; 0x1f438 _delay(50); 1f3c2: 62 e3 ldi r22, 0x32 ; 50 1f3c4: 70 e0 ldi r23, 0x00 ; 0 1f3c6: 80 e0 ldi r24, 0x00 ; 0 1f3c8: 90 e0 ldi r25, 0x00 ; 0 1f3ca: 0f 94 56 0b call 0x216ac ; 0x216ac 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; 1f3ce: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e if (++ next_block_index == BLOCK_BUFFER_SIZE) 1f3d2: 8f 5f subi r24, 0xFF ; 255 1f3d4: 80 31 cpi r24, 0x10 ; 16 1f3d6: 09 f4 brne .+2 ; 0x1f3da next_block_index = 0; 1f3d8: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 1f3da: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f if (! planner_queue_full()) { 1f3de: 98 17 cp r25, r24 1f3e0: 59 f1 breq .+86 ; 0x1f438 // Only move up, whatever direction the user rotates the encoder. current_position[Z_AXIS] += abs(lcd_encoder); 1f3e2: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 1f3e6: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 1f3ea: 77 ff sbrs r23, 7 1f3ec: 03 c0 rjmp .+6 ; 0x1f3f4 1f3ee: 71 95 neg r23 1f3f0: 61 95 neg r22 1f3f2: 71 09 sbc r23, r1 1f3f4: 07 2e mov r0, r23 1f3f6: 00 0c add r0, r0 1f3f8: 88 0b sbc r24, r24 1f3fa: 99 0b sbc r25, r25 1f3fc: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1f400: 20 91 69 12 lds r18, 0x1269 ; 0x801269 1f404: 30 91 6a 12 lds r19, 0x126A ; 0x80126a 1f408: 40 91 6b 12 lds r20, 0x126B ; 0x80126b 1f40c: 50 91 6c 12 lds r21, 0x126C ; 0x80126c 1f410: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1f414: 60 93 69 12 sts 0x1269, r22 ; 0x801269 1f418: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 1f41c: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 1f420: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c lcd_encoder = 0; 1f424: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 1f428: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60); 1f42c: 65 e5 ldi r22, 0x55 ; 85 1f42e: 75 e5 ldi r23, 0x55 ; 85 1f430: 85 e8 ldi r24, 0x85 ; 133 1f432: 91 e4 ldi r25, 0x41 ; 65 1f434: 0f 94 0d 4a call 0x2941a ; 0x2941a } } if (lcd_clicked()) { 1f438: 0e 94 c6 73 call 0xe78c ; 0xe78c 1f43c: 88 23 and r24, r24 1f43e: c9 f1 breq .+114 ; 0x1f4b2 // Abort a move if in progress. planner_abort_hard(); 1f440: 0f 94 87 4c call 0x2990e ; 0x2990e planner_aborted = false; 1f444: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 while (lcd_clicked()) ; 1f448: 0e 94 c6 73 call 0xe78c ; 0xe78c 1f44c: 81 11 cpse r24, r1 1f44e: fc cf rjmp .-8 ; 0x1f448 _delay(10); 1f450: 6a e0 ldi r22, 0x0A ; 10 1f452: 70 e0 ldi r23, 0x00 ; 0 1f454: 80 e0 ldi r24, 0x00 ; 0 1f456: 90 e0 ldi r25, 0x00 ; 0 1f458: 0f 94 56 0b call 0x216ac ; 0x216ac while (lcd_clicked()) ; 1f45c: 0e 94 c6 73 call 0xe78c ; 0xe78c 1f460: 81 11 cpse r24, r1 1f462: fc cf rjmp .-8 ; 0x1f45c 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); 1f464: 89 e3 ldi r24, 0x39 ; 57 1f466: 9b e3 ldi r25, 0x3B ; 59 1f468: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1f46c: 41 e0 ldi r20, 0x01 ; 1 1f46e: 60 e0 ldi r22, 0x00 ; 0 1f470: 0e 94 5f e3 call 0x1c6be ; 0x1c6be if (result == LCD_BUTTON_TIMEOUT) 1f474: 8f 3f cpi r24, 0xFF ; 255 1f476: d1 f1 breq .+116 ; 0x1f4ec goto canceled; else if (result == LCD_LEFT_BUTTON_CHOICE) 1f478: 81 11 cpse r24, r1 1f47a: 82 cf rjmp .-252 ; 0x1f380 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; 1f47c: 80 e0 ldi r24, 0x00 ; 0 1f47e: 90 e0 ldi r25, 0x00 ; 0 1f480: af e4 ldi r26, 0x4F ; 79 1f482: b3 e4 ldi r27, 0x43 ; 67 1f484: 80 93 69 12 sts 0x1269, r24 ; 0x801269 1f488: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 1f48c: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 1f490: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c } else { current_position[Z_AXIS] = Z_MAX_POS+4.f; } plan_set_position_curposXYZE(); 1f494: 0f 94 cd 48 call 0x2919a ; 0x2919a return true; 1f498: 81 e0 ldi r24, 0x01 ; 1 canceled: return false; } 1f49a: df 91 pop r29 1f49c: cf 91 pop r28 1f49e: 1f 91 pop r17 1f4a0: 0f 91 pop r16 1f4a2: ff 90 pop r15 1f4a4: ef 90 pop r14 1f4a6: df 90 pop r13 1f4a8: cf 90 pop r12 1f4aa: bf 90 pop r11 1f4ac: af 90 pop r10 1f4ae: 9f 90 pop r9 1f4b0: 08 95 ret while (lcd_clicked()) ; _delay(10); while (lcd_clicked()) ; break; } if (multi_screen && _millis() - previous_millis_msg > 5000) { 1f4b2: 01 15 cp r16, r1 1f4b4: 11 05 cpc r17, r1 1f4b6: 09 f4 brne .+2 ; 0x1f4ba 1f4b8: 79 cf rjmp .-270 ; 0x1f3ac 1f4ba: 0f 94 89 0b call 0x21712 ; 0x21712 1f4be: 6c 19 sub r22, r12 1f4c0: 7d 09 sbc r23, r13 1f4c2: 8e 09 sbc r24, r14 1f4c4: 9f 09 sbc r25, r15 1f4c6: 69 38 cpi r22, 0x89 ; 137 1f4c8: 73 41 sbci r23, 0x13 ; 19 1f4ca: 81 05 cpc r24, r1 1f4cc: 91 05 cpc r25, r1 1f4ce: 08 f4 brcc .+2 ; 0x1f4d2 1f4d0: 6d cf rjmp .-294 ; 0x1f3ac if (msg_next == NULL) 1f4d2: 20 97 sbiw r28, 0x00 ; 0 1f4d4: 11 f4 brne .+4 ; 0x1f4da msg_next = msg; 1f4d6: cb 2d mov r28, r11 1f4d8: da 2d mov r29, r10 msg_next = lcd_display_message_fullscreen_P(msg_next); 1f4da: ce 01 movw r24, r28 1f4dc: 0e 94 91 de call 0x1bd22 ; 0x1bd22 1f4e0: ec 01 movw r28, r24 previous_millis_msg = _millis(); 1f4e2: 0f 94 89 0b call 0x21712 ; 0x21712 1f4e6: 6b 01 movw r12, r22 1f4e8: 7c 01 movw r14, r24 1f4ea: 60 cf rjmp .-320 ; 0x1f3ac } plan_set_position_curposXYZE(); return true; canceled: return false; 1f4ec: 80 e0 ldi r24, 0x00 ; 0 1f4ee: d5 cf rjmp .-86 ; 0x1f49a 0001f4f0 : } } return false; // couldn't accomplish the task } void MMU2::ToolChangeCommon(uint8_t slot) { 1f4f0: 2f 92 push r2 1f4f2: 3f 92 push r3 1f4f4: 4f 92 push r4 1f4f6: 5f 92 push r5 1f4f8: 6f 92 push r6 1f4fa: 7f 92 push r7 1f4fc: 8f 92 push r8 1f4fe: 9f 92 push r9 1f500: af 92 push r10 1f502: bf 92 push r11 1f504: cf 92 push r12 1f506: df 92 push r13 1f508: ef 92 push r14 1f50a: ff 92 push r15 1f50c: 0f 93 push r16 1f50e: 1f 93 push r17 1f510: cf 93 push r28 1f512: df 93 push r29 1f514: cd b7 in r28, 0x3d ; 61 1f516: de b7 in r29, 0x3e ; 62 1f518: 67 97 sbiw r28, 0x17 ; 23 1f51a: 0f b6 in r0, 0x3f ; 63 1f51c: f8 94 cli 1f51e: de bf out 0x3e, r29 ; 62 1f520: 0f be out 0x3f, r0 ; 63 1f522: cd bf out 0x3d, r28 ; 61 1f524: 08 2f mov r16, r24 1f526: ce 01 movw r24, r28 1f528: 46 96 adiw r24, 0x16 ; 22 1f52a: 9f 8b std Y+23, r25 ; 0x17 1f52c: 8e 8b std Y+22, r24 ; 0x16 1f52e: 83 e0 ldi r24, 0x03 ; 3 1f530: f8 2e mov r15, r24 lcd_draw_update = 1; // force redraw } void lcd_clearstatus() { memset(lcd_status_message, 0, sizeof(lcd_status_message)); 1f532: 95 e1 ldi r25, 0x15 ; 21 1f534: 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 1f536: 0f 94 60 4e call 0x29cc0 ; 0x29cc0 tool_change_extruder = slot; 1f53a: 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)); 1f53e: 40 2f mov r20, r16 1f540: 64 e5 ldi r22, 0x54 ; 84 1f542: ce 01 movw r24, r28 1f544: 01 96 adiw r24, 0x01 ; 1 1f546: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 1f54a: 49 81 ldd r20, Y+1 ; 0x01 1f54c: 5a 81 ldd r21, Y+2 ; 0x02 1f54e: 6b 81 ldd r22, Y+3 ; 0x03 1f550: 7c 81 ldd r23, Y+4 ; 0x04 1f552: 8d 81 ldd r24, Y+5 ; 0x05 1f554: 0f 94 ba 95 call 0x32b74 ; 0x32b74 logic.ToolChange(slot); // let the MMU pull the filament out and push a new one in if (manage_response(true, true)) { 1f558: 61 e0 ldi r22, 0x01 ; 1 1f55a: 81 e0 ldi r24, 0x01 ; 1 1f55c: 0f 94 4b 9d call 0x33a96 ; 0x33a96 1f560: 18 2f mov r17, r24 1f562: 81 11 cpse r24, r1 1f564: 07 c0 rjmp .+14 ; 0x1f574 break; } // otherwise: failed to perform the command - unload first and then let it run again IncrementMMUFails(); 1f566: 0f 94 b4 4d call 0x29b68 ; 0x29b68 // just in case we stood in an error screen for too long and the hotend got cold ResumeHotendTemp(); 1f56a: 0f 94 e9 9c call 0x339d2 ; 0x339d2 // if the extruder has been parked, it will get unparked once the ToolChange command finishes OK // - so no ResumeUnpark() at this spot UnloadInner(); 1f56e: 0f 94 d9 9d call 0x33bb2 ; 0x33bb2 1f572: e1 cf rjmp .-62 ; 0x1f536 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1f574: 0f 94 94 18 call 0x23128 ; 0x23128 } bool MMU2::VerifyFilamentEnteredPTFE() { planner_synchronize(); if (WhereIsFilament() != FilamentState::AT_FSENSOR) 1f578: 0f 94 96 4e call 0x29d2c ; 0x29d2c 1f57c: 81 30 cpi r24, 0x01 ; 1 1f57e: 79 f1 breq .+94 ; 0x1f5de // 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(); 1f580: 0f 94 d9 9d call 0x33bb2 ; 0x33bb2 if (retries == 2 && cutter_enabled()) { 1f584: 92 e0 ldi r25, 0x02 ; 2 1f586: f9 12 cpse r15, r25 1f588: 09 c0 rjmp .+18 ; 0x1f59c 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; 1f58a: 8e ec ldi r24, 0xCE ; 206 1f58c: 9e e0 ldi r25, 0x0E ; 14 1f58e: 0f 94 81 a4 call 0x34902 ; 0x34902 1f592: 81 30 cpi r24, 0x01 ; 1 1f594: 19 f4 brne .+6 ; 0x1f59c CutFilamentInner(slot); // try cutting filament tip at the last attempt 1f596: 80 2f mov r24, r16 1f598: 0f 94 c0 9e call 0x33d80 ; 0x33d80 1f59c: 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) { 1f59e: f1 10 cpse r15, r1 1f5a0: ca cf rjmp .-108 ; 0x1f536 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()) { 1f5a2: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1f5a6: 88 23 and r24, r24 1f5a8: 09 f4 brne .+2 ; 0x1f5ac 1f5aa: ef c0 rjmp .+478 ; 0x1f78a SetCurrentTool(slot); // filament change is finished SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } 1f5ac: 67 96 adiw r28, 0x17 ; 23 1f5ae: 0f b6 in r0, 0x3f ; 63 1f5b0: f8 94 cli 1f5b2: de bf out 0x3e, r29 ; 62 1f5b4: 0f be out 0x3f, r0 ; 63 1f5b6: cd bf out 0x3d, r28 ; 61 1f5b8: df 91 pop r29 1f5ba: cf 91 pop r28 1f5bc: 1f 91 pop r17 1f5be: 0f 91 pop r16 1f5c0: ff 90 pop r15 1f5c2: ef 90 pop r14 1f5c4: df 90 pop r13 1f5c6: cf 90 pop r12 1f5c8: bf 90 pop r11 1f5ca: af 90 pop r10 1f5cc: 9f 90 pop r9 1f5ce: 8f 90 pop r8 1f5d0: 7f 90 pop r7 1f5d2: 6f 90 pop r6 1f5d4: 5f 90 pop r5 1f5d6: 4f 90 pop r4 1f5d8: 3f 90 pop r3 1f5da: 2f 90 pop r2 1f5dc: 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(); 1f5de: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 1f5e2: 70 e0 ldi r23, 0x00 ; 0 1f5e4: 90 e0 ldi r25, 0x00 ; 0 1f5e6: 80 e0 ldi r24, 0x00 ; 0 1f5e8: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1f5ec: 9b 01 movw r18, r22 1f5ee: ac 01 movw r20, r24 1f5f0: 66 e6 ldi r22, 0x66 ; 102 1f5f2: 76 e6 ldi r23, 0x66 ; 102 1f5f4: 8d e9 ldi r24, 0x9D ; 157 1f5f6: 92 e4 ldi r25, 0x42 ; 66 1f5f8: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1f5fc: 36 2e mov r3, r22 1f5fe: 87 2e mov r8, r23 1f600: 98 2e mov r9, r24 1f602: 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)) 1f604: 26 2f mov r18, r22 1f606: 37 2f mov r19, r23 1f608: 48 2f mov r20, r24 1f60a: 59 2f mov r21, r25 1f60c: 60 e0 ldi r22, 0x00 ; 0 1f60e: 70 e0 ldi r23, 0x00 ; 0 1f610: 80 e2 ldi r24, 0x20 ; 32 1f612: 91 e4 ldi r25, 0x41 ; 65 1f614: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 1f618: 2b 01 movw r4, r22 1f61a: 3c 01 movw r6, r24 1f61c: e5 e6 ldi r30, 0x65 ; 101 1f61e: f4 e0 ldi r31, 0x04 ; 4 1f620: 82 2d mov r24, r2 1f622: 11 92 st Z+, r1 1f624: 8a 95 dec r24 1f626: e9 f7 brne .-6 ; 0x1f622 lcd_status_message_idx = 0; 1f628: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.417> 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); 1f62c: 83 2d mov r24, r3 1f62e: 98 2d mov r25, r8 1f630: a9 2d mov r26, r9 1f632: be 2d mov r27, r14 1f634: bc 01 movw r22, r24 1f636: 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++) { 1f638: 91 2c mov r9, r1 1f63a: 31 2c mov r3, r1 1f63c: e1 2c mov r14, r1 extruder_move(move == 0 ? tryload_length : -tryload_length, MMU2_VERIFY_LOAD_TO_NOZZLE_FEED_RATE); 1f63e: 5b 01 movw r10, r22 1f640: 6c 01 movw r12, r24 1f642: d7 fa bst r13, 7 1f644: d0 94 com r13 1f646: d7 f8 bld r13, 7 1f648: d0 94 com r13 1f64a: 20 e0 ldi r18, 0x00 ; 0 1f64c: 30 e0 ldi r19, 0x00 ; 0 1f64e: 48 e4 ldi r20, 0x48 ; 72 1f650: 52 e4 ldi r21, 0x42 ; 66 1f652: 0f 94 62 4e call 0x29cc4 ; 0x29cc4 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); 1f656: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 1f65a: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f while (planner_any_moves()) { 1f65e: 98 17 cp r25, r24 1f660: 09 f4 brne .+2 ; 0x1f664 1f662: 49 c0 rjmp .+146 ; 0x1f6f6 filament_inserted = filament_inserted && (WhereIsFilament() == FilamentState::AT_FSENSOR); 1f664: 11 23 and r17, r17 1f666: 31 f0 breq .+12 ; 0x1f674 1f668: 0f 94 96 4e call 0x29d2c ; 0x29d2c 1f66c: 11 e0 ldi r17, 0x01 ; 1 1f66e: 81 30 cpi r24, 0x01 ; 1 1f670: 09 f0 breq .+2 ; 0x1f674 1f672: 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); 1f674: 83 e0 ldi r24, 0x03 ; 3 1f676: 0f 94 80 18 call 0x23100 ; 0x23100 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); 1f67a: 20 91 6d 12 lds r18, 0x126D ; 0x80126d 1f67e: 30 91 6e 12 lds r19, 0x126E ; 0x80126e 1f682: 40 91 6f 12 lds r20, 0x126F ; 0x80126f 1f686: 50 91 70 12 lds r21, 0x1270 ; 0x801270 1f68a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1f68e: a3 01 movw r20, r6 1f690: 92 01 movw r18, r4 1f692: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1f696: 0f 94 87 a6 call 0x34d0e ; 0x34d0e 1f69a: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 1f69e: 86 2e mov r8, r22 if (dpixel1 - dpixel0) { 1f6a0: e6 16 cp r14, r22 1f6a2: c1 f0 breq .+48 ; 0x1f6d4 1f6a4: e3 2d mov r30, r3 1f6a6: e4 31 cpi r30, 0x14 ; 20 1f6a8: 08 f0 brcs .+2 ; 0x1f6ac 1f6aa: 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); 1f6ac: 33 24 eor r3, r3 1f6ae: 33 94 inc r3 1f6b0: 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] : '-'); 1f6b2: 8f ef ldi r24, 0xFF ; 255 1f6b4: 11 11 cpse r17, r1 1f6b6: 01 c0 rjmp .+2 ; 0x1f6ba 1f6b8: 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; 1f6ba: f0 e0 ldi r31, 0x00 ; 0 1f6bc: eb 59 subi r30, 0x9B ; 155 1f6be: fb 4f sbci r31, 0xFB ; 251 1f6c0: 80 83 st Z, r24 lcd_draw_update = 1; // force redraw 1f6c2: 91 e0 ldi r25, 0x01 ; 1 1f6c4: 90 93 59 02 sts 0x0259, r25 ; 0x800259 if (!lcd_update_enabled) lcdui_print_status_line(); 1f6c8: 80 91 5a 02 lds r24, 0x025A ; 0x80025a 1f6cc: 81 11 cpse r24, r1 1f6ce: 02 c0 rjmp .+4 ; 0x1f6d4 1f6d0: 0f 94 64 0c call 0x218c8 ; 0x218c8 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 1f6d4: 90 e0 ldi r25, 0x00 ; 0 1f6d6: 80 e0 ldi r24, 0x00 ; 0 1f6d8: 0e 94 07 8d call 0x11a0e ; 0x11a0e } 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); 1f6dc: e8 2c mov r14, r8 tlur.Progress(filament_inserted); safe_delay_keep_alive(0); if (planner_draining()) { 1f6de: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 1f6e2: 88 23 and r24, r24 1f6e4: 09 f4 brne .+2 ; 0x1f6e8 1f6e6: b7 cf rjmp .-146 ; 0x1f656 return false; // power panic or a similar issue happened, bail out fast 1f6e8: 10 e0 ldi r17, 0x00 ; 0 1f6ea: 37 c0 rjmp .+110 ; 0x1f75a 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); 1f6ec: c6 01 movw r24, r12 1f6ee: b5 01 movw r22, r10 1f6f0: 99 24 eor r9, r9 1f6f2: 93 94 inc r9 1f6f4: aa cf rjmp .-172 ; 0x1f64a 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++) { 1f6f6: 91 e0 ldi r25, 0x01 ; 1 1f6f8: 99 12 cpse r9, r25 1f6fa: f8 cf rjmp .-16 ; 0x1f6ec return false; // power panic or a similar issue happened, bail out fast } } } Disable_E0(); 1f6fc: 0f 94 60 4e call 0x29cc0 ; 0x29cc0 if (!filament_inserted) { 1f700: 11 11 cpse r17, r1 1f702: 08 c0 rjmp .+16 ; 0x1f714 eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); } void IncrementLoadFails(){ eeprom_increment_byte((uint8_t *)EEPROM_MMU_LOAD_FAIL); 1f704: 8f ec ldi r24, 0xCF ; 207 1f706: 9e e0 ldi r25, 0x0E ; 14 1f708: 0e 94 cd 78 call 0xf19a ; 0xf19a eeprom_increment_word((uint16_t *)EEPROM_MMU_LOAD_FAIL_TOT); 1f70c: 80 ed ldi r24, 0xD0 ; 208 1f70e: 9e e0 ldi r25, 0x0E ; 14 1f710: 0e 94 c0 78 call 0xf180 ; 0xf180 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); 1f714: 44 e1 ldi r20, 0x14 ; 20 1f716: 50 e0 ldi r21, 0x00 ; 0 1f718: 65 e6 ldi r22, 0x65 ; 101 1f71a: 74 e0 ldi r23, 0x04 ; 4 1f71c: ce 01 movw r24, r28 1f71e: 01 96 adiw r24, 0x01 ; 1 1f720: 0f 94 01 ab call 0x35602 ; 0x35602 1f724: fe 01 movw r30, r28 1f726: 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'; 1f728: 81 91 ld r24, Z+ 1f72a: 87 fd sbrc r24, 7 1f72c: 2c c0 rjmp .+88 ; 0x1f786 1f72e: 80 e3 ldi r24, 0x30 ; 48 1f730: df 01 movw r26, r30 1f732: 11 97 sbiw r26, 0x01 ; 1 1f734: 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++) { 1f736: 8e 89 ldd r24, Y+22 ; 0x16 1f738: 9f 89 ldd r25, Y+23 ; 0x17 1f73a: 8e 17 cp r24, r30 1f73c: 9f 07 cpc r25, r31 1f73e: a1 f7 brne .-24 ; 0x1f728 // 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; 1f740: 1d 8a std Y+21, r1 ; 0x15 MMU2_ECHO_MSGLN(buf); 1f742: 84 ee ldi r24, 0xE4 ; 228 1f744: 92 ea ldi r25, 0xA2 ; 162 1f746: 0e 94 15 7b call 0xf62a ; 0xf62a 1f74a: 81 e8 ldi r24, 0x81 ; 129 1f74c: 98 e8 ldi r25, 0x88 ; 136 1f74e: 0e 94 15 7b call 0xf62a ; 0xf62a 1f752: ce 01 movw r24, r28 1f754: 01 96 adiw r24, 0x01 ; 1 1f756: 0e 94 1a 86 call 0x10c34 ; 0x10c34 SERIAL_ECHOLN(message); } void lcd_reset_status_message_timeout() { lcd_status_message_timeout.start(); 1f75a: 8a e7 ldi r24, 0x7A ; 122 1f75c: 94 e0 ldi r25, 0x04 ; 4 1f75e: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::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()) { 1f762: 11 23 and r17, r17 1f764: 09 f4 brne .+2 ; 0x1f768 1f766: 0c cf rjmp .-488 ; 0x1f580 // 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 1f768: 80 2f mov r24, r16 1f76a: 0f 94 65 65 call 0x2caca ; 0x2caca } } void SpoolJoin::setSlot(uint8_t slot) { currentMMUSlot = slot; 1f76e: 00 93 90 12 sts 0x1290, r16 ; 0x801290 SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; 1f772: 80 91 05 13 lds r24, 0x1305 ; 0x801305 1f776: 90 91 06 13 lds r25, 0x1306 ; 0x801306 1f77a: 01 96 adiw r24, 0x01 ; 1 1f77c: 90 93 06 13 sts 0x1306, r25 ; 0x801306 1f780: 80 93 05 13 sts 0x1305, r24 ; 0x801305 1f784: 13 cf rjmp .-474 ; 0x1f5ac 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'; 1f786: 81 e3 ldi r24, 0x31 ; 49 1f788: d3 cf rjmp .-90 ; 0x1f730 void SetInAutoRetry(bool iar) { inAutoRetry = iar; } inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; 1f78a: 8a e2 ldi r24, 0x2A ; 42 1f78c: 90 e8 ldi r25, 0x80 ; 128 1f78e: 90 93 93 12 sts 0x1293, r25 ; 0x801293 1f792: 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 1f796: 61 e0 ldi r22, 0x01 ; 1 1f798: 81 e0 ldi r24, 0x01 ; 1 1f79a: 0f 94 4b 9d call 0x33a96 ; 0x33a96 1f79e: c7 ce rjmp .-626 ; 0x1f52e 0001f7a0 : } ScreenUpdateEnable(); return true; } bool MMU2::load_filament_to_nozzle(uint8_t slot) { 1f7a0: cf 93 push r28 1f7a2: df 93 push r29 1f7a4: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1f7a6: 0f 94 47 7a call 0x2f48e ; 0x2f48e 1f7aa: c8 2f mov r28, r24 1f7ac: 88 23 and r24, r24 1f7ae: 49 f1 breq .+82 ; 0x1f802 safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 1f7b0: 88 ec ldi r24, 0xC8 ; 200 1f7b2: 90 e0 ldi r25, 0x00 ; 0 1f7b4: 0f 94 e4 51 call 0x2a3c8 ; 0x2a3c8 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.372]> 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); 1f7b8: 82 e0 ldi r24, 0x02 ; 2 1f7ba: 0f 94 3f 23 call 0x2467e ; 0x2467e void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 1f7be: 8f ea ldi r24, 0xAF ; 175 1f7c0: 92 e6 ldi r25, 0x62 ; 98 1f7c2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1f7c6: 6d 2f mov r22, r29 1f7c8: 0f 94 95 4d call 0x29b2a ; 0x29b2a struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1f7cc: 0f 94 13 7a call 0x2f426 ; 0x2f426 FullScreenMsgLoad(slot); { // used for MMU-menu operation "Load to Nozzle" ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 1f7d0: 0f 94 c9 78 call 0x2f192 ; 0x2f192 if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly 1f7d4: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 1f7d8: 83 36 cpi r24, 0x63 ; 99 1f7da: 29 f0 breq .+10 ; 0x1f7e6 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 1f7dc: 62 e1 ldi r22, 0x12 ; 18 1f7de: 8d e1 ldi r24, 0x1D ; 29 1f7e0: 9e e9 ldi r25, 0x9E ; 158 1f7e2: 0f 94 1e 7a call 0x2f43c ; 0x2f43c if (extruder != MMU2_NO_TOOL) { // we already have some filament loaded - free it + shape its tip properly filament_ramming(); } ToolChangeCommon(slot); 1f7e6: 8d 2f mov r24, r29 1f7e8: 0e 94 78 fa call 0x1f4f0 ; 0x1f4f0 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); 1f7ec: 0e 94 f2 bb call 0x177e4 ; 0x177e4 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); 1f7f0: 83 e0 ldi r24, 0x03 ; 3 1f7f2: 0f 94 3f 23 call 0x2467e ; 0x2467e #endif //(FILAMENT_SENSOR_TYPE == FSENSOR_PAT9125) // SERIAL_ECHOLNPGM("FSBlockRunout"); } FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 1f7f6: 0f 94 33 6d call 0x2da66 ; 0x2da66 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1f7fa: 0f 94 3c 7a call 0x2f478 ; 0x2f478 // Finish loading to the nozzle with finely tuned steps. execute_load_to_nozzle_sequence(); MakeSound(Confirm); } ScreenUpdateEnable(); 1f7fe: 0f 94 92 4d call 0x29b24 ; 0x29b24 return true; } 1f802: 8c 2f mov r24, r28 1f804: df 91 pop r29 1f806: cf 91 pop r28 1f808: 08 95 ret 0001f80a : 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); 1f80a: 0e 94 d0 fb call 0x1f7a0 ; 0x1f7a0 // Extrude a little bit of filament so the user // can see the color is correct load_filament_final_feed(); 1f80e: 0e 94 3e 64 call 0xc87c ; 0xc87c st_synchronize(); 1f812: 0f 94 94 18 call 0x23128 ; 0x23128 // Ask user if the extruded color is correct: lcd_return_to_status(); 1f816: 0f 94 6e 05 call 0x20adc ; 0x20adc lcd_load_filament_color_check(); 1f81a: 0f 94 a0 18 call 0x23140 ; 0x23140 lcd_setstatuspgm(MSG_WELCOME); 1f81e: 8a e8 ldi r24, 0x8A ; 138 1f820: 9c e6 ldi r25, 0x6C ; 108 1f822: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 custom_message_type = CustomMsg::Status; 1f826: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d // Clear the filament action clearFilamentAction(); 1f82a: 0d 94 6f 09 jmp 0x212de ; 0x212de 0001f82e : SpoolJoin::spooljoin.setSlot(slot); ++toolchange_counter; } bool MMU2::tool_change(uint8_t slot) { 1f82e: cf 93 push r28 1f830: df 93 push r29 1f832: d8 2f mov r29, r24 if (!WaitForMMUReady()) { 1f834: 0f 94 47 7a call 0x2f48e ; 0x2f48e 1f838: c8 2f mov r28, r24 1f83a: 88 23 and r24, r24 1f83c: b9 f0 breq .+46 ; 0x1f86c return false; } if (slot != extruder) { 1f83e: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 1f842: 8d 17 cp r24, r29 1f844: 99 f0 breq .+38 ; 0x1f86c 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(); 1f846: 0e 94 e2 66 call 0xcdc4 ; 0xcdc4 if (/*FindaDetectsFilament()*/ 1f84a: 81 11 cpse r24, r1 1f84c: 02 c0 rjmp .+4 ; 0x1f852 /*!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(); 1f84e: 0f 94 12 9e call 0x33c24 ; 0x33c24 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 1f852: 0f 94 13 7a call 0x2f426 ; 0x2f426 // we need to unload manually as well -- but only if FINDA detects filament unload(); } ReportingRAII rep(CommandInProgress::ToolChange); FSensorBlockRunout blockRunout; 1f856: 0f 94 c9 78 call 0x2f192 ; 0x2f192 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 1f85a: 0f 94 94 18 call 0x23128 ; 0x23128 planner_synchronize(); ToolChangeCommon(slot); 1f85e: 8d 2f mov r24, r29 1f860: 0e 94 78 fa call 0x1f4f0 ; 0x1f4f0 1f864: 0f 94 33 6d call 0x2da66 ; 0x2da66 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 1f868: 0f 94 3c 7a call 0x2f478 ; 0x2f478 FSensorBlockRunout blockRunout; planner_synchronize(); ToolChangeCommon(slot); } return true; } 1f86c: 8c 2f mov r24, r28 1f86e: df 91 pop r29 1f870: cf 91 pop r28 1f872: 08 95 ret 0001f874 : /// 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) { 1f874: 1f 93 push r17 1f876: cf 93 push r28 1f878: df 93 push r29 1f87a: c8 2f mov r28, r24 1f87c: 16 2f mov r17, r22 if (!WaitForMMUReady()) { 1f87e: 0f 94 47 7a call 0x2f48e ; 0x2f48e 1f882: d8 2f mov r29, r24 1f884: 88 23 and r24, r24 1f886: 89 f0 breq .+34 ; 0x1f8aa return false; } FSensorBlockRunout blockRunout; 1f888: 0f 94 c9 78 call 0x2f192 ; 0x2f192 switch (code) { 1f88c: c3 36 cpi r28, 0x63 ; 99 1f88e: 01 f1 breq .+64 ; 0x1f8d0 1f890: c8 37 cpi r28, 0x78 ; 120 1f892: 81 f0 breq .+32 ; 0x1f8b4 1f894: cf 33 cpi r28, 0x3F ; 63 1f896: 39 f4 brne .+14 ; 0x1f8a6 case '?': { waitForHotendTargetTemp(100, [] {}); 1f898: 84 e6 ldi r24, 0x64 ; 100 1f89a: 90 e0 ldi r25, 0x00 ; 0 1f89c: 0f 94 e4 51 call 0x2a3c8 ; 0x2a3c8 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.372]> load_filament_to_nozzle(slot); 1f8a0: 81 2f mov r24, r17 1f8a2: 0e 94 d0 fb call 0x1f7a0 ; 0x1f7a0 1f8a6: 0f 94 33 6d call 0x2da66 ; 0x2da66 execute_load_to_nozzle_sequence(); } break; } return true; } 1f8aa: 8d 2f mov r24, r29 1f8ac: df 91 pop r29 1f8ae: cf 91 pop r28 1f8b0: 1f 91 pop r17 1f8b2: 08 95 ret } #ifdef PREVENT_DANGEROUS_EXTRUDE void set_extrude_min_temp(int temp) { extrude_min_temp = temp; 1f8b4: 10 92 58 02 sts 0x0258, r1 ; 0x800258 1f8b8: 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); 1f8bc: 81 2f mov r24, r17 1f8be: 0e 94 17 fc call 0x1f82e ; 0x1f82e 1f8c2: 8f ea ldi r24, 0xAF ; 175 1f8c4: 90 e0 ldi r25, 0x00 ; 0 1f8c6: 90 93 58 02 sts 0x0258, r25 ; 0x800258 1f8ca: 80 93 57 02 sts 0x0257, r24 ; 0x800257 1f8ce: eb cf rjmp .-42 ; 0x1f8a6 thermal_setExtrudeMintemp(EXTRUDE_MINTEMP); } break; case 'c': { waitForHotendTargetTemp(100, [] {}); 1f8d0: 84 e6 ldi r24, 0x64 ; 100 1f8d2: 90 e0 ldi r25, 0x00 ; 0 1f8d4: 0f 94 e4 51 call 0x2a3c8 ; 0x2a3c8 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.372]> execute_load_to_nozzle_sequence(); 1f8d8: 0e 94 f2 bb call 0x177e4 ; 0x177e4 1f8dc: e4 cf rjmp .-56 ; 0x1f8a6 0001f8de : // Clear the filament action clearFilamentAction(); } static inline void loading_test_wrapper(uint8_t i){ 1f8de: cf 93 push r28 1f8e0: 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); 1f8e2: 83 e7 ldi r24, 0x73 ; 115 1f8e4: 96 e4 ldi r25, 0x46 ; 70 1f8e6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1f8ea: 6c 2f mov r22, r28 1f8ec: 0f 94 95 4d call 0x29b2a ; 0x29b2a return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1f8f0: 8c 2f mov r24, r28 1f8f2: 0e 94 17 fc call 0x1f82e ; 0x1f82e 1f8f6: 0f 94 94 18 call 0x23128 ; 0x23128 planner_synchronize(); unload(); 1f8fa: 0f 94 12 9e call 0x33c24 ; 0x33c24 ScreenUpdateEnable(); 1f8fe: 0f 94 92 4d call 0x29b24 ; 0x29b24 MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); } 1f902: cf 91 pop r28 static inline void loading_test_wrapper(uint8_t i){ MMU2::mmu2.loading_test(i); // Clear the filament action clearFilamentAction(); 1f904: 0d 94 6f 09 jmp 0x212de ; 0x212de 0001f908 : 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(){ 1f908: cf 93 push r28 for(uint8_t i = 0; i < 5; ++i){ 1f90a: c0 e0 ldi r28, 0x00 ; 0 1f90c: 83 e7 ldi r24, 0x73 ; 115 1f90e: 96 e4 ldi r25, 0x46 ; 70 1f910: 0e 94 8b 75 call 0xeb16 ; 0xeb16 1f914: 6c 2f mov r22, r28 1f916: 0f 94 95 4d call 0x29b2a ; 0x29b2a return true; } bool MMU2::loading_test(uint8_t slot) { FullScreenMsgTest(slot); tool_change(slot); 1f91a: 8c 2f mov r24, r28 1f91c: 0e 94 17 fc call 0x1f82e ; 0x1f82e 1f920: 0f 94 94 18 call 0x23128 ; 0x23128 planner_synchronize(); unload(); 1f924: 0f 94 12 9e call 0x33c24 ; 0x33c24 ScreenUpdateEnable(); 1f928: 0f 94 92 4d call 0x29b24 ; 0x29b24 1f92c: cf 5f subi r28, 0xFF ; 255 1f92e: c5 30 cpi r28, 0x05 ; 5 1f930: 69 f7 brne .-38 ; 0x1f90c MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); } 1f932: cf 91 pop r28 for(uint8_t i = 0; i < 5; ++i){ MMU2::mmu2.loading_test(i); } // Clear the filament action clearFilamentAction(); 1f934: 0d 94 6f 09 jmp 0x212de ; 0x212de 0001f938 : void MMU2::PowerOn() { power_on(); } bool MMU2::ReadRegister(uint8_t address) { 1f938: 1f 93 push r17 1f93a: cf 93 push r28 1f93c: df 93 push r29 1f93e: 00 d0 rcall .+0 ; 0x1f940 1f940: 1f 92 push r1 1f942: 1f 92 push r1 1f944: cd b7 in r28, 0x3d ; 61 1f946: de b7 in r29, 0x3e ; 62 1f948: 18 2f mov r17, r24 if (!WaitForMMUReady()) { 1f94a: 0f 94 47 7a call 0x2f48e ; 0x2f48e 1f94e: 88 23 and r24, r24 1f950: d9 f0 breq .+54 ; 0x1f988 void ProtocolLogic::Home(uint8_t mode) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Home, mode)); } void ProtocolLogic::ReadRegister(uint8_t address) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Read, address)); 1f952: 41 2f mov r20, r17 1f954: 62 e5 ldi r22, 0x52 ; 82 1f956: ce 01 movw r24, r28 1f958: 01 96 adiw r24, 0x01 ; 1 1f95a: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 1f95e: 49 81 ldd r20, Y+1 ; 0x01 1f960: 5a 81 ldd r21, Y+2 ; 0x02 1f962: 6b 81 ldd r22, Y+3 ; 0x03 1f964: 7c 81 ldd r23, Y+4 ; 0x04 1f966: 8d 81 ldd r24, Y+5 ; 0x05 1f968: 0f 94 ba 95 call 0x32b74 ; 0x32b74 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)); 1f96c: 60 e0 ldi r22, 0x00 ; 0 1f96e: 80 e0 ldi r24, 0x00 ; 0 1f970: 0f 94 4b 9d call 0x33a96 ; 0x33a96 1f974: 88 23 and r24, r24 1f976: 69 f3 breq .-38 ; 0x1f952 // Update cached value lastReadRegisterValue = logic.rsp.paramValue; 1f978: 20 91 ad 12 lds r18, 0x12AD ; 0x8012ad 1f97c: 30 91 ae 12 lds r19, 0x12AE ; 0x8012ae 1f980: 30 93 fe 12 sts 0x12FE, r19 ; 0x8012fe 1f984: 20 93 fd 12 sts 0x12FD, r18 ; 0x8012fd return true; } 1f988: 0f 90 pop r0 1f98a: 0f 90 pop r0 1f98c: 0f 90 pop r0 1f98e: 0f 90 pop r0 1f990: 0f 90 pop r0 1f992: df 91 pop r29 1f994: cf 91 pop r28 1f996: 1f 91 pop r17 1f998: 08 95 ret 0001f99a : 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; 1f99a: 88 3e cpi r24, 0xE8 ; 232 1f99c: 23 e0 ldi r18, 0x03 ; 3 1f99e: 92 07 cpc r25, r18 1f9a0: 10 f0 brcs .+4 ; 0x1f9a6 1f9a2: 87 ee ldi r24, 0xE7 ; 231 1f9a4: 93 e0 ldi r25, 0x03 ; 3 } 1f9a6: 08 95 ret 0001f9a8 : return 0; } int uart2_getchar(_UNUSED FILE *stream) { if (rbuf_empty(uart2_ibuf)) return -1; 1f9a8: 90 91 47 0d lds r25, 0x0D47 ; 0x800d47 1f9ac: 80 91 46 0d lds r24, 0x0D46 ; 0x800d46 1f9b0: 2f ef ldi r18, 0xFF ; 255 1f9b2: 3f ef ldi r19, 0xFF ; 255 1f9b4: 89 17 cp r24, r25 1f9b6: 71 f0 breq .+28 ; 0x1f9d4 _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 1f9b8: e9 2f mov r30, r25 1f9ba: f0 e0 ldi r31, 0x00 ; 0 1f9bc: e7 5b subi r30, 0xB7 ; 183 1f9be: f2 4f sbci r31, 0xF2 ; 242 1f9c0: 20 81 ld r18, Z 1f9c2: 30 e0 ldi r19, 0x00 ; 0 buf_r++; //increment read index 1f9c4: 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 1f9c6: 80 91 45 0d lds r24, 0x0D45 ; 0x800d45 1f9ca: 98 17 cp r25, r24 1f9cc: 08 f0 brcs .+2 ; 0x1f9d0 1f9ce: 90 e0 ldi r25, 0x00 ; 0 ptr[2] = buf_r; //store read index 1f9d0: 90 93 47 0d sts 0x0D47, r25 ; 0x800d47 return rbuf_get(uart2_ibuf); } 1f9d4: c9 01 movw r24, r18 1f9d6: 08 95 ret 0001f9d8 : FILE _uart2io = {0}; int uart2_putchar(char c, _UNUSED FILE *stream) { while (!uart2_txready); 1f9d8: 90 91 d0 00 lds r25, 0x00D0 ; 0x8000d0 <__TEXT_REGION_LENGTH__+0x7c20d0> 1f9dc: 95 ff sbrs r25, 5 1f9de: fc cf rjmp .-8 ; 0x1f9d8 UDR2 = c; // transmit byte 1f9e0: 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; } 1f9e4: 90 e0 ldi r25, 0x00 ; 0 1f9e6: 80 e0 ldi r24, 0x00 ; 0 1f9e8: 08 95 ret 0001f9ea : } unsigned long micros2(void) { unsigned long m; uint8_t oldSREG = SREG, t; 1f9ea: 3f b7 in r19, 0x3f ; 63 cli(); 1f9ec: f8 94 cli m = timer2_overflow_count; 1f9ee: 80 91 fc 05 lds r24, 0x05FC ; 0x8005fc 1f9f2: 90 91 fd 05 lds r25, 0x05FD ; 0x8005fd 1f9f6: a0 91 fe 05 lds r26, 0x05FE ; 0x8005fe 1f9fa: b0 91 ff 05 lds r27, 0x05FF ; 0x8005ff #if defined(TCNT2) t = TCNT2; 1f9fe: 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)) 1fa02: b8 9b sbis 0x17, 0 ; 23 1fa04: 05 c0 rjmp .+10 ; 0x1fa10 1fa06: 2f 3f cpi r18, 0xFF ; 255 1fa08: 19 f0 breq .+6 ; 0x1fa10 m++; 1fa0a: 01 96 adiw r24, 0x01 ; 1 1fa0c: a1 1d adc r26, r1 1fa0e: b1 1d adc r27, r1 #else if ((TIFR & _BV(TOV2)) && (t < 255)) m++; #endif SREG = oldSREG; 1fa10: 3f bf out 0x3f, r19 ; 63 return ((m << 8) + t) * (64 / clockCyclesPerMicrosecond()); 1fa12: ba 2f mov r27, r26 1fa14: a9 2f mov r26, r25 1fa16: 98 2f mov r25, r24 1fa18: 88 27 eor r24, r24 1fa1a: bc 01 movw r22, r24 1fa1c: cd 01 movw r24, r26 1fa1e: 62 0f add r22, r18 1fa20: 71 1d adc r23, r1 1fa22: 81 1d adc r24, r1 1fa24: 91 1d adc r25, r1 1fa26: 42 e0 ldi r20, 0x02 ; 2 1fa28: 66 0f add r22, r22 1fa2a: 77 1f adc r23, r23 1fa2c: 88 1f adc r24, r24 1fa2e: 99 1f adc r25, r25 1fa30: 4a 95 dec r20 1fa32: d1 f7 brne .-12 ; 0x1fa28 } 1fa34: 08 95 ret 0001fa36 : #endif temp_meas_ready = true; } static void temp_mgr_pid() { 1fa36: 2f 92 push r2 1fa38: 3f 92 push r3 1fa3a: 4f 92 push r4 1fa3c: 5f 92 push r5 1fa3e: 6f 92 push r6 1fa40: 7f 92 push r7 1fa42: 8f 92 push r8 1fa44: 9f 92 push r9 1fa46: af 92 push r10 1fa48: bf 92 push r11 1fa4a: cf 92 push r12 1fa4c: df 92 push r13 1fa4e: ef 92 push r14 1fa50: ff 92 push r15 1fa52: 0f 93 push r16 1fa54: 1f 93 push r17 1fa56: cf 93 push r28 1fa58: df 93 push r29 1fa5a: cd b7 in r28, 0x3d ; 61 1fa5c: de b7 in r29, 0x3e ; 62 1fa5e: 2e 97 sbiw r28, 0x0e ; 14 1fa60: 0f b6 in r0, 0x3f ; 63 1fa62: f8 94 cli 1fa64: de bf out 0x3e, r29 ; 62 1fa66: 0f be out 0x3f, r0 ; 63 1fa68: 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]); 1fa6a: 20 90 ef 05 lds r2, 0x05EF ; 0x8005ef 1fa6e: 30 90 f0 05 lds r3, 0x05F0 ; 0x8005f0 1fa72: 40 90 f1 05 lds r4, 0x05F1 ; 0x8005f1 1fa76: 50 90 f2 05 lds r5, 0x05F2 ; 0x8005f2 1fa7a: 60 90 f3 05 lds r6, 0x05F3 ; 0x8005f3 1fa7e: 70 90 f4 05 lds r7, 0x05F4 ; 0x8005f4 #ifdef PIDTEMP pid_input = current; #ifndef PID_OPENLOOP if(target == 0) { 1fa82: 21 14 cp r2, r1 1fa84: 31 04 cpc r3, r1 1fa86: 39 f4 brne .+14 ; 0x1fa96 pid_output = 0; pid_reset[e] = true; 1fa88: 81 e0 ldi r24, 0x01 ; 1 1fa8a: 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; 1fa8e: 81 2c mov r8, r1 1fa90: 91 2c mov r9, r1 1fa92: 54 01 movw r10, r8 1fa94: f9 c0 rjmp .+498 ; 0x1fc88 #ifndef PID_OPENLOOP if(target == 0) { pid_output = 0; pid_reset[e] = true; } else { pid_error[e] = target - pid_input; 1fa96: b1 01 movw r22, r2 1fa98: 03 2c mov r0, r3 1fa9a: 00 0c add r0, r0 1fa9c: 88 0b sbc r24, r24 1fa9e: 99 0b sbc r25, r25 1faa0: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1faa4: a3 01 movw r20, r6 1faa6: 92 01 movw r18, r4 1faa8: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1faac: 6b 01 movw r12, r22 1faae: 7c 01 movw r14, r24 if(pid_reset[e]) { 1fab0: 80 91 c8 05 lds r24, 0x05C8 ; 0x8005c8 1fab4: 88 23 and r24, r24 1fab6: 91 f0 breq .+36 ; 0x1fadc iState_sum[e] = 0.0; 1fab8: 10 92 c4 05 sts 0x05C4, r1 ; 0x8005c4 1fabc: 10 92 c5 05 sts 0x05C5, r1 ; 0x8005c5 1fac0: 10 92 c6 05 sts 0x05C6, r1 ; 0x8005c6 1fac4: 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) 1fac8: 10 92 c0 05 sts 0x05C0, r1 ; 0x8005c0 1facc: 10 92 c1 05 sts 0x05C1, r1 ; 0x8005c1 1fad0: 10 92 c2 05 sts 0x05C2, r1 ; 0x8005c2 1fad4: 10 92 c3 05 sts 0x05C3, r1 ; 0x8005c3 pid_reset[e] = false; 1fad8: 10 92 c8 05 sts 0x05C8, r1 ; 0x8005c8 } #ifndef PonM pTerm[e] = cs.Kp * pid_error[e]; 1fadc: 20 91 cf 0d lds r18, 0x0DCF ; 0x800dcf 1fae0: 30 91 d0 0d lds r19, 0x0DD0 ; 0x800dd0 1fae4: 40 91 d1 0d lds r20, 0x0DD1 ; 0x800dd1 1fae8: 50 91 d2 0d lds r21, 0x0DD2 ; 0x800dd2 1faec: c7 01 movw r24, r14 1faee: b6 01 movw r22, r12 1faf0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1faf4: 69 83 std Y+1, r22 ; 0x01 1faf6: 7a 83 std Y+2, r23 ; 0x02 1faf8: 8b 83 std Y+3, r24 ; 0x03 1fafa: 9c 83 std Y+4, r25 ; 0x04 iState_sum[e] += pid_error[e]; 1fafc: 20 91 c4 05 lds r18, 0x05C4 ; 0x8005c4 1fb00: 30 91 c5 05 lds r19, 0x05C5 ; 0x8005c5 1fb04: 40 91 c6 05 lds r20, 0x05C6 ; 0x8005c6 1fb08: 50 91 c7 05 lds r21, 0x05C7 ; 0x8005c7 1fb0c: c7 01 movw r24, r14 1fb0e: b6 01 movw r22, r12 1fb10: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1fb14: 4b 01 movw r8, r22 1fb16: 5c 01 movw r10, r24 iState_sum[e] = constrain(iState_sum[e], iState_sum_min[e], iState_sum_max[e]); 1fb18: 20 91 1c 04 lds r18, 0x041C ; 0x80041c <_ZL14iState_sum_min.lto_priv.432> 1fb1c: 2d 87 std Y+13, r18 ; 0x0d 1fb1e: 30 91 1d 04 lds r19, 0x041D ; 0x80041d <_ZL14iState_sum_min.lto_priv.432+0x1> 1fb22: 39 87 std Y+9, r19 ; 0x09 1fb24: 10 91 1e 04 lds r17, 0x041E ; 0x80041e <_ZL14iState_sum_min.lto_priv.432+0x2> 1fb28: 00 91 1f 04 lds r16, 0x041F ; 0x80041f <_ZL14iState_sum_min.lto_priv.432+0x3> 1fb2c: 41 2f mov r20, r17 1fb2e: 50 2f mov r21, r16 1fb30: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1fb34: 87 fd sbrc r24, 7 1fb36: 17 c0 rjmp .+46 ; 0x1fb66 1fb38: 80 91 18 04 lds r24, 0x0418 ; 0x800418 <_ZL14iState_sum_max.lto_priv.433> 1fb3c: 8d 87 std Y+13, r24 ; 0x0d 1fb3e: 90 91 19 04 lds r25, 0x0419 ; 0x800419 <_ZL14iState_sum_max.lto_priv.433+0x1> 1fb42: 99 87 std Y+9, r25 ; 0x09 1fb44: 10 91 1a 04 lds r17, 0x041A ; 0x80041a <_ZL14iState_sum_max.lto_priv.433+0x2> 1fb48: 00 91 1b 04 lds r16, 0x041B ; 0x80041b <_ZL14iState_sum_max.lto_priv.433+0x3> 1fb4c: 9c 01 movw r18, r24 1fb4e: 41 2f mov r20, r17 1fb50: 50 2f mov r21, r16 1fb52: b4 01 movw r22, r8 1fb54: c5 01 movw r24, r10 1fb56: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1fb5a: 18 16 cp r1, r24 1fb5c: 24 f0 brlt .+8 ; 0x1fb66 1fb5e: 8d 86 std Y+13, r8 ; 0x0d 1fb60: 99 86 std Y+9, r9 ; 0x09 1fb62: 1a 2d mov r17, r10 1fb64: 0b 2d mov r16, r11 1fb66: 8d 85 ldd r24, Y+13 ; 0x0d 1fb68: 99 85 ldd r25, Y+9 ; 0x09 1fb6a: a1 2f mov r26, r17 1fb6c: b0 2f mov r27, r16 1fb6e: 80 93 c4 05 sts 0x05C4, r24 ; 0x8005c4 1fb72: 90 93 c5 05 sts 0x05C5, r25 ; 0x8005c5 1fb76: a0 93 c6 05 sts 0x05C6, r26 ; 0x8005c6 1fb7a: b0 93 c7 05 sts 0x05C7, r27 ; 0x8005c7 iTerm[e] = cs.Ki * iState_sum[e]; 1fb7e: 20 91 d3 0d lds r18, 0x0DD3 ; 0x800dd3 1fb82: 30 91 d4 0d lds r19, 0x0DD4 ; 0x800dd4 1fb86: 40 91 d5 0d lds r20, 0x0DD5 ; 0x800dd5 1fb8a: 50 91 d6 0d lds r21, 0x0DD6 ; 0x800dd6 1fb8e: bc 01 movw r22, r24 1fb90: 81 2f mov r24, r17 1fb92: 90 2f mov r25, r16 1fb94: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1fb98: 6d 83 std Y+5, r22 ; 0x05 1fb9a: 7e 83 std Y+6, r23 ; 0x06 1fb9c: 8f 83 std Y+7, r24 ; 0x07 1fb9e: 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 1fba0: 20 91 bc 05 lds r18, 0x05BC ; 0x8005bc 1fba4: 30 91 bd 05 lds r19, 0x05BD ; 0x8005bd 1fba8: 40 91 be 05 lds r20, 0x05BE ; 0x8005be 1fbac: 50 91 bf 05 lds r21, 0x05BF ; 0x8005bf 1fbb0: c3 01 movw r24, r6 1fbb2: b2 01 movw r22, r4 1fbb4: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1fbb8: 20 91 d7 0d lds r18, 0x0DD7 ; 0x800dd7 1fbbc: 30 91 d8 0d lds r19, 0x0DD8 ; 0x800dd8 1fbc0: 40 91 d9 0d lds r20, 0x0DD9 ; 0x800dd9 1fbc4: 50 91 da 0d lds r21, 0x0DDA ; 0x800dda 1fbc8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1fbcc: 20 ed ldi r18, 0xD0 ; 208 1fbce: 3c ec ldi r19, 0xCC ; 204 1fbd0: 4c e4 ldi r20, 0x4C ; 76 1fbd2: 5d e3 ldi r21, 0x3D ; 61 1fbd4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1fbd8: 4b 01 movw r8, r22 1fbda: 5c 01 movw r10, r24 1fbdc: 23 e3 ldi r18, 0x33 ; 51 1fbde: 33 e3 ldi r19, 0x33 ; 51 1fbe0: 43 e7 ldi r20, 0x73 ; 115 1fbe2: 5f e3 ldi r21, 0x3F ; 63 1fbe4: 60 91 c0 05 lds r22, 0x05C0 ; 0x8005c0 1fbe8: 70 91 c1 05 lds r23, 0x05C1 ; 0x8005c1 1fbec: 80 91 c2 05 lds r24, 0x05C2 ; 0x8005c2 1fbf0: 90 91 c3 05 lds r25, 0x05C3 ; 0x8005c3 1fbf4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1fbf8: 9b 01 movw r18, r22 1fbfa: ac 01 movw r20, r24 1fbfc: c5 01 movw r24, r10 1fbfe: b4 01 movw r22, r8 1fc00: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1fc04: 4b 01 movw r8, r22 1fc06: 5c 01 movw r10, r24 1fc08: 80 92 c0 05 sts 0x05C0, r8 ; 0x8005c0 1fc0c: 90 92 c1 05 sts 0x05C1, r9 ; 0x8005c1 1fc10: a0 92 c2 05 sts 0x05C2, r10 ; 0x8005c2 1fc14: 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) 1fc18: 2d 81 ldd r18, Y+5 ; 0x05 1fc1a: 3e 81 ldd r19, Y+6 ; 0x06 1fc1c: 4f 81 ldd r20, Y+7 ; 0x07 1fc1e: 58 85 ldd r21, Y+8 ; 0x08 1fc20: 69 81 ldd r22, Y+1 ; 0x01 1fc22: 7a 81 ldd r23, Y+2 ; 0x02 1fc24: 8b 81 ldd r24, Y+3 ; 0x03 1fc26: 9c 81 ldd r25, Y+4 ; 0x04 1fc28: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1fc2c: a5 01 movw r20, r10 1fc2e: 94 01 movw r18, r8 1fc30: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1fc34: 4b 01 movw r8, r22 1fc36: 5c 01 movw r10, r24 if (pid_output > PID_MAX) { 1fc38: 20 e0 ldi r18, 0x00 ; 0 1fc3a: 30 e0 ldi r19, 0x00 ; 0 1fc3c: 4f e7 ldi r20, 0x7F ; 127 1fc3e: 53 e4 ldi r21, 0x43 ; 67 1fc40: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1fc44: 20 e0 ldi r18, 0x00 ; 0 1fc46: 30 e0 ldi r19, 0x00 ; 0 1fc48: 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) { 1fc4a: 18 16 cp r1, r24 1fc4c: 0c f0 brlt .+2 ; 0x1fc50 1fc4e: 6d c1 rjmp .+730 ; 0x1ff2a if (pid_error[e] > 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1fc50: c7 01 movw r24, r14 1fc52: b6 01 movw r22, r12 1fc54: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1fc58: 18 16 cp r1, r24 1fc5a: 84 f4 brge .+32 ; 0x1fc7c 1fc5c: a7 01 movw r20, r14 1fc5e: 96 01 movw r18, r12 1fc60: 6d 85 ldd r22, Y+13 ; 0x0d 1fc62: 79 85 ldd r23, Y+9 ; 0x09 1fc64: 81 2f mov r24, r17 1fc66: 90 2f mov r25, r16 1fc68: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1fc6c: 60 93 c4 05 sts 0x05C4, r22 ; 0x8005c4 1fc70: 70 93 c5 05 sts 0x05C5, r23 ; 0x8005c5 1fc74: 80 93 c6 05 sts 0x05C6, r24 ; 0x8005c6 1fc78: 90 93 c7 05 sts 0x05C7, r25 ; 0x8005c7 pid_output=PID_MAX; 1fc7c: 81 2c mov r8, r1 1fc7e: 91 2c mov r9, r1 1fc80: 3f e7 ldi r19, 0x7F ; 127 1fc82: a3 2e mov r10, r19 1fc84: 33 e4 ldi r19, 0x43 ; 67 1fc86: 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; 1fc88: 40 92 bc 05 sts 0x05BC, r4 ; 0x8005bc 1fc8c: 50 92 bd 05 sts 0x05BD, r5 ; 0x8005bd 1fc90: 60 92 be 05 sts 0x05BE, r6 ; 0x8005be 1fc94: 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)) 1fc98: 60 91 54 02 lds r22, 0x0254 ; 0x800254 <_ZL8maxttemp.lto_priv.434> 1fc9c: 70 91 55 02 lds r23, 0x0255 ; 0x800255 <_ZL8maxttemp.lto_priv.434+0x1> 1fca0: 07 2e mov r0, r23 1fca2: 00 0c add r0, r0 1fca4: 88 0b sbc r24, r24 1fca6: 99 0b sbc r25, r25 1fca8: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1fcac: 9b 01 movw r18, r22 1fcae: ac 01 movw r20, r24 1fcb0: c3 01 movw r24, r6 1fcb2: b2 01 movw r22, r4 1fcb4: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1fcb8: 87 ff sbrs r24, 7 1fcba: 57 c1 rjmp .+686 ; 0x1ff6a 1fcbc: 23 28 or r2, r3 1fcbe: 09 f4 brne .+2 ; 0x1fcc2 1fcc0: 54 c1 rjmp .+680 ; 0x1ff6a soft_pwm[e] = (int)pid_output >> 1; 1fcc2: c5 01 movw r24, r10 1fcc4: b4 01 movw r22, r8 1fcc6: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1fcca: 75 95 asr r23 1fccc: 67 95 ror r22 1fcce: 60 93 f5 05 sts 0x05F5, r22 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.501> 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); 1fcd2: 20 91 e8 05 lds r18, 0x05E8 ; 0x8005e8 1fcd6: 30 91 e9 05 lds r19, 0x05E9 ; 0x8005e9 1fcda: 3a 83 std Y+2, r19 ; 0x02 1fcdc: 29 83 std Y+1, r18 ; 0x01 1fcde: 40 90 ea 05 lds r4, 0x05EA ; 0x8005ea 1fce2: 50 90 eb 05 lds r5, 0x05EB ; 0x8005eb 1fce6: 60 90 ec 05 lds r6, 0x05EC ; 0x8005ec 1fcea: 70 90 ed 05 lds r7, 0x05ED ; 0x8005ed #ifdef PIDTEMPBED pid_input = current; #ifndef PID_OPENLOOP pid_error_bed = target - pid_input; 1fcee: b9 01 movw r22, r18 1fcf0: 33 0f add r19, r19 1fcf2: 88 0b sbc r24, r24 1fcf4: 99 0b sbc r25, r25 1fcf6: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 1fcfa: a3 01 movw r20, r6 1fcfc: 92 01 movw r18, r4 1fcfe: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1fd02: 6b 01 movw r12, r22 1fd04: 7c 01 movw r14, r24 pTerm_bed = cs.bedKp * pid_error_bed; 1fd06: 20 91 db 0d lds r18, 0x0DDB ; 0x800ddb 1fd0a: 30 91 dc 0d lds r19, 0x0DDC ; 0x800ddc 1fd0e: 40 91 dd 0d lds r20, 0x0DDD ; 0x800ddd 1fd12: 50 91 de 0d lds r21, 0x0DDE ; 0x800dde 1fd16: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1fd1a: 6d 83 std Y+5, r22 ; 0x05 1fd1c: 7e 83 std Y+6, r23 ; 0x06 1fd1e: 8f 83 std Y+7, r24 ; 0x07 1fd20: 98 87 std Y+8, r25 ; 0x08 temp_iState_bed += pid_error_bed; 1fd22: 20 91 d1 05 lds r18, 0x05D1 ; 0x8005d1 1fd26: 30 91 d2 05 lds r19, 0x05D2 ; 0x8005d2 1fd2a: 40 91 d3 05 lds r20, 0x05D3 ; 0x8005d3 1fd2e: 50 91 d4 05 lds r21, 0x05D4 ; 0x8005d4 1fd32: c7 01 movw r24, r14 1fd34: b6 01 movw r22, r12 1fd36: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1fd3a: 5b 01 movw r10, r22 1fd3c: 8c 01 movw r16, r24 temp_iState_bed = constrain(temp_iState_bed, temp_iState_min_bed, temp_iState_max_bed); 1fd3e: 30 91 14 04 lds r19, 0x0414 ; 0x800414 <_ZL19temp_iState_min_bed.lto_priv.430> 1fd42: 3e 87 std Y+14, r19 ; 0x0e 1fd44: 80 91 15 04 lds r24, 0x0415 ; 0x800415 <_ZL19temp_iState_min_bed.lto_priv.430+0x1> 1fd48: 8d 87 std Y+13, r24 ; 0x0d 1fd4a: 30 90 16 04 lds r3, 0x0416 ; 0x800416 <_ZL19temp_iState_min_bed.lto_priv.430+0x2> 1fd4e: 20 90 17 04 lds r2, 0x0417 ; 0x800417 <_ZL19temp_iState_min_bed.lto_priv.430+0x3> 1fd52: 23 2f mov r18, r19 1fd54: 38 2f mov r19, r24 1fd56: 43 2d mov r20, r3 1fd58: 52 2d mov r21, r2 1fd5a: b5 01 movw r22, r10 1fd5c: c8 01 movw r24, r16 1fd5e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1fd62: 87 fd sbrc r24, 7 1fd64: 18 c0 rjmp .+48 ; 0x1fd96 1fd66: 90 91 10 04 lds r25, 0x0410 ; 0x800410 <_ZL19temp_iState_max_bed.lto_priv.431> 1fd6a: 9e 87 std Y+14, r25 ; 0x0e 1fd6c: 20 91 11 04 lds r18, 0x0411 ; 0x800411 <_ZL19temp_iState_max_bed.lto_priv.431+0x1> 1fd70: 2d 87 std Y+13, r18 ; 0x0d 1fd72: 30 90 12 04 lds r3, 0x0412 ; 0x800412 <_ZL19temp_iState_max_bed.lto_priv.431+0x2> 1fd76: 20 90 13 04 lds r2, 0x0413 ; 0x800413 <_ZL19temp_iState_max_bed.lto_priv.431+0x3> 1fd7a: 29 2f mov r18, r25 1fd7c: 3d 85 ldd r19, Y+13 ; 0x0d 1fd7e: 43 2d mov r20, r3 1fd80: 52 2d mov r21, r2 1fd82: b5 01 movw r22, r10 1fd84: c8 01 movw r24, r16 1fd86: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1fd8a: 18 16 cp r1, r24 1fd8c: 24 f0 brlt .+8 ; 0x1fd96 1fd8e: ae 86 std Y+14, r10 ; 0x0e 1fd90: bd 86 std Y+13, r11 ; 0x0d 1fd92: 30 2e mov r3, r16 1fd94: 21 2e mov r2, r17 1fd96: 8e 85 ldd r24, Y+14 ; 0x0e 1fd98: 9d 85 ldd r25, Y+13 ; 0x0d 1fd9a: a3 2d mov r26, r3 1fd9c: b2 2d mov r27, r2 1fd9e: 80 93 d1 05 sts 0x05D1, r24 ; 0x8005d1 1fda2: 90 93 d2 05 sts 0x05D2, r25 ; 0x8005d2 1fda6: a0 93 d3 05 sts 0x05D3, r26 ; 0x8005d3 1fdaa: b0 93 d4 05 sts 0x05D4, r27 ; 0x8005d4 iTerm_bed = cs.bedKi * temp_iState_bed; 1fdae: 20 91 df 0d lds r18, 0x0DDF ; 0x800ddf 1fdb2: 30 91 e0 0d lds r19, 0x0DE0 ; 0x800de0 1fdb6: 40 91 e1 0d lds r20, 0x0DE1 ; 0x800de1 1fdba: 50 91 e2 0d lds r21, 0x0DE2 ; 0x800de2 1fdbe: bc 01 movw r22, r24 1fdc0: 83 2d mov r24, r3 1fdc2: 92 2d mov r25, r2 1fdc4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1fdc8: 69 87 std Y+9, r22 ; 0x09 1fdca: 7a 87 std Y+10, r23 ; 0x0a 1fdcc: 8b 87 std Y+11, r24 ; 0x0b 1fdce: 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); 1fdd0: 20 91 cd 05 lds r18, 0x05CD ; 0x8005cd 1fdd4: 30 91 ce 05 lds r19, 0x05CE ; 0x8005ce 1fdd8: 40 91 cf 05 lds r20, 0x05CF ; 0x8005cf 1fddc: 50 91 d0 05 lds r21, 0x05D0 ; 0x8005d0 1fde0: c3 01 movw r24, r6 1fde2: b2 01 movw r22, r4 1fde4: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1fde8: 20 91 e3 0d lds r18, 0x0DE3 ; 0x800de3 1fdec: 30 91 e4 0d lds r19, 0x0DE4 ; 0x800de4 1fdf0: 40 91 e5 0d lds r20, 0x0DE5 ; 0x800de5 1fdf4: 50 91 e6 0d lds r21, 0x0DE6 ; 0x800de6 1fdf8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1fdfc: 20 ed ldi r18, 0xD0 ; 208 1fdfe: 3c ec ldi r19, 0xCC ; 204 1fe00: 4c e4 ldi r20, 0x4C ; 76 1fe02: 5d e3 ldi r21, 0x3D ; 61 1fe04: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1fe08: 4b 01 movw r8, r22 1fe0a: 5c 01 movw r10, r24 1fe0c: 23 e3 ldi r18, 0x33 ; 51 1fe0e: 33 e3 ldi r19, 0x33 ; 51 1fe10: 43 e7 ldi r20, 0x73 ; 115 1fe12: 5f e3 ldi r21, 0x3F ; 63 1fe14: 60 91 c9 05 lds r22, 0x05C9 ; 0x8005c9 1fe18: 70 91 ca 05 lds r23, 0x05CA ; 0x8005ca 1fe1c: 80 91 cb 05 lds r24, 0x05CB ; 0x8005cb 1fe20: 90 91 cc 05 lds r25, 0x05CC ; 0x8005cc 1fe24: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 1fe28: 9b 01 movw r18, r22 1fe2a: ac 01 movw r20, r24 1fe2c: c5 01 movw r24, r10 1fe2e: b4 01 movw r22, r8 1fe30: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1fe34: 4b 01 movw r8, r22 1fe36: 5c 01 movw r10, r24 1fe38: 80 92 c9 05 sts 0x05C9, r8 ; 0x8005c9 1fe3c: 90 92 ca 05 sts 0x05CA, r9 ; 0x8005ca 1fe40: a0 92 cb 05 sts 0x05CB, r10 ; 0x8005cb 1fe44: b0 92 cc 05 sts 0x05CC, r11 ; 0x8005cc temp_dState_bed = pid_input; 1fe48: 40 92 cd 05 sts 0x05CD, r4 ; 0x8005cd 1fe4c: 50 92 ce 05 sts 0x05CE, r5 ; 0x8005ce 1fe50: 60 92 cf 05 sts 0x05CF, r6 ; 0x8005cf 1fe54: 70 92 d0 05 sts 0x05D0, r7 ; 0x8005d0 pid_output = pTerm_bed + iTerm_bed - dTerm_bed; 1fe58: 29 85 ldd r18, Y+9 ; 0x09 1fe5a: 3a 85 ldd r19, Y+10 ; 0x0a 1fe5c: 4b 85 ldd r20, Y+11 ; 0x0b 1fe5e: 5c 85 ldd r21, Y+12 ; 0x0c 1fe60: 6d 81 ldd r22, Y+5 ; 0x05 1fe62: 7e 81 ldd r23, Y+6 ; 0x06 1fe64: 8f 81 ldd r24, Y+7 ; 0x07 1fe66: 98 85 ldd r25, Y+8 ; 0x08 1fe68: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 1fe6c: a5 01 movw r20, r10 1fe6e: 94 01 movw r18, r8 1fe70: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1fe74: 4b 01 movw r8, r22 1fe76: 5c 01 movw r10, r24 if (pid_output > MAX_BED_POWER) { 1fe78: 20 e0 ldi r18, 0x00 ; 0 1fe7a: 30 e0 ldi r19, 0x00 ; 0 1fe7c: 4f e7 ldi r20, 0x7F ; 127 1fe7e: 53 e4 ldi r21, 0x43 ; 67 1fe80: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1fe84: 20 e0 ldi r18, 0x00 ; 0 1fe86: 30 e0 ldi r19, 0x00 ; 0 1fe88: 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) { 1fe8a: 18 16 cp r1, r24 1fe8c: 0c f0 brlt .+2 ; 0x1fe90 1fe8e: 70 c0 rjmp .+224 ; 0x1ff70 if (pid_error_bed > 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1fe90: c7 01 movw r24, r14 1fe92: b6 01 movw r22, r12 1fe94: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 1fe98: 18 16 cp r1, r24 1fe9a: 84 f4 brge .+32 ; 0x1febc 1fe9c: a7 01 movw r20, r14 1fe9e: 96 01 movw r18, r12 1fea0: 6e 85 ldd r22, Y+14 ; 0x0e 1fea2: 7d 85 ldd r23, Y+13 ; 0x0d 1fea4: 83 2d mov r24, r3 1fea6: 92 2d mov r25, r2 1fea8: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1feac: 60 93 d1 05 sts 0x05D1, r22 ; 0x8005d1 1feb0: 70 93 d2 05 sts 0x05D2, r23 ; 0x8005d2 1feb4: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 1feb8: 90 93 d4 05 sts 0x05D4, r25 ; 0x8005d4 pid_output=MAX_BED_POWER; 1febc: 81 2c mov r8, r1 1febe: 91 2c mov r9, r1 1fec0: 9f e7 ldi r25, 0x7F ; 127 1fec2: a9 2e mov r10, r25 1fec4: 93 e4 ldi r25, 0x43 ; 67 1fec6: b9 2e mov r11, r25 #else pid_output = constrain(target, 0, MAX_BED_POWER); #endif //PID_OPENLOOP if(current < BED_MAXTEMP) 1fec8: 20 e0 ldi r18, 0x00 ; 0 1feca: 30 e0 ldi r19, 0x00 ; 0 1fecc: 4a ef ldi r20, 0xFA ; 250 1fece: 52 e4 ldi r21, 0x42 ; 66 1fed0: c3 01 movw r24, r6 1fed2: b2 01 movw r22, r4 1fed4: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1fed8: 87 ff sbrs r24, 7 1feda: 6d c0 rjmp .+218 ; 0x1ffb6 { soft_pwm_bed = (int)pid_output >> 1; 1fedc: c5 01 movw r24, r10 1fede: b4 01 movw r22, r8 1fee0: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 1fee4: 75 95 asr r23 1fee6: 67 95 ror r22 1fee8: 60 93 ee 05 sts 0x05EE, r22 ; 0x8005ee soft_pwm_bed = 0; WRITE(HEATER_BED_PIN,LOW); } #endif //BED_LIMIT_SWITCHING if(target==0) 1feec: 89 81 ldd r24, Y+1 ; 0x01 1feee: 9a 81 ldd r25, Y+2 ; 0x02 1fef0: 89 2b or r24, r25 1fef2: 11 f4 brne .+4 ; 0x1fef8 { soft_pwm_bed = 0; 1fef4: 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); } 1fef8: 2e 96 adiw r28, 0x0e ; 14 1fefa: 0f b6 in r0, 0x3f ; 63 1fefc: f8 94 cli 1fefe: de bf out 0x3e, r29 ; 62 1ff00: 0f be out 0x3f, r0 ; 63 1ff02: cd bf out 0x3d, r28 ; 61 1ff04: df 91 pop r29 1ff06: cf 91 pop r28 1ff08: 1f 91 pop r17 1ff0a: 0f 91 pop r16 1ff0c: ff 90 pop r15 1ff0e: ef 90 pop r14 1ff10: df 90 pop r13 1ff12: cf 90 pop r12 1ff14: bf 90 pop r11 1ff16: af 90 pop r10 1ff18: 9f 90 pop r9 1ff1a: 8f 90 pop r8 1ff1c: 7f 90 pop r7 1ff1e: 6f 90 pop r6 1ff20: 5f 90 pop r5 1ff22: 4f 90 pop r4 1ff24: 3f 90 pop r3 1ff26: 2f 90 pop r2 1ff28: 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) { 1ff2a: c5 01 movw r24, r10 1ff2c: b4 01 movw r22, r8 1ff2e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1ff32: 87 ff sbrs r24, 7 1ff34: a9 ce rjmp .-686 ; 0x1fc88 if (pid_error[e] < 0 ) iState_sum[e] -= pid_error[e]; // conditional un-integration 1ff36: 20 e0 ldi r18, 0x00 ; 0 1ff38: 30 e0 ldi r19, 0x00 ; 0 1ff3a: a9 01 movw r20, r18 1ff3c: c7 01 movw r24, r14 1ff3e: b6 01 movw r22, r12 1ff40: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1ff44: 87 ff sbrs r24, 7 1ff46: a3 cd rjmp .-1210 ; 0x1fa8e 1ff48: a7 01 movw r20, r14 1ff4a: 96 01 movw r18, r12 1ff4c: 6d 85 ldd r22, Y+13 ; 0x0d 1ff4e: 79 85 ldd r23, Y+9 ; 0x09 1ff50: 81 2f mov r24, r17 1ff52: 90 2f mov r25, r16 1ff54: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1ff58: 60 93 c4 05 sts 0x05C4, r22 ; 0x8005c4 1ff5c: 70 93 c5 05 sts 0x05C5, r23 ; 0x8005c5 1ff60: 80 93 c6 05 sts 0x05C6, r24 ; 0x8005c6 1ff64: 90 93 c7 05 sts 0x05C7, r25 ; 0x8005c7 1ff68: 92 cd rjmp .-1244 ; 0x1fa8e // 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; 1ff6a: 10 92 f5 05 sts 0x05F5, r1 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.501> 1ff6e: b1 ce rjmp .-670 ; 0x1fcd2 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){ 1ff70: c5 01 movw r24, r10 1ff72: b4 01 movw r22, r8 1ff74: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1ff78: 87 ff sbrs r24, 7 1ff7a: a6 cf rjmp .-180 ; 0x1fec8 if (pid_error_bed < 0 ) temp_iState_bed -= pid_error_bed; // conditional un-integration 1ff7c: 20 e0 ldi r18, 0x00 ; 0 1ff7e: 30 e0 ldi r19, 0x00 ; 0 1ff80: a9 01 movw r20, r18 1ff82: c7 01 movw r24, r14 1ff84: b6 01 movw r22, r12 1ff86: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 1ff8a: 87 ff sbrs r24, 7 1ff8c: 10 c0 rjmp .+32 ; 0x1ffae 1ff8e: a7 01 movw r20, r14 1ff90: 96 01 movw r18, r12 1ff92: 6e 85 ldd r22, Y+14 ; 0x0e 1ff94: 7d 85 ldd r23, Y+13 ; 0x0d 1ff96: 83 2d mov r24, r3 1ff98: 92 2d mov r25, r2 1ff9a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 1ff9e: 60 93 d1 05 sts 0x05D1, r22 ; 0x8005d1 1ffa2: 70 93 d2 05 sts 0x05D2, r23 ; 0x8005d2 1ffa6: 80 93 d3 05 sts 0x05D3, r24 ; 0x8005d3 1ffaa: 90 93 d4 05 sts 0x05D4, r25 ; 0x8005d4 pid_output=0; 1ffae: 81 2c mov r8, r1 1ffb0: 91 2c mov r9, r1 1ffb2: 54 01 movw r10, r8 1ffb4: 89 cf rjmp .-238 ; 0x1fec8 { soft_pwm_bed = (int)pid_output >> 1; } else { soft_pwm_bed = 0; 1ffb6: 10 92 ee 05 sts 0x05EE, r1 ; 0x8005ee 1ffba: 98 cf rjmp .-208 ; 0x1feec 0001ffbc : } static void setIsrTargetTemperatures() { for(uint8_t e=0;e 1ffc0: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 1ffc4: 90 93 f0 05 sts 0x05F0, r25 ; 0x8005f0 1ffc8: 80 93 ef 05 sts 0x05EF, r24 ; 0x8005ef target_temperature_bed_isr = target_temperature_bed; 1ffcc: 80 91 59 12 lds r24, 0x1259 ; 0x801259 1ffd0: 90 91 5a 12 lds r25, 0x125A ; 0x80125a 1ffd4: 90 93 e9 05 sts 0x05E9, r25 ; 0x8005e9 1ffd8: 80 93 e8 05 sts 0x05E8, r24 ; 0x8005e8 } 1ffdc: 08 95 ret 0001ffde : /* 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() { 1ffde: cf 93 push r28 { bool temp_mgr_state; public: TempMgrGuard() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 1ffe0: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 1ffe2: f8 94 cli temp_mgr_state = TEMP_MGR_INTERRUPT_STATE(); 1ffe4: c0 91 71 00 lds r28, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1ffe8: c2 70 andi r28, 0x02 ; 2 DISABLE_TEMP_MGR_INTERRUPT(); 1ffea: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 1ffee: 8d 7f andi r24, 0xFD ; 253 1fff0: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 1fff4: 9f bf out 0x3f, r25 ; 63 } static void setCurrentTemperaturesFromIsr() { for(uint8_t e=0;e 1fffa: 90 91 f2 05 lds r25, 0x05F2 ; 0x8005f2 1fffe: a0 91 f3 05 lds r26, 0x05F3 ; 0x8005f3 20002: b0 91 f4 05 lds r27, 0x05F4 ; 0x8005f4 20006: 80 93 5a 0d sts 0x0D5A, r24 ; 0x800d5a 2000a: 90 93 5b 0d sts 0x0D5B, r25 ; 0x800d5b 2000e: a0 93 5c 0d sts 0x0D5C, r26 ; 0x800d5c 20012: b0 93 5d 0d sts 0x0D5D, r27 ; 0x800d5d current_temperature_bed = current_temperature_bed_isr; 20016: 80 91 ea 05 lds r24, 0x05EA ; 0x8005ea 2001a: 90 91 eb 05 lds r25, 0x05EB ; 0x8005eb 2001e: a0 91 ec 05 lds r26, 0x05EC ; 0x8005ec 20022: b0 91 ed 05 lds r27, 0x05ED ; 0x8005ed 20026: 80 93 bc 03 sts 0x03BC, r24 ; 0x8003bc 2002a: 90 93 bd 03 sts 0x03BD, r25 ; 0x8003bd 2002e: a0 93 be 03 sts 0x03BE, r26 ; 0x8003be 20032: b0 93 bf 03 sts 0x03BF, r27 ; 0x8003bf #ifdef PINDA_THERMISTOR current_temperature_pinda = current_temperature_pinda_isr; 20036: 80 91 d6 05 lds r24, 0x05D6 ; 0x8005d6 2003a: 90 91 d7 05 lds r25, 0x05D7 ; 0x8005d7 2003e: a0 91 d8 05 lds r26, 0x05D8 ; 0x8005d8 20042: b0 91 d9 05 lds r27, 0x05D9 ; 0x8005d9 20046: 80 93 85 03 sts 0x0385, r24 ; 0x800385 2004a: 90 93 86 03 sts 0x0386, r25 ; 0x800386 2004e: a0 93 87 03 sts 0x0387, r26 ; 0x800387 20052: 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) { 20056: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 2005a: 81 11 cpse r24, r1 2005c: 02 c0 rjmp .+4 ; 0x20062 // refuse to update target temperatures in any error condition! setIsrTargetTemperatures(); 2005e: 0e 94 de ff call 0x1ffbc ; 0x1ffbc } temp_meas_ready = false; 20062: 10 92 d5 05 sts 0x05D5, r1 ; 0x8005d5 DISABLE_TEMP_MGR_INTERRUPT(); } } ~TempMgrGuard() throw() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 20066: 9f b7 in r25, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 20068: f8 94 cli if(temp_mgr_state) ENABLE_TEMP_MGR_INTERRUPT(); 2006a: cc 23 and r28, r28 2006c: 29 f0 breq .+10 ; 0x20078 2006e: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 20072: 82 60 ori r24, 0x02 ; 2 20074: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 20078: 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; } 2007a: cf 91 pop r28 2007c: 08 95 ret 0002007e : { // 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) 2007e: 81 30 cpi r24, 0x01 ; 1 20080: 61 f1 breq .+88 ; 0x200da 20082: 20 f0 brcs .+8 ; 0x2008c 20084: 82 30 cpi r24, 0x02 ; 2 20086: 09 f4 brne .+2 ; 0x2008a 20088: 4b c0 rjmp .+150 ; 0x20120 2008a: 08 95 ret { case X_AXIS: { enable_x(); 2008c: 17 98 cbi 0x02, 7 ; 2 uint8_t old_x_dir_pin = READ(X_DIR_PIN); //if dualzstepper, both point to same direction. 2008e: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 20092: 81 e0 ldi r24, 0x01 ; 1 20094: 29 2f mov r18, r25 20096: 22 70 andi r18, 0x02 ; 2 20098: 91 ff sbrs r25, 1 2009a: 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) { 2009c: 86 17 cp r24, r22 2009e: 59 f0 breq .+22 ; 0x200b6 WRITE_NC(X_DIR_PIN, new_x_dir_pin); 200a0: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 200a4: 66 23 and r22, r22 200a6: a9 f0 breq .+42 ; 0x200d2 200a8: 82 60 ori r24, 0x02 ; 2 200aa: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> #endif // busy wait __asm__ __volatile__ ( 200ae: 8b e8 ldi r24, 0x8B ; 139 200b0: 91 e0 ldi r25, 0x01 ; 1 200b2: 01 97 sbiw r24, 0x01 ; 1 200b4: f1 f7 brne .-4 ; 0x200b2 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(X_AXIS); 200b6: 40 9a sbi 0x08, 0 ; 8 200b8: 83 e0 ldi r24, 0x03 ; 3 200ba: 90 e0 ldi r25, 0x00 ; 0 200bc: 01 97 sbiw r24, 0x01 ; 1 200be: f1 f7 brne .-4 ; 0x200bc #ifdef DEBUG_XSTEP_DUP_PIN STEP_NC_HI(X_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(X_AXIS); 200c0: 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); 200c2: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 200c6: 22 23 and r18, r18 200c8: 31 f0 breq .+12 ; 0x200d6 200ca: 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); 200cc: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> } break; default: break; } } 200d0: 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); 200d2: 8d 7f andi r24, 0xFD ; 253 200d4: ea cf rjmp .-44 ; 0x200aa #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); 200d6: 8d 7f andi r24, 0xFD ; 253 200d8: f9 cf rjmp .-14 ; 0x200cc } break; case Y_AXIS: { enable_y(); 200da: 16 98 cbi 0x02, 6 ; 2 uint8_t old_y_dir_pin = READ(Y_DIR_PIN); //if dualzstepper, both point to same direction. 200dc: 80 91 09 01 lds r24, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 200e0: 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) { 200e2: 86 17 cp r24, r22 200e4: 59 f0 breq .+22 ; 0x200fc WRITE_NC(Y_DIR_PIN, new_y_dir_pin); 200e6: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 200ea: 66 23 and r22, r22 200ec: 99 f0 breq .+38 ; 0x20114 200ee: 91 60 ori r25, 0x01 ; 1 200f0: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 200f4: eb e8 ldi r30, 0x8B ; 139 200f6: f1 e0 ldi r31, 0x01 ; 1 200f8: 31 97 sbiw r30, 0x01 ; 1 200fa: f1 f7 brne .-4 ; 0x200f8 delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Y_AXIS); 200fc: 41 9a sbi 0x08, 1 ; 8 200fe: e3 e0 ldi r30, 0x03 ; 3 20100: f0 e0 ldi r31, 0x00 ; 0 20102: 31 97 sbiw r30, 0x01 ; 1 20104: f1 f7 brne .-4 ; 0x20102 #ifdef DEBUG_YSTEP_DUP_PIN STEP_NC_HI(Y_DUP_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Y_AXIS); 20106: 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); 20108: 88 23 and r24, r24 2010a: 31 f0 breq .+12 ; 0x20118 2010c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20110: 81 60 ori r24, 0x01 ; 1 20112: dc cf rjmp .-72 ; 0x200cc 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); 20114: 9e 7f andi r25, 0xFE ; 254 20116: ec cf rjmp .-40 ; 0x200f0 #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); 20118: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 2011c: 8e 7f andi r24, 0xFE ; 254 2011e: d6 cf rjmp .-84 ; 0x200cc } break; case Z_AXIS: { enable_z(); 20120: 15 98 cbi 0x02, 5 ; 2 uint8_t old_z_dir_pin = READ(Z_DIR_PIN); //if dualzstepper, both point to same direction. 20122: 90 91 09 01 lds r25, 0x0109 ; 0x800109 <__TEXT_REGION_LENGTH__+0x7c2109> 20126: 81 e0 ldi r24, 0x01 ; 1 20128: 29 2f mov r18, r25 2012a: 24 70 andi r18, 0x04 ; 4 2012c: 92 ff sbrs r25, 2 2012e: 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) { 20130: 68 17 cp r22, r24 20132: 59 f0 breq .+22 ; 0x2014a WRITE_NC(Z_DIR_PIN, new_z_dir_pin); 20134: 90 91 0b 01 lds r25, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20138: 66 23 and r22, r22 2013a: b1 f0 breq .+44 ; 0x20168 2013c: 94 60 ori r25, 0x04 ; 4 2013e: 90 93 0b 01 sts 0x010B, r25 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20142: eb e8 ldi r30, 0x8B ; 139 20144: f1 e0 ldi r31, 0x01 ; 1 20146: 31 97 sbiw r30, 0x01 ; 1 20148: f1 f7 brne .-4 ; 0x20146 #endif delayMicroseconds(STEPPER_SET_DIR_DELAY); } //perform step STEP_NC_HI(Z_AXIS); 2014a: 42 9a sbi 0x08, 2 ; 8 2014c: e3 e0 ldi r30, 0x03 ; 3 2014e: f0 e0 ldi r31, 0x00 ; 0 20150: 31 97 sbiw r30, 0x01 ; 1 20152: f1 f7 brne .-4 ; 0x20150 #ifdef Z_DUAL_STEPPER_DRIVERS STEP_NC_HI(Z2_AXIS); #endif STEPPER_MINIMUM_DELAY; STEP_NC_LO(Z_AXIS); 20154: 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) { 20156: 68 17 cp r22, r24 20158: 09 f4 brne .+2 ; 0x2015c 2015a: ba cf rjmp .-140 ; 0x200d0 WRITE_NC(Z_DIR_PIN, old_z_dir_pin); 2015c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 20160: 22 23 and r18, r18 20162: 21 f0 breq .+8 ; 0x2016c 20164: 84 60 ori r24, 0x04 ; 4 20166: b2 cf rjmp .-156 ; 0x200cc 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); 20168: 9b 7f andi r25, 0xFB ; 251 2016a: e9 cf rjmp .-46 ; 0x2013e 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); 2016c: 8b 7f andi r24, 0xFB ; 251 2016e: ae cf rjmp .-164 ; 0x200cc 00020170 : } } static void checkRx(void) { if (selectedSerialPort == 0) { 20170: 80 91 1c 06 lds r24, 0x061C ; 0x80061c 20174: 81 11 cpse r24, r1 20176: 25 c0 rjmp .+74 ; 0x201c2 if((M_UCSRxA & (1< 2017c: 87 ff sbrs r24, 7 2017e: 3d c0 rjmp .+122 ; 0x201fa // Test for a framing error. if (M_UCSRxA & (1< 20184: 84 ff sbrs r24, 4 20186: 03 c0 rjmp .+6 ; 0x2018e // 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); 20188: 80 91 c6 00 lds r24, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> 2018c: 08 95 ret } else { unsigned char c = M_UDRx; 2018e: 40 91 c6 00 lds r20, 0x00C6 ; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7c20c6> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 20192: 20 91 42 05 lds r18, 0x0542 ; 0x800542 20196: 30 91 43 05 lds r19, 0x0543 ; 0x800543 2019a: c9 01 movw r24, r18 2019c: 01 96 adiw r24, 0x01 ; 1 2019e: 8f 77 andi r24, 0x7F ; 127 201a0: 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) { 201a2: 60 91 44 05 lds r22, 0x0544 ; 0x800544 201a6: 70 91 45 05 lds r23, 0x0545 ; 0x800545 201aa: 86 17 cp r24, r22 201ac: 97 07 cpc r25, r23 201ae: 29 f1 breq .+74 ; 0x201fa // 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; 201b0: 2e 53 subi r18, 0x3E ; 62 201b2: 3b 4f sbci r19, 0xFB ; 251 201b4: f9 01 movw r30, r18 201b6: 40 83 st Z, r20 rx_buffer.head = i; 201b8: 90 93 43 05 sts 0x0543, r25 ; 0x800543 201bc: 80 93 42 05 sts 0x0542, r24 ; 0x800542 201c0: 1c c0 rjmp .+56 ; 0x201fa UDR1 = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } else { // if(selectedSerialPort == 1) { if((UCSR1A & (1< 201c6: 87 ff sbrs r24, 7 201c8: 18 c0 rjmp .+48 ; 0x201fa // Test for a framing error. if (UCSR1A & (1< 201ce: 84 ff sbrs r24, 4 201d0: 03 c0 rjmp .+6 ; 0x201d8 // 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); 201d2: 80 91 ce 00 lds r24, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> 201d6: 08 95 ret } else { unsigned char c = UDR1; 201d8: 40 91 ce 00 lds r20, 0x00CE ; 0x8000ce <__TEXT_REGION_LENGTH__+0x7c20ce> int i = (unsigned int)(rx_buffer.head + 1) % RX_BUFFER_SIZE; 201dc: 20 91 42 05 lds r18, 0x0542 ; 0x800542 201e0: 30 91 43 05 lds r19, 0x0543 ; 0x800543 201e4: c9 01 movw r24, r18 201e6: 01 96 adiw r24, 0x01 ; 1 201e8: 8f 77 andi r24, 0x7F ; 127 201ea: 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) { 201ec: 60 91 44 05 lds r22, 0x0544 ; 0x800544 201f0: 70 91 45 05 lds r23, 0x0545 ; 0x800545 201f4: 68 17 cp r22, r24 201f6: 79 07 cpc r23, r25 201f8: d9 f6 brne .-74 ; 0x201b0 M_UDRx = c; #endif //DEBUG_DUMP_TO_2ND_SERIAL } } } } 201fa: 08 95 ret 000201fc : static void Sound_DoSound_Alert(bool bOnce) { uint8_t nI,nMax; nMax=bOnce?1:3; 201fc: 23 e0 ldi r18, 0x03 ; 3 201fe: 81 11 cpse r24, r1 20200: 21 e0 ldi r18, 0x01 ; 1 for(nI=0;nI 20214: 94 60 ori r25, 0x04 ; 4 20216: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2021a: 3f bf out 0x3f, r19 ; 63 2021c: fb 01 movw r30, r22 2021e: 31 97 sbiw r30, 0x01 ; 1 20220: f1 f7 brne .-4 ; 0x2021e delayMicroseconds(200); WRITE(BEEPER,LOW); 20222: 3f b7 in r19, 0x3f ; 63 20224: f8 94 cli 20226: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2022a: 9b 7f andi r25, 0xFB ; 251 2022c: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20230: 3f bf out 0x3f, r19 ; 63 20232: fa 01 movw r30, r20 20234: 31 97 sbiw r30, 0x01 ; 1 20236: f1 f7 brne .-4 ; 0x20234 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); } } 2023e: 08 95 ret 00020240 : delayMicroseconds(75); } } static void Sound_DoSound_Echo(void) { 20240: 8a e0 ldi r24, 0x0A ; 10 20242: 2b e8 ldi r18, 0x8B ; 139 20244: 31 e0 ldi r19, 0x01 ; 1 uint8_t nI; for(nI=0;nI<10;nI++) { WRITE(BEEPER,HIGH); 20246: 4f b7 in r20, 0x3f ; 63 20248: f8 94 cli 2024a: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2024e: 94 60 ori r25, 0x04 ; 4 20250: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20254: 4f bf out 0x3f, r20 ; 63 20256: f9 01 movw r30, r18 20258: 31 97 sbiw r30, 0x01 ; 1 2025a: f1 f7 brne .-4 ; 0x20258 delayMicroseconds(100); WRITE(BEEPER,LOW); 2025c: 4f b7 in r20, 0x3f ; 63 2025e: f8 94 cli 20260: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 20264: 9b 7f andi r25, 0xFB ; 251 20266: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2026a: 4f bf out 0x3f, r20 ; 63 2026c: f9 01 movw r30, r18 2026e: 31 97 sbiw r30, 0x01 ; 1 20270: f1 f7 brne .-4 ; 0x2026e 20272: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Echo(void) { uint8_t nI; for(nI=0;nI<10;nI++) 20274: 41 f7 brne .-48 ; 0x20246 WRITE(BEEPER,HIGH); delayMicroseconds(100); WRITE(BEEPER,LOW); delayMicroseconds(100); } } 20276: 08 95 ret 00020278 : /// 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; 20278: 86 27 eor r24, r22 2027a: 98 e0 ldi r25, 0x08 ; 8 for (uint8_t i = 0; i < 8; i++) { if ((data & 0x80U) != 0) { data <<= 1U; data ^= 0x07U; 2027c: 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) { 2027e: 38 2f mov r19, r24 20280: 88 0f add r24, r24 20282: 37 fd sbrc r19, 7 data <<= 1U; data ^= 0x07U; 20284: 82 27 eor r24, r18 20286: 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++) { 20288: d1 f7 brne .-12 ; 0x2027e } else { data <<= 1U; } } return data; } 2028a: 08 95 ret 0002028c : #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){ 2028c: cf 93 push r28 2028e: df 93 push r29 20290: cd b7 in r28, 0x3d ; 61 20292: de b7 in r29, 0x3e ; 62 20294: 2f 97 sbiw r28, 0x0f ; 15 20296: 0f b6 in r0, 0x3f ; 63 20298: f8 94 cli 2029a: de bf out 0x3e, r29 ; 62 2029c: 0f be out 0x3f, r0 ; 63 2029e: cd bf out 0x3d, r28 ; 61 202a0: fc 01 movw r30, r24 202a2: de 01 movw r26, r28 202a4: 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; 202a6: 90 e0 ldi r25, 0x00 ; 0 202a8: 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); 202aa: 84 91 lpm r24, Z 202ac: 41 e0 ldi r20, 0x01 ; 1 202ae: 49 0f add r20, r25 if( ! b ) 202b0: 88 23 and r24, r24 202b2: 29 f0 breq .+10 ; 0x202be break; dst[i] = b; 202b4: 8d 93 st X+, r24 202b6: 31 96 adiw r30, 0x01 ; 1 202b8: 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 202ba: 4d 30 cpi r20, 0x0D ; 13 202bc: b1 f7 brne .-20 ; 0x202aa uint8_t b = pgm_read_byte(ipgmLabel + i); if( ! b ) break; dst[i] = b; } dst[i] = ':'; // append the colon 202be: f9 01 movw r30, r18 202c0: e9 0f add r30, r25 202c2: f1 1d adc r31, r1 202c4: 8a e3 ldi r24, 0x3A ; 58 202c6: 80 83 st Z, r24 ++i; 202c8: 9f 5f subi r25, 0xFF ; 255 202ca: f9 01 movw r30, r18 202cc: e9 0f add r30, r25 202ce: f1 1d adc r31, r1 for(; i < dstSize - 1; ++i) // fill the rest with spaces dst[i] = ' '; 202d0: 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 202d2: 9e 30 cpi r25, 0x0E ; 14 202d4: 19 f0 breq .+6 ; 0x202dc dst[i] = ' '; 202d6: 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 202d8: 9f 5f subi r25, 0xFF ; 255 202da: fb cf rjmp .-10 ; 0x202d2 dst[i] = ' '; dst[dstSize-1] = '\0'; // terminate the string properly 202dc: 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 202de: 7f 93 push r23 202e0: 6f 93 push r22 202e2: 3f 93 push r19 202e4: 2f 93 push r18 202e6: 89 e1 ldi r24, 0x19 ; 25 202e8: 99 e9 ldi r25, 0x99 ; 153 202ea: 9f 93 push r25 202ec: 8f 93 push r24 202ee: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 202f2: 0f 90 pop r0 202f4: 0f 90 pop r0 202f6: 0f 90 pop r0 202f8: 0f 90 pop r0 202fa: 0f 90 pop r0 202fc: 0f 90 pop r0 } 202fe: 2f 96 adiw r28, 0x0f ; 15 20300: 0f b6 in r0, 0x3f ; 63 20302: f8 94 cli 20304: de bf out 0x3e, r29 ; 62 20306: 0f be out 0x3f, r0 ; 63 20308: cd bf out 0x3d, r28 ; 61 2030a: df 91 pop r29 2030c: cf 91 pop r28 2030e: 08 95 ret 00020310 : //! | | //! | | //! ---------------------- //! @endcode void lcd_menu_extruder_info() // NOT static due to using inside "Marlin_main" module ("manage_inactivity()") { 20310: df 92 push r13 20312: ef 92 push r14 20314: ff 92 push r15 20316: 0f 93 push r16 20318: 1f 93 push r17 2031a: cf 93 push r28 2031c: df 93 push r29 2031e: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 20322: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 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] ); 20326: c7 eb ldi r28, 0xB7 ; 183 20328: d3 e0 ldi r29, 0x03 ; 3 2032a: 8a 81 ldd r24, Y+2 ; 0x02 2032c: 9b 81 ldd r25, Y+3 ; 0x03 2032e: 2c e3 ldi r18, 0x3C ; 60 20330: f2 2e mov r15, r18 20332: f8 9e mul r15, r24 20334: 80 01 movw r16, r0 20336: f9 9e mul r15, r25 20338: 10 0d add r17, r0 2033a: 11 24 eor r1, r1 2033c: 87 e2 ldi r24, 0x27 ; 39 2033e: 9a e4 ldi r25, 0x4A ; 74 20340: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20344: e8 2e mov r14, r24 20346: d9 2e mov r13, r25 20348: 88 81 ld r24, Y 2034a: 99 81 ldd r25, Y+1 ; 0x01 2034c: f8 9e mul r15, r24 2034e: e0 01 movw r28, r0 20350: f9 9e mul r15, r25 20352: d0 0d add r29, r0 20354: 11 24 eor r1, r1 20356: 84 e3 ldi r24, 0x34 ; 52 20358: 9a e4 ldi r25, 0x4A ; 74 2035a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2035e: 1f 93 push r17 20360: 0f 93 push r16 20362: df 92 push r13 20364: ef 92 push r14 20366: df 93 push r29 20368: cf 93 push r28 2036a: 9f 93 push r25 2036c: 8f 93 push r24 2036e: 8f e8 ldi r24, 0x8F ; 143 20370: 98 e9 ldi r25, 0x98 ; 152 20372: 9f 93 push r25 20374: 8f 93 push r24 20376: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 menu_back_if_clicked(); 2037a: 8d b7 in r24, 0x3d ; 61 2037c: 9e b7 in r25, 0x3e ; 62 2037e: 0a 96 adiw r24, 0x0a ; 10 20380: 0f b6 in r0, 0x3f ; 63 20382: f8 94 cli 20384: 9e bf out 0x3e, r25 ; 62 20386: 0f be out 0x3f, r0 ; 63 20388: 8d bf out 0x3d, r24 ; 61 } 2038a: df 91 pop r29 2038c: cf 91 pop r28 2038e: 1f 91 pop r17 20390: 0f 91 pop r16 20392: ff 90 pop r15 20394: ef 90 pop r14 20396: 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(); 20398: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae 0002039c : //! | PINDA: 000D| MSG_PINDA c=14 //! ---------------------- //! D - Degree sysmbol LCD_STR_DEGREE //! @endcode static void lcd_menu_temperatures() { 2039c: cf 92 push r12 2039e: df 92 push r13 203a0: ef 92 push r14 203a2: ff 92 push r15 203a4: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 203a8: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 lcd_menu_temperatures_line( _T(MSG_NOZZLE), (int)current_temperature[0] ); 203ac: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 203b0: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 203b4: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 203b8: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 203bc: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 203c0: 6b 01 movw r12, r22 203c2: 85 ee ldi r24, 0xE5 ; 229 203c4: 94 e4 ldi r25, 0x44 ; 68 203c6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 203ca: b6 01 movw r22, r12 203cc: 0f 94 46 01 call 0x2028c ; 0x2028c lcd_menu_temperatures_line( _T(MSG_BED), (int)current_temperature_bed ); 203d0: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 203d4: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 203d8: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 203dc: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 203e0: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 203e4: 6b 01 movw r12, r22 203e6: 8a ec ldi r24, 0xCA ; 202 203e8: 94 e4 ldi r25, 0x44 ; 68 203ea: 0e 94 8b 75 call 0xeb16 ; 0xeb16 203ee: b6 01 movw r22, r12 203f0: 0f 94 46 01 call 0x2028c ; 0x2028c #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 203f4: 60 91 85 03 lds r22, 0x0385 ; 0x800385 203f8: 70 91 86 03 lds r23, 0x0386 ; 0x800386 203fc: 80 91 87 03 lds r24, 0x0387 ; 0x800387 20400: 90 91 88 03 lds r25, 0x0388 ; 0x800388 20404: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 20408: 8a e7 ldi r24, 0x7A ; 122 2040a: 98 e6 ldi r25, 0x68 ; 104 2040c: 0f 94 46 01 call 0x2028c ; 0x2028c #endif //PINDA_THERMISTOR menu_back_if_clicked(); } 20410: ff 90 pop r15 20412: ef 90 pop r14 20414: df 90 pop r13 20416: 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(); 20418: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae 0002041c : } #ifdef FILAMENT_SENSOR static void lcd_menu_AutoLoadFilament() { lcd_display_message_fullscreen_nonBlocking_P(_T(MSG_AUTOLOADING_ENABLED)); 2041c: 80 e1 ldi r24, 0x10 ; 16 2041e: 99 e5 ldi r25, 0x59 ; 89 20420: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20424: 0e 94 06 de call 0x1bc0c ; 0x1bc0c menu_back_if_clicked(); 20428: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae 0002042c : } } #endif //MMU_HAS_CUTTER bool shouldPreheatOnlyNozzle() { uint8_t eeprom_setting = eeprom_read_byte((uint8_t*)EEPROM_HEAT_BED_ON_LOAD_FILAMENT); 2042c: 87 ea ldi r24, 0xA7 ; 167 2042e: 9c e0 ldi r25, 0x0C ; 12 20430: 0f 94 81 a4 call 0x34902 ; 0x34902 if (eeprom_setting != 0) 20434: 81 11 cpse r24, r1 20436: 05 c0 rjmp .+10 ; 0x20442 return false; switch(eFilamentAction) { 20438: 80 91 94 03 lds r24, 0x0394 ; 0x800394 2043c: 81 50 subi r24, 0x01 ; 1 2043e: 88 30 cpi r24, 0x08 ; 8 20440: 10 f0 brcs .+4 ; 0x20446 #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; 20442: 80 e0 ldi r24, 0x00 ; 0 20444: 08 95 ret case FilamentAction::MmuLoad: case FilamentAction::MmuUnLoad: case FilamentAction::MmuLoadingTest: case FilamentAction::MmuEject: case FilamentAction::MmuCut: return true; 20446: 81 e0 ldi r24, 0x01 ; 1 default: return false; } } 20448: 08 95 ret 0002044a : //! | 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() { 2044a: cf 92 push r12 2044c: df 92 push r13 2044e: ef 92 push r14 20450: ff 92 push r15 20452: 0f 93 push r16 20454: 1f 93 push r17 20456: cf 93 push r28 20458: df 93 push r29 2045a: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 2045e: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 " %-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) )); 20462: 8f ec ldi r24, 0xCF ; 207 20464: 9e e0 ldi r25, 0x0E ; 14 20466: 0f 94 81 a4 call 0x34902 ; 0x34902 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 2046a: 90 e0 ldi r25, 0x00 ; 0 2046c: 0e 94 cd fc call 0x1f99a ; 0x1f99a 20470: d8 2e mov r13, r24 20472: c9 2e mov r12, r25 20474: 82 e6 ldi r24, 0x62 ; 98 20476: 97 e5 ldi r25, 0x57 ; 87 20478: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2047c: f8 2e mov r15, r24 2047e: 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) ), 20480: 82 ed ldi r24, 0xD2 ; 210 20482: 9e e0 ldi r25, 0x0E ; 14 20484: 0f 94 81 a4 call 0x34902 ; 0x34902 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu_print() { lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); lcd_printf_P( 20488: 90 e0 ldi r25, 0x00 ; 0 2048a: 0e 94 cd fc call 0x1f99a ; 0x1f99a 2048e: 18 2f mov r17, r24 20490: 09 2f mov r16, r25 20492: 86 e5 ldi r24, 0x56 ; 86 20494: 97 e5 ldi r25, 0x57 ; 87 20496: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2049a: ec 01 movw r28, r24 2049c: 88 e9 ldi r24, 0x98 ; 152 2049e: 97 e5 ldi r25, 0x57 ; 87 204a0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 204a4: cf 92 push r12 204a6: df 92 push r13 204a8: ef 92 push r14 204aa: ff 92 push r15 204ac: 0f 93 push r16 204ae: 1f 93 push r17 204b0: df 93 push r29 204b2: cf 93 push r28 204b4: 9f 93 push r25 204b6: 8f 93 push r24 204b8: 8a ea ldi r24, 0xAA ; 170 204ba: 98 e9 ldi r25, 0x98 ; 152 204bc: 9f 93 push r25 204be: 8f 93 push r24 204c0: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 " %-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(); 204c4: 8d b7 in r24, 0x3d ; 61 204c6: 9e b7 in r25, 0x3e ; 62 204c8: 0c 96 adiw r24, 0x0c ; 12 204ca: 0f b6 in r0, 0x3f ; 63 204cc: f8 94 cli 204ce: 9e bf out 0x3e, r25 ; 62 204d0: 0f be out 0x3f, r0 ; 63 204d2: 8d bf out 0x3d, r24 ; 61 } 204d4: df 91 pop r29 204d6: cf 91 pop r28 204d8: 1f 91 pop r17 204da: 0f 91 pop r16 204dc: ff 90 pop r15 204de: ef 90 pop r14 204e0: df 90 pop r13 204e2: 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(); 204e4: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae 000204e8 : //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 204e8: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 204ec: 10 92 60 04 sts 0x0460, r1 ; 0x800460 204f0: 80 91 60 04 lds r24, 0x0460 ; 0x800460 204f4: 84 30 cpi r24, 0x04 ; 4 204f6: 68 f5 brcc .+90 ; 0x20552 204f8: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 204fc: 89 ef ldi r24, 0xF9 ; 249 204fe: 98 e4 ldi r25, 0x48 ; 72 20500: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20504: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_SUBMENU_P(_T(MSG_LAST_PRINT), lcd_menu_fails_stats_mmu_print); 20508: 89 e4 ldi r24, 0x49 ; 73 2050a: 97 e5 ldi r25, 0x57 ; 87 2050c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20510: 64 e2 ldi r22, 0x24 ; 36 20512: 78 e3 ldi r23, 0x38 ; 56 20514: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_TOTAL), lcd_menu_fails_stats_mmu_total); 20518: 81 e4 ldi r24, 0x41 ; 65 2051a: 97 e5 ldi r25, 0x57 ; 87 2051c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20520: 62 e0 ldi r22, 0x02 ; 2 20522: 79 e3 ldi r23, 0x39 ; 57 20524: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_MATERIAL_CHANGES), lcd_menu_toolchange_stats_mmu_total); 20528: 85 e8 ldi r24, 0x85 ; 133 2052a: 97 e5 ldi r25, 0x57 ; 87 2052c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20530: 6a e3 ldi r22, 0x3A ; 58 20532: 78 e3 ldi r23, 0x38 ; 56 20534: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_END(); 20538: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 //! | Material changes | MSG_MATERIAL_CHANGES c=18 //! ---------------------- //! @endcode static void lcd_menu_fails_stats_mmu() { MENU_BEGIN(); 2053c: 80 91 60 04 lds r24, 0x0460 ; 0x800460 20540: 8f 5f subi r24, 0xFF ; 255 20542: 80 93 60 04 sts 0x0460, r24 ; 0x800460 20546: 80 91 62 04 lds r24, 0x0462 ; 0x800462 2054a: 8f 5f subi r24, 0xFF ; 255 2054c: 80 93 62 04 sts 0x0462, r24 ; 0x800462 20550: cf cf rjmp .-98 ; 0x204f0 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(); } 20552: 08 95 ret 00020554 : setFilamentAction(FilamentAction::None); } /// Reset the menu stack and clear the planned filament action flag static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); 20554: 80 91 15 06 lds r24, 0x0615 ; 0x800615 20558: 81 11 cpse r24, r1 2055a: 03 c0 rjmp .+6 ; 0x20562 2055c: 82 e0 ldi r24, 0x02 ; 2 2055e: 0c 94 50 63 jmp 0xc6a0 ; 0xc6a0 20562: 81 e0 ldi r24, 0x01 ; 1 20564: fc cf rjmp .-8 ; 0x2055e 00020566 : } #ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (EEPROM_MMU_CUTTER_ENABLED_enabled == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) 20566: 8e ec ldi r24, 0xCE ; 206 20568: 9e e0 ldi r25, 0x0E ; 14 2056a: 0f 94 81 a4 call 0x34902 ; 0x34902 2056e: 60 e0 ldi r22, 0x00 ; 0 20570: 81 30 cpi r24, 0x01 ; 1 20572: 09 f0 breq .+2 ; 0x20576 20574: 61 e0 ldi r22, 0x01 ; 1 20576: 8e ec ldi r24, 0xCE ; 206 20578: 9e e0 ldi r25, 0x0E ; 14 2057a: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 0002057e : MENU_END(); } void lcd_set_fan_check() { fans_check_enabled = !fans_check_enabled; 2057e: 60 91 40 02 lds r22, 0x0240 ; 0x800240 20582: 81 e0 ldi r24, 0x01 ; 1 20584: 68 27 eor r22, r24 20586: 60 93 40 02 sts 0x0240, r22 ; 0x800240 2058a: 87 e8 ldi r24, 0x87 ; 135 2058c: 9f e0 ldi r25, 0x0F ; 15 2058e: 0f 94 a5 a4 call 0x3494a ; 0x3494a 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. 20592: 80 91 40 02 lds r24, 0x0240 ; 0x800240 20596: 81 11 cpse r24, r1 20598: 02 c0 rjmp .+4 ; 0x2059e 2059a: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce #endif //FANCHECK } 2059e: 08 95 ret 000205a0 : } } void SpoolJoin::toggleSpoolJoin() { if (eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Disabled) 205a0: 86 ed ldi r24, 0xD6 ; 214 205a2: 9e e0 ldi r25, 0x0E ; 14 205a4: 0f 94 81 a4 call 0x34902 ; 0x34902 205a8: 61 e0 ldi r22, 0x01 ; 1 205aa: 82 30 cpi r24, 0x02 ; 2 205ac: 09 f0 breq .+2 ; 0x205b0 205ae: 62 e0 ldi r22, 0x02 ; 2 205b0: 86 ed ldi r24, 0xD6 ; 214 205b2: 9e e0 ldi r25, 0x0E ; 14 205b4: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 000205b8 : #ifdef MENU_SERIAL_DUMP #include "Dcodes.h" static void lcd_serial_dump() { serial_dump_and_reset(dump_crash_reason::manual); 205b8: 80 e0 ldi r24, 0x00 ; 0 205ba: 0c 94 f2 84 jmp 0x109e4 ; 0x109e4 000205be : //! | Debug | c=18 //! @endcode //! ---------------------- //! @endcode static void lcd_support_menu() { 205be: ef 92 push r14 205c0: ff 92 push r15 205c2: 0f 93 push r16 205c4: 1f 93 push r17 205c6: cf 93 push r28 205c8: 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) 205ca: 80 91 96 03 lds r24, 0x0396 ; 0x800396 205ce: 88 23 and r24, r24 205d0: 29 f0 breq .+10 ; 0x205dc 205d2: 90 91 59 02 lds r25, 0x0259 ; 0x800259 205d6: 92 30 cpi r25, 0x02 ; 2 205d8: 09 f0 breq .+2 ; 0x205dc 205da: 74 c1 rjmp .+744 ; 0x208c4 { // Menu was entered or SD card status has changed (plugged in or removed). // Initialize its status. _md->status = 1; 205dc: 81 e0 ldi r24, 0x01 ; 1 205de: 80 93 96 03 sts 0x0396, r24 ; 0x800396 205e2: 80 91 48 16 lds r24, 0x1648 ; 0x801648 _md->is_flash_air = card.ToshibaFlashAir_isEnabled(); 205e6: 80 93 97 03 sts 0x0397, r24 ; 0x800397 if (_md->is_flash_air) { 205ea: 88 23 and r24, r24 205ec: 21 f0 breq .+8 ; 0x205f6 card.ToshibaFlashAir_GetIP((uint8_t*)(&_md->ip)); // ip == 0 if it failed 205ee: 88 e9 ldi r24, 0x98 ; 152 205f0: 93 e0 ldi r25, 0x03 ; 3 205f2: 0f 94 15 78 call 0x2f02a ; 0x2f02a { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 205f6: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 205fa: 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); 205fe: 84 e5 ldi r24, 0x54 ; 84 20600: e8 2e mov r14, r24 20602: 89 e9 ldi r24, 0x99 ; 153 20604: 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]); 20606: c3 e2 ldi r28, 0x23 ; 35 20608: d9 e9 ldi r29, 0x99 ; 153 2060a: 0c e9 ldi r16, 0x9C ; 156 2060c: 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(); 2060e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 20612: 84 30 cpi r24, 0x04 ; 4 20614: 08 f0 brcs .+2 ; 0x20618 20616: 7d c1 rjmp .+762 ; 0x20912 20618: 10 92 63 04 sts 0x0463, r1 ; 0x800463 MENU_ITEM_BACK_P(_T(MSG_MAIN)); 2061c: 89 ef ldi r24, 0xF9 ; 249 2061e: 98 e4 ldi r25, 0x48 ; 72 20620: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20624: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR("Firmware:")); 20628: 87 eb ldi r24, 0xB7 ; 183 2062a: 99 e9 ldi r25, 0x99 ; 153 2062c: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR(" " FW_VERSION_FULL)); 20630: 8a ea ldi r24, 0xAA ; 170 20632: 99 e9 ldi r25, 0x99 ; 153 20634: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR(" Repo:" FW_REPOSITORY)); 20638: 8c e9 ldi r24, 0x9C ; 156 2063a: 99 e9 ldi r25, 0x99 ; 153 2063c: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR(" Hash:" FW_COMMIT_HASH)); 20640: 8c e8 ldi r24, 0x8C ; 140 20642: 99 e9 ldi r25, 0x99 ; 153 20644: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(_n("prusa3d.com"));////MSG_PRUSA3D c=18 20648: 80 eb ldi r24, 0xB0 ; 176 2064a: 9b e6 ldi r25, 0x6B ; 107 2064c: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(_n("forum.prusa3d.com"));////MSG_PRUSA3D_FORUM c=18 20650: 8e e9 ldi r24, 0x9E ; 158 20652: 9b e6 ldi r25, 0x6B ; 107 20654: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(_n("help.prusa3d.com"));////MSG_PRUSA3D_HELP c=18 20658: 8d e8 ldi r24, 0x8D ; 141 2065a: 9b e6 ldi r25, 0x6B ; 107 2065c: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(STR_SEPARATOR); 20660: 84 ec ldi r24, 0xC4 ; 196 20662: 94 e8 ldi r25, 0x84 ; 132 20664: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR(FILAMENT_SIZE)); 20668: 80 e8 ldi r24, 0x80 ; 128 2066a: 99 e9 ldi r25, 0x99 ; 153 2066c: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR(ELECTRONICS)); 20670: 87 e7 ldi r24, 0x77 ; 119 20672: 99 e9 ldi r25, 0x99 ; 153 20674: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR(NOZZLE_TYPE)); 20678: 8d e6 ldi r24, 0x6D ; 109 2067a: 99 e9 ldi r25, 0x99 ; 153 2067c: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(STR_SEPARATOR); 20680: 84 ec ldi r24, 0xC4 ; 196 20682: 94 e8 ldi r25, 0x84 ; 132 20684: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(_T(MSG_DATE)); 20688: 8b e3 ldi r24, 0x3B ; 59 2068a: 98 e5 ldi r25, 0x58 ; 88 2068c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20690: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR(SOURCE_DATE_EPOCH)); 20694: 82 e6 ldi r24, 0x62 ; 98 20696: 99 e9 ldi r25, 0x99 ; 153 20698: 0e 94 1f 73 call 0xe63e ; 0xe63e 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); 2069c: 84 ec ldi r24, 0xC4 ; 196 2069e: 94 e8 ldi r25, 0x84 ; 132 206a0: 0e 94 1f 73 call 0xe63e ; 0xe63e if (MMU2::mmu2.Enabled()) 206a4: 80 91 01 13 lds r24, 0x1301 ; 0x801301 206a8: 81 30 cpi r24, 0x01 ; 1 206aa: 09 f0 breq .+2 ; 0x206ae 206ac: 2d c1 rjmp .+602 ; 0x20908 { MENU_ITEM_BACK_P(_T(MSG_MMU_CONNECTED)); 206ae: 8b e2 ldi r24, 0x2B ; 43 206b0: 98 e5 ldi r25, 0x58 ; 88 206b2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 206b6: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR(" FW:")); ////c=17 206ba: 8d e5 ldi r24, 0x5D ; 93 206bc: 99 e9 ldi r25, 0x99 ; 153 206be: 0e 94 1f 73 call 0xe63e ; 0xe63e if (((menu_item - 1) == menu_line) && lcd_draw_update) 206c2: 80 91 63 04 lds r24, 0x0463 ; 0x800463 206c6: 81 50 subi r24, 0x01 ; 1 206c8: 99 0b sbc r25, r25 206ca: 20 91 62 04 lds r18, 0x0462 ; 0x800462 206ce: 28 17 cp r18, r24 206d0: 19 06 cpc r1, r25 206d2: 49 f5 brne .+82 ; 0x20726 206d4: 80 91 59 02 lds r24, 0x0259 ; 0x800259 206d8: 88 23 and r24, r24 206da: 29 f1 breq .+74 ; 0x20726 { lcd_set_cursor(6, menu_row); 206dc: 60 91 60 04 lds r22, 0x0460 ; 0x800460 206e0: 86 e0 ldi r24, 0x06 ; 6 206e2: 0e 94 ab 6f call 0xdf56 ; 0xdf56 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) { 206e6: 80 91 01 13 lds r24, 0x1301 ; 0x801301 206ea: 81 30 cpi r24, 0x01 ; 1 206ec: 09 f0 breq .+2 ; 0x206f0 206ee: 05 c1 rjmp .+522 ; 0x208fa 206f0: 80 91 e1 12 lds r24, 0x12E1 ; 0x8012e1 206f4: 90 91 e2 12 lds r25, 0x12E2 ; 0x8012e2 206f8: 20 91 e3 12 lds r18, 0x12E3 ; 0x8012e3 MMU2::Version mmu_version = MMU2::mmu2.GetMMUFWVersion(); if (mmu_version.major > 0) 206fc: 88 23 and r24, r24 206fe: 09 f4 brne .+2 ; 0x20702 20700: fc c0 rjmp .+504 ; 0x208fa lcd_printf_P(PSTR("%d.%d.%d"), mmu_version.major, mmu_version.minor, mmu_version.build); 20702: 1f 92 push r1 20704: 2f 93 push r18 20706: 1f 92 push r1 20708: 9f 93 push r25 2070a: 1f 92 push r1 2070c: 8f 93 push r24 2070e: ff 92 push r15 20710: ef 92 push r14 20712: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 20716: 8d b7 in r24, 0x3d ; 61 20718: 9e b7 in r25, 0x3e ; 62 2071a: 08 96 adiw r24, 0x08 ; 8 2071c: 0f b6 in r0, 0x3f ; 63 2071e: f8 94 cli 20720: 9e bf out 0x3e, r25 ; 62 20722: 0f be out 0x3f, r0 ; 63 20724: 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) { 20726: 80 91 97 03 lds r24, 0x0397 ; 0x800397 2072a: 88 23 and r24, r24 2072c: 09 f4 brne .+2 ; 0x20730 2072e: 40 c0 rjmp .+128 ; 0x207b0 MENU_ITEM_BACK_P(STR_SEPARATOR); 20730: 84 ec ldi r24, 0xC4 ; 196 20732: 94 e8 ldi r25, 0x84 ; 132 20734: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR("FlashAir IP Addr:")); ////MSG_FLASHAIR c=18 20738: 83 e3 ldi r24, 0x33 ; 51 2073a: 99 e9 ldi r25, 0x99 ; 153 2073c: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR(" ")); 20740: 81 e3 ldi r24, 0x31 ; 49 20742: 99 e9 ldi r25, 0x99 ; 153 20744: 0e 94 1f 73 call 0xe63e ; 0xe63e if (((menu_item - 1) == menu_line) && lcd_draw_update) { 20748: 80 91 63 04 lds r24, 0x0463 ; 0x800463 2074c: 81 50 subi r24, 0x01 ; 1 2074e: 99 0b sbc r25, r25 20750: 20 91 62 04 lds r18, 0x0462 ; 0x800462 20754: 28 17 cp r18, r24 20756: 19 06 cpc r1, r25 20758: 59 f5 brne .+86 ; 0x207b0 2075a: 80 91 59 02 lds r24, 0x0259 ; 0x800259 2075e: 88 23 and r24, r24 20760: 39 f1 breq .+78 ; 0x207b0 lcd_set_cursor(2, menu_row); 20762: 60 91 60 04 lds r22, 0x0460 ; 0x800460 20766: 82 e0 ldi r24, 0x02 ; 2 20768: 0e 94 ab 6f call 0xdf56 ; 0xdf56 2076c: 80 91 9b 03 lds r24, 0x039B ; 0x80039b 20770: 1f 92 push r1 20772: 8f 93 push r24 20774: 80 91 9a 03 lds r24, 0x039A ; 0x80039a 20778: 1f 92 push r1 2077a: 8f 93 push r24 2077c: 80 91 99 03 lds r24, 0x0399 ; 0x800399 20780: 1f 92 push r1 20782: 8f 93 push r24 20784: 80 91 98 03 lds r24, 0x0398 ; 0x800398 20788: 1f 92 push r1 2078a: 8f 93 push r24 2078c: df 93 push r29 2078e: cf 93 push r28 20790: 1f 93 push r17 20792: 0f 93 push r16 20794: 0f 94 98 a3 call 0x34730 ; 0x34730 ip4_to_str(_md->ip_str, (uint8_t*)(&_md->ip)); lcd_print(_md->ip_str); 20798: 8c e9 ldi r24, 0x9C ; 156 2079a: 93 e0 ldi r25, 0x03 ; 3 2079c: 0e 94 b0 73 call 0xe760 ; 0xe760 207a0: 8d b7 in r24, 0x3d ; 61 207a2: 9e b7 in r25, 0x3e ; 62 207a4: 0c 96 adiw r24, 0x0c ; 12 207a6: 0f b6 in r0, 0x3f ; 63 207a8: f8 94 cli 207aa: 9e bf out 0x3e, r25 ; 62 207ac: 0f be out 0x3f, r0 ; 63 207ae: 8d bf out 0x3d, r24 ; 61 } } // Show the printer IP address, if it is available. if (IP_address) { 207b0: 80 91 10 06 lds r24, 0x0610 ; 0x800610 207b4: 90 91 11 06 lds r25, 0x0611 ; 0x800611 207b8: a0 91 12 06 lds r26, 0x0612 ; 0x800612 207bc: b0 91 13 06 lds r27, 0x0613 ; 0x800613 207c0: 89 2b or r24, r25 207c2: 8a 2b or r24, r26 207c4: 8b 2b or r24, r27 207c6: 09 f4 brne .+2 ; 0x207ca 207c8: 42 c0 rjmp .+132 ; 0x2084e MENU_ITEM_BACK_P(STR_SEPARATOR); 207ca: 84 ec ldi r24, 0xC4 ; 196 207cc: 94 e8 ldi r25, 0x84 ; 132 207ce: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(_T(MSG_PRINTER_IP)); 207d2: 8e e0 ldi r24, 0x0E ; 14 207d4: 98 e5 ldi r25, 0x58 ; 88 207d6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 207da: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_BACK_P(PSTR(" ")); 207de: 8f e2 ldi r24, 0x2F ; 47 207e0: 99 e9 ldi r25, 0x99 ; 153 207e2: 0e 94 1f 73 call 0xe63e ; 0xe63e if (((menu_item - 1) == menu_line) && lcd_draw_update) { 207e6: 80 91 63 04 lds r24, 0x0463 ; 0x800463 207ea: 81 50 subi r24, 0x01 ; 1 207ec: 99 0b sbc r25, r25 207ee: 20 91 62 04 lds r18, 0x0462 ; 0x800462 207f2: 28 17 cp r18, r24 207f4: 19 06 cpc r1, r25 207f6: 59 f5 brne .+86 ; 0x2084e 207f8: 80 91 59 02 lds r24, 0x0259 ; 0x800259 207fc: 88 23 and r24, r24 207fe: 39 f1 breq .+78 ; 0x2084e lcd_set_cursor(2, menu_row); 20800: 60 91 60 04 lds r22, 0x0460 ; 0x800460 20804: 82 e0 ldi r24, 0x02 ; 2 20806: 0e 94 ab 6f call 0xdf56 ; 0xdf56 2080a: 80 91 13 06 lds r24, 0x0613 ; 0x800613 2080e: 1f 92 push r1 20810: 8f 93 push r24 20812: 80 91 12 06 lds r24, 0x0612 ; 0x800612 20816: 1f 92 push r1 20818: 8f 93 push r24 2081a: 80 91 11 06 lds r24, 0x0611 ; 0x800611 2081e: 1f 92 push r1 20820: 8f 93 push r24 20822: 80 91 10 06 lds r24, 0x0610 ; 0x800610 20826: 1f 92 push r1 20828: 8f 93 push r24 2082a: df 93 push r29 2082c: cf 93 push r28 2082e: 1f 93 push r17 20830: 0f 93 push r16 20832: 0f 94 98 a3 call 0x34730 ; 0x34730 ip4_to_str(_md->ip_str, (uint8_t*)(&IP_address)); lcd_print(_md->ip_str); 20836: 8c e9 ldi r24, 0x9C ; 156 20838: 93 e0 ldi r25, 0x03 ; 3 2083a: 0e 94 b0 73 call 0xe760 ; 0xe760 2083e: 8d b7 in r24, 0x3d ; 61 20840: 9e b7 in r25, 0x3e ; 62 20842: 0c 96 adiw r24, 0x0c ; 12 20844: 0f b6 in r0, 0x3f ; 63 20846: f8 94 cli 20848: 9e bf out 0x3e, r25 ; 62 2084a: 0f be out 0x3f, r0 ; 63 2084c: 8d bf out 0x3d, r24 ; 61 } } MENU_ITEM_BACK_P(STR_SEPARATOR); 2084e: 84 ec ldi r24, 0xC4 ; 196 20850: 94 e8 ldi r25, 0x84 ; 132 20852: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_SUBMENU_P(_T(MSG_XYZ_DETAILS), lcd_menu_xyz_y_min); 20856: 8b ef ldi r24, 0xFB ; 251 20858: 97 e5 ldi r25, 0x57 ; 87 2085a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2085e: 6b e7 ldi r22, 0x7B ; 123 20860: 74 ec ldi r23, 0xC4 ; 196 20862: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_EXTRUDER), lcd_menu_extruder_info); 20866: 8b ee ldi r24, 0xEB ; 235 20868: 97 e5 ldi r25, 0x57 ; 87 2086a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2086e: 64 e6 ldi r22, 0x64 ; 100 20870: 78 e3 ldi r23, 0x38 ; 56 20872: 0e 94 44 73 call 0xe688 ; 0xe688 MENU_ITEM_SUBMENU_P(_T(MSG_INFO_SENSORS), lcd_menu_show_sensors_state); 20876: 8d ed ldi r24, 0xDD ; 221 20878: 97 e5 ldi r25, 0x57 ; 87 2087a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2087e: 68 e7 ldi r22, 0x78 ; 120 20880: 72 ec ldi r23, 0xC2 ; 194 20882: 0e 94 44 73 call 0xe688 ; 0xe688 #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); 20886: 8e ec ldi r24, 0xCE ; 206 20888: 97 e5 ldi r25, 0x57 ; 87 2088a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2088e: 60 e2 ldi r22, 0x20 ; 32 20890: 77 e3 ldi r23, 0x37 ; 55 20892: 0e 94 44 73 call 0xe688 ; 0xe688 #ifdef MENU_DUMP MENU_ITEM_FUNCTION_P(_n("Dump memory"), lcd_dump_memory); #endif //MENU_DUMP #ifdef MENU_SERIAL_DUMP if (emergency_serial_dump) 20896: 80 91 0f 06 lds r24, 0x060F ; 0x80060f 2089a: 88 23 and r24, r24 2089c: 31 f0 breq .+12 ; 0x208aa MENU_ITEM_FUNCTION_P(_n("Dump to serial"), lcd_serial_dump); 2089e: 64 e0 ldi r22, 0x04 ; 4 208a0: 79 e3 ldi r23, 0x39 ; 57 208a2: 8e e7 ldi r24, 0x7E ; 126 208a4: 9b e6 ldi r25, 0x6B ; 107 208a6: 0e 94 ee 72 call 0xe5dc ; 0xe5dc 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(); 208aa: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; } MENU_BEGIN(); 208ae: 80 91 60 04 lds r24, 0x0460 ; 0x800460 208b2: 8f 5f subi r24, 0xFF ; 255 208b4: 80 93 60 04 sts 0x0460, r24 ; 0x800460 208b8: 80 91 62 04 lds r24, 0x0462 ; 0x800462 208bc: 8f 5f subi r24, 0xFF ; 255 208be: 80 93 62 04 sts 0x0462, r24 ; 0x800462 208c2: a5 ce rjmp .-694 ; 0x2060e _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) 208c4: 90 91 97 03 lds r25, 0x0397 ; 0x800397 208c8: 99 23 and r25, r25 208ca: 09 f4 brne .+2 ; 0x208ce 208cc: 94 ce rjmp .-728 ; 0x205f6 208ce: 40 91 98 03 lds r20, 0x0398 ; 0x800398 208d2: 50 91 99 03 lds r21, 0x0399 ; 0x800399 208d6: 60 91 9a 03 lds r22, 0x039A ; 0x80039a 208da: 70 91 9b 03 lds r23, 0x039B ; 0x80039b 208de: 45 2b or r20, r21 208e0: 46 2b or r20, r22 208e2: 47 2b or r20, r23 208e4: 09 f0 breq .+2 ; 0x208e8 208e6: 87 ce rjmp .-754 ; 0x205f6 208e8: 8f 5f subi r24, 0xFF ; 255 208ea: 80 31 cpi r24, 0x10 ; 16 208ec: 19 f0 breq .+6 ; 0x208f4 208ee: 80 93 96 03 sts 0x0396, r24 ; 0x800396 208f2: 81 ce rjmp .-766 ; 0x205f6 { // Waiting for the FlashAir card to get an IP address from a router. Force an update. _md->status = 0; 208f4: 10 92 96 03 sts 0x0396, r1 ; 0x800396 208f8: 7e ce rjmp .-772 ; 0x205f6 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)); 208fa: 81 e2 ldi r24, 0x21 ; 33 208fc: 98 e5 ldi r25, 0x58 ; 88 208fe: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20902: 0e 94 6e 6f call 0xdedc ; 0xdedc 20906: 0f cf rjmp .-482 ; 0x20726 } } else MENU_ITEM_BACK_P(PSTR("MMU N/A")); 20908: 85 e4 ldi r24, 0x45 ; 69 2090a: 99 e9 ldi r25, 0x99 ; 153 2090c: 0e 94 1f 73 call 0xe63e ; 0xe63e 20910: 0a cf rjmp .-492 ; 0x20726 #endif //EMERGENCY_HANDLERS MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18 #endif /* DEBUG_BUILD */ MENU_END(); } 20912: df 91 pop r29 20914: cf 91 pop r28 20916: 1f 91 pop r17 20918: 0f 91 pop r16 2091a: ff 90 pop r15 2091c: ef 90 pop r14 2091e: 08 95 ret 00020920 : //! |Total failures | MSG_TOTAL_FAILURES c=20 //! | Fil. runouts 000| MSG_FIL_RUNOUTS c=15 //! ---------------------- //! @endcode static void lcd_menu_fails_stats() { 20920: bf 92 push r11 20922: cf 92 push r12 20924: df 92 push r13 20926: ef 92 push r14 20928: ff 92 push r15 2092a: 0f 93 push r16 2092c: 1f 93 push r17 2092e: cf 93 push r28 20930: df 93 push r29 20932: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout uint8_t filamentLast = eeprom_read_byte((uint8_t*)EEPROM_FERROR_COUNT); 20936: 85 e6 ldi r24, 0x65 ; 101 20938: 9f e0 ldi r25, 0x0F ; 15 2093a: 0f 94 81 a4 call 0x34902 ; 0x34902 2093e: 18 2f mov r17, r24 uint16_t filamentTotal = clamp999( eeprom_read_word((uint16_t*)EEPROM_FERROR_COUNT_TOT) ); 20940: 81 e0 ldi r24, 0x01 ; 1 20942: 9f e0 ldi r25, 0x0F ; 15 20944: 0f 94 8f a4 call 0x3491e ; 0x3491e 20948: 0e 94 cd fc call 0x1f99a ; 0x1f99a 2094c: c8 2e mov r12, r24 2094e: b9 2e mov r11, r25 lcd_home(); 20950: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 lcd_printf_P(failStatsFmt, 20954: 8f eb ldi r24, 0xBF ; 191 20956: 97 e5 ldi r25, 0x57 ; 87 20958: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2095c: e8 2e mov r14, r24 2095e: d9 2e mov r13, r25 20960: 8e ea ldi r24, 0xAE ; 174 20962: 97 e5 ldi r25, 0x57 ; 87 20964: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20968: 08 2f mov r16, r24 2096a: f9 2e mov r15, r25 2096c: 8f eb ldi r24, 0xBF ; 191 2096e: 97 e5 ldi r25, 0x57 ; 87 20970: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20974: ec 01 movw r28, r24 20976: 88 e9 ldi r24, 0x98 ; 152 20978: 97 e5 ldi r25, 0x57 ; 87 2097a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2097e: bf 92 push r11 20980: cf 92 push r12 20982: df 92 push r13 20984: ef 92 push r14 20986: ff 92 push r15 20988: 0f 93 push r16 2098a: 1f 92 push r1 2098c: 1f 93 push r17 2098e: df 93 push r29 20990: cf 93 push r28 20992: 9f 93 push r25 20994: 8f 93 push r24 20996: 86 ef ldi r24, 0xF6 ; 246 20998: 98 e9 ldi r25, 0x98 ; 152 2099a: 9f 93 push r25 2099c: 8f 93 push r24 2099e: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 _T(MSG_LAST_PRINT_FAILURES), _T(MSG_FIL_RUNOUTS), filamentLast, _T(MSG_TOTAL_FAILURES), _T(MSG_FIL_RUNOUTS), filamentTotal); menu_back_if_clicked(); 209a2: 8d b7 in r24, 0x3d ; 61 209a4: 9e b7 in r25, 0x3e ; 62 209a6: 0e 96 adiw r24, 0x0e ; 14 209a8: 0f b6 in r0, 0x3f ; 63 209aa: f8 94 cli 209ac: 9e bf out 0x3e, r25 ; 62 209ae: 0f be out 0x3f, r0 ; 63 209b0: 8d bf out 0x3d, r24 ; 61 } 209b2: df 91 pop r29 209b4: cf 91 pop r28 209b6: 1f 91 pop r17 209b8: 0f 91 pop r16 209ba: ff 90 pop r15 209bc: ef 90 pop r14 209be: df 90 pop r13 209c0: cf 90 pop r12 209c2: 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(); 209c4: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae 000209c8 : //! | 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() { 209c8: 8f 92 push r8 209ca: 9f 92 push r9 209cc: af 92 push r10 209ce: bf 92 push r11 209d0: cf 92 push r12 209d2: df 92 push r13 209d4: ef 92 push r14 209d6: ff 92 push r15 209d8: 0f 93 push r16 209da: 1f 93 push r17 209dc: cf 93 push r28 209de: df 93 push r29 209e0: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout lcd_home(); 209e4: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 lcd_printf_P( 209e8: 80 91 07 13 lds r24, 0x1307 ; 0x801307 209ec: 90 91 08 13 lds r25, 0x1308 ; 0x801308 209f0: 0e 94 cd fc call 0x1f99a ; 0x1f99a 209f4: 98 2e mov r9, r24 209f6: 89 2e mov r8, r25 209f8: 83 e7 ldi r24, 0x73 ; 115 209fa: 97 e5 ldi r25, 0x57 ; 87 209fc: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20a00: b8 2e mov r11, r24 20a02: a9 2e mov r10, r25 20a04: 80 ed ldi r24, 0xD0 ; 208 20a06: 9e e0 ldi r25, 0x0E ; 14 20a08: 0f 94 8f a4 call 0x3491e ; 0x3491e 20a0c: 0e 94 cd fc call 0x1f99a ; 0x1f99a 20a10: d8 2e mov r13, r24 20a12: c9 2e mov r12, r25 20a14: 82 e6 ldi r24, 0x62 ; 98 20a16: 97 e5 ldi r25, 0x57 ; 87 20a18: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20a1c: f8 2e mov r15, r24 20a1e: e9 2e mov r14, r25 20a20: 83 ed ldi r24, 0xD3 ; 211 20a22: 9e e0 ldi r25, 0x0E ; 14 20a24: 0f 94 8f a4 call 0x3491e ; 0x3491e 20a28: 0e 94 cd fc call 0x1f99a ; 0x1f99a 20a2c: 18 2f mov r17, r24 20a2e: 09 2f mov r16, r25 20a30: 86 e5 ldi r24, 0x56 ; 86 20a32: 97 e5 ldi r25, 0x57 ; 87 20a34: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20a38: ec 01 movw r28, r24 20a3a: 8e ea ldi r24, 0xAE ; 174 20a3c: 97 e5 ldi r25, 0x57 ; 87 20a3e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20a42: 8f 92 push r8 20a44: 9f 92 push r9 20a46: af 92 push r10 20a48: bf 92 push r11 20a4a: cf 92 push r12 20a4c: df 92 push r13 20a4e: ef 92 push r14 20a50: ff 92 push r15 20a52: 0f 93 push r16 20a54: 1f 93 push r17 20a56: df 93 push r29 20a58: cf 93 push r28 20a5a: 9f 93 push r25 20a5c: 8f 93 push r24 20a5e: 89 ec ldi r24, 0xC9 ; 201 20a60: 98 e9 ldi r25, 0x98 ; 152 20a62: 9f 93 push r25 20a64: 8f 93 push r24 20a66: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 ), _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(); 20a6a: 8d b7 in r24, 0x3d ; 61 20a6c: 9e b7 in r25, 0x3e ; 62 20a6e: 40 96 adiw r24, 0x10 ; 16 20a70: 0f b6 in r0, 0x3f ; 63 20a72: f8 94 cli 20a74: 9e bf out 0x3e, r25 ; 62 20a76: 0f be out 0x3f, r0 ; 63 20a78: 8d bf out 0x3d, r24 ; 61 } 20a7a: df 91 pop r29 20a7c: cf 91 pop r28 20a7e: 1f 91 pop r17 20a80: 0f 91 pop r16 20a82: ff 90 pop r15 20a84: ef 90 pop r14 20a86: df 90 pop r13 20a88: cf 90 pop r12 20a8a: bf 90 pop r11 20a8c: af 90 pop r10 20a8e: 9f 90 pop r9 20a90: 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(); 20a92: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae 00020a96 : { 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) { 20a96: 80 91 96 03 lds r24, 0x0396 ; 0x800396 20a9a: 81 11 cpse r24, r1 20a9c: 19 c0 rjmp .+50 ; 0x20ad0 lcd_clear(); 20a9e: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_P(_T(MSG_MATERIAL_CHANGES)); /// MSG_MATERIAL_CHANGES c=18 20aa2: 85 e8 ldi r24, 0x85 ; 133 20aa4: 97 e5 ldi r25, 0x57 ; 87 20aa6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 20aaa: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_putc(':'); 20aae: 8a e3 ldi r24, 0x3A ; 58 20ab0: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_set_cursor(10, 1); 20ab4: 61 e0 ldi r22, 0x01 ; 1 20ab6: 8a e0 ldi r24, 0x0A ; 10 20ab8: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_print(eeprom_read_dword((uint32_t*)EEPROM_MMU_MATERIAL_CHANGES)); 20abc: 88 ea ldi r24, 0xA8 ; 168 20abe: 9c e0 ldi r25, 0x0C ; 12 20ac0: 0f 94 89 a4 call 0x34912 ; 0x34912 else lcd_printNumber(n, base); 20ac4: 4a e0 ldi r20, 0x0A ; 10 20ac6: 0e 94 c7 71 call 0xe38e ; 0xe38e _md->initialized = true; 20aca: 81 e0 ldi r24, 0x01 ; 1 20acc: 80 93 96 03 sts 0x0396, r24 ; 0x800396 } menu_back_if_clicked(); 20ad0: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae 00020ad4 : } //! @brief Send host action "pause" void lcd_pause_usb_print() { SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); 20ad4: 8f e6 ldi r24, 0x6F ; 111 20ad6: 9b e6 ldi r25, 0x6B ; 107 20ad8: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c 00020adc : #endif //DEBUG_DISABLE_LCD_STATUS_LINE } static void lcdui_refresh(uint8_t clear = true) { clear ? lcd_refresh() : lcd_refresh_noclear(); 20adc: 0e 94 f0 70 call 0xe1e0 ; 0xe1e0 lcd_status_message_idx = 0; // Re-draw message from beginning 20ae0: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.417> } void lcd_return_to_status() { lcdui_refresh(); // to maybe revive the LCD if static electricity killed it. menu_goto(lcd_status_screen, 0, true); 20ae4: 20 e0 ldi r18, 0x00 ; 0 20ae6: 41 e0 ldi r20, 0x01 ; 1 20ae8: 70 e0 ldi r23, 0x00 ; 0 20aea: 60 e0 ldi r22, 0x00 ; 0 20aec: 82 e4 ldi r24, 0x42 ; 66 20aee: 97 e3 ldi r25, 0x37 ; 55 20af0: 0e 94 08 63 call 0xc610 ; 0xc610 menu_depth = 0; 20af4: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df eFilamentAction = FilamentAction::None; // i.e. non-autoLoad 20af8: 10 92 94 03 sts 0x0394, r1 ; 0x800394 } 20afc: 08 95 ret 00020afe : // 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); 20afe: 81 e0 ldi r24, 0x01 ; 1 20b00: 0e 94 79 6f call 0xdef2 ; 0xdef2 if (MMU2::mmu2.get_current_tool() == MMU2::mmu2.get_tool_change_tool()) { 20b04: 0f 94 45 65 call 0x2ca8a ; 0x2ca8a 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; 20b08: 90 91 e9 12 lds r25, 0x12E9 ; 0x8012e9 20b0c: 93 36 cpi r25, 0x63 ; 99 20b0e: 09 f4 brne .+2 ; 0x20b12 20b10: 9f ef ldi r25, 0xFF ; 255 20b12: 89 13 cpse r24, r25 20b14: 0e c0 rjmp .+28 ; 0x20b32 lcd_putc('F'); 20b16: 86 e4 ldi r24, 0x46 ; 70 20b18: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 20b1c: 0f 94 45 65 call 0x2ca8a ; 0x2ca8a 20b20: 8f 3f cpi r24, 0xFF ; 255 20b22: 29 f0 breq .+10 ; 0x20b2e 20b24: 8f 5c subi r24, 0xCF ; 207 20b26: 0e 94 72 6f call 0xdee4 ; 0xdee4 20b2a: 83 e0 ldi r24, 0x03 ; 3 20b2c: 08 95 ret 20b2e: 8f e3 ldi r24, 0x3F ; 63 20b30: fa cf rjmp .-12 ; 0x20b26 chars += 2; } else { lcd_putc(MMU2::mmu2.get_current_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_current_tool() + '1'); 20b32: 8f 3f cpi r24, 0xFF ; 255 20b34: 89 f0 breq .+34 ; 0x20b58 20b36: 8f 5c subi r24, 0xCF ; 207 20b38: 0e 94 72 6f call 0xdee4 ; 0xdee4 lcd_putc('>'); 20b3c: 8e e3 ldi r24, 0x3E ; 62 20b3e: 0e 94 72 6f call 0xdee4 ; 0xdee4 20b42: 80 91 e9 12 lds r24, 0x12E9 ; 0x8012e9 20b46: 83 36 cpi r24, 0x63 ; 99 20b48: 49 f0 breq .+18 ; 0x20b5c lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 20b4a: 8f 3f cpi r24, 0xFF ; 255 20b4c: 39 f0 breq .+14 ; 0x20b5c 20b4e: 8f 5c subi r24, 0xCF ; 207 20b50: 0e 94 72 6f call 0xdee4 ; 0xdee4 chars += 3; 20b54: 84 e0 ldi r24, 0x04 ; 4 } return chars; } 20b56: 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'); 20b58: 8f e3 ldi r24, 0x3F ; 63 20b5a: ee cf rjmp .-36 ; 0x20b38 lcd_putc('>'); lcd_putc(MMU2::mmu2.get_tool_change_tool() == (uint8_t)MMU2::FILAMENT_UNKNOWN ? '?' : MMU2::mmu2.get_tool_change_tool() + '1'); 20b5c: 8f e3 ldi r24, 0x3F ; 63 20b5e: f8 cf rjmp .-16 ; 0x20b50 00020b60 : } 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){ 20b60: 0f 93 push r16 20b62: 1f 93 push r17 20b64: cf 93 push r28 20b66: df 93 push r29 20b68: ec 01 movw r28, r24 20b6a: cb 01 movw r24, r22 20b6c: ba 01 movw r22, r20 static const char m1[] PROGMEM = "Please restart"; switch(state){ 20b6e: 4a 81 ldd r20, Y+2 ; 0x02 20b70: 41 30 cpi r20, 0x01 ; 1 20b72: 29 f0 breq .+10 ; 0x20b7e 20b74: 88 f0 brcs .+34 ; 0x20b98 20b76: 42 30 cpi r20, 0x02 ; 2 20b78: 09 f1 breq .+66 ; 0x20bbc 20b7a: 43 30 cpi r20, 0x03 ; 3 20b7c: d1 f4 brne .+52 ; 0x20bb2 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 ){ 20b7e: 8b 81 ldd r24, Y+3 ; 0x03 20b80: 81 11 cpse r24, r1 20b82: 25 c0 rjmp .+74 ; 0x20bce state = next_state; // advance to the next state 20b84: 82 e0 ldi r24, 0x02 ; 2 20b86: 8a 83 std Y+2, r24 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 20b88: 63 e0 ldi r22, 0x03 ; 3 20b8a: 87 e4 ldi r24, 0x47 ; 71 20b8c: 98 e9 ldi r25, 0x98 ; 152 20b8e: 0e 94 14 d8 call 0x1b028 ; 0x1b028 repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too 20b92: 85 e0 ldi r24, 0x05 ; 5 } else { --repeat; 20b94: 8b 83 std Y+3, r24 ; 0x03 20b96: 0d c0 rjmp .+26 ; 0x20bb2 //! @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 ){ 20b98: a9 01 movw r20, r18 20b9a: 98 01 movw r18, r16 20b9c: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 20ba0: 18 16 cp r1, r24 20ba2: 3c f4 brge .+14 ; 0x20bb2 lcd_setalertstatuspgm(m2, LCD_STATUS_CRITICAL); 20ba4: 63 e0 ldi r22, 0x03 ; 3 20ba6: 88 81 ld r24, Y 20ba8: 99 81 ldd r25, Y+1 ; 0x01 20baa: 0e 94 14 d8 call 0x1b028 ; 0x1b028 state = States::TempAboveMintemp; 20bae: 81 e0 ldi r24, 0x01 ; 1 20bb0: 8a 83 std Y+2, r24 ; 0x02 break; case States::ShowPleaseRestart: // displaying "Please restart" substep(m2, States::ShowMintemp); break; } } 20bb2: df 91 pop r29 20bb4: cf 91 pop r28 20bb6: 1f 91 pop r17 20bb8: 0f 91 pop r16 20bba: 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 ){ 20bbc: 8b 81 ldd r24, Y+3 ; 0x03 20bbe: 81 11 cpse r24, r1 20bc0: 06 c0 rjmp .+12 ; 0x20bce 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); 20bc2: 88 81 ld r24, Y 20bc4: 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 20bc6: 23 e0 ldi r18, 0x03 ; 3 20bc8: 2a 83 std Y+2, r18 ; 0x02 lcd_setalertstatuspgm(next_msg, LCD_STATUS_CRITICAL); 20bca: 63 e0 ldi r22, 0x03 ; 3 20bcc: e0 cf rjmp .-64 ; 0x20b8e repeat = ALERT_AUTOMATON_SPEED_DIV; // and prepare repeating for it too } else { --repeat; 20bce: 81 50 subi r24, 0x01 ; 1 20bd0: e1 cf rjmp .-62 ; 0x20b94 00020bd2 : SERIAL_ECHO(_status); SERIAL_ECHO(']'); } static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); 20bd2: 85 e2 ldi r24, 0x25 ; 37 20bd4: 9a e8 ldi r25, 0x8A ; 138 20bd6: 0c 94 15 7b jmp 0xf62a ; 0xf62a 00020bda : static void Sound_DoSound_Prompt(void) { backlight_wake(2); WRITE(BEEPER,HIGH); 20bda: 9f b7 in r25, 0x3f ; 63 20bdc: f8 94 cli 20bde: e2 e0 ldi r30, 0x02 ; 2 20be0: f1 e0 ldi r31, 0x01 ; 1 20be2: 80 81 ld r24, Z 20be4: 84 60 ori r24, 0x04 ; 4 20be6: 80 83 st Z, r24 20be8: 9f bf out 0x3f, r25 ; 63 20bea: 2f ef ldi r18, 0xFF ; 255 20bec: 89 e6 ldi r24, 0x69 ; 105 20bee: 98 e1 ldi r25, 0x18 ; 24 20bf0: 21 50 subi r18, 0x01 ; 1 20bf2: 80 40 sbci r24, 0x00 ; 0 20bf4: 90 40 sbci r25, 0x00 ; 0 20bf6: e1 f7 brne .-8 ; 0x20bf0 20bf8: 00 c0 rjmp .+0 ; 0x20bfa 20bfa: 00 00 nop _delay_ms(500); WRITE(BEEPER,LOW); 20bfc: 9f b7 in r25, 0x3f ; 63 20bfe: f8 94 cli 20c00: 80 81 ld r24, Z 20c02: 8b 7f andi r24, 0xFB ; 251 20c04: 80 83 st Z, r24 20c06: 9f bf out 0x3f, r25 ; 63 } 20c08: 08 95 ret 00020c0a : SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); SERIAL_ECHO(']'); } static void prusa_stat_temperatures() { SERIAL_ECHOPGM("[ST0:"); 20c0a: 88 e4 ldi r24, 0x48 ; 72 20c0c: 9a e8 ldi r25, 0x8A ; 138 20c0e: 0e 94 15 7b call 0xf62a ; 0xf62a 20c12: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 20c16: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 20c1a: 07 2e mov r0, r23 20c1c: 00 0c add r0, r0 20c1e: 88 0b sbc r24, r24 20c20: 99 0b sbc r25, r25 20c22: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_ECHO(target_temperature[0]); SERIAL_ECHOPGM("][STB:"); 20c26: 81 e4 ldi r24, 0x41 ; 65 20c28: 9a e8 ldi r25, 0x8A ; 138 20c2a: 0e 94 15 7b call 0xf62a ; 0xf62a 20c2e: 60 91 59 12 lds r22, 0x1259 ; 0x801259 20c32: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 20c36: 07 2e mov r0, r23 20c38: 00 0c add r0, r0 20c3a: 88 0b sbc r24, r24 20c3c: 99 0b sbc r25, r25 20c3e: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_ECHO(target_temperature_bed); SERIAL_ECHOPGM("][AT0:"); 20c42: 8a e3 ldi r24, 0x3A ; 58 20c44: 9a e8 ldi r25, 0x8A ; 138 20c46: 0e 94 15 7b call 0xf62a ; 0xf62a else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 20c4a: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 20c4e: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 20c52: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 20c56: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 20c5a: 42 e0 ldi r20, 0x02 ; 2 20c5c: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_ECHO(current_temperature[0]); SERIAL_ECHOPGM("][ATB:"); 20c60: 83 e3 ldi r24, 0x33 ; 51 20c62: 9a e8 ldi r25, 0x8A ; 138 20c64: 0e 94 15 7b call 0xf62a ; 0xf62a 20c68: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 20c6c: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 20c70: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 20c74: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 20c78: 42 e0 ldi r20, 0x02 ; 2 20c7a: 0e 94 97 7a call 0xf52e ; 0xf52e } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 20c7e: 8d e5 ldi r24, 0x5D ; 93 20c80: 0c 94 02 7a jmp 0xf404 ; 0xf404 00020c84 : prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } static void prusa_stat_printerstatus(uint8_t _status) { 20c84: cf 93 push r28 20c86: c8 2f mov r28, r24 SERIAL_ECHOPGM("[PRN:"); 20c88: 8f e1 ldi r24, 0x1F ; 31 20c8a: 9a e8 ldi r25, 0x8A ; 138 20c8c: 0e 94 15 7b call 0xf62a ; 0xf62a } } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); 20c90: 8c 2f mov r24, r28 20c92: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 20c96: 8d e5 ldi r24, 0x5D ; 93 SERIAL_ECHO(_status); SERIAL_ECHO(']'); } 20c98: cf 91 pop r28 20c9a: 0c 94 02 7a jmp 0xf404 ; 0xf404 00020c9e : #ifdef PRUSA_M28 static void trace(); #endif static void prusa_statistics_err(char c) { 20c9e: cf 93 push r28 20ca0: c8 2f mov r28, r24 SERIAL_ECHOPGM("{[ERR:"); 20ca2: 88 ee ldi r24, 0xE8 ; 232 20ca4: 99 e8 ldi r25, 0x89 ; 137 20ca6: 0e 94 15 7b call 0xf62a ; 0xf62a 20caa: 8c 2f mov r24, r28 20cac: 0e 94 02 7a call 0xf404 ; 0xf404 20cb0: 8d e5 ldi r24, 0x5D ; 93 20cb2: 0e 94 02 7a call 0xf404 ; 0xf404 SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } 20cb6: cf 91 pop r28 static void prusa_statistics_err(char c) { SERIAL_ECHOPGM("{[ERR:"); SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); 20cb8: 0d 94 e9 05 jmp 0x20bd2 ; 0x20bd2 00020cbc : static void prusa_stat_farm_number() { SERIAL_ECHOPGM("[PFN:0]"); } static void prusa_stat_diameter() { SERIAL_ECHOPGM("[DIA:"); 20cbc: 8d e2 ldi r24, 0x2D ; 45 20cbe: 9a e8 ldi r25, 0x8A ; 138 20cc0: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHO(eeprom_read_word((uint16_t*)EEPROM_NOZZLE_DIAMETER_uM)); 20cc4: 85 ea ldi r24, 0xA5 ; 165 20cc6: 9d e0 ldi r25, 0x0D ; 13 20cc8: 0f 94 8f a4 call 0x3491e ; 0x3491e print((long) n, base); } void MarlinSerial::print(unsigned int n, int base) { print((unsigned long) n, base); 20ccc: bc 01 movw r22, r24 20cce: 90 e0 ldi r25, 0x00 ; 0 20cd0: 80 e0 ldi r24, 0x00 ; 0 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 20cd2: 4a e0 ldi r20, 0x0A ; 10 20cd4: 0e 94 16 7a call 0xf42c ; 0xf42c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 20cd8: 8d e5 ldi r24, 0x5D ; 93 20cda: 0c 94 02 7a jmp 0xf404 ; 0xf404 00020cde : // 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) { 20cde: 2f 92 push r2 20ce0: 3f 92 push r3 20ce2: 4f 92 push r4 20ce4: 5f 92 push r5 20ce6: 6f 92 push r6 20ce8: 7f 92 push r7 20cea: 8f 92 push r8 20cec: 9f 92 push r9 20cee: af 92 push r10 20cf0: bf 92 push r11 20cf2: cf 92 push r12 20cf4: df 92 push r13 20cf6: ef 92 push r14 20cf8: ff 92 push r15 20cfa: 0f 93 push r16 20cfc: 1f 93 push r17 20cfe: cf 93 push r28 20d00: df 93 push r29 20d02: cd b7 in r28, 0x3d ; 61 20d04: de b7 in r29, 0x3e ; 62 20d06: a1 97 sbiw r28, 0x21 ; 33 20d08: 0f b6 in r0, 0x3f ; 63 20d0a: f8 94 cli 20d0c: de bf out 0x3e, r29 ; 62 20d0e: 0f be out 0x3f, r0 ; 63 20d10: cd bf out 0x3d, r28 ; 61 20d12: 1c 01 movw r2, r24 20d14: 48 01 movw r8, r16 20d16: 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) 20d18: fc 01 movw r30, r24 20d1a: e8 5b subi r30, 0xB8 ; 184 20d1c: ff 4f sbci r31, 0xFF ; 255 20d1e: c0 80 ld r12, Z 20d20: d1 80 ldd r13, Z+1 ; 0x01 20d22: e2 80 ldd r14, Z+2 ; 0x02 20d24: f3 80 ldd r15, Z+3 ; 0x03 20d26: 9a 01 movw r18, r20 20d28: ab 01 movw r20, r22 20d2a: c7 01 movw r24, r14 20d2c: b6 01 movw r22, r12 20d2e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 20d32: 0f 94 87 a6 call 0x34d0e ; 0x34d0e 20d36: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 20d3a: 8b 01 movw r16, r22 20d3c: 8d 83 std Y+5, r24 ; 0x05 20d3e: 99 83 std Y+1, r25 ; 0x01 uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min) 20d40: a5 01 movw r20, r10 20d42: 94 01 movw r18, r8 20d44: c7 01 movw r24, r14 20d46: b6 01 movw r22, r12 20d48: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 20d4c: 0f 94 87 a6 call 0x34d0e ; 0x34d0e 20d50: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 20d54: 36 2f mov r19, r22 20d56: 27 2f mov r18, r23 20d58: a8 01 movw r20, r16 20d5a: 6d 81 ldd r22, Y+5 ; 0x05 20d5c: 79 81 ldd r23, Y+1 ; 0x01 20d5e: 48 37 cpi r20, 0x78 ; 120 20d60: 51 05 cpc r21, r1 20d62: 61 05 cpc r22, r1 20d64: 71 05 cpc r23, r1 20d66: 20 f4 brcc .+8 ; 0x20d70 20d68: 48 e7 ldi r20, 0x78 ; 120 20d6a: 50 e0 ldi r21, 0x00 ; 0 20d6c: 60 e0 ldi r22, 0x00 ; 0 20d6e: 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) 20d70: d1 01 movw r26, r2 20d72: d6 96 adiw r26, 0x36 ; 54 20d74: 8d 90 ld r8, X+ 20d76: 9d 90 ld r9, X+ 20d78: ad 90 ld r10, X+ 20d7a: bc 90 ld r11, X 20d7c: d9 97 sbiw r26, 0x39 ; 57 20d7e: 8f 8a std Y+23, r8 ; 0x17 20d80: 98 8e std Y+24, r9 ; 0x18 20d82: a9 8e std Y+25, r10 ; 0x19 20d84: ba 8e std Y+26, r11 ; 0x1a 20d86: 48 15 cp r20, r8 20d88: 59 05 cpc r21, r9 20d8a: 6a 05 cpc r22, r10 20d8c: 7b 05 cpc r23, r11 20d8e: 20 f4 brcc .+8 ; 0x20d98 20d90: 4f 8b std Y+23, r20 ; 0x17 20d92: 58 8f std Y+24, r21 ; 0x18 20d94: 69 8f std Y+25, r22 ; 0x19 20d96: 7a 8f std Y+26, r23 ; 0x1a 20d98: 43 2f mov r20, r19 20d9a: 52 2f mov r21, r18 20d9c: bc 01 movw r22, r24 20d9e: 48 37 cpi r20, 0x78 ; 120 20da0: 51 05 cpc r21, r1 20da2: 61 05 cpc r22, r1 20da4: 71 05 cpc r23, r1 20da6: 20 f4 brcc .+8 ; 0x20db0 20da8: 48 e7 ldi r20, 0x78 ; 120 20daa: 50 e0 ldi r21, 0x00 ; 0 20dac: 60 e0 ldi r22, 0x00 ; 0 20dae: 70 e0 ldi r23, 0x00 ; 0 20db0: 18 2d mov r17, r8 20db2: 09 2d mov r16, r9 20db4: a9 a2 std Y+33, r10 ; 0x21 20db6: b8 a2 std Y+32, r11 ; 0x20 20db8: 48 15 cp r20, r8 20dba: 59 05 cpc r21, r9 20dbc: 6a 05 cpc r22, r10 20dbe: 7b 05 cpc r23, r11 20dc0: 20 f4 brcc .+8 ; 0x20dca 20dc2: 14 2f mov r17, r20 20dc4: 05 2f mov r16, r21 20dc6: 69 a3 std Y+33, r22 ; 0x21 20dc8: 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; 20dca: f1 01 movw r30, r2 20dcc: ee 5b subi r30, 0xBE ; 190 20dce: ff 4f sbci r31, 0xFF ; 255 20dd0: c0 80 ld r12, Z 20dd2: d1 80 ldd r13, Z+1 ; 0x01 20dd4: e2 80 ldd r14, Z+2 ; 0x02 20dd6: f3 80 ldd r15, Z+3 ; 0x03 20dd8: cd 82 std Y+5, r12 ; 0x05 20dda: de 82 std Y+6, r13 ; 0x06 20ddc: ef 82 std Y+7, r14 ; 0x07 20dde: f8 86 std Y+8, r15 ; 0x08 if (acceleration == 0) 20de0: cd 28 or r12, r13 20de2: ce 28 or r12, r14 20de4: cf 28 or r12, r15 20de6: 41 f4 brne .+16 ; 0x20df8 // Don't allow zero acceleration. acceleration = 1; 20de8: c1 2c mov r12, r1 20dea: d1 2c mov r13, r1 20dec: 76 01 movw r14, r12 20dee: c3 94 inc r12 20df0: cd 82 std Y+5, r12 ; 0x05 20df2: de 82 std Y+6, r13 ; 0x06 20df4: ef 82 std Y+7, r14 ; 0x07 20df6: 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; 20df8: 2f 89 ldd r18, Y+23 ; 0x17 20dfa: 38 8d ldd r19, Y+24 ; 0x18 20dfc: 49 8d ldd r20, Y+25 ; 0x19 20dfe: 5a 8d ldd r21, Y+26 ; 0x1a 20e00: b9 01 movw r22, r18 20e02: ca 01 movw r24, r20 20e04: 0f 94 e4 a4 call 0x349c8 ; 0x349c8 <__mulsi3> 20e08: 6d 87 std Y+13, r22 ; 0x0d 20e0a: 7e 87 std Y+14, r23 ; 0x0e 20e0c: 8f 87 std Y+15, r24 ; 0x0f 20e0e: 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; 20e10: a5 01 movw r20, r10 20e12: 94 01 movw r18, r8 20e14: c5 01 movw r24, r10 20e16: b4 01 movw r22, r8 20e18: 0f 94 e4 a4 call 0x349c8 ; 0x349c8 <__mulsi3> 20e1c: 2b 01 movw r4, r22 20e1e: 3c 01 movw r6, r24 uint32_t final_rate_sqr = final_rate*final_rate; 20e20: 21 2f mov r18, r17 20e22: 30 2f mov r19, r16 20e24: 49 a1 ldd r20, Y+33 ; 0x21 20e26: 58 a1 ldd r21, Y+32 ; 0x20 20e28: 61 2f mov r22, r17 20e2a: 70 2f mov r23, r16 20e2c: ca 01 movw r24, r20 20e2e: 0f 94 e4 a4 call 0x349c8 ; 0x349c8 <__mulsi3> 20e32: 69 8b std Y+17, r22 ; 0x11 20e34: 7a 8b std Y+18, r23 ; 0x12 20e36: 8b 8b std Y+19, r24 ; 0x13 20e38: 9c 8b std Y+20, r25 ; 0x14 uint32_t acceleration_x2 = acceleration << 1; 20e3a: cd 80 ldd r12, Y+5 ; 0x05 20e3c: de 80 ldd r13, Y+6 ; 0x06 20e3e: ef 80 ldd r14, Y+7 ; 0x07 20e40: f8 84 ldd r15, Y+8 ; 0x08 20e42: cc 0c add r12, r12 20e44: dd 1c adc r13, r13 20e46: ee 1c adc r14, r14 20e48: ff 1c adc r15, r15 20e4a: c9 86 std Y+9, r12 ; 0x09 20e4c: da 86 std Y+10, r13 ; 0x0a 20e4e: eb 86 std Y+11, r14 ; 0x0b 20e50: 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; 20e52: c3 01 movw r24, r6 20e54: b2 01 movw r22, r4 20e56: 61 50 subi r22, 0x01 ; 1 20e58: 71 09 sbc r23, r1 20e5a: 81 09 sbc r24, r1 20e5c: 91 09 sbc r25, r1 20e5e: cd 84 ldd r12, Y+13 ; 0x0d 20e60: de 84 ldd r13, Y+14 ; 0x0e 20e62: ef 84 ldd r14, Y+15 ; 0x0f 20e64: f8 88 ldd r15, Y+16 ; 0x10 20e66: 6c 19 sub r22, r12 20e68: 7d 09 sbc r23, r13 20e6a: 8e 09 sbc r24, r14 20e6c: 9f 09 sbc r25, r15 20e6e: c9 84 ldd r12, Y+9 ; 0x09 20e70: da 84 ldd r13, Y+10 ; 0x0a 20e72: eb 84 ldd r14, Y+11 ; 0x0b 20e74: fc 84 ldd r15, Y+12 ; 0x0c 20e76: 6c 0d add r22, r12 20e78: 7d 1d adc r23, r13 20e7a: 8e 1d adc r24, r14 20e7c: 9f 1d adc r25, r15 20e7e: a7 01 movw r20, r14 20e80: 96 01 movw r18, r12 20e82: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 20e86: 69 01 movw r12, r18 20e88: 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; 20e8a: c3 01 movw r24, r6 20e8c: b2 01 movw r22, r4 20e8e: 29 89 ldd r18, Y+17 ; 0x11 20e90: 3a 89 ldd r19, Y+18 ; 0x12 20e92: 4b 89 ldd r20, Y+19 ; 0x13 20e94: 5c 89 ldd r21, Y+20 ; 0x14 20e96: 62 1b sub r22, r18 20e98: 73 0b sbc r23, r19 20e9a: 84 0b sbc r24, r20 20e9c: 95 0b sbc r25, r21 20e9e: 29 85 ldd r18, Y+9 ; 0x09 20ea0: 3a 85 ldd r19, Y+10 ; 0x0a 20ea2: 4b 85 ldd r20, Y+11 ; 0x0b 20ea4: 5c 85 ldd r21, Y+12 ; 0x0c 20ea6: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 20eaa: 29 01 movw r4, r18 20eac: 3a 01 movw r6, r20 uint32_t accel_decel_steps = accelerate_steps + decelerate_steps; 20eae: d7 01 movw r26, r14 20eb0: c6 01 movw r24, r12 20eb2: 84 0d add r24, r4 20eb4: 95 1d adc r25, r5 20eb6: a6 1d adc r26, r6 20eb8: b7 1d adc r27, r7 20eba: 8c 8f std Y+28, r24 ; 0x1c 20ebc: 9d 8f std Y+29, r25 ; 0x1d 20ebe: ae 8f std Y+30, r26 ; 0x1e 20ec0: 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) { 20ec2: f1 01 movw r30, r2 20ec4: e4 5b subi r30, 0xB4 ; 180 20ec6: ff 4f sbci r31, 0xFF ; 255 20ec8: 90 81 ld r25, Z 20eca: 9b 8f std Y+27, r25 ; 0x1b 20ecc: 99 23 and r25, r25 20ece: 09 f4 brne .+2 ; 0x20ed2 20ed0: 8d c0 rjmp .+282 ; 0x20fec final_adv_steps = final_rate * block->adv_comp; 20ed2: 61 2f mov r22, r17 20ed4: 70 2f mov r23, r16 20ed6: 89 a1 ldd r24, Y+33 ; 0x21 20ed8: 98 a1 ldd r25, Y+32 ; 0x20 20eda: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 20ede: f1 01 movw r30, r2 20ee0: ec 5a subi r30, 0xAC ; 172 20ee2: ff 4f sbci r31, 0xFF ; 255 20ee4: 20 81 ld r18, Z 20ee6: 31 81 ldd r19, Z+1 ; 0x01 20ee8: 42 81 ldd r20, Z+2 ; 0x02 20eea: 53 81 ldd r21, Z+3 ; 0x03 20eec: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 20ef0: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 20ef4: 6d 8b std Y+21, r22 ; 0x15 20ef6: 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) { 20ef8: d1 01 movw r26, r2 20efa: 50 96 adiw r26, 0x10 ; 16 20efc: 2d 91 ld r18, X+ 20efe: 3d 91 ld r19, X+ 20f00: 4d 91 ld r20, X+ 20f02: 5c 91 ld r21, X 20f04: 53 97 sbiw r26, 0x13 ; 19 20f06: 29 83 std Y+1, r18 ; 0x01 20f08: 3a 83 std Y+2, r19 ; 0x02 20f0a: 4b 83 std Y+3, r20 ; 0x03 20f0c: 5c 83 std Y+4, r21 ; 0x04 20f0e: 8c 8d ldd r24, Y+28 ; 0x1c 20f10: 9d 8d ldd r25, Y+29 ; 0x1d 20f12: ae 8d ldd r26, Y+30 ; 0x1e 20f14: bf 8d ldd r27, Y+31 ; 0x1f 20f16: 82 17 cp r24, r18 20f18: 93 07 cpc r25, r19 20f1a: a4 07 cpc r26, r20 20f1c: b5 07 cpc r27, r21 20f1e: 08 f0 brcs .+2 ; 0x20f22 20f20: 68 c0 rjmp .+208 ; 0x20ff2 plateau_steps = block->step_event_count.wide - accel_decel_steps; 20f22: 29 01 movw r4, r18 20f24: 3a 01 movw r6, r20 20f26: 48 1a sub r4, r24 20f28: 59 0a sbc r5, r25 20f2a: 6a 0a sbc r6, r26 20f2c: 7b 0a sbc r7, r27 #ifdef LIN_ADVANCE if (block->use_advance_lead) 20f2e: 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; 20f30: 40 e0 ldi r20, 0x00 ; 0 20f32: 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) 20f34: 99 23 and r25, r25 20f36: 89 f0 breq .+34 ; 0x20f5a max_adv_steps = block->nominal_rate * block->adv_comp; 20f38: c5 01 movw r24, r10 20f3a: b4 01 movw r22, r8 20f3c: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 20f40: f1 01 movw r30, r2 20f42: ec 5a subi r30, 0xAC ; 172 20f44: ff 4f sbci r31, 0xFF ; 255 20f46: 20 81 ld r18, Z 20f48: 31 81 ldd r19, Z+1 ; 0x01 20f4a: 42 81 ldd r20, Z+2 ; 0x02 20f4c: 53 81 ldd r21, Z+3 ; 0x03 20f4e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 20f52: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 20f56: 46 2f mov r20, r22 20f58: 87 2f mov r24, r23 } } #endif } CRITICAL_SECTION_START; // Fill variables used by the stepper in a critical section 20f5a: 3f b7 in r19, 0x3f ; 63 20f5c: 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. 20f5e: f1 01 movw r30, r2 20f60: e9 5b subi r30, 0xB9 ; 185 20f62: ff 4f sbci r31, 0xFF ; 255 20f64: 20 81 ld r18, Z 20f66: 21 11 cpse r18, r1 20f68: 27 c0 rjmp .+78 ; 0x20fb8 block->accelerate_until = accelerate_steps; 20f6a: d1 01 movw r26, r2 20f6c: 59 96 adiw r26, 0x19 ; 25 20f6e: cd 92 st X+, r12 20f70: dd 92 st X+, r13 20f72: ed 92 st X+, r14 20f74: fc 92 st X, r15 20f76: 5c 97 sbiw r26, 0x1c ; 28 block->decelerate_after = accelerate_steps+plateau_steps; 20f78: c4 0c add r12, r4 20f7a: d5 1c adc r13, r5 20f7c: e6 1c adc r14, r6 20f7e: f7 1c adc r15, r7 20f80: f1 01 movw r30, r2 20f82: c5 8e std Z+29, r12 ; 0x1d 20f84: d6 8e std Z+30, r13 ; 0x1e 20f86: e7 8e std Z+31, r14 ; 0x1f 20f88: f0 a2 std Z+32, r15 ; 0x20 block->initial_rate = initial_rate; 20f8a: cf 88 ldd r12, Y+23 ; 0x17 20f8c: c2 ae std Z+58, r12 ; 0x3a 20f8e: d8 8c ldd r13, Y+24 ; 0x18 20f90: d3 ae std Z+59, r13 ; 0x3b 20f92: e9 8c ldd r14, Y+25 ; 0x19 20f94: e4 ae std Z+60, r14 ; 0x3c 20f96: fa 8c ldd r15, Y+26 ; 0x1a 20f98: f5 ae std Z+61, r15 ; 0x3d block->final_rate = final_rate; 20f9a: fe 96 adiw r30, 0x3e ; 62 20f9c: 10 83 st Z, r17 20f9e: 01 83 std Z+1, r16 ; 0x01 20fa0: c9 a0 ldd r12, Y+33 ; 0x21 20fa2: c2 82 std Z+2, r12 ; 0x02 20fa4: d8 a0 ldd r13, Y+32 ; 0x20 20fa6: d3 82 std Z+3, r13 ; 0x03 #ifdef LIN_ADVANCE block->final_adv_steps = final_adv_steps; 20fa8: 73 96 adiw r30, 0x13 ; 19 20faa: ed 88 ldd r14, Y+21 ; 0x15 20fac: e0 82 st Z, r14 20fae: fe 88 ldd r15, Y+22 ; 0x16 20fb0: f1 82 std Z+1, r15 ; 0x01 block->max_adv_steps = max_adv_steps; 20fb2: 32 97 sbiw r30, 0x02 ; 2 20fb4: 40 83 st Z, r20 20fb6: 81 83 std Z+1, r24 ; 0x01 #endif } CRITICAL_SECTION_END; 20fb8: 3f bf out 0x3f, r19 ; 63 } 20fba: a1 96 adiw r28, 0x21 ; 33 20fbc: 0f b6 in r0, 0x3f ; 63 20fbe: f8 94 cli 20fc0: de bf out 0x3e, r29 ; 62 20fc2: 0f be out 0x3f, r0 ; 63 20fc4: cd bf out 0x3d, r28 ; 61 20fc6: df 91 pop r29 20fc8: cf 91 pop r28 20fca: 1f 91 pop r17 20fcc: 0f 91 pop r16 20fce: ff 90 pop r15 20fd0: ef 90 pop r14 20fd2: df 90 pop r13 20fd4: cf 90 pop r12 20fd6: bf 90 pop r11 20fd8: af 90 pop r10 20fda: 9f 90 pop r9 20fdc: 8f 90 pop r8 20fde: 7f 90 pop r7 20fe0: 6f 90 pop r6 20fe2: 5f 90 pop r5 20fe4: 4f 90 pop r4 20fe6: 3f 90 pop r3 20fe8: 2f 90 pop r2 20fea: 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; 20fec: 1d 8a std Y+21, r1 ; 0x15 20fee: 1e 8a std Y+22, r1 ; 0x16 20ff0: 83 cf rjmp .-250 ; 0x20ef8 #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; 20ff2: 2d 81 ldd r18, Y+5 ; 0x05 20ff4: 3e 81 ldd r19, Y+6 ; 0x06 20ff6: 4f 81 ldd r20, Y+7 ; 0x07 20ff8: 58 85 ldd r21, Y+8 ; 0x08 20ffa: 82 e0 ldi r24, 0x02 ; 2 20ffc: 22 0f add r18, r18 20ffe: 33 1f adc r19, r19 21000: 44 1f adc r20, r20 21002: 55 1f adc r21, r21 21004: 8a 95 dec r24 21006: d1 f7 brne .-12 ; 0x20ffc 21008: 89 81 ldd r24, Y+1 ; 0x01 2100a: 9a 81 ldd r25, Y+2 ; 0x02 2100c: ab 81 ldd r26, Y+3 ; 0x03 2100e: bc 81 ldd r27, Y+4 ; 0x04 21010: 81 70 andi r24, 0x01 ; 1 21012: 99 27 eor r25, r25 21014: aa 27 eor r26, r26 21016: bb 27 eor r27, r27 21018: 8d 83 std Y+5, r24 ; 0x05 2101a: 9e 83 std Y+6, r25 ; 0x06 2101c: af 83 std Y+7, r26 ; 0x07 2101e: b8 87 std Y+8, r27 ; 0x08 21020: 89 80 ldd r8, Y+1 ; 0x01 21022: 9a 80 ldd r9, Y+2 ; 0x02 21024: ab 80 ldd r10, Y+3 ; 0x03 21026: bc 80 ldd r11, Y+4 ; 0x04 21028: b6 94 lsr r11 2102a: a7 94 ror r10 2102c: 97 94 ror r9 2102e: 87 94 ror r8 // Avoid negative numbers if (final_rate_sqr >= initial_rate_sqr) { 21030: cd 84 ldd r12, Y+13 ; 0x0d 21032: de 84 ldd r13, Y+14 ; 0x0e 21034: ef 84 ldd r14, Y+15 ; 0x0f 21036: f8 88 ldd r15, Y+16 ; 0x10 21038: 89 89 ldd r24, Y+17 ; 0x11 2103a: 9a 89 ldd r25, Y+18 ; 0x12 2103c: ab 89 ldd r26, Y+19 ; 0x13 2103e: bc 89 ldd r27, Y+20 ; 0x14 21040: 8c 15 cp r24, r12 21042: 9d 05 cpc r25, r13 21044: ae 05 cpc r26, r14 21046: bf 05 cpc r27, r15 21048: 08 f4 brcc .+2 ; 0x2104c 2104a: 6f c0 rjmp .+222 ; 0x2112a // 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; 2104c: 6c 01 movw r12, r24 2104e: 7d 01 movw r14, r26 21050: 91 e0 ldi r25, 0x01 ; 1 21052: c9 1a sub r12, r25 21054: d1 08 sbc r13, r1 21056: e1 08 sbc r14, r1 21058: f1 08 sbc r15, r1 2105a: 8d 85 ldd r24, Y+13 ; 0x0d 2105c: 9e 85 ldd r25, Y+14 ; 0x0e 2105e: af 85 ldd r26, Y+15 ; 0x0f 21060: b8 89 ldd r27, Y+16 ; 0x10 21062: c8 1a sub r12, r24 21064: d9 0a sbc r13, r25 21066: ea 0a sbc r14, r26 21068: fb 0a sbc r15, r27 2106a: c7 01 movw r24, r14 2106c: b6 01 movw r22, r12 2106e: 62 0f add r22, r18 21070: 73 1f adc r23, r19 21072: 84 1f adc r24, r20 21074: 95 1f adc r25, r21 if (block->step_event_count.wide & 1) 21076: cd 80 ldd r12, Y+5 ; 0x05 21078: de 80 ldd r13, Y+6 ; 0x06 2107a: ef 80 ldd r14, Y+7 ; 0x07 2107c: f8 84 ldd r15, Y+8 ; 0x08 2107e: cd 28 or r12, r13 21080: ce 28 or r12, r14 21082: cf 28 or r12, r15 21084: 41 f0 breq .+16 ; 0x21096 accelerate_steps += acceleration_x2; 21086: c9 84 ldd r12, Y+9 ; 0x09 21088: da 84 ldd r13, Y+10 ; 0x0a 2108a: eb 84 ldd r14, Y+11 ; 0x0b 2108c: fc 84 ldd r15, Y+12 ; 0x0c 2108e: 6c 0d add r22, r12 21090: 7d 1d adc r23, r13 21092: 8e 1d adc r24, r14 21094: 9f 1d adc r25, r15 accelerate_steps /= acceleration_x4; 21096: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 2109a: 75 01 movw r14, r10 2109c: 64 01 movw r12, r8 2109e: c2 0e add r12, r18 210a0: d3 1e adc r13, r19 210a2: e4 1e adc r14, r20 210a4: f5 1e adc r15, r21 210a6: 29 81 ldd r18, Y+1 ; 0x01 210a8: 3a 81 ldd r19, Y+2 ; 0x02 210aa: 4b 81 ldd r20, Y+3 ; 0x03 210ac: 5c 81 ldd r21, Y+4 ; 0x04 210ae: 2c 15 cp r18, r12 210b0: 3d 05 cpc r19, r13 210b2: 4e 05 cpc r20, r14 210b4: 5f 05 cpc r21, r15 210b6: 10 f4 brcc .+4 ; 0x210bc 210b8: 69 01 movw r12, r18 210ba: 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) { 210bc: 2b 8d ldd r18, Y+27 ; 0x1b 210be: 22 23 and r18, r18 210c0: 09 f4 brne .+2 ; 0x210c4 210c2: 69 c0 rjmp .+210 ; 0x21196 if(!accelerate_steps || !decelerate_steps) { 210c4: c1 14 cp r12, r1 210c6: d1 04 cpc r13, r1 210c8: e1 04 cpc r14, r1 210ca: f1 04 cpc r15, r1 210cc: 09 f4 brne .+2 ; 0x210d0 210ce: 66 c0 rjmp .+204 ; 0x2119c // 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; 210d0: 4d 89 ldd r20, Y+21 ; 0x15 210d2: 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) { 210d4: 41 14 cp r4, r1 210d6: 51 04 cpc r5, r1 210d8: 61 04 cpc r6, r1 210da: 71 04 cpc r7, r1 210dc: 09 f4 brne .+2 ; 0x210e0 210de: 3d cf rjmp .-390 ; 0x20f5a // 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); 210e0: a7 01 movw r20, r14 210e2: 96 01 movw r18, r12 210e4: 69 85 ldd r22, Y+9 ; 0x09 210e6: 7a 85 ldd r23, Y+10 ; 0x0a 210e8: 8b 85 ldd r24, Y+11 ; 0x0b 210ea: 9c 85 ldd r25, Y+12 ; 0x0c 210ec: 0f 94 e4 a4 call 0x349c8 ; 0x349c8 <__mulsi3> 210f0: 2d 85 ldd r18, Y+13 ; 0x0d 210f2: 3e 85 ldd r19, Y+14 ; 0x0e 210f4: 4f 85 ldd r20, Y+15 ; 0x0f 210f6: 58 89 ldd r21, Y+16 ; 0x10 210f8: 62 0f add r22, r18 210fa: 73 1f adc r23, r19 210fc: 84 1f adc r24, r20 210fe: 95 1f adc r25, r21 21100: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 21104: 0f 94 77 a9 call 0x352ee ; 0x352ee max_adv_steps = max_rate * block->adv_comp; 21108: f1 01 movw r30, r2 2110a: ec 5a subi r30, 0xAC ; 172 2110c: ff 4f sbci r31, 0xFF ; 255 2110e: 20 81 ld r18, Z 21110: 31 81 ldd r19, Z+1 ; 0x01 21112: 42 81 ldd r20, Z+2 ; 0x02 21114: 53 81 ldd r21, Z+3 ; 0x03 21116: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2111a: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 2111e: 46 2f mov r20, r22 21120: 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; 21122: 41 2c mov r4, r1 21124: 51 2c mov r5, r1 21126: 32 01 movw r6, r4 21128: 18 cf rjmp .-464 ; 0x20f5a 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; 2112a: 6d 85 ldd r22, Y+13 ; 0x0d 2112c: 7e 85 ldd r23, Y+14 ; 0x0e 2112e: 8f 85 ldd r24, Y+15 ; 0x0f 21130: 98 89 ldd r25, Y+16 ; 0x10 21132: c9 88 ldd r12, Y+17 ; 0x11 21134: da 88 ldd r13, Y+18 ; 0x12 21136: eb 88 ldd r14, Y+19 ; 0x13 21138: fc 88 ldd r15, Y+20 ; 0x14 2113a: 6c 19 sub r22, r12 2113c: 7d 09 sbc r23, r13 2113e: 8e 09 sbc r24, r14 21140: 9f 09 sbc r25, r15 if (block->step_event_count.wide & 1) 21142: cd 80 ldd r12, Y+5 ; 0x05 21144: de 80 ldd r13, Y+6 ; 0x06 21146: ef 80 ldd r14, Y+7 ; 0x07 21148: f8 84 ldd r15, Y+8 ; 0x08 2114a: cd 28 or r12, r13 2114c: ce 28 or r12, r14 2114e: cf 28 or r12, r15 21150: 41 f0 breq .+16 ; 0x21162 decelerate_steps += acceleration_x2; 21152: c9 84 ldd r12, Y+9 ; 0x09 21154: da 84 ldd r13, Y+10 ; 0x0a 21156: eb 84 ldd r14, Y+11 ; 0x0b 21158: fc 84 ldd r15, Y+12 ; 0x0c 2115a: 6c 0d add r22, r12 2115c: 7d 1d adc r23, r13 2115e: 8e 1d adc r24, r14 21160: 9f 1d adc r25, r15 decelerate_steps /= acceleration_x4; 21162: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> decelerate_steps += (block->step_event_count.wide >> 1); 21166: 82 0e add r8, r18 21168: 93 1e adc r9, r19 2116a: a4 1e adc r10, r20 2116c: b5 1e adc r11, r21 2116e: 49 80 ldd r4, Y+1 ; 0x01 21170: 5a 80 ldd r5, Y+2 ; 0x02 21172: 6b 80 ldd r6, Y+3 ; 0x03 21174: 7c 80 ldd r7, Y+4 ; 0x04 21176: 84 14 cp r8, r4 21178: 95 04 cpc r9, r5 2117a: a6 04 cpc r10, r6 2117c: b7 04 cpc r11, r7 2117e: 10 f4 brcc .+4 ; 0x21184 21180: 24 01 movw r4, r8 21182: 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; 21184: c9 80 ldd r12, Y+1 ; 0x01 21186: da 80 ldd r13, Y+2 ; 0x02 21188: eb 80 ldd r14, Y+3 ; 0x03 2118a: fc 80 ldd r15, Y+4 ; 0x04 2118c: c4 18 sub r12, r4 2118e: d5 08 sbc r13, r5 21190: e6 08 sbc r14, r6 21192: f7 08 sbc r15, r7 21194: 93 cf rjmp .-218 ; 0x210bc // 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; 21196: 40 e0 ldi r20, 0x00 ; 0 21198: 80 e0 ldi r24, 0x00 ; 0 2119a: c3 cf rjmp .-122 ; 0x21122 #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; 2119c: 4d 89 ldd r20, Y+21 ; 0x15 2119e: 8e 89 ldd r24, Y+22 ; 0x16 211a0: c0 cf rjmp .-128 ; 0x21122 000211a2 : }; 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() { 211a2: ef 92 push r14 211a4: ff 92 push r15 211a6: 0f 93 push r16 211a8: 1f 93 push r17 211aa: cf 93 push r28 211ac: df 93 push r29 211ae: 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) 211b2: 80 91 a3 03 lds r24, 0x03A3 ; 0x8003a3 211b6: 81 11 cpse r24, r1 211b8: 23 c0 rjmp .+70 ; 0x21200 { _md->status = 1; // Menu entered for the first time 211ba: 81 e0 ldi r24, 0x01 ; 1 211bc: 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; 211c0: 81 e0 ldi r24, 0x01 ; 1 211c2: 90 e0 ldi r25, 0x00 ; 0 211c4: 20 91 d2 12 lds r18, 0x12D2 ; 0x8012d2 211c8: 30 91 d3 12 lds r19, 0x12D3 ; 0x8012d3 211cc: 27 30 cpi r18, 0x07 ; 7 211ce: 31 48 sbci r19, 0x81 ; 129 211d0: 11 f0 breq .+4 ; 0x211d6 211d2: 90 e0 ldi r25, 0x00 ; 0 211d4: 80 e0 ldi r24, 0x00 ; 0 memcpy_P(&(_md->item), &TuneItems[offset], sizeof(TuneItem)); 211d6: bc 01 movw r22, r24 211d8: 66 0f add r22, r22 211da: 77 1f adc r23, r23 211dc: 68 0f add r22, r24 211de: 79 1f adc r23, r25 211e0: 66 52 subi r22, 0x26 ; 38 211e2: 77 47 sbci r23, 0x77 ; 119 211e4: 43 e0 ldi r20, 0x03 ; 3 211e6: 50 e0 ldi r21, 0x00 ; 0 211e8: 85 ea ldi r24, 0xA5 ; 165 211ea: 93 e0 ldi r25, 0x03 ; 3 211ec: 0f 94 1b a2 call 0x34436 ; 0x34436 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); 211f0: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 211f4: 0e 94 9c fc call 0x1f938 ; 0x1f938 _md->currentValue = mmu2.GetLastReadRegisterValue(); 211f8: 80 91 fd 12 lds r24, 0x12FD ; 0x8012fd 211fc: 80 93 a4 03 sts 0x03A4, r24 ; 0x8003a4 } MENU_BEGIN(); 21200: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 21204: 10 92 60 04 sts 0x0460, r1 ; 0x800460 21208: 80 91 60 04 lds r24, 0x0460 ; 0x800460 2120c: 84 30 cpi r24, 0x04 ; 4 2120e: e0 f5 brcc .+120 ; 0x21288 21210: 10 92 63 04 sts 0x0463, r1 ; 0x800463 ON_MENU_LEAVE( 21214: 0e 94 9d 62 call 0xc53a ; 0xc53a 21218: 88 23 and r24, r24 2121a: 89 f0 breq .+34 ; 0x2123e 2121c: 60 91 a4 03 lds r22, 0x03A4 ; 0x8003a4 21220: 70 e0 ldi r23, 0x00 ; 0 21222: 80 91 a5 03 lds r24, 0x03A5 ; 0x8003a5 21226: 0e 94 84 d0 call 0x1a108 ; 0x1a108 2122a: 10 92 43 0d sts 0x0D43, r1 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.449> &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 2122e: df 91 pop r29 21230: cf 91 pop r28 21232: 1f 91 pop r17 21234: 0f 91 pop r16 21236: ff 90 pop r15 21238: ef 90 pop r14 mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); ON_MENU_LEAVE( 2123a: 0d 94 6e 05 jmp 0x20adc ; 0x20adc mmu2.WriteRegister(_md->item.address, (uint16_t)_md->currentValue); putErrorScreenToSleep = false; lcd_return_to_status(); return; ); MENU_ITEM_BACK_P(_T(MSG_DONE)); 2123e: 83 ec ldi r24, 0xC3 ; 195 21240: 96 e5 ldi r25, 0x56 ; 86 21242: 0e 94 8b 75 call 0xeb16 ; 0xeb16 21246: 0e 94 1f 73 call 0xe63e ; 0xe63e MENU_ITEM_EDIT_int3_P( 2124a: 00 91 a7 03 lds r16, 0x03A7 ; 0x8003a7 2124e: 10 e0 ldi r17, 0x00 ; 0 21250: c0 91 a6 03 lds r28, 0x03A6 ; 0x8003a6 21254: d0 e0 ldi r29, 0x00 ; 0 21256: 85 eb ldi r24, 0xB5 ; 181 21258: 96 e5 ldi r25, 0x56 ; 86 2125a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2125e: f1 2c mov r15, r1 21260: e1 2c mov r14, r1 21262: 9e 01 movw r18, r28 21264: 48 e0 ldi r20, 0x08 ; 8 21266: 64 ea ldi r22, 0xA4 ; 164 21268: 73 e0 ldi r23, 0x03 ; 3 2126a: 0e 94 bf 6f call 0xdf7e ; 0xdf7e _T(MSG_MMU_SENSITIVITY), &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); 2126e: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 // Fetch the value which is currently in MMU EEPROM mmu2.ReadRegister(_md->item.address); _md->currentValue = mmu2.GetLastReadRegisterValue(); } MENU_BEGIN(); 21272: 80 91 60 04 lds r24, 0x0460 ; 0x800460 21276: 8f 5f subi r24, 0xFF ; 255 21278: 80 93 60 04 sts 0x0460, r24 ; 0x800460 2127c: 80 91 62 04 lds r24, 0x0462 ; 0x800462 21280: 8f 5f subi r24, 0xFF ; 255 21282: 80 93 62 04 sts 0x0462, r24 ; 0x800462 21286: c0 cf rjmp .-128 ; 0x21208 &_md->currentValue, _md->item.minValue, _md->item.maxValue ); MENU_END(); } 21288: df 91 pop r29 2128a: cf 91 pop r28 2128c: 1f 91 pop r17 2128e: 0f 91 pop r16 21290: ff 90 pop r15 21292: ef 90 pop r14 21294: 08 95 ret 00021296 : lcd_puts_at_P(0, 2, _T(MSG_CHANGE_SUCCESS)); } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { 21296: 1f 93 push r17 21298: cf 93 push r28 2129a: 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); 2129c: 64 e6 ldi r22, 0x64 ; 100 2129e: 70 e0 ldi r23, 0x00 ; 0 212a0: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> 212a4: 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++) { 212a6: 10 e0 ldi r17, 0x00 ; 0 lcd_putc_at(i, 3, '.'); 212a8: 4e e2 ldi r20, 0x2E ; 46 212aa: 63 e0 ldi r22, 0x03 ; 3 212ac: 81 2f mov r24, r17 212ae: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); 212b2: ce 01 movw r24, r28 212b4: 0e 94 07 8d call 0x11a0e ; 0x11a0e 212b8: ce 01 movw r24, r28 212ba: 0e 94 07 8d call 0x11a0e ; 0x11a0e 212be: ce 01 movw r24, r28 212c0: 0e 94 07 8d call 0x11a0e ; 0x11a0e 212c4: ce 01 movw r24, r28 212c6: 0e 94 07 8d call 0x11a0e ; 0x11a0e 212ca: ce 01 movw r24, r28 212cc: 0e 94 07 8d call 0x11a0e ; 0x11a0e } static void lcd_loading_progress_bar(uint16_t loading_time_ms) { for (uint_least8_t i = 0; i < LCD_WIDTH; i++) { 212d0: 1f 5f subi r17, 0xFF ; 255 212d2: 14 31 cpi r17, 0x14 ; 20 212d4: 49 f7 brne .-46 ; 0x212a8 //loading_time_ms/20 delay for (uint_least8_t j = 0; j < 5; j++) { delay_keep_alive(loading_time_ms / 100); } } } 212d6: df 91 pop r29 212d8: cf 91 pop r28 212da: 1f 91 pop r17 212dc: 08 95 ret 000212de : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 212de: 10 92 94 03 sts 0x0394, r1 ; 0x800394 static void __attribute__((noinline)) clearFilamentAction() { // filament action has been cancelled or completed setFilamentAction(FilamentAction::None); } 212e2: 08 95 ret 000212e4 : bFilamentPreheatState = false; mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { 212e4: cf 93 push r28 MENU_BEGIN(); 212e6: 0e 94 5d 74 call 0xe8ba ; 0xe8ba 212ea: 10 92 60 04 sts 0x0460, r1 ; 0x800460 212ee: 80 91 60 04 lds r24, 0x0460 ; 0x800460 212f2: 84 30 cpi r24, 0x04 ; 4 212f4: 08 f0 brcs .+2 ; 0x212f8 212f6: b1 c0 rjmp .+354 ; 0x2145a 212f8: 10 92 63 04 sts 0x0463, r1 ; 0x800463 if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 212fc: 8f e5 ldi r24, 0x5F ; 95 212fe: 9f e0 ldi r25, 0x0F ; 15 21300: 0f 94 81 a4 call 0x34902 ; 0x34902 21304: 81 11 cpse r24, r1 21306: 0f c0 rjmp .+30 ; 0x21326 { ON_MENU_LEAVE( 21308: 0e 94 9d 62 call 0xc53a ; 0xc53a 2130c: 81 11 cpse r24, r1 2130e: 0f 94 6f 09 call 0x212de ; 0x212de clearFilamentAction(); ); MENU_ITEM_BACK_P(_T(eFilamentAction == FilamentAction::Lay1Cal ? MSG_BACK : MSG_MAIN)); 21312: 80 91 94 03 lds r24, 0x0394 ; 0x800394 21316: 8a 30 cpi r24, 0x0A ; 10 21318: a9 f1 breq .+106 ; 0x21384 2131a: 89 ef ldi r24, 0xF9 ; 249 2131c: 98 e4 ldi r25, 0x48 ; 72 2131e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 21322: 0e 94 1f 73 call 0xe63e ; 0xe63e } if (farm_mode) 21326: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 2132a: 88 23 and r24, r24 2132c: 71 f1 breq .+92 ; 0x2138a { MENU_ITEM_FUNCTION_P(PSTR("farm - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/" STRINGIFY(FARM_PREHEAT_HPB_TEMP)), mFilamentItem_farm); 2132e: 60 e7 ldi r22, 0x70 ; 112 21330: 77 e3 ldi r23, 0x37 ; 55 21332: 84 ee ldi r24, 0xE4 ; 228 21334: 9a e9 ldi r25, 0x9A ; 154 21336: 0e 94 ee 72 call 0xe5dc ; 0xe5dc MENU_ITEM_FUNCTION_P(PSTR("nozzle - " STRINGIFY(FARM_PREHEAT_HOTEND_TEMP) "/0"), mFilamentItem_farm_nozzle); 2133a: 60 e9 ldi r22, 0x90 ; 144 2133c: 77 e3 ldi r23, 0x37 ; 55 2133e: 84 ed ldi r24, 0xD4 ; 212 21340: 9a e9 ldi r25, 0x9A ; 154 21342: 0e 94 ee 72 call 0xe5dc ; 0xe5dc 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); 21346: 8f e5 ldi r24, 0x5F ; 95 21348: 9f e0 ldi r25, 0x0F ; 15 2134a: 0f 94 81 a4 call 0x34902 ; 0x34902 2134e: 81 11 cpse r24, r1 21350: 0c c0 rjmp .+24 ; 0x2136a 21352: 80 91 94 03 lds r24, 0x0394 ; 0x800394 21356: 89 30 cpi r24, 0x09 ; 9 21358: 41 f4 brne .+16 ; 0x2136a 2135a: 82 ed ldi r24, 0xD2 ; 210 2135c: 98 e5 ldi r25, 0x58 ; 88 2135e: 0e 94 8b 75 call 0xeb16 ; 0xeb16 21362: 6e e0 ldi r22, 0x0E ; 14 21364: 78 e3 ldi r23, 0x38 ; 56 21366: 0e 94 ee 72 call 0xe5dc ; 0xe5dc MENU_END(); 2136a: 0e 94 d4 62 call 0xc5a8 ; 0xc5a8 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); } void lcd_generic_preheat_menu() { MENU_BEGIN(); 2136e: 80 91 60 04 lds r24, 0x0460 ; 0x800460 21372: 8f 5f subi r24, 0xFF ; 255 21374: 80 93 60 04 sts 0x0460, r24 ; 0x800460 21378: 80 91 62 04 lds r24, 0x0462 ; 0x800462 2137c: 8f 5f subi r24, 0xFF ; 255 2137e: 80 93 62 04 sts 0x0462, r24 ; 0x800462 21382: b5 cf rjmp .-150 ; 0x212ee 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)); 21384: 82 e0 ldi r24, 0x02 ; 2 21386: 9b e4 ldi r25, 0x4B ; 75 21388: ca cf rjmp .-108 ; 0x2131e 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(); 2138a: 0f 94 16 02 call 0x2042c ; 0x2042c 2138e: 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); 21390: 89 eb ldi r24, 0xB9 ; 185 21392: 9a e9 ldi r25, 0x9A ; 154 21394: cc 23 and r28, r28 21396: 11 f0 breq .+4 ; 0x2139c 21398: 88 ec ldi r24, 0xC8 ; 200 2139a: 9a e9 ldi r25, 0x9A ; 154 2139c: 66 e1 ldi r22, 0x16 ; 22 2139e: 78 e3 ldi r23, 0x38 ; 56 213a0: 0e 94 44 73 call 0xe688 ; 0xe688 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); 213a4: 8e e9 ldi r24, 0x9E ; 158 213a6: 9a e9 ldi r25, 0x9A ; 154 213a8: cc 23 and r28, r28 213aa: 11 f0 breq .+4 ; 0x213b0 213ac: 8d ea ldi r24, 0xAD ; 173 213ae: 9a e9 ldi r25, 0x9A ; 154 213b0: 66 ee ldi r22, 0xE6 ; 230 213b2: 77 e3 ldi r23, 0x37 ; 55 213b4: 0e 94 44 73 call 0xe688 ; 0xe688 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); 213b8: 82 e8 ldi r24, 0x82 ; 130 213ba: 9a e9 ldi r25, 0x9A ; 154 213bc: cc 23 and r28, r28 213be: 11 f0 breq .+4 ; 0x213c4 213c0: 82 e9 ldi r24, 0x92 ; 146 213c2: 9a e9 ldi r25, 0x9A ; 154 213c4: 68 ef ldi r22, 0xF8 ; 248 213c6: 78 e3 ldi r23, 0x38 ; 56 213c8: 0e 94 44 73 call 0xe688 ; 0xe688 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); 213cc: 86 e6 ldi r24, 0x66 ; 102 213ce: 9a e9 ldi r25, 0x9A ; 154 213d0: cc 23 and r28, r28 213d2: 11 f0 breq .+4 ; 0x213d8 213d4: 86 e7 ldi r24, 0x76 ; 118 213d6: 9a e9 ldi r25, 0x9A ; 154 213d8: 68 e2 ldi r22, 0x28 ; 40 213da: 78 e3 ldi r23, 0x38 ; 56 213dc: 0e 94 44 73 call 0xe688 ; 0xe688 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); 213e0: 8b e4 ldi r24, 0x4B ; 75 213e2: 9a e9 ldi r25, 0x9A ; 154 213e4: cc 23 and r28, r28 213e6: 11 f0 breq .+4 ; 0x213ec 213e8: 8a e5 ldi r24, 0x5A ; 90 213ea: 9a e9 ldi r25, 0x9A ; 154 213ec: 62 ea ldi r22, 0xA2 ; 162 213ee: 77 e3 ldi r23, 0x37 ; 55 213f0: 0e 94 44 73 call 0xe688 ; 0xe688 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); 213f4: 80 e3 ldi r24, 0x30 ; 48 213f6: 9a e9 ldi r25, 0x9A ; 154 213f8: cc 23 and r28, r28 213fa: 11 f0 breq .+4 ; 0x21400 213fc: 8f e3 ldi r24, 0x3F ; 63 213fe: 9a e9 ldi r25, 0x9A ; 154 21400: 6c eb ldi r22, 0xBC ; 188 21402: 77 e3 ldi r23, 0x37 ; 55 21404: 0e 94 44 73 call 0xe688 ; 0xe688 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); 21408: 84 e1 ldi r24, 0x14 ; 20 2140a: 9a e9 ldi r25, 0x9A ; 154 2140c: cc 23 and r28, r28 2140e: 11 f0 breq .+4 ; 0x21414 21410: 84 e2 ldi r24, 0x24 ; 36 21412: 9a e9 ldi r25, 0x9A ; 154 21414: 60 ec ldi r22, 0xC0 ; 192 21416: 77 e3 ldi r23, 0x37 ; 55 21418: 0e 94 44 73 call 0xe688 ; 0xe688 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); 2141c: 88 ef ldi r24, 0xF8 ; 248 2141e: 99 e9 ldi r25, 0x99 ; 153 21420: cc 23 and r28, r28 21422: 11 f0 breq .+4 ; 0x21428 21424: 88 e0 ldi r24, 0x08 ; 8 21426: 9a e9 ldi r25, 0x9A ; 154 21428: 66 ec ldi r22, 0xC6 ; 198 2142a: 78 e3 ldi r23, 0x38 ; 56 2142c: 0e 94 44 73 call 0xe688 ; 0xe688 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); 21430: 8c ed ldi r24, 0xDC ; 220 21432: 99 e9 ldi r25, 0x99 ; 153 21434: cc 23 and r28, r28 21436: 11 f0 breq .+4 ; 0x2143c 21438: 8c ee ldi r24, 0xEC ; 236 2143a: 99 e9 ldi r25, 0x99 ; 153 2143c: 64 e1 ldi r22, 0x14 ; 20 2143e: 78 e3 ldi r23, 0x38 ; 56 21440: 0e 94 44 73 call 0xe688 ; 0xe688 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); 21444: 81 ec ldi r24, 0xC1 ; 193 21446: 99 e9 ldi r25, 0x99 ; 153 21448: cc 23 and r28, r28 2144a: 11 f0 breq .+4 ; 0x21450 2144c: 80 ed ldi r24, 0xD0 ; 208 2144e: 99 e9 ldi r25, 0x99 ; 153 21450: 62 e7 ldi r22, 0x72 ; 114 21452: 78 e3 ldi r23, 0x38 ; 56 21454: 0e 94 44 73 call 0xe688 ; 0xe688 21458: 76 cf rjmp .-276 ; 0x21346 } if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) && eFilamentAction == FilamentAction::Preheat) MENU_ITEM_FUNCTION_P(_T(MSG_COOLDOWN), lcd_cooldown); MENU_END(); } 2145a: cf 91 pop r28 2145c: 08 95 ret 0002145e : #endif //RESUME_DEBUG //! @brief Show Preheat Menu static void lcd_preheat_menu() { eFilamentAction = FilamentAction::Preheat; 2145e: 89 e0 ldi r24, 0x09 ; 9 21460: 80 93 94 03 sts 0x0394, r24 ; 0x800394 lcd_generic_preheat_menu(); 21464: 0d 94 72 09 jmp 0x212e4 ; 0x212e4 00021468 : } // 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); 21468: 5f 93 push r21 2146a: 4f 93 push r20 2146c: 7f 93 push r23 2146e: 6f 93 push r22 21470: 28 2f mov r18, r24 21472: 08 2e mov r0, r24 21474: 00 0c add r0, r0 21476: 33 0b sbc r19, r19 21478: 3f 93 push r19 2147a: 8f 93 push r24 2147c: 8b ef ldi r24, 0xFB ; 251 2147e: 9a e6 ldi r25, 0x6A ; 106 21480: 9f 93 push r25 21482: 8f 93 push r24 21484: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 lcd_space(9 - chars); 21488: 2d b7 in r18, 0x3d ; 61 2148a: 3e b7 in r19, 0x3e ; 62 2148c: 28 5f subi r18, 0xF8 ; 248 2148e: 3f 4f sbci r19, 0xFF ; 255 21490: 0f b6 in r0, 0x3f ; 63 21492: f8 94 cli 21494: 3e bf out 0x3e, r19 ; 62 21496: 0f be out 0x3f, r0 ; 63 21498: 2d bf out 0x3d, r18 ; 61 2149a: 99 e0 ldi r25, 0x09 ; 9 2149c: 98 1b sub r25, r24 2149e: 89 2f mov r24, r25 214a0: 0c 94 79 6f jmp 0xdef2 ; 0xdef2 000214a4 : default: return false; } } void lcd_print_target_temps_first_line() { 214a4: cf 93 push r28 214a6: df 93 push r29 lcd_home(); 214a8: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 lcdui_print_temp(LCD_STR_THERMOMETER[0], (int) degHotend(0), (int) degTargetHotend(0)); 214ac: c0 91 5d 12 lds r28, 0x125D ; 0x80125d 214b0: d0 91 5e 12 lds r29, 0x125E ; 0x80125e 214b4: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 214b8: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 214bc: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 214c0: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 214c4: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 214c8: ae 01 movw r20, r28 214ca: 82 e8 ldi r24, 0x82 ; 130 214cc: 0f 94 34 0a call 0x21468 ; 0x21468 lcd_set_cursor(10, 0); 214d0: 60 e0 ldi r22, 0x00 ; 0 214d2: 8a e0 ldi r24, 0x0A ; 10 214d4: 0e 94 ab 6f call 0xdf56 ; 0xdf56 FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 214d8: c0 91 59 12 lds r28, 0x1259 ; 0x801259 214dc: d0 91 5a 12 lds r29, 0x125A ; 0x80125a int targetBedTemp = (int) degTargetBed(); if (targetBedTemp) { 214e0: 20 97 sbiw r28, 0x00 ; 0 214e2: 81 f0 breq .+32 ; 0x21504 lcdui_print_temp(LCD_STR_BEDTEMP[0], (int) degBed(), targetBedTemp); 214e4: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 214e8: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 214ec: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 214f0: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 214f4: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 214f8: ae 01 movw r20, r28 214fa: 80 e8 ldi r24, 0x80 ; 128 } else { lcd_space(10); } } 214fc: df 91 pop r29 214fe: 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); 21500: 0d 94 34 0a jmp 0x21468 ; 0x21468 } else { lcd_space(10); 21504: 8a e0 ldi r24, 0x0A ; 10 } } 21506: df 91 pop r29 21508: 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); 2150a: 0c 94 79 6f jmp 0xdef2 ; 0xdef2 0002150e : 2150e: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 } } static void mFilamentPrompt() { lcd_timeoutToStatus.stop(); lcd_print_target_temps_first_line(); 21512: 0f 94 52 0a call 0x214a4 ; 0x214a4 lcd_puts_at_P(0,1, _T(MSG_PRESS_KNOB)); 21516: 8b e6 ldi r24, 0x6B ; 107 21518: 98 e5 ldi r25, 0x58 ; 88 2151a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2151e: ac 01 movw r20, r24 21520: 61 e0 ldi r22, 0x01 ; 1 21522: 80 e0 ldi r24, 0x00 ; 0 21524: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(0,2); 21528: 62 e0 ldi r22, 0x02 ; 2 2152a: 80 e0 ldi r24, 0x00 ; 0 2152c: 0e 94 ab 6f call 0xdf56 ; 0xdf56 switch(eFilamentAction) { 21530: 80 91 94 03 lds r24, 0x0394 ; 0x800394 21534: 83 30 cpi r24, 0x03 ; 3 21536: 81 f1 breq .+96 ; 0x21598 21538: 48 f4 brcc .+18 ; 0x2154c 2153a: 81 30 cpi r24, 0x01 ; 1 2153c: 60 f0 brcs .+24 ; 0x21556 case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_TO_LOAD_FIL)); 2153e: 88 e5 ldi r24, 0x58 ; 88 21540: 98 e5 ldi r25, 0x58 ; 88 break; case FilamentAction::UnLoad: case FilamentAction::MmuUnLoad: lcd_puts_P(_T(MSG_TO_UNLOAD_FIL)); 21542: 0e 94 8b 75 call 0xeb16 ; 0xeb16 21546: 0e 94 6e 6f call 0xdedc ; 0xdedc 2154a: 05 c0 rjmp .+10 ; 0x21556 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) { 2154c: 85 30 cpi r24, 0x05 ; 5 2154e: 21 f1 breq .+72 ; 0x21598 21550: b0 f3 brcs .-20 ; 0x2153e 21552: 88 30 cpi r24, 0x08 ; 8 21554: a1 f3 breq .-24 ; 0x2153e case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } if(lcd_clicked() 21556: 0e 94 c6 73 call 0xe78c ; 0xe78c #ifdef FILAMENT_SENSOR /// @todo leptun - add this as a specific retest item || (((eFilamentAction == FilamentAction::Load) || (eFilamentAction == FilamentAction::AutoLoad)) && fsensor.getFilamentLoadEvent()) 2155a: 81 11 cpse r24, r1 2155c: 09 c0 rjmp .+18 ; 0x21570 2155e: 80 91 94 03 lds r24, 0x0394 ; 0x800394 21562: 81 50 subi r24, 0x01 ; 1 21564: 82 30 cpi r24, 0x02 ; 2 21566: 28 f5 brcc .+74 ; 0x215b2 21568: 80 91 f5 16 lds r24, 0x16F5 ; 0x8016f5 2156c: 88 23 and r24, r24 2156e: 09 f1 breq .+66 ; 0x215b2 #endif //FILAMENT_SENSOR ) { menu_back(bFilamentPreheatState ? 2 : 3); 21570: 80 91 15 06 lds r24, 0x0615 ; 0x800615 21574: 81 11 cpse r24, r1 21576: 13 c0 rjmp .+38 ; 0x2159e 21578: 83 e0 ldi r24, 0x03 ; 3 2157a: 0e 94 50 63 call 0xc6a0 ; 0xc6a0 switch(eFilamentAction) { 2157e: 80 91 94 03 lds r24, 0x0394 ; 0x800394 21582: 82 30 cpi r24, 0x02 ; 2 21584: 71 f0 breq .+28 ; 0x215a2 21586: 83 30 cpi r24, 0x03 ; 3 21588: 81 f0 breq .+32 ; 0x215aa 2158a: 81 30 cpi r24, 0x01 ; 1 2158c: 91 f4 brne .+36 ; 0x215b2 case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament 2158e: 61 e0 ldi r22, 0x01 ; 1 21590: 8c eb ldi r24, 0xBC ; 188 21592: 9b e6 ldi r25, 0x6B ; 107 break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 21594: 0c 94 62 8d jmp 0x11ac4 ; 0x11ac4 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)); 21598: 83 e4 ldi r24, 0x43 ; 67 2159a: 98 e5 ldi r25, 0x58 ; 88 2159c: d2 cf rjmp .-92 ; 0x21542 #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); 2159e: 82 e0 ldi r24, 0x02 ; 2 215a0: ec cf rjmp .-40 ; 0x2157a switch(eFilamentAction) { case FilamentAction::AutoLoad: // loading no longer cancellable eFilamentAction = FilamentAction::Load; 215a2: 81 e0 ldi r24, 0x01 ; 1 215a4: 80 93 94 03 sts 0x0394, r24 ; 0x800394 215a8: f2 cf rjmp .-28 ; 0x2158e [[fallthrough]]; case FilamentAction::Load: enquecommand_P(MSG_M701); // load filament break; case FilamentAction::UnLoad: enquecommand_P(MSG_M702); // unload filament 215aa: 61 e0 ldi r22, 0x01 ; 1 215ac: 8c e6 ldi r24, 0x6C ; 108 215ae: 99 e6 ldi r25, 0x69 ; 105 215b0: f1 cf rjmp .-30 ; 0x21594 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: break; } } } 215b2: 08 95 ret 000215b4 <__vector_51>: } return 1; //all characters match - return 1 } ISR(USART2_RX_vect) { 215b4: 1f 92 push r1 215b6: 0f 92 push r0 215b8: 0f b6 in r0, 0x3f ; 63 215ba: 0f 92 push r0 215bc: 11 24 eor r1, r1 215be: 0b b6 in r0, 0x3b ; 59 215c0: 0f 92 push r0 215c2: 2f 93 push r18 215c4: 3f 93 push r19 215c6: 4f 93 push r20 215c8: 5f 93 push r21 215ca: 6f 93 push r22 215cc: 7f 93 push r23 215ce: 8f 93 push r24 215d0: 9f 93 push r25 215d2: af 93 push r26 215d4: bf 93 push r27 215d6: ef 93 push r30 215d8: ff 93 push r31 //printf_P(PSTR("USART2_RX_vect \n") ); if (rbuf_put(uart2_ibuf, UDR2) < 0) // put received byte to buffer 215da: 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 215de: 80 91 46 0d lds r24, 0x0D46 ; 0x800d46 uint8_t buf_r = ptr[2]; //get read index 215e2: 90 91 47 0d lds r25, 0x0D47 ; 0x800d47 _unlock(); //unlock ptr[4 + buf_w] = b; //store byte to buffer 215e6: e8 2f mov r30, r24 215e8: f0 e0 ldi r31, 0x00 ; 0 215ea: e7 5b subi r30, 0xB7 ; 183 215ec: f2 4f sbci r31, 0xF2 ; 242 215ee: 20 83 st Z, r18 buf_w++; //incerment write index 215f0: 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 215f2: 20 91 45 0d lds r18, 0x0D45 ; 0x800d45 215f6: 82 17 cp r24, r18 215f8: 08 f0 brcs .+2 ; 0x215fc <__vector_51+0x48> 215fa: 80 e0 ldi r24, 0x00 ; 0 if (buf_w == buf_r) return -1; //return -1 to signal buffer full 215fc: 98 13 cpse r25, r24 215fe: 17 c0 rjmp .+46 ; 0x2162e <__vector_51+0x7a> { //rx buffer full //uart2_rx_clr(); //for sure, clear input buffer puts_P(PSTR("USART2 rx Full!!!")); 21600: 86 e5 ldi r24, 0x56 ; 86 21602: 98 e9 ldi r25, 0x98 ; 152 21604: 0f 94 6a a3 call 0x346d4 ; 0x346d4 } } 21608: ff 91 pop r31 2160a: ef 91 pop r30 2160c: bf 91 pop r27 2160e: af 91 pop r26 21610: 9f 91 pop r25 21612: 8f 91 pop r24 21614: 7f 91 pop r23 21616: 6f 91 pop r22 21618: 5f 91 pop r21 2161a: 4f 91 pop r20 2161c: 3f 91 pop r19 2161e: 2f 91 pop r18 21620: 0f 90 pop r0 21622: 0b be out 0x3b, r0 ; 59 21624: 0f 90 pop r0 21626: 0f be out 0x3f, r0 ; 63 21628: 0f 90 pop r0 2162a: 1f 90 pop r1 2162c: 18 95 reti ptr[1] = buf_w; //store write index 2162e: 80 93 46 0d sts 0x0D46, r24 ; 0x800d46 21632: ea cf rjmp .-44 ; 0x21608 <__vector_51+0x54> 00021634 <__vector_45>: { WRITE(BEEPER, 1); } ISR(TIMER4_OVF_vect) { 21634: 1f 92 push r1 21636: 0f 92 push r0 21638: 0f b6 in r0, 0x3f ; 63 2163a: 0f 92 push r0 2163c: 11 24 eor r1, r1 2163e: 0b b6 in r0, 0x3b ; 59 21640: 0f 92 push r0 21642: 8f 93 push r24 21644: 9f 93 push r25 21646: ef 93 push r30 21648: ff 93 push r31 WRITE(BEEPER, 0); 2164a: 9f b7 in r25, 0x3f ; 63 2164c: f8 94 cli 2164e: e2 e0 ldi r30, 0x02 ; 2 21650: f1 e0 ldi r31, 0x01 ; 1 21652: 80 81 ld r24, Z 21654: 8b 7f andi r24, 0xFB ; 251 21656: 80 83 st Z, r24 21658: 9f bf out 0x3f, r25 ; 63 } 2165a: ff 91 pop r31 2165c: ef 91 pop r30 2165e: 9f 91 pop r25 21660: 8f 91 pop r24 21662: 0f 90 pop r0 21664: 0b be out 0x3b, r0 ; 59 21666: 0f 90 pop r0 21668: 0f be out 0x3f, r0 ; 63 2166a: 0f 90 pop r0 2166c: 1f 90 pop r1 2166e: 18 95 reti 00021670 <__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) { 21670: 1f 92 push r1 21672: 0f 92 push r0 21674: 0f b6 in r0, 0x3f ; 63 21676: 0f 92 push r0 21678: 11 24 eor r1, r1 2167a: 0b b6 in r0, 0x3b ; 59 2167c: 0f 92 push r0 2167e: 8f 93 push r24 21680: 9f 93 push r25 21682: ef 93 push r30 21684: ff 93 push r31 WRITE(BEEPER, 1); 21686: 9f b7 in r25, 0x3f ; 63 21688: f8 94 cli 2168a: e2 e0 ldi r30, 0x02 ; 2 2168c: f1 e0 ldi r31, 0x01 ; 1 2168e: 80 81 ld r24, Z 21690: 84 60 ori r24, 0x04 ; 4 21692: 80 83 st Z, r24 21694: 9f bf out 0x3f, r25 ; 63 } 21696: ff 91 pop r31 21698: ef 91 pop r30 2169a: 9f 91 pop r25 2169c: 8f 91 pop r24 2169e: 0f 90 pop r0 216a0: 0b be out 0x3b, r0 ; 59 216a2: 0f 90 pop r0 216a4: 0f be out 0x3f, r0 ; 63 216a6: 0f 90 pop r0 216a8: 1f 90 pop r1 216aa: 18 95 reti 000216ac : void delay2(unsigned long ms) { 216ac: 8f 92 push r8 216ae: 9f 92 push r9 216b0: af 92 push r10 216b2: bf 92 push r11 216b4: cf 92 push r12 216b6: df 92 push r13 216b8: ef 92 push r14 216ba: ff 92 push r15 216bc: 6b 01 movw r12, r22 216be: 7c 01 movw r14, r24 uint32_t start = micros2(); 216c0: 0e 94 f5 fc call 0x1f9ea ; 0x1f9ea 216c4: 4b 01 movw r8, r22 216c6: 5c 01 movw r10, r24 while (ms > 0) { yield(); while ( ms > 0 && (micros2() - start) >= 1000) 216c8: c1 14 cp r12, r1 216ca: d1 04 cpc r13, r1 216cc: e1 04 cpc r14, r1 216ce: f1 04 cpc r15, r1 216d0: b9 f0 breq .+46 ; 0x21700 216d2: 0e 94 f5 fc call 0x1f9ea ; 0x1f9ea 216d6: 68 19 sub r22, r8 216d8: 79 09 sbc r23, r9 216da: 8a 09 sbc r24, r10 216dc: 9b 09 sbc r25, r11 216de: 68 3e cpi r22, 0xE8 ; 232 216e0: 73 40 sbci r23, 0x03 ; 3 216e2: 81 05 cpc r24, r1 216e4: 91 05 cpc r25, r1 216e6: 80 f3 brcs .-32 ; 0x216c8 { ms--; 216e8: 21 e0 ldi r18, 0x01 ; 1 216ea: c2 1a sub r12, r18 216ec: d1 08 sbc r13, r1 216ee: e1 08 sbc r14, r1 216f0: f1 08 sbc r15, r1 start += 1000; 216f2: 88 ee ldi r24, 0xE8 ; 232 216f4: 88 0e add r8, r24 216f6: 83 e0 ldi r24, 0x03 ; 3 216f8: 98 1e adc r9, r24 216fa: a1 1c adc r10, r1 216fc: b1 1c adc r11, r1 216fe: e4 cf rjmp .-56 ; 0x216c8 } } } 21700: ff 90 pop r15 21702: ef 90 pop r14 21704: df 90 pop r13 21706: cf 90 pop r12 21708: bf 90 pop r11 2170a: af 90 pop r10 2170c: 9f 90 pop r9 2170e: 8f 90 pop r8 21710: 08 95 ret 00021712 : } unsigned long millis2(void) { unsigned long m; uint8_t oldSREG = SREG; 21712: 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(); 21714: f8 94 cli m = timer2_millis; 21716: 60 91 f8 05 lds r22, 0x05F8 ; 0x8005f8 2171a: 70 91 f9 05 lds r23, 0x05F9 ; 0x8005f9 2171e: 80 91 fa 05 lds r24, 0x05FA ; 0x8005fa 21722: 90 91 fb 05 lds r25, 0x05FB ; 0x8005fb SREG = oldSREG; 21726: 2f bf out 0x3f, r18 ; 63 return m; } 21728: 08 95 ret 0002172a : } //! @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); 2172a: 60 e0 ldi r22, 0x00 ; 0 2172c: 70 e0 ldi r23, 0x00 ; 0 2172e: 80 e8 ldi r24, 0x80 ; 128 21730: 9f eb ldi r25, 0xBF ; 191 21732: 0f 94 a4 65 call 0x2cb48 ; 0x2cb48 SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); 21736: 8f e5 ldi r24, 0x5F ; 95 21738: 9b e6 ldi r25, 0x6B ; 107 2173a: 0e 94 0e 7d call 0xfa1c ; 0xfa1c // Indicate that the printer is paused did_pause_print = true; 2173e: 81 e0 ldi r24, 0x01 ; 1 21740: 80 93 cd 03 sts 0x03CD, r24 ; 0x8003cd } else return false; } bool Stopwatch::pause() { if (isRunning()) { 21744: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 21748: 81 30 cpi r24, 0x01 ; 1 2174a: 69 f4 brne .+26 ; 0x21766 state = PAUSED; 2174c: 82 e0 ldi r24, 0x02 ; 2 2174e: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b stopTimestamp = _millis(); 21752: 0f 94 89 0b call 0x21712 ; 0x21712 21756: 60 93 0b 06 sts 0x060B, r22 ; 0x80060b 2175a: 70 93 0c 06 sts 0x060C, r23 ; 0x80060c 2175e: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d 21762: 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; 21766: 82 e0 ldi r24, 0x02 ; 2 21768: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e lcd_return_to_status(); 2176c: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 00021770 ::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) 21770: ff 92 push r15 21772: 0f 93 push r16 21774: 1f 93 push r17 21776: cf 93 push r28 21778: df 93 push r29 { if (!m_isRunning) return false; 2177a: fc 01 movw r30, r24 2177c: f0 80 ld r15, Z 2177e: f1 10 cpse r15, r1 21780: 08 c0 rjmp .+16 ; 0x21792 ::expired(unsigned short)+0x22> 21782: f1 2c mov r15, r1 expired = true; } } if (expired) m_isRunning = false; return expired; } 21784: 8f 2d mov r24, r15 21786: df 91 pop r29 21788: cf 91 pop r28 2178a: 1f 91 pop r17 2178c: 0f 91 pop r16 2178e: ff 90 pop r15 21790: 08 95 ret 21792: 8b 01 movw r16, r22 21794: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 21796: 0f 94 89 0b call 0x21712 ; 0x21712 if (m_started <= m_started + msPeriod) 2179a: 89 81 ldd r24, Y+1 ; 0x01 2179c: 9a 81 ldd r25, Y+2 ; 0x02 2179e: 08 0f add r16, r24 217a0: 19 1f adc r17, r25 217a2: 08 17 cp r16, r24 217a4: 19 07 cpc r17, r25 217a6: 40 f0 brcs .+16 ; 0x217b8 ::expired(unsigned short)+0x48> { if ((now >= m_started + msPeriod) || (now < m_started)) 217a8: 60 17 cp r22, r16 217aa: 71 07 cpc r23, r17 217ac: 18 f4 brcc .+6 ; 0x217b4 ::expired(unsigned short)+0x44> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 217ae: 68 17 cp r22, r24 217b0: 79 07 cpc r23, r25 217b2: 38 f7 brcc .-50 ; 0x21782 ::expired(unsigned short)+0x12> { expired = true; } } if (expired) m_isRunning = false; 217b4: 18 82 st Y, r1 217b6: e6 cf rjmp .-52 ; 0x21784 ::expired(unsigned short)+0x14> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 217b8: 60 17 cp r22, r16 217ba: 71 07 cpc r23, r17 217bc: c0 f7 brcc .-16 ; 0x217ae ::expired(unsigned short)+0x3e> 217be: e1 cf rjmp .-62 ; 0x21782 ::expired(unsigned short)+0x12> 000217c0 ::expired_cont(unsigned short)>: } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 217c0: fc 01 movw r30, r24 217c2: 20 81 ld r18, Z 217c4: 21 11 cpse r18, r1 217c6: 0d 94 b8 0b jmp 0x21770 ; 0x21770 ::expired(unsigned short)> } 217ca: 81 e0 ldi r24, 0x01 ; 1 217cc: 08 95 ret 000217ce ::start()>: /** * @brief Start timer */ template void Timer::start() 217ce: cf 93 push r28 217d0: df 93 push r29 217d2: ec 01 movw r28, r24 { m_started = _millis(); 217d4: 0f 94 89 0b call 0x21712 ; 0x21712 217d8: 7a 83 std Y+2, r23 ; 0x02 217da: 69 83 std Y+1, r22 ; 0x01 m_isRunning = true; 217dc: 81 e0 ldi r24, 0x01 ; 1 217de: 88 83 st Y, r24 } 217e0: df 91 pop r29 217e2: cf 91 pop r28 217e4: 08 95 ret 000217e6 : TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); } static uint8_t twi_wait(uint8_t status) { 217e6: 1f 93 push r17 217e8: cf 93 push r28 217ea: df 93 push r29 217ec: 00 d0 rcall .+0 ; 0x217ee 217ee: cd b7 in r28, 0x3d ; 61 217f0: de b7 in r29, 0x3e ; 62 217f2: 18 2f mov r17, r24 ShortTimer timmy; 217f4: 19 82 std Y+1, r1 ; 0x01 217f6: 1b 82 std Y+3, r1 ; 0x03 217f8: 1a 82 std Y+2, r1 ; 0x02 timmy.start(); 217fa: ce 01 movw r24, r28 217fc: 01 96 adiw r24, 0x01 ; 1 217fe: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> while(!(TWCR & _BV(TWINT))) { 21802: 80 91 bc 00 lds r24, 0x00BC ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> 21806: 87 fd sbrc r24, 7 21808: 0a c0 rjmp .+20 ; 0x2181e if (timmy.expired(TWI_TIMEOUT_MS)) { 2180a: 6a e0 ldi r22, 0x0A ; 10 2180c: 70 e0 ldi r23, 0x00 ; 0 2180e: ce 01 movw r24, r28 21810: 01 96 adiw r24, 0x01 ; 1 21812: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 21816: 88 23 and r24, r24 21818: a1 f3 breq .-24 ; 0x21802 return 2; 2181a: 82 e0 ldi r24, 0x02 ; 2 2181c: 09 c0 rjmp .+18 ; 0x21830 } } if(TW_STATUS != status) 2181e: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 21822: 88 7f andi r24, 0xF8 ; 248 21824: 18 17 cp r17, r24 21826: 59 f0 breq .+22 ; 0x2183e } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 21828: 84 e9 ldi r24, 0x94 ; 148 2182a: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> } } if(TW_STATUS != status) { twi_stop(); return 1; 2182e: 81 e0 ldi r24, 0x01 ; 1 } return 0; } 21830: 0f 90 pop r0 21832: 0f 90 pop r0 21834: 0f 90 pop r0 21836: df 91 pop r29 21838: cf 91 pop r28 2183a: 1f 91 pop r17 2183c: 08 95 ret if(TW_STATUS != status) { twi_stop(); return 1; } return 0; 2183e: 80 e0 ldi r24, 0x00 ; 0 21840: f7 cf rjmp .-18 ; 0x21830 00021842 ::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) 21842: 8f 92 push r8 21844: 9f 92 push r9 21846: af 92 push r10 21848: bf 92 push r11 2184a: cf 92 push r12 2184c: df 92 push r13 2184e: ef 92 push r14 21850: ff 92 push r15 21852: 1f 93 push r17 21854: cf 93 push r28 21856: df 93 push r29 { if (!m_isRunning) return false; 21858: fc 01 movw r30, r24 2185a: 10 81 ld r17, Z 2185c: 11 11 cpse r17, r1 2185e: 0e c0 rjmp .+28 ; 0x2187c ::expired(unsigned long)+0x3a> 21860: 10 e0 ldi r17, 0x00 ; 0 expired = true; } } if (expired) m_isRunning = false; return expired; } 21862: 81 2f mov r24, r17 21864: df 91 pop r29 21866: cf 91 pop r28 21868: 1f 91 pop r17 2186a: ff 90 pop r15 2186c: ef 90 pop r14 2186e: df 90 pop r13 21870: cf 90 pop r12 21872: bf 90 pop r11 21874: af 90 pop r10 21876: 9f 90 pop r9 21878: 8f 90 pop r8 2187a: 08 95 ret 2187c: 6a 01 movw r12, r20 2187e: 7b 01 movw r14, r22 21880: ec 01 movw r28, r24 template bool Timer::expired(T msPeriod) { if (!m_isRunning) return false; bool expired = false; const T now = _millis(); 21882: 0f 94 89 0b call 0x21712 ; 0x21712 21886: 4b 01 movw r8, r22 21888: 5c 01 movw r10, r24 if (m_started <= m_started + msPeriod) 2188a: 89 81 ldd r24, Y+1 ; 0x01 2188c: 9a 81 ldd r25, Y+2 ; 0x02 2188e: ab 81 ldd r26, Y+3 ; 0x03 21890: bc 81 ldd r27, Y+4 ; 0x04 21892: c8 0e add r12, r24 21894: d9 1e adc r13, r25 21896: ea 1e adc r14, r26 21898: fb 1e adc r15, r27 2189a: c8 16 cp r12, r24 2189c: d9 06 cpc r13, r25 2189e: ea 06 cpc r14, r26 218a0: fb 06 cpc r15, r27 218a2: 60 f0 brcs .+24 ; 0x218bc ::expired(unsigned long)+0x7a> { if ((now >= m_started + msPeriod) || (now < m_started)) 218a4: 8c 14 cp r8, r12 218a6: 9d 04 cpc r9, r13 218a8: ae 04 cpc r10, r14 218aa: bf 04 cpc r11, r15 218ac: 28 f4 brcc .+10 ; 0x218b8 ::expired(unsigned long)+0x76> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 218ae: 88 16 cp r8, r24 218b0: 99 06 cpc r9, r25 218b2: aa 06 cpc r10, r26 218b4: bb 06 cpc r11, r27 218b6: a0 f6 brcc .-88 ; 0x21860 ::expired(unsigned long)+0x1e> { expired = true; } } if (expired) m_isRunning = false; 218b8: 18 82 st Y, r1 218ba: d3 cf rjmp .-90 ; 0x21862 ::expired(unsigned long)+0x20> expired = true; } } else { if ((now >= m_started + msPeriod) && (now < m_started)) 218bc: 8c 14 cp r8, r12 218be: 9d 04 cpc r9, r13 218c0: ae 04 cpc r10, r14 218c2: bf 04 cpc r11, r15 218c4: a0 f7 brcc .-24 ; 0x218ae ::expired(unsigned long)+0x6c> 218c6: cc cf rjmp .-104 ; 0x21860 ::expired(unsigned long)+0x1e> 000218c8 : } lcd_space(8 - chars); } //! @Brief Print status line on status screen void lcdui_print_status_line(void) { 218c8: 0f 93 push r16 218ca: 1f 93 push r17 218cc: cf 93 push r28 static uint8_t heating_status_counter; if (heating_status != HeatingStatus::NO_HEATING) { // If heating flag, show progress of heating 218ce: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 218d2: 88 23 and r24, r24 218d4: 09 f4 brne .+2 ; 0x218d8 218d6: 4d c0 rjmp .+154 ; 0x21972 heating_status_counter++; 218d8: 80 91 04 06 lds r24, 0x0604 ; 0x800604 218dc: 8f 5f subi r24, 0xFF ; 255 if (heating_status_counter > 13) { 218de: 8e 30 cpi r24, 0x0E ; 14 218e0: b0 f4 brcc .+44 ; 0x2190e //! @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++; 218e2: 80 93 04 06 sts 0x0604, r24 ; 0x800604 if (heating_status_counter > 13) { heating_status_counter = 0; } lcd_set_cursor(7, 3); 218e6: 63 e0 ldi r22, 0x03 ; 3 218e8: 87 e0 ldi r24, 0x07 ; 7 218ea: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_space(13); 218ee: 8d e0 ldi r24, 0x0D ; 13 218f0: 0e 94 79 6f call 0xdef2 ; 0xdef2 for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 218f4: c0 e0 ldi r28, 0x00 ; 0 218f6: 80 91 04 06 lds r24, 0x0604 ; 0x800604 218fa: c8 17 cp r28, r24 218fc: 58 f4 brcc .+22 ; 0x21914 lcd_putc_at(7 + dots, 3, '.'); 218fe: 4e e2 ldi r20, 0x2E ; 46 21900: 63 e0 ldi r22, 0x03 ; 3 21902: 87 e0 ldi r24, 0x07 ; 7 21904: 8c 0f add r24, r28 21906: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 heating_status_counter = 0; } lcd_set_cursor(7, 3); lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { 2190a: cf 5f subi r28, 0xFF ; 255 2190c: f4 cf rjmp .-24 ; 0x218f6 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; 2190e: 10 92 04 06 sts 0x0604, r1 ; 0x800604 21912: e9 cf rjmp .-46 ; 0x218e6 lcd_space(13); for (uint8_t dots = 0; dots < heating_status_counter; dots++) { lcd_putc_at(7 + dots, 3, '.'); } switch (heating_status) { 21914: 80 91 cb 03 lds r24, 0x03CB ; 0x8003cb 21918: 82 30 cpi r24, 0x02 ; 2 2191a: d1 f0 breq .+52 ; 0x21950 2191c: 30 f4 brcc .+12 ; 0x2192a 2191e: 81 30 cpi r24, 0x01 ; 1 21920: 59 f0 breq .+22 ; 0x21938 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 21922: cf 91 pop r28 21924: 1f 91 pop r17 21926: 0f 91 pop r16 21928: 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) { 2192a: 83 30 cpi r24, 0x03 ; 3 2192c: f9 f0 breq .+62 ; 0x2196c 2192e: 84 30 cpi r24, 0x04 ; 4 21930: c1 f7 brne .-16 ; 0x21922 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)); 21932: 8e e0 ldi r24, 0x0E ; 14 21934: 97 e5 ldi r25, 0x57 ; 87 21936: 0e c0 rjmp .+28 ; 0x21954 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)); 21938: 87 e3 ldi r24, 0x37 ; 55 2193a: 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)); 2193c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 21940: ac 01 movw r20, r24 21942: 63 e0 ldi r22, 0x03 ; 3 21944: 80 e0 ldi r24, 0x00 ; 0 break; } } } 21946: cf 91 pop r28 21948: 1f 91 pop r17 2194a: 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)); 2194c: 0c 94 58 70 jmp 0xe0b0 ; 0xe0b0 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)); 21950: 87 e2 ldi r24, 0x27 ; 39 21952: 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)); 21954: 0e 94 8b 75 call 0xeb16 ; 0xeb16 21958: ac 01 movw r20, r24 2195a: 63 e0 ldi r22, 0x03 ; 3 2195c: 80 e0 ldi r24, 0x00 ; 0 2195e: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 heating_status = HeatingStatus::NO_HEATING; 21962: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb heating_status_counter = 0; 21966: 10 92 04 06 sts 0x0604, r1 ; 0x800604 2196a: db cf rjmp .-74 ; 0x21922 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)); 2196c: 89 e1 ldi r24, 0x19 ; 25 2196e: 97 e5 ldi r25, 0x57 ; 87 21970: e5 cf rjmp .-54 ; 0x2193c break; } } else if ((IS_SD_PRINTING) && (custom_message_type == CustomMsg::Status) && (lcd_status_message_level <= LCD_STATUS_INFO) && 21972: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 21976: 88 23 and r24, r24 21978: 61 f1 breq .+88 ; 0x219d2 break; default: break; } } else if ((IS_SD_PRINTING) && 2197a: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 2197e: 81 11 cpse r24, r1 21980: 28 c0 rjmp .+80 ; 0x219d2 (custom_message_type == CustomMsg::Status) && 21982: 80 91 c0 03 lds r24, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> 21986: 82 30 cpi r24, 0x02 ; 2 21988: 20 f5 brcc .+72 ; 0x219d2 } template bool Timer::expired_cont(T msPeriod) { return !m_isRunning || expired(msPeriod); 2198a: 80 91 7a 04 lds r24, 0x047A ; 0x80047a <_ZL26lcd_status_message_timeout.lto_priv.421> 2198e: 81 11 cpse r24, r1 21990: 16 c0 rjmp .+44 ; 0x219be (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); 21992: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 21996: 88 23 and r24, r24 21998: 09 f4 brne .+2 ; 0x2199c 2199a: 35 c0 rjmp .+106 ; 0x21a06 2199c: 8e ee ldi r24, 0xEE ; 238 2199e: 93 e1 ldi r25, 0x13 ; 19 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) 219a0: 20 91 62 0d lds r18, 0x0D62 ; 0x800d62 219a4: 64 e1 ldi r22, 0x14 ; 20 219a6: 82 0f add r24, r18 219a8: 91 1d adc r25, r1 219aa: 0e 94 98 73 call 0xe730 ; 0xe730 219ae: 81 11 cpse r24, r1 219b0: 2d c0 rjmp .+90 ; 0x21a0c { scrollstuff++; 219b2: 80 91 62 0d lds r24, 0x0D62 ; 0x800d62 219b6: 8f 5f subi r24, 0xFF ; 255 219b8: 80 93 62 0d sts 0x0D62, r24 ; 0x800d62 219bc: b2 cf rjmp .-156 ; 0x21922 219be: 40 e2 ldi r20, 0x20 ; 32 219c0: 5e e4 ldi r21, 0x4E ; 78 219c2: 60 e0 ldi r22, 0x00 ; 0 219c4: 70 e0 ldi r23, 0x00 ; 0 219c6: 8a e7 ldi r24, 0x7A ; 122 219c8: 94 e0 ldi r25, 0x04 ; 4 219ca: 0f 94 21 0c call 0x21842 ; 0x21842 ::expired(unsigned long)> 219ce: 81 11 cpse r24, r1 219d0: e0 cf rjmp .-64 ; 0x21992 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) 219d2: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 219d6: 81 11 cpse r24, r1 219d8: 1c c0 rjmp .+56 ; 0x21a12 { return; // Nothing to do, waiting for delay to expire } switch (custom_message_type) { 219da: e0 91 5d 06 lds r30, 0x065D ; 0x80065d 219de: ea 30 cpi r30, 0x0A ; 10 219e0: 08 f0 brcs .+2 ; 0x219e4 219e2: 9f cf rjmp .-194 ; 0x21922 219e4: f0 e0 ldi r31, 0x00 ; 0 219e6: 88 27 eor r24, r24 219e8: e7 50 subi r30, 0x07 ; 7 219ea: f3 4f sbci r31, 0xF3 ; 243 219ec: 8e 4f sbci r24, 0xFE ; 254 219ee: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> 219f2: ca 37 cpi r28, 0x7A ; 122 219f4: ce 38 cpi r28, 0x8E ; 142 219f6: ca 37 cpi r28, 0x7A ; 122 219f8: 9a 37 cpi r25, 0x7A ; 122 219fa: e2 37 cpi r30, 0x72 ; 114 219fc: be 38 cpi r27, 0x8E ; 142 219fe: ca 37 cpi r28, 0x7A ; 122 21a00: ca 37 cpi r28, 0x7A ; 122 21a02: 46 37 cpi r20, 0x76 ; 118 21a04: ca 37 cpi r28, 0x7A ; 122 (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); 21a06: 89 ed ldi r24, 0xD9 ; 217 21a08: 93 e1 ldi r25, 0x13 ; 19 21a0a: ca cf rjmp .-108 ; 0x219a0 if( lcd_print_pad(&longFilenameOLD[scrollstuff], LCD_WIDTH) == 0) { scrollstuff++; } else { scrollstuff = 0; 21a0c: 10 92 62 0d sts 0x0D62, r1 ; 0x800d62 21a10: 88 cf rjmp .-240 ; 0x21922 } } else { // Otherwise check for other special events if ( custom_message_type != CustomMsg::Status && lcd_status_message_timeout.running() 21a12: 80 91 7a 04 lds r24, 0x047A ; 0x80047a <_ZL26lcd_status_message_timeout.lto_priv.421> 21a16: 88 23 and r24, r24 21a18: 01 f3 breq .-64 ; 0x219da * 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; 21a1a: 0f 94 89 0b call 0x21712 ; 0x21712 21a1e: 00 91 7b 04 lds r16, 0x047B ; 0x80047b <_ZL26lcd_status_message_timeout.lto_priv.421+0x1> 21a22: 10 91 7c 04 lds r17, 0x047C ; 0x80047c <_ZL26lcd_status_message_timeout.lto_priv.421+0x2> 21a26: 20 91 7d 04 lds r18, 0x047D ; 0x80047d <_ZL26lcd_status_message_timeout.lto_priv.421+0x3> 21a2a: 30 91 7e 04 lds r19, 0x047E ; 0x80047e <_ZL26lcd_status_message_timeout.lto_priv.421+0x4> 21a2e: 60 1b sub r22, r16 21a30: 71 0b sbc r23, r17 21a32: 82 0b sbc r24, r18 21a34: 93 0b sbc r25, r19 && lcd_status_message_timeout.elapsed() < LCD_STATUS_DELAYED_TIMEOUT) 21a36: 60 3a cpi r22, 0xA0 ; 160 21a38: 7f 40 sbci r23, 0x0F ; 15 21a3a: 81 05 cpc r24, r1 21a3c: 91 05 cpc r25, r1 21a3e: 68 f6 brcc .-102 ; 0x219da 21a40: 70 cf rjmp .-288 ; 0x21922 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); 21a42: 63 e0 ldi r22, 0x03 ; 3 21a44: 80 91 64 04 lds r24, 0x0464 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.417> 21a48: 0e 94 ab 6f call 0xdf56 ; 0xdf56 const uint8_t padding = lcd_print_pad(&lcd_status_message[lcd_status_message_idx], LCD_WIDTH - lcd_status_message_idx); 21a4c: 80 91 64 04 lds r24, 0x0464 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.417> 21a50: c4 e1 ldi r28, 0x14 ; 20 21a52: 6c 2f mov r22, r28 21a54: 68 1b sub r22, r24 21a56: 90 e0 ldi r25, 0x00 ; 0 21a58: 8b 59 subi r24, 0x9B ; 155 21a5a: 9b 4f sbci r25, 0xFB ; 251 21a5c: 0e 94 98 73 call 0xe730 ; 0xe730 lcd_status_message_idx = LCD_WIDTH - padding; 21a60: c8 1b sub r28, r24 21a62: c0 93 64 04 sts 0x0464, r28 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.417> 21a66: 5d cf rjmp .-326 ; 0x21922 } break; case CustomMsg::MeshBedLeveling: // If mesh bed leveling in progress, show the status if (custom_message_state > 10) { 21a68: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21a6c: 8b 30 cpi r24, 0x0B ; 11 21a6e: 08 f1 brcs .+66 ; 0x21ab2 lcd_set_cursor(0, 3); 21a70: 63 e0 ldi r22, 0x03 ; 3 21a72: 80 e0 ldi r24, 0x00 ; 0 21a74: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_space(LCD_WIDTH); 21a78: 84 e1 ldi r24, 0x14 ; 20 21a7a: 0e 94 79 6f call 0xdef2 ; 0xdef2 lcd_puts_at_P(0, 3, _T(MSG_CALIBRATE_Z_AUTO)); 21a7e: 8e ef ldi r24, 0xFE ; 254 21a80: 96 e5 ldi r25, 0x56 ; 86 21a82: 0e 94 8b 75 call 0xeb16 ; 0xeb16 21a86: ac 01 movw r20, r24 21a88: 63 e0 ldi r22, 0x03 ; 3 21a8a: 80 e0 ldi r24, 0x00 ; 0 21a8c: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_puts_P(PSTR(" : ")); 21a90: 82 e8 ldi r24, 0x82 ; 130 21a92: 98 e9 ldi r25, 0x98 ; 152 21a94: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_print(custom_message_state - 10); 21a98: 60 91 de 03 lds r22, 0x03DE ; 0x8003de 21a9c: 6a 50 subi r22, 0x0A ; 10 21a9e: 77 0b sbc r23, r23 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 21aa0: 07 2e mov r0, r23 21aa2: 00 0c add r0, r0 21aa4: 88 0b sbc r24, r24 21aa6: 99 0b sbc r25, r25 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 21aa8: cf 91 pop r28 21aaa: 1f 91 pop r17 21aac: 0f 91 pop r16 21aae: 0c 94 2c 72 jmp 0xe458 ; 0xe458 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) { 21ab2: 83 30 cpi r24, 0x03 ; 3 21ab4: 31 f4 brne .+12 ; 0x21ac2 lcd_setstatuspgm(MSG_WELCOME); 21ab6: 8a e8 ldi r24, 0x8A ; 138 21ab8: 9c e6 ldi r25, 0x6C ; 108 21aba: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 custom_message_type = CustomMsg::Status; 21abe: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d } if (custom_message_state > 3 && custom_message_state <= 10) { 21ac2: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21ac6: 84 50 subi r24, 0x04 ; 4 21ac8: 87 30 cpi r24, 0x07 ; 7 21aca: 08 f0 brcs .+2 ; 0x21ace 21acc: 2a cf rjmp .-428 ; 0x21922 lcd_set_cursor(0, 3); 21ace: 63 e0 ldi r22, 0x03 ; 3 21ad0: 80 e0 ldi r24, 0x00 ; 0 21ad2: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_space(19); 21ad6: 83 e1 ldi r24, 0x13 ; 19 21ad8: 0e 94 79 6f call 0xdef2 ; 0xdef2 lcd_puts_at_P(0, 3, _T(MSG_HOMEYZ_DONE)); 21adc: 8b ee ldi r24, 0xEB ; 235 21ade: 96 e5 ldi r25, 0x56 ; 86 21ae0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 21ae4: ac 01 movw r20, r24 21ae6: 63 e0 ldi r22, 0x03 ; 3 21ae8: 80 e0 ldi r24, 0x00 ; 0 21aea: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 custom_message_state--; 21aee: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21af2: 81 50 subi r24, 0x01 ; 1 21af4: 80 93 de 03 sts 0x03DE, r24 ; 0x8003de 21af8: 14 cf rjmp .-472 ; 0x21922 } } break; case CustomMsg::PidCal: // PID tuning in progress lcd_print_pad(lcd_status_message, LCD_WIDTH); 21afa: 64 e1 ldi r22, 0x14 ; 20 21afc: 85 e6 ldi r24, 0x65 ; 101 21afe: 94 e0 ldi r25, 0x04 ; 4 21b00: 0e 94 98 73 call 0xe730 ; 0xe730 if (pid_cycle <= pid_number_of_cycles && custom_message_state > 0) { 21b04: 20 91 02 06 lds r18, 0x0602 ; 0x800602 21b08: 30 91 03 06 lds r19, 0x0603 ; 0x800603 21b0c: 80 91 00 06 lds r24, 0x0600 ; 0x800600 21b10: 90 91 01 06 lds r25, 0x0601 ; 0x800601 21b14: 82 17 cp r24, r18 21b16: 93 07 cpc r25, r19 21b18: 0c f4 brge .+2 ; 0x21b1c 21b1a: 03 cf rjmp .-506 ; 0x21922 21b1c: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21b20: 88 23 and r24, r24 21b22: 09 f4 brne .+2 ; 0x21b26 21b24: fe ce rjmp .-516 ; 0x21922 lcd_set_cursor(10, 3); 21b26: 63 e0 ldi r22, 0x03 ; 3 21b28: 8a e0 ldi r24, 0x0A ; 10 21b2a: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(PSTR("%3d/%-3d"), pid_cycle, pid_number_of_cycles); 21b2e: 80 91 01 06 lds r24, 0x0601 ; 0x800601 21b32: 8f 93 push r24 21b34: 80 91 00 06 lds r24, 0x0600 ; 0x800600 21b38: 8f 93 push r24 21b3a: 80 91 03 06 lds r24, 0x0603 ; 0x800603 21b3e: 8f 93 push r24 21b40: 80 91 02 06 lds r24, 0x0602 ; 0x800602 21b44: 8f 93 push r24 21b46: 89 e7 ldi r24, 0x79 ; 121 21b48: 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); 21b4a: 9f 93 push r25 21b4c: 8f 93 push r24 21b4e: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 21b52: 0f 90 pop r0 21b54: 0f 90 pop r0 21b56: 0f 90 pop r0 21b58: 0f 90 pop r0 21b5a: 0f 90 pop r0 21b5c: 0f 90 pop r0 21b5e: e1 ce rjmp .-574 ; 0x21922 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); 21b60: 63 e0 ldi r22, 0x03 ; 3 21b62: 80 e0 ldi r24, 0x00 ; 0 21b64: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(PSTR("%-12.12S%-d/6"), _T(MSG_PINDA_CALIBRATION), custom_message_state); 21b68: c0 91 de 03 lds r28, 0x03DE ; 0x8003de 21b6c: 85 ed ldi r24, 0xD5 ; 213 21b6e: 95 e4 ldi r25, 0x45 ; 69 21b70: 0e 94 8b 75 call 0xeb16 ; 0xeb16 21b74: 1f 92 push r1 21b76: cf 93 push r28 21b78: 9f 93 push r25 21b7a: 8f 93 push r24 21b7c: 8b e6 ldi r24, 0x6B ; 107 21b7e: 98 e9 ldi r25, 0x98 ; 152 21b80: e4 cf rjmp .-56 ; 0x21b4a break; case CustomMsg::TempCompPreheat: // temp compensation preheat lcd_puts_at_P(0, 3, _T(MSG_PINDA_PREHEAT)); 21b82: 8b ed ldi r24, 0xDB ; 219 21b84: 96 e5 ldi r25, 0x56 ; 86 21b86: 0e 94 8b 75 call 0xeb16 ; 0xeb16 21b8a: ac 01 movw r20, r24 21b8c: 63 e0 ldi r22, 0x03 ; 3 21b8e: 80 e0 ldi r24, 0x00 ; 0 21b90: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 if (custom_message_state <= PINDA_HEAT_T) { 21b94: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21b98: 89 37 cpi r24, 0x79 ; 121 21b9a: 08 f0 brcs .+2 ; 0x21b9e 21b9c: c2 ce rjmp .-636 ; 0x21922 lcd_puts_P(PSTR(": ")); 21b9e: 88 e6 ldi r24, 0x68 ; 104 21ba0: 98 e9 ldi r25, 0x98 ; 152 21ba2: 0e 94 6e 6f call 0xdedc ; 0xdedc } void lcd_print(unsigned long n, int base) { if (base == 0) lcd_write(n); 21ba6: 80 91 de 03 lds r24, 0x03DE ; 0x8003de 21baa: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 21bae: 80 e2 ldi r24, 0x20 ; 32 case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); break; } } } 21bb0: cf 91 pop r28 21bb2: 1f 91 pop r17 21bb4: 0f 91 pop r16 21bb6: 0c 94 f3 70 jmp 0xe1e6 ; 0xe1e6 lcd_print(custom_message_state); // seconds lcd_print(' '); } break; case CustomMsg::Resuming: // Resuming lcd_puts_at_P(0, 3, _T(MSG_RESUMING_PRINT)); 21bba: 8a ec ldi r24, 0xCA ; 202 21bbc: 96 e5 ldi r25, 0x56 ; 86 21bbe: be ce rjmp .-644 ; 0x2193c 00021bc0 ::start()>: /** * @brief Start timer */ template void Timer::start() 21bc0: cf 93 push r28 21bc2: df 93 push r29 21bc4: ec 01 movw r28, r24 { m_started = _millis(); 21bc6: 0f 94 89 0b call 0x21712 ; 0x21712 21bca: 69 83 std Y+1, r22 ; 0x01 21bcc: 7a 83 std Y+2, r23 ; 0x02 21bce: 8b 83 std Y+3, r24 ; 0x03 21bd0: 9c 83 std Y+4, r25 ; 0x04 m_isRunning = true; 21bd2: 81 e0 ldi r24, 0x01 ; 1 21bd4: 88 83 st Y, r24 } 21bd6: df 91 pop r29 21bd8: cf 91 pop r28 21bda: 08 95 ret 00021bdc : //! 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) { 21bdc: cf 92 push r12 21bde: df 92 push r13 21be0: ef 92 push r14 21be2: ff 92 push r15 21be4: 1f 93 push r17 21be6: cf 93 push r28 21be8: df 93 push r29 21bea: cd b7 in r28, 0x3d ; 61 21bec: de b7 in r29, 0x3e ; 62 21bee: 64 97 sbiw r28, 0x14 ; 20 21bf0: 0f b6 in r0, 0x3f ; 63 21bf2: f8 94 cli 21bf4: de bf out 0x3e, r29 ; 62 21bf6: 0f be out 0x3f, r0 ; 63 21bf8: cd bf out 0x3d, r28 ; 61 21bfa: 7c 01 movw r14, r24 21bfc: 16 2f mov r17, r22 char msg[LCD_WIDTH]; strcpy_P(msg, PSTR("Err: ")); 21bfe: 61 e3 ldi r22, 0x31 ; 49 21c00: 78 e9 ldi r23, 0x98 ; 152 21c02: ce 01 movw r24, r28 21c04: 01 96 adiw r24, 0x01 ; 1 21c06: 0f 94 38 a2 call 0x34470 ; 0x34470 strcat_P(msg, type); 21c0a: b7 01 movw r22, r14 21c0c: ce 01 movw r24, r28 21c0e: 01 96 adiw r24, 0x01 ; 1 21c10: 0f 94 24 a2 call 0x34448 ; 0x34448 lcd_status_message_timeout.start(); } void lcd_setalertstatus_(const char* message, uint8_t severity, bool progmem) { if (lcd_message_check(severity)) { 21c14: 83 e0 ldi r24, 0x03 ; 3 21c16: 0e 94 fe d7 call 0x1affc ; 0x1affc 21c1a: 88 23 and r24, r24 21c1c: e1 f0 breq .+56 ; 0x21c56 bool same = !(progmem? strcmp_P(lcd_status_message, message): strcmp(lcd_status_message, message)); 21c1e: be 01 movw r22, r28 21c20: 6f 5f subi r22, 0xFF ; 255 21c22: 7f 4f sbci r23, 0xFF ; 255 21c24: 85 e6 ldi r24, 0x65 ; 101 21c26: 94 e0 ldi r25, 0x04 ; 4 21c28: 0f 94 e3 aa call 0x355c6 ; 0x355c6 21c2c: 6c 01 movw r12, r24 lcd_status_message_timeout.start(); 21c2e: 8a e7 ldi r24, 0x7A ; 122 21c30: 94 e0 ldi r25, 0x04 ; 4 21c32: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> lcd_status_message_level = severity; 21c36: 83 e0 ldi r24, 0x03 ; 3 21c38: 80 93 c0 03 sts 0x03C0, r24 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> custom_message_type = CustomMsg::Status; 21c3c: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d custom_message_state = 0; 21c40: 10 92 de 03 sts 0x03DE, r1 ; 0x8003de if (!same) { 21c44: cd 28 or r12, r13 21c46: 39 f0 breq .+14 ; 0x21c56 // do not kick the user out of the menus if the message is unchanged lcd_updatestatus(message, progmem); 21c48: 60 e0 ldi r22, 0x00 ; 0 21c4a: ce 01 movw r24, r28 21c4c: 01 96 adiw r24, 0x01 ; 1 21c4e: 0e 94 e3 d7 call 0x1afc6 ; 0x1afc6 lcd_return_to_status(); 21c52: 0f 94 6e 05 call 0x20adc ; 0x20adc lcd_setalertstatus(msg, LCD_STATUS_CRITICAL); SERIAL_ERROR_START; 21c56: 87 ec ldi r24, 0xC7 ; 199 21c58: 92 ea ldi r25, 0xA2 ; 162 21c5a: 0e 94 15 7b call 0xf62a ; 0xf62a if(e != EXTRUDERS) { 21c5e: 11 30 cpi r17, 0x01 ; 1 21c60: 51 f0 breq .+20 ; 0x21c76 print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 21c62: 61 2f mov r22, r17 21c64: 70 e0 ldi r23, 0x00 ; 0 21c66: 90 e0 ldi r25, 0x00 ; 0 21c68: 80 e0 ldi r24, 0x00 ; 0 21c6a: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_ERROR((int)e); SERIAL_ERRORPGM(": "); 21c6e: 8e e2 ldi r24, 0x2E ; 46 21c70: 98 e9 ldi r25, 0x98 ; 152 21c72: 0e 94 15 7b call 0xf62a ; 0xf62a } SERIAL_ERRORPGM("Heaters switched off. "); 21c76: 87 e1 ldi r24, 0x17 ; 23 21c78: 98 e9 ldi r25, 0x98 ; 152 21c7a: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORRPGM(type); 21c7e: c7 01 movw r24, r14 21c80: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORLNPGM(" triggered!"); 21c84: 8b e0 ldi r24, 0x0B ; 11 21c86: 98 e9 ldi r25, 0x98 ; 152 21c88: 0e 94 0e 7d call 0xfa1c ; 0xfa1c } 21c8c: 64 96 adiw r28, 0x14 ; 20 21c8e: 0f b6 in r0, 0x3f ; 63 21c90: f8 94 cli 21c92: de bf out 0x3e, r29 ; 62 21c94: 0f be out 0x3f, r0 ; 63 21c96: cd bf out 0x3d, r28 ; 61 21c98: df 91 pop r29 21c9a: cf 91 pop r28 21c9c: 1f 91 pop r17 21c9e: ff 90 pop r15 21ca0: ef 90 pop r14 21ca2: df 90 pop r13 21ca4: cf 90 pop r12 21ca6: 08 95 ret 00021ca8 <__vector_15>: volatile unsigned long timer2_overflow_count; volatile unsigned long timer2_millis; unsigned char timer2_fract = 0; ISR(TIMER2_OVF_vect) { 21ca8: 1f 92 push r1 21caa: 0f 92 push r0 21cac: 0f b6 in r0, 0x3f ; 63 21cae: 0f 92 push r0 21cb0: 11 24 eor r1, r1 21cb2: 2f 93 push r18 21cb4: 3f 93 push r19 21cb6: 8f 93 push r24 21cb8: 9f 93 push r25 21cba: af 93 push r26 21cbc: 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; 21cbe: 80 91 f8 05 lds r24, 0x05F8 ; 0x8005f8 21cc2: 90 91 f9 05 lds r25, 0x05F9 ; 0x8005f9 21cc6: a0 91 fa 05 lds r26, 0x05FA ; 0x8005fa 21cca: b0 91 fb 05 lds r27, 0x05FB ; 0x8005fb unsigned char f = timer2_fract; 21cce: 30 91 f7 05 lds r19, 0x05F7 ; 0x8005f7 m += MILLIS_INC; f += FRACT_INC; 21cd2: 23 e0 ldi r18, 0x03 ; 3 21cd4: 23 0f add r18, r19 if (f >= FRACT_MAX) 21cd6: 2d 37 cpi r18, 0x7D ; 125 21cd8: 58 f5 brcc .+86 ; 0x21d30 <__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; 21cda: 01 96 adiw r24, 0x01 ; 1 21cdc: a1 1d adc r26, r1 21cde: b1 1d adc r27, r1 if (f >= FRACT_MAX) { f -= FRACT_MAX; m += 1; } timer2_fract = f; 21ce0: 20 93 f7 05 sts 0x05F7, r18 ; 0x8005f7 timer2_millis = m; 21ce4: 80 93 f8 05 sts 0x05F8, r24 ; 0x8005f8 21ce8: 90 93 f9 05 sts 0x05F9, r25 ; 0x8005f9 21cec: a0 93 fa 05 sts 0x05FA, r26 ; 0x8005fa 21cf0: b0 93 fb 05 sts 0x05FB, r27 ; 0x8005fb timer2_overflow_count++; 21cf4: 80 91 fc 05 lds r24, 0x05FC ; 0x8005fc 21cf8: 90 91 fd 05 lds r25, 0x05FD ; 0x8005fd 21cfc: a0 91 fe 05 lds r26, 0x05FE ; 0x8005fe 21d00: b0 91 ff 05 lds r27, 0x05FF ; 0x8005ff 21d04: 01 96 adiw r24, 0x01 ; 1 21d06: a1 1d adc r26, r1 21d08: b1 1d adc r27, r1 21d0a: 80 93 fc 05 sts 0x05FC, r24 ; 0x8005fc 21d0e: 90 93 fd 05 sts 0x05FD, r25 ; 0x8005fd 21d12: a0 93 fe 05 sts 0x05FE, r26 ; 0x8005fe 21d16: b0 93 ff 05 sts 0x05FF, r27 ; 0x8005ff } 21d1a: bf 91 pop r27 21d1c: af 91 pop r26 21d1e: 9f 91 pop r25 21d20: 8f 91 pop r24 21d22: 3f 91 pop r19 21d24: 2f 91 pop r18 21d26: 0f 90 pop r0 21d28: 0f be out 0x3f, r0 ; 63 21d2a: 0f 90 pop r0 21d2c: 1f 90 pop r1 21d2e: 18 95 reti unsigned char f = timer2_fract; m += MILLIS_INC; f += FRACT_INC; if (f >= FRACT_MAX) { f -= FRACT_MAX; 21d30: 26 e8 ldi r18, 0x86 ; 134 21d32: 23 0f add r18, r19 m += 1; 21d34: 02 96 adiw r24, 0x02 ; 2 21d36: a1 1d adc r26, r1 21d38: b1 1d adc r27, r1 21d3a: d2 cf rjmp .-92 ; 0x21ce0 <__vector_15+0x38> 00021d3c : } ENABLE_TEMP_MGR_INTERRUPT(); } void disable_heater() { 21d3c: cf 93 push r28 }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 21d3e: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 21d42: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 21d46: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 21d4a: 10 92 59 12 sts 0x1259, r1 ; 0x801259 setTargetHotend(0); setTargetBed(0); ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 21d4e: cf b7 in r28, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 21d50: f8 94 cli // propagate all values down the chain setIsrTargetTemperatures(); 21d52: 0e 94 de ff call 0x1ffbc ; 0x1ffbc temp_mgr_pid(); 21d56: 0e 94 1b fd call 0x1fa36 ; 0x1fa36 // 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); 21d5a: 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; 21d5c: 10 92 28 06 sts 0x0628, r1 ; 0x800628 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 21d60: cf bf out 0x3f, r28 ; 63 #endif } } 21d62: cf 91 pop r28 21d64: 08 95 ret 00021d66 : /* Menu implementation */ static void lcd_cooldown() { disable_heater(); 21d66: 0f 94 9e 0e call 0x21d3c ; 0x21d3c fanSpeed = 0; 21d6a: 10 92 55 12 sts 0x1255, r1 ; 0x801255 lcd_return_to_status(); 21d6e: 0d 94 6e 05 jmp 0x20adc ; 0x20adc 00021d72 : // 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) { 21d72: 1f 93 push r17 21d74: cf 93 push r28 21d76: df 93 push r29 21d78: c8 2f mov r28, r24 21d7a: 16 2f mov r17, r22 21d7c: d4 2f mov r29, r20 // save the original target temperatures for recovery before disabling heaters if(!temp_error_state.error && !saved_printing) { 21d7e: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 21d82: 80 fd sbrc r24, 0 21d84: 18 c0 rjmp .+48 ; 0x21db6 21d86: 80 91 73 12 lds r24, 0x1273 ; 0x801273 21d8a: 81 11 cpse r24, r1 21d8c: 14 c0 rjmp .+40 ; 0x21db6 saved_bed_temperature = target_temperature_bed; 21d8e: 80 91 59 12 lds r24, 0x1259 ; 0x801259 21d92: 80 93 58 12 sts 0x1258, r24 ; 0x801258 saved_extruder_temperature = target_temperature[index]; 21d96: e6 2f mov r30, r22 21d98: f0 e0 ldi r31, 0x00 ; 0 21d9a: ee 0f add r30, r30 21d9c: ff 1f adc r31, r31 21d9e: e3 5a subi r30, 0xA3 ; 163 21da0: fd 4e sbci r31, 0xED ; 237 21da2: 80 81 ld r24, Z 21da4: 91 81 ldd r25, Z+1 ; 0x01 21da6: 90 93 5c 12 sts 0x125C, r25 ; 0x80125c 21daa: 80 93 5b 12 sts 0x125B, r24 ; 0x80125b saved_fan_speed = fanSpeed; 21dae: 80 91 55 12 lds r24, 0x1255 ; 0x801255 21db2: 80 93 54 12 sts 0x1254, r24 ; 0x801254 } // keep disabling heaters and keep fans on as long as the condition is asserted disable_heater(); 21db6: 0f 94 9e 0e call 0x21d3c ; 0x21d3c void hotendFanSetFullSpeed() { #ifdef EXTRUDER_ALTFAN_DETECT altfanStatus.altfanOverride = 1; //full speed #endif //EXTRUDER_ALTFAN_DETECT resetFanCheck(); 21dba: 0e 94 f3 77 call 0xefe6 ; 0xefe6 setExtruderAutoFanState(3); 21dbe: 83 e0 ldi r24, 0x03 ; 3 21dc0: 0e 94 00 78 call 0xf000 ; 0xf000 SET_OUTPUT(FAN_PIN); 21dc4: 80 91 01 01 lds r24, 0x0101 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> 21dc8: 88 60 ori r24, 0x08 ; 8 21dca: 80 93 01 01 sts 0x0101, r24 ; 0x800101 <__TEXT_REGION_LENGTH__+0x7c2101> #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = 255; 21dce: 8f ef ldi r24, 0xFF ; 255 21dd0: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d #else //FAN_SOFT_PWM analogWrite(FAN_PIN, 255); #endif //FAN_SOFT_PWM fanSpeed = 255; 21dd4: 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) { 21dd8: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 21ddc: 80 ff sbrs r24, 0 21dde: 07 c0 rjmp .+14 ; 0x21dee 21de0: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 21de4: 82 95 swap r24 21de6: 86 95 lsr r24 21de8: 87 70 andi r24, 0x07 ; 7 21dea: d8 17 cp r29, r24 21dec: c0 f4 brcc .+48 ; 0x21e1e temp_error_state.source = (uint8_t)source; 21dee: c3 70 andi r28, 0x03 ; 3 21df0: cc 0f add r28, r28 21df2: cc 0f add r28, r28 21df4: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 21df8: 83 7f andi r24, 0xF3 ; 243 21dfa: 8c 2b or r24, r28 21dfc: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> temp_error_state.index = index; 21e00: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 21e04: 10 fb bst r17, 0 21e06: 84 f9 bld r24, 4 21e08: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> temp_error_state.type = (uint8_t)type; 21e0c: d2 95 swap r29 21e0e: dd 0f add r29, r29 21e10: d0 7e andi r29, 0xE0 ; 224 21e12: 40 91 cc 03 lds r20, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 21e16: 4f 71 andi r20, 0x1F ; 31 21e18: 4d 2b or r20, r29 21e1a: 40 93 cc 03 sts 0x03CC, r20 ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> } // always set the error state temp_error_state.error = true; 21e1e: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 21e22: 81 60 ori r24, 0x01 ; 1 21e24: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> temp_error_state.assert = true; 21e28: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 21e2c: 82 60 ori r24, 0x02 ; 2 21e2e: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> } 21e32: df 91 pop r29 21e34: cf 91 pop r28 21e36: 1f 91 pop r17 21e38: 08 95 ret 00021e3a : 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) { 21e3a: 2f 92 push r2 21e3c: 3f 92 push r3 21e3e: 4f 92 push r4 21e40: 5f 92 push r5 21e42: 6f 92 push r6 21e44: 7f 92 push r7 21e46: 8f 92 push r8 21e48: 9f 92 push r9 21e4a: af 92 push r10 21e4c: bf 92 push r11 21e4e: cf 92 push r12 21e50: df 92 push r13 21e52: ef 92 push r14 21e54: ff 92 push r15 21e56: 0f 93 push r16 21e58: 1f 93 push r17 21e5a: cf 93 push r28 21e5c: df 93 push r29 21e5e: cd b7 in r28, 0x3d ; 61 21e60: de b7 in r29, 0x3e ; 62 21e62: 2c 97 sbiw r28, 0x0c ; 12 21e64: 0f b6 in r0, 0x3f ; 63 21e66: f8 94 cli 21e68: de bf out 0x3e, r29 ; 62 21e6a: 0f be out 0x3f, r0 ; 63 21e6c: cd bf out 0x3d, r28 ; 61 21e6e: 28 2e mov r2, r24 21e70: 49 83 std Y+1, r20 ; 0x01 21e72: 5a 83 std Y+2, r21 ; 0x02 21e74: 6b 83 std Y+3, r22 ; 0x03 21e76: 7c 83 std Y+4, r23 ; 0x04 21e78: 28 01 movw r4, r16 21e7a: 39 01 movw r6, r18 21e7c: 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) 21e7e: 0f 94 89 0b call 0x21712 ; 0x21712 21e82: 02 2d mov r16, r2 21e84: 10 e0 ldi r17, 0x00 ; 0 21e86: 98 01 movw r18, r16 21e88: 22 0f add r18, r18 21e8a: 33 1f adc r19, r19 21e8c: 22 0f add r18, r18 21e8e: 33 1f adc r19, r19 21e90: 3c 87 std Y+12, r19 ; 0x0c 21e92: 2b 87 std Y+11, r18 ; 0x0b 21e94: f9 01 movw r30, r18 21e96: e4 56 subi r30, 0x64 ; 100 21e98: fa 4f sbci r31, 0xFA ; 250 21e9a: 80 80 ld r8, Z 21e9c: 91 80 ldd r9, Z+1 ; 0x01 21e9e: a2 80 ldd r10, Z+2 ; 0x02 21ea0: b3 80 ldd r11, Z+3 ; 0x03 21ea2: 68 19 sub r22, r8 21ea4: 79 09 sbc r23, r9 21ea6: 8a 09 sbc r24, r10 21ea8: 9b 09 sbc r25, r11 21eaa: 61 3d cpi r22, 0xD1 ; 209 21eac: 77 40 sbci r23, 0x07 ; 7 21eae: 81 05 cpc r24, r1 21eb0: 91 05 cpc r25, r1 21eb2: 08 f4 brcc .+2 ; 0x21eb6 21eb4: ea c0 rjmp .+468 ; 0x2208a { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) 21eb6: 33 20 and r3, r3 21eb8: 09 f4 brne .+2 ; 0x21ebc 21eba: 75 c0 rjmp .+234 ; 0x21fa6 { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; __timeout = TEMP_RUNAWAY_BED_TIMEOUT; 21ebc: 88 e6 ldi r24, 0x68 ; 104 21ebe: 91 e0 ldi r25, 0x01 ; 1 21ec0: 9a 87 std Y+10, r25 ; 0x0a 21ec2: 89 87 std Y+9, r24 ; 0x09 { #ifdef TEMP_RUNAWAY_BED_TIMEOUT if (_isbed) { __hysteresis = TEMP_RUNAWAY_BED_HYSTERESIS; 21ec4: 80 e0 ldi r24, 0x00 ; 0 21ec6: 90 e0 ldi r25, 0x00 ; 0 21ec8: a0 ea ldi r26, 0xA0 ; 160 21eca: b0 e4 ldi r27, 0x40 ; 64 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 21ecc: 8d 83 std Y+5, r24 ; 0x05 21ece: 9e 83 std Y+6, r25 ; 0x06 21ed0: af 83 std Y+7, r26 ; 0x07 21ed2: b8 87 std Y+8, r27 ; 0x08 __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; } #endif temp_runaway_timer[_heater_id] = _millis(); 21ed4: 0f 94 89 0b call 0x21712 ; 0x21712 21ed8: eb 85 ldd r30, Y+11 ; 0x0b 21eda: fc 85 ldd r31, Y+12 ; 0x0c 21edc: e4 56 subi r30, 0x64 ; 100 21ede: fa 4f sbci r31, 0xFA ; 250 21ee0: 60 83 st Z, r22 21ee2: 71 83 std Z+1, r23 ; 0x01 21ee4: 82 83 std Z+2, r24 ; 0x02 21ee6: 93 83 std Z+3, r25 ; 0x03 if (_output == 0) 21ee8: 20 e0 ldi r18, 0x00 ; 0 21eea: 30 e0 ldi r19, 0x00 ; 0 21eec: a9 01 movw r20, r18 21eee: c7 01 movw r24, r14 21ef0: b6 01 movw r22, r12 21ef2: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 21ef6: 81 11 cpse r24, r1 21ef8: 07 c0 rjmp .+14 ; 0x21f08 { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 21efa: f8 01 movw r30, r16 21efc: ee 0f add r30, r30 21efe: ff 1f adc r31, r31 21f00: e8 56 subi r30, 0x68 ; 104 21f02: fa 4f sbci r31, 0xFA ; 250 21f04: 11 82 std Z+1, r1 ; 0x01 21f06: 10 82 st Z, r1 } if (temp_runaway_target[_heater_id] != _target_temperature) 21f08: ab 85 ldd r26, Y+11 ; 0x0b 21f0a: bc 85 ldd r27, Y+12 ; 0x0c 21f0c: a0 57 subi r26, 0x70 ; 112 21f0e: ba 4f sbci r27, 0xFA ; 250 21f10: 5d 01 movw r10, r26 21f12: 29 81 ldd r18, Y+1 ; 0x01 21f14: 3a 81 ldd r19, Y+2 ; 0x02 21f16: 4b 81 ldd r20, Y+3 ; 0x03 21f18: 5c 81 ldd r21, Y+4 ; 0x04 21f1a: 6d 91 ld r22, X+ 21f1c: 7d 91 ld r23, X+ 21f1e: 8d 91 ld r24, X+ 21f20: 9c 91 ld r25, X 21f22: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 21f26: 88 23 and r24, r24 21f28: 09 f4 brne .+2 ; 0x21f2c 21f2a: 91 c0 rjmp .+290 ; 0x2204e { if (_target_temperature > 0) 21f2c: 20 e0 ldi r18, 0x00 ; 0 21f2e: 30 e0 ldi r19, 0x00 ; 0 21f30: a9 01 movw r20, r18 21f32: 69 81 ldd r22, Y+1 ; 0x01 21f34: 7a 81 ldd r23, Y+2 ; 0x02 21f36: 8b 81 ldd r24, Y+3 ; 0x03 21f38: 9c 81 ldd r25, Y+4 ; 0x04 21f3a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 21f3e: f8 01 movw r30, r16 21f40: e2 57 subi r30, 0x72 ; 114 21f42: fa 4f sbci r31, 0xFA ; 250 21f44: 18 16 cp r1, r24 21f46: c4 f5 brge .+112 ; 0x21fb8 { temp_runaway_status[_heater_id] = TempRunaway_PREHEAT; 21f48: 81 e0 ldi r24, 0x01 ; 1 21f4a: 80 83 st Z, r24 temp_runaway_target[_heater_id] = _target_temperature; 21f4c: 89 81 ldd r24, Y+1 ; 0x01 21f4e: 9a 81 ldd r25, Y+2 ; 0x02 21f50: ab 81 ldd r26, Y+3 ; 0x03 21f52: bc 81 ldd r27, Y+4 ; 0x04 21f54: f5 01 movw r30, r10 21f56: 80 83 st Z, r24 21f58: 91 83 std Z+1, r25 ; 0x01 21f5a: a2 83 std Z+2, r26 ; 0x02 21f5c: b3 83 std Z+3, r27 ; 0x03 __preheat_start[_heater_id] = _current_temperature; 21f5e: eb 85 ldd r30, Y+11 ; 0x0b 21f60: fc 85 ldd r31, Y+12 ; 0x0c 21f62: ea 57 subi r30, 0x7A ; 122 21f64: fa 4f sbci r31, 0xFA ; 250 21f66: 40 82 st Z, r4 21f68: 51 82 std Z+1, r5 ; 0x01 21f6a: 62 82 std Z+2, r6 ; 0x02 21f6c: 73 82 std Z+3, r7 ; 0x03 __preheat_counter[_heater_id] = 0; 21f6e: f8 01 movw r30, r16 21f70: ec 57 subi r30, 0x7C ; 124 21f72: fa 4f sbci r31, 0xFA ; 250 21f74: 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)) 21f76: a3 01 movw r20, r6 21f78: 92 01 movw r18, r4 21f7a: bc 01 movw r22, r24 21f7c: cd 01 movw r24, r26 21f7e: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 21f82: 18 16 cp r1, r24 21f84: 1c f5 brge .+70 ; 0x21fcc { __preheat_counter[_heater_id]++; 21f86: f8 01 movw r30, r16 21f88: ec 57 subi r30, 0x7C ; 124 21f8a: fa 4f sbci r31, 0xFA ; 250 21f8c: 80 81 ld r24, Z 21f8e: 8f 5f subi r24, 0xFF ; 255 21f90: 80 83 st Z, r24 if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes 21f92: 31 10 cpse r3, r1 21f94: c7 c0 rjmp .+398 ; 0x22124 21f96: 89 30 cpi r24, 0x09 ; 9 21f98: c8 f0 brcs .+50 ; 0x21fcc { __delta=2.0; 21f9a: 81 2c mov r8, r1 21f9c: 91 2c mov r9, r1 21f9e: a1 2c mov r10, r1 21fa0: 50 e4 ldi r21, 0x40 ; 64 21fa2: b5 2e mov r11, r21 21fa4: e8 c0 rjmp .+464 ; 0x22176 #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; __timeout = TEMP_RUNAWAY_EXTRUDER_TIMEOUT; 21fa6: ad e2 ldi r26, 0x2D ; 45 21fa8: b0 e0 ldi r27, 0x00 ; 0 21faa: ba 87 std Y+10, r27 ; 0x0a 21fac: a9 87 std Y+9, r26 ; 0x09 } #endif #ifdef TEMP_RUNAWAY_EXTRUDER_TIMEOUT if (!_isbed) { __hysteresis = TEMP_RUNAWAY_EXTRUDER_HYSTERESIS; 21fae: 80 e0 ldi r24, 0x00 ; 0 21fb0: 90 e0 ldi r25, 0x00 ; 0 21fb2: a0 e7 ldi r26, 0x70 ; 112 21fb4: b1 e4 ldi r27, 0x41 ; 65 21fb6: 8a cf rjmp .-236 ; 0x21ecc __preheat_start[_heater_id] = _current_temperature; __preheat_counter[_heater_id] = 0; } else { temp_runaway_status[_heater_id] = TempRunaway_INACTIVE; 21fb8: 10 82 st Z, r1 temp_runaway_target[_heater_id] = _target_temperature; 21fba: 89 81 ldd r24, Y+1 ; 0x01 21fbc: 9a 81 ldd r25, Y+2 ; 0x02 21fbe: ab 81 ldd r26, Y+3 ; 0x03 21fc0: bc 81 ldd r27, Y+4 ; 0x04 21fc2: f5 01 movw r30, r10 21fc4: 80 83 st Z, r24 21fc6: 91 83 std Z+1, r25 ; 0x01 21fc8: a2 83 std Z+2, r26 ; 0x02 21fca: 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) 21fcc: 2d 81 ldd r18, Y+5 ; 0x05 21fce: 3e 81 ldd r19, Y+6 ; 0x06 21fd0: 4f 81 ldd r20, Y+7 ; 0x07 21fd2: 58 85 ldd r21, Y+8 ; 0x08 21fd4: 69 81 ldd r22, Y+1 ; 0x01 21fd6: 7a 81 ldd r23, Y+2 ; 0x02 21fd8: 8b 81 ldd r24, Y+3 ; 0x03 21fda: 9c 81 ldd r25, Y+4 ; 0x04 21fdc: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 21fe0: a3 01 movw r20, r6 21fe2: 92 01 movw r18, r4 21fe4: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 21fe8: 87 ff sbrs r24, 7 21fea: 46 c0 rjmp .+140 ; 0x22078 21fec: f8 01 movw r30, r16 21fee: e2 57 subi r30, 0x72 ; 114 21ff0: fa 4f sbci r31, 0xFA ; 250 21ff2: 80 81 ld r24, Z 21ff4: 81 30 cpi r24, 0x01 ; 1 21ff6: 49 f4 brne .+18 ; 0x2200a { temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; 21ff8: 82 e0 ldi r24, 0x02 ; 2 21ffa: 80 83 st Z, r24 temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 21ffc: f8 01 movw r30, r16 21ffe: ee 0f add r30, r30 22000: ff 1f adc r31, r31 22002: e8 56 subi r30, 0x68 ; 104 22004: fa 4f sbci r31, 0xFA ; 250 22006: 11 82 std Z+1, r1 ; 0x01 22008: 10 82 st Z, r1 } if (_output > 0) 2200a: 20 e0 ldi r18, 0x00 ; 0 2200c: 30 e0 ldi r19, 0x00 ; 0 2200e: a9 01 movw r20, r18 22010: c7 01 movw r24, r14 22012: b6 01 movw r22, r12 22014: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 22018: 18 16 cp r1, r24 2201a: bc f5 brge .+110 ; 0x2208a if (temp_runaway_check_active) { // we are in range if ((_current_temperature > (_target_temperature - __hysteresis)) && (_current_temperature < (_target_temperature + __hysteresis))) 2201c: 29 81 ldd r18, Y+1 ; 0x01 2201e: 3a 81 ldd r19, Y+2 ; 0x02 22020: 4b 81 ldd r20, Y+3 ; 0x03 22022: 5c 81 ldd r21, Y+4 ; 0x04 22024: 6d 81 ldd r22, Y+5 ; 0x05 22026: 7e 81 ldd r23, Y+6 ; 0x06 22028: 8f 81 ldd r24, Y+7 ; 0x07 2202a: 98 85 ldd r25, Y+8 ; 0x08 2202c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 22030: a3 01 movw r20, r6 22032: 92 01 movw r18, r4 22034: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 22038: 18 16 cp r1, r24 2203a: 0c f0 brlt .+2 ; 0x2203e 2203c: 3f c0 rjmp .+126 ; 0x220bc { temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; 2203e: 00 0f add r16, r16 22040: 11 1f adc r17, r17 22042: f8 01 movw r30, r16 22044: e8 56 subi r30, 0x68 ; 104 22046: fa 4f sbci r31, 0xFA ; 250 22048: 11 82 std Z+1, r1 ; 0x01 2204a: 10 82 st Z, r1 2204c: 1e c0 rjmp .+60 ; 0x2208a 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)) 2204e: a3 01 movw r20, r6 22050: 92 01 movw r18, r4 22052: 69 81 ldd r22, Y+1 ; 0x01 22054: 7a 81 ldd r23, Y+2 ; 0x02 22056: 8b 81 ldd r24, Y+3 ; 0x03 22058: 9c 81 ldd r25, Y+4 ; 0x04 2205a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2205e: 18 16 cp r1, r24 22060: 0c f0 brlt .+2 ; 0x22064 22062: b4 cf rjmp .-152 ; 0x21fcc 22064: f8 01 movw r30, r16 22066: e2 57 subi r30, 0x72 ; 114 22068: fa 4f sbci r31, 0xFA ; 250 2206a: 80 81 ld r24, Z 2206c: 81 30 cpi r24, 0x01 ; 1 2206e: 09 f0 breq .+2 ; 0x22072 22070: ad cf rjmp .-166 ; 0x21fcc 22072: 89 cf rjmp .-238 ; 0x21f86 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; 22074: 10 82 st Z, r1 22076: 97 c0 rjmp .+302 ; 0x221a6 temp_runaway_status[_heater_id] = TempRunaway_ACTIVE; temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } if (_output > 0) 22078: 20 e0 ldi r18, 0x00 ; 0 2207a: 30 e0 ldi r19, 0x00 ; 0 2207c: a9 01 movw r20, r18 2207e: c7 01 movw r24, r14 22080: b6 01 movw r22, r12 22082: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 22086: 18 16 cp r1, r24 22088: cc f0 brlt .+50 ; 0x220bc } } } } } 2208a: 2c 96 adiw r28, 0x0c ; 12 2208c: 0f b6 in r0, 0x3f ; 63 2208e: f8 94 cli 22090: de bf out 0x3e, r29 ; 62 22092: 0f be out 0x3f, r0 ; 63 22094: cd bf out 0x3d, r28 ; 61 22096: df 91 pop r29 22098: cf 91 pop r28 2209a: 1f 91 pop r17 2209c: 0f 91 pop r16 2209e: ff 90 pop r15 220a0: ef 90 pop r14 220a2: df 90 pop r13 220a4: cf 90 pop r12 220a6: bf 90 pop r11 220a8: af 90 pop r10 220aa: 9f 90 pop r9 220ac: 8f 90 pop r8 220ae: 7f 90 pop r7 220b0: 6f 90 pop r6 220b2: 5f 90 pop r5 220b4: 4f 90 pop r4 220b6: 3f 90 pop r3 220b8: 2f 90 pop r2 220ba: 08 95 ret temp_runaway_check_active = false; temp_runaway_error_counter[_heater_id] = 0; } else { if (temp_runaway_status[_heater_id] > TempRunaway_PREHEAT) 220bc: f8 01 movw r30, r16 220be: e2 57 subi r30, 0x72 ; 114 220c0: fa 4f sbci r31, 0xFA ; 250 220c2: 80 81 ld r24, Z 220c4: 82 30 cpi r24, 0x02 ; 2 220c6: 08 f3 brcs .-62 ; 0x2208a { temp_runaway_error_counter[_heater_id]++; 220c8: 00 0f add r16, r16 220ca: 11 1f adc r17, r17 220cc: f8 01 movw r30, r16 220ce: e8 56 subi r30, 0x68 ; 104 220d0: fa 4f sbci r31, 0xFA ; 250 220d2: 80 81 ld r24, Z 220d4: 91 81 ldd r25, Z+1 ; 0x01 220d6: 01 96 adiw r24, 0x01 ; 1 220d8: 91 83 std Z+1, r25 ; 0x01 220da: 80 83 st Z, r24 if (temp_runaway_error_counter[_heater_id] * 2 > __timeout) 220dc: 88 0f add r24, r24 220de: 99 1f adc r25, r25 220e0: e9 85 ldd r30, Y+9 ; 0x09 220e2: fa 85 ldd r31, Y+10 ; 0x0a 220e4: e8 17 cp r30, r24 220e6: f9 07 cpc r31, r25 220e8: 80 f6 brcc .-96 ; 0x2208a set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::runaway); 220ea: 43 e0 ldi r20, 0x03 ; 3 220ec: 62 2d mov r22, r2 220ee: 83 2d mov r24, r3 } } } } } 220f0: 2c 96 adiw r28, 0x0c ; 12 220f2: 0f b6 in r0, 0x3f ; 63 220f4: f8 94 cli 220f6: de bf out 0x3e, r29 ; 62 220f8: 0f be out 0x3f, r0 ; 63 220fa: cd bf out 0x3d, r28 ; 61 220fc: df 91 pop r29 220fe: cf 91 pop r28 22100: 1f 91 pop r17 22102: 0f 91 pop r16 22104: ff 90 pop r15 22106: ef 90 pop r14 22108: df 90 pop r13 2210a: cf 90 pop r12 2210c: bf 90 pop r11 2210e: af 90 pop r10 22110: 9f 90 pop r9 22112: 8f 90 pop r8 22114: 7f 90 pop r7 22116: 6f 90 pop r6 22118: 5f 90 pop r5 2211a: 4f 90 pop r4 2211c: 3f 90 pop r3 2211e: 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); 22120: 0d 94 b9 0e jmp 0x21d72 ; 0x21d72 } 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 22124: 81 31 cpi r24, 0x11 ; 17 22126: 08 f4 brcc .+2 ; 0x2212a 22128: 51 cf rjmp .-350 ; 0x21fcc { __delta=2.0; if(_isbed) { __delta=3.0; if(_current_temperature>90.0) __delta=2.0; 2212a: 20 e0 ldi r18, 0x00 ; 0 2212c: 30 e0 ldi r19, 0x00 ; 0 2212e: 44 eb ldi r20, 0xB4 ; 180 22130: 52 e4 ldi r21, 0x42 ; 66 22132: c3 01 movw r24, r6 22134: b2 01 movw r22, r4 22136: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> if (__preheat_counter[_heater_id] > ((_isbed) ? 16 : 8)) // periodicaly check if current temperature changes { __delta=2.0; if(_isbed) { __delta=3.0; 2213a: 81 2c mov r8, r1 2213c: 91 2c mov r9, r1 2213e: e0 e4 ldi r30, 0x40 ; 64 22140: ae 2e mov r10, r30 22142: ba 2c mov r11, r10 if(_current_temperature>90.0) __delta=2.0; 22144: 18 16 cp r1, r24 22146: 2c f4 brge .+10 ; 0x22152 22148: 81 2c mov r8, r1 2214a: 91 2c mov r9, r1 2214c: a1 2c mov r10, r1 2214e: 70 e4 ldi r23, 0x40 ; 64 22150: b7 2e mov r11, r23 if(_current_temperature>105.0) __delta=0.6; 22152: 20 e0 ldi r18, 0x00 ; 0 22154: 30 e0 ldi r19, 0x00 ; 0 22156: 42 ed ldi r20, 0xD2 ; 210 22158: 52 e4 ldi r21, 0x42 ; 66 2215a: c3 01 movw r24, r6 2215c: b2 01 movw r22, r4 2215e: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 22162: 18 16 cp r1, r24 22164: 44 f4 brge .+16 ; 0x22176 22166: 6a e9 ldi r22, 0x9A ; 154 22168: 86 2e mov r8, r22 2216a: 69 e9 ldi r22, 0x99 ; 153 2216c: 96 2e mov r9, r22 2216e: 69 e1 ldi r22, 0x19 ; 25 22170: a6 2e mov r10, r22 22172: 6f e3 ldi r22, 0x3F ; 63 22174: b6 2e mov r11, r22 } if (_current_temperature - __preheat_start[_heater_id] < __delta) { 22176: eb 85 ldd r30, Y+11 ; 0x0b 22178: fc 85 ldd r31, Y+12 ; 0x0c 2217a: ea 57 subi r30, 0x7A ; 122 2217c: fa 4f sbci r31, 0xFA ; 250 2217e: 20 81 ld r18, Z 22180: 31 81 ldd r19, Z+1 ; 0x01 22182: 42 81 ldd r20, Z+2 ; 0x02 22184: 53 81 ldd r21, Z+3 ; 0x03 22186: c3 01 movw r24, r6 22188: b2 01 movw r22, r4 2218a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2218e: a5 01 movw r20, r10 22190: 94 01 movw r18, r8 22192: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 22196: f8 01 movw r30, r16 22198: ee 57 subi r30, 0x7E ; 126 2219a: fa 4f sbci r31, 0xFA ; 250 2219c: 87 ff sbrs r24, 7 2219e: 6a cf rjmp .-300 ; 0x22074 __preheat_errors[_heater_id]++; 221a0: 80 81 ld r24, Z 221a2: 8f 5f subi r24, 0xFF ; 255 221a4: 80 83 st Z, r24 } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 221a6: 80 81 ld r24, Z 221a8: 90 e0 ldi r25, 0x00 ; 0 221aa: 31 10 cpse r3, r1 221ac: 04 c0 rjmp .+8 ; 0x221b6 221ae: 06 97 sbiw r24, 0x06 ; 6 221b0: 4c f0 brlt .+18 ; 0x221c4 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 221b2: 80 e0 ldi r24, 0x00 ; 0 221b4: 03 c0 rjmp .+6 ; 0x221bc __preheat_errors[_heater_id]++; } else { __preheat_errors[_heater_id] = 0; } if (__preheat_errors[_heater_id] > ((_isbed) ? 3 : 5)) 221b6: 04 97 sbiw r24, 0x04 ; 4 221b8: 2c f0 brlt .+10 ; 0x221c4 set_temp_error((_isbed?TempErrorSource::bed:TempErrorSource::hotend), _heater_id, TempErrorType::preheat); 221ba: 81 e0 ldi r24, 0x01 ; 1 221bc: 42 e0 ldi r20, 0x02 ; 2 221be: 62 2d mov r22, r2 221c0: 0f 94 b9 0e call 0x21d72 ; 0x21d72 __preheat_start[_heater_id] = _current_temperature; 221c4: 2b 85 ldd r18, Y+11 ; 0x0b 221c6: 3c 85 ldd r19, Y+12 ; 0x0c 221c8: 2a 57 subi r18, 0x7A ; 122 221ca: 3a 4f sbci r19, 0xFA ; 250 221cc: d9 01 movw r26, r18 221ce: 4d 92 st X+, r4 221d0: 5d 92 st X+, r5 221d2: 6d 92 st X+, r6 221d4: 7c 92 st X, r7 221d6: 13 97 sbiw r26, 0x03 ; 3 __preheat_counter[_heater_id] = 0; 221d8: f8 01 movw r30, r16 221da: ec 57 subi r30, 0x7C ; 124 221dc: fa 4f sbci r31, 0xFA ; 250 221de: 10 82 st Z, r1 221e0: f5 ce rjmp .-534 ; 0x21fcc 000221e2 : //! @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() { 221e2: 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); 221e4: 89 e2 ldi r24, 0x29 ; 41 221e6: 9d e0 ldi r25, 0x0D ; 13 221e8: 0f 94 81 a4 call 0x34902 ; 0x34902 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; 221ec: 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. 221ee: 8f 3f cpi r24, 0xFF ; 255 221f0: 91 f4 brne .+36 ; 0x22216 { #endif //PINDA_TEMP_COMP return (current_temperature_pinda >= PINDA_MINTEMP) ? true : false; 221f2: 20 e0 ldi r18, 0x00 ; 0 221f4: 30 e0 ldi r19, 0x00 ; 0 221f6: 40 ef ldi r20, 0xF0 ; 240 221f8: 51 e4 ldi r21, 0x41 ; 65 221fa: 60 91 85 03 lds r22, 0x0385 ; 0x800385 221fe: 70 91 86 03 lds r23, 0x0386 ; 0x800386 22202: 80 91 87 03 lds r24, 0x0387 ; 0x800387 22206: 90 91 88 03 lds r25, 0x0388 ; 0x800388 2220a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2220e: 87 ff sbrs r24, 7 22210: 04 c0 rjmp .+8 ; 0x2221a #ifdef PINDA_TEMP_COMP } else if (pinda_temp_compensation == 0) return true; //Overwritten via LCD menu SuperPINDA [No] 22212: c0 e0 ldi r28, 0x00 ; 0 22214: 02 c0 rjmp .+4 ; 0x2221a 22216: 81 11 cpse r24, r1 22218: fc cf rjmp .-8 ; 0x22212 else return false; //Overwritten via LCD menu SuperPINDA [YES] #endif //PINDA_TEMP_COMP #else return true; #endif } 2221a: 8c 2f mov r24, r28 2221c: cf 91 pop r28 2221e: 08 95 ret 00022220 <__vector_14>: #ifdef SYSTEM_TIMER_2 ISR(TIMER2_COMPB_vect) #else //SYSTEM_TIMER_2 ISR(TIMER0_COMPB_vect) #endif //SYSTEM_TIMER_2 { 22220: 1f 92 push r1 22222: 0f 92 push r0 22224: 0f b6 in r0, 0x3f ; 63 22226: 0f 92 push r0 22228: 11 24 eor r1, r1 2222a: 0b b6 in r0, 0x3b ; 59 2222c: 0f 92 push r0 2222e: ff 92 push r15 22230: 0f 93 push r16 22232: 1f 93 push r17 22234: 2f 93 push r18 22236: 3f 93 push r19 22238: 4f 93 push r20 2223a: 5f 93 push r21 2223c: 6f 93 push r22 2223e: 7f 93 push r23 22240: 8f 93 push r24 22242: 9f 93 push r25 22244: af 93 push r26 22246: bf 93 push r27 22248: cf 93 push r28 2224a: df 93 push r29 2224c: ef 93 push r30 2224e: ff 93 push r31 DISABLE_SOFT_PWM_INTERRUPT(); 22250: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 22254: 8b 7f andi r24, 0xFB ; 251 22256: 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(); 2225a: 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) 2225c: 80 91 00 01 lds r24, 0x0100 ; 0x800100 <__TEXT_REGION_LENGTH__+0x7c2100> 22260: 86 fd sbrc r24, 6 22262: c8 c0 rjmp .+400 ; 0x223f4 <__vector_14+0x1d4> { //button is pressed if (buttonBlanking.expired_cont(BUTTON_BLANKING_TIME)) { 22264: 68 ec ldi r22, 0xC8 ; 200 22266: 70 e0 ldi r23, 0x00 ; 0 22268: 82 eb ldi r24, 0xB2 ; 178 2226a: 95 e0 ldi r25, 0x05 ; 5 2226c: 0f 94 e0 0b call 0x217c0 ; 0x217c0 ::expired_cont(unsigned short)> 22270: 88 23 and r24, r24 22272: b9 f0 breq .+46 ; 0x222a2 <__vector_14+0x82> buttonBlanking.start(); 22274: 82 eb ldi r24, 0xB2 ; 178 22276: 95 e0 ldi r25, 0x05 ; 5 22278: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> safetyTimer.start(); 2227c: 8d ea ldi r24, 0xAD ; 173 2227e: 95 e0 ldi r25, 0x05 ; 5 22280: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) 22284: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 22288: 81 11 cpse r24, r1 2228a: a5 c0 rjmp .+330 ; 0x223d6 <__vector_14+0x1b6> 2228c: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 22290: 81 11 cpse r24, r1 22292: a1 c0 rjmp .+322 ; 0x223d6 <__vector_14+0x1b6> { longPressTimer.start(); 22294: 88 ea ldi r24, 0xA8 ; 168 22296: 95 e0 ldi r25, 0x05 ; 5 22298: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> lcd_button_pressed = 1; 2229c: 81 e0 ldi r24, 0x01 ; 1 2229e: 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); 222a2: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 222a6: 82 fb bst r24, 2 222a8: 88 27 eor r24, r24 222aa: 80 f9 bld r24, 0 222ac: 91 e0 ldi r25, 0x01 ; 1 222ae: 89 27 eor r24, r25 if (!READ(BTN_EN2)) enc_bits |= _BV(1); 222b0: 90 91 03 01 lds r25, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 222b4: 91 ff sbrs r25, 1 222b6: 82 60 ori r24, 0x02 ; 2 if (enc_bits != enc_bits_old) 222b8: e0 91 a5 05 lds r30, 0x05A5 ; 0x8005a5 222bc: e8 17 cp r30, r24 222be: e1 f0 breq .+56 ; 0x222f8 <__vector_14+0xd8> { int8_t newDiff = pgm_read_byte(&encrot_table[(enc_bits_old << 2) | enc_bits]); 222c0: 24 e0 ldi r18, 0x04 ; 4 222c2: e2 9f mul r30, r18 222c4: f0 01 movw r30, r0 222c6: 11 24 eor r1, r1 222c8: e8 2b or r30, r24 222ca: e9 5c subi r30, 0xC9 ; 201 222cc: f7 46 sbci r31, 0x67 ; 103 222ce: e4 91 lpm r30, Z lcd_encoder_diff += newDiff; 222d0: 90 91 a4 05 lds r25, 0x05A4 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.499> 222d4: e9 0f add r30, r25 222d6: e0 93 a4 05 sts 0x05A4, r30 ; 0x8005a4 <_ZL16lcd_encoder_diff.lto_priv.499> if (abs(lcd_encoder_diff) >= ENCODER_PULSES_PER_STEP) { 222da: 0e 2e mov r0, r30 222dc: 00 0c add r0, r0 222de: ff 0b sbc r31, r31 222e0: f7 ff sbrs r31, 7 222e2: 03 c0 rjmp .+6 ; 0x222ea <__vector_14+0xca> 222e4: f1 95 neg r31 222e6: e1 95 neg r30 222e8: f1 09 sbc r31, r1 222ea: 34 97 sbiw r30, 0x04 ; 4 222ec: 1c f0 brlt .+6 ; 0x222f4 <__vector_14+0xd4> lcd_backlight_wake_trigger = true; // flag event, knob rotated 222ee: 91 e0 ldi r25, 0x01 ; 1 222f0: 90 93 a6 05 sts 0x05A6, r25 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.498> } enc_bits_old = enc_bits; 222f4: 80 93 a5 05 sts 0x05A5, r24 ; 0x8005a5 #ifndef SLOW_PWM_HEATERS /* * standard PWM modulation */ if (pwm_count == 0) 222f8: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 222fc: 81 11 cpse r24, r1 222fe: 08 c0 rjmp .+16 ; 0x22310 <__vector_14+0xf0> { soft_pwm_0 = soft_pwm[0]; 22300: 80 91 f5 05 lds r24, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.501> 22304: 80 93 bb 05 sts 0x05BB, r24 ; 0x8005bb if(soft_pwm_0 > 0) 22308: 88 23 and r24, r24 2230a: 09 f4 brne .+2 ; 0x2230e <__vector_14+0xee> 2230c: 87 c0 rjmp .+270 ; 0x2241c <__vector_14+0x1fc> { WRITE(HEATER_0_PIN,1); 2230e: 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) 22310: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 22314: 8f 70 andi r24, 0x0F ; 15 22316: a9 f4 brne .+42 ; 0x22342 <__vector_14+0x122> { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); 22318: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 2231c: 90 e0 ldi r25, 0x00 ; 0 2231e: 24 e0 ldi r18, 0x04 ; 4 22320: 95 95 asr r25 22322: 87 95 ror r24 22324: 2a 95 dec r18 22326: e1 f7 brne .-8 ; 0x22320 <__vector_14+0x100> 22328: 80 93 0f 04 sts 0x040F, r24 ; 0x80040f <_ZL12soft_pwm_fan.lto_priv.435> if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 2232c: 89 2b or r24, r25 2232e: 09 f4 brne .+2 ; 0x22332 <__vector_14+0x112> 22330: 77 c0 rjmp .+238 ; 0x22420 <__vector_14+0x200> 22332: 9f b7 in r25, 0x3f ; 63 22334: f8 94 cli 22336: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2233a: 88 60 ori r24, 0x08 ; 8 2233c: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22340: 9f bf out 0x3f, r25 ; 63 } #endif if(soft_pwm_0 < pwm_count) 22342: 90 91 bb 05 lds r25, 0x05BB ; 0x8005bb 22346: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 2234a: 98 17 cp r25, r24 2234c: 08 f4 brcc .+2 ; 0x22350 <__vector_14+0x130> { WRITE(HEATER_0_PIN,0); 2234e: 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); 22350: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 22354: 8f 70 andi r24, 0x0F ; 15 22356: 90 91 0f 04 lds r25, 0x040F ; 0x80040f <_ZL12soft_pwm_fan.lto_priv.435> 2235a: 98 17 cp r25, r24 2235c: 40 f4 brcc .+16 ; 0x2236e <__vector_14+0x14e> 2235e: 9f b7 in r25, 0x3f ; 63 22360: f8 94 cli 22362: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22366: 87 7f andi r24, 0xF7 ; 247 22368: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2236c: 9f bf out 0x3f, r25 ; 63 #endif pwm_count += (1 << SOFT_PWM_SCALE); 2236e: 80 91 6e 02 lds r24, 0x026E ; 0x80026e 22372: 8f 5f subi r24, 0xFF ; 255 pwm_count &= 0x7f; 22374: 8f 77 andi r24, 0x7F ; 127 22376: 80 93 6e 02 sts 0x026E, r24 ; 0x80026e 2237a: 10 e0 ldi r17, 0x00 ; 0 2237c: 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 2237e: e8 01 movw r28, r16 22380: cc 0f add r28, r28 22382: dd 1f adc r29, r29 22384: c1 58 subi r28, 0x81 ; 129 22386: dc 4f sbci r29, 0xFC ; 252 22388: 88 81 ld r24, Y 2238a: 99 81 ldd r25, Y+1 ; 0x01 if(curTodo>0) 2238c: 18 16 cp r1, r24 2238e: 19 06 cpc r1, r25 22390: 0c f0 brlt .+2 ; 0x22394 <__vector_14+0x174> 22392: 4c c0 rjmp .+152 ; 0x2242c <__vector_14+0x20c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22394: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22396: f8 94 cli babystep(axis,/*fwd*/true); 22398: 61 e0 ldi r22, 0x01 ; 1 2239a: 80 2f mov r24, r16 2239c: 0f 94 3f 00 call 0x2007e ; 0x2007e babystepsTodo[axis]--; //less to do next time 223a0: 88 81 ld r24, Y 223a2: 99 81 ldd r25, Y+1 ; 0x01 223a4: 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 223a6: 99 83 std Y+1, r25 ; 0x01 223a8: 88 83 st Y, r24 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 223aa: ff be out 0x3f, r15 ; 63 __asm__ volatile ("" ::: "memory"); 223ac: 0f 5f subi r16, 0xFF ; 255 223ae: 1f 4f sbci r17, 0xFF ; 255 } #endif #ifdef BABYSTEPPING FORCE_INLINE static void applyBabysteps() { for(uint8_t axis=0;axis<3;axis++) 223b0: 03 30 cpi r16, 0x03 ; 3 223b2: 11 05 cpc r17, r1 223b4: 21 f7 brne .-56 ; 0x2237e <__vector_14+0x15e> #ifdef BABYSTEPPING applyBabysteps(); #endif //BABYSTEPPING // Check if a stack overflow happened if (!SdFatUtil::test_stack_integrity()) stack_error(); 223b6: 80 91 37 17 lds r24, 0x1737 ; 0x801737 <__bss_end+0x20> 223ba: 90 91 38 17 lds r25, 0x1738 ; 0x801738 <__bss_end+0x21> 223be: a0 91 39 17 lds r26, 0x1739 ; 0x801739 <__bss_end+0x22> 223c2: b0 91 3a 17 lds r27, 0x173A ; 0x80173a <__bss_end+0x23> 223c6: 82 3a cpi r24, 0xA2 ; 162 223c8: 92 4a sbci r25, 0xA2 ; 162 223ca: a1 05 cpc r26, r1 223cc: b1 05 cpc r27, r1 223ce: d9 f1 breq .+118 ; 0x22446 <__vector_14+0x226> crash_and_burn(dump_crash_reason::bad_isr); } #endif //EMERGENCY_HANDLERS void stack_error() { crash_and_burn(dump_crash_reason::stack_error); 223d0: 81 e0 ldi r24, 0x01 ; 1 223d2: 0e 94 40 85 call 0x10a80 ; 0x10a80 if ((lcd_button_pressed == 0) && (lcd_long_press_active == 0)) { longPressTimer.start(); lcd_button_pressed = 1; } else if (longPressTimer.expired(LONG_PRESS_TIME)) 223d6: 68 ee ldi r22, 0xE8 ; 232 223d8: 73 e0 ldi r23, 0x03 ; 3 223da: 88 ea ldi r24, 0xA8 ; 168 223dc: 95 e0 ldi r25, 0x05 ; 5 223de: 0f 94 b8 0b call 0x21770 ; 0x21770 ::expired(unsigned short)> 223e2: 88 23 and r24, r24 223e4: 09 f4 brne .+2 ; 0x223e8 <__vector_14+0x1c8> 223e6: 5d cf rjmp .-326 ; 0x222a2 <__vector_14+0x82> { lcd_long_press_active = 1; 223e8: 81 e0 ldi r24, 0x01 ; 1 223ea: 80 93 ab 05 sts 0x05AB, r24 ; 0x8005ab lcd_longpress_trigger = 1; 223ee: 80 93 a7 05 sts 0x05A7, r24 ; 0x8005a7 223f2: 57 cf rjmp .-338 ; 0x222a2 <__vector_14+0x82> } } } else { //button not pressed if (lcd_button_pressed) 223f4: 80 91 ac 05 lds r24, 0x05AC ; 0x8005ac 223f8: 88 23 and r24, r24 223fa: 09 f4 brne .+2 ; 0x223fe <__vector_14+0x1de> 223fc: 52 cf rjmp .-348 ; 0x222a2 <__vector_14+0x82> { //button was released lcd_button_pressed = 0; // Reset to prevent double triggering 223fe: 10 92 ac 05 sts 0x05AC, r1 ; 0x8005ac if (!lcd_long_press_active) 22402: 80 91 ab 05 lds r24, 0x05AB ; 0x8005ab 22406: 81 11 cpse r24, r1 22408: 03 c0 rjmp .+6 ; 0x22410 <__vector_14+0x1f0> { //button released before long press gets activated lcd_click_trigger = 1; // This flag is reset when the event is consumed 2240a: 81 e0 ldi r24, 0x01 ; 1 2240c: 80 93 95 03 sts 0x0395, r24 ; 0x800395 } lcd_backlight_wake_trigger = true; // flag event, knob pressed 22410: 81 e0 ldi r24, 0x01 ; 1 22412: 80 93 a6 05 sts 0x05A6, r24 ; 0x8005a6 <_ZL26lcd_backlight_wake_trigger.lto_priv.498> lcd_long_press_active = 0; 22416: 10 92 ab 05 sts 0x05AB, r1 ; 0x8005ab 2241a: 43 cf rjmp .-378 ; 0x222a2 <__vector_14+0x82> { WRITE(HEATER_0_PIN,1); #ifdef HEATERS_PARALLEL WRITE(HEATER_1_PIN,1); #endif } else WRITE(HEATER_0_PIN,0); 2241c: 75 98 cbi 0x0e, 5 ; 14 2241e: 78 cf rjmp .-272 ; 0x22310 <__vector_14+0xf0> #ifdef FAN_SOFT_PWM if ((pwm_count & ((1 << FAN_SOFT_PWM_BITS) - 1)) == 0) { soft_pwm_fan = fanSpeedSoftPwm / (1 << (8 - FAN_SOFT_PWM_BITS)); if(soft_pwm_fan > 0) WRITE(FAN_PIN,1); else WRITE(FAN_PIN,0); 22420: 9f b7 in r25, 0x3f ; 63 22422: f8 94 cli 22424: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 22428: 87 7f andi r24, 0xF7 ; 247 2242a: 88 cf rjmp .-240 ; 0x2233c <__vector_14+0x11c> babystep(axis,/*fwd*/true); babystepsTodo[axis]--; //less to do next time } } else if(curTodo<0) 2242c: 89 2b or r24, r25 2242e: 09 f4 brne .+2 ; 0x22432 <__vector_14+0x212> 22430: bd cf rjmp .-134 ; 0x223ac <__vector_14+0x18c> { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 22432: ff b6 in r15, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 22434: f8 94 cli babystep(axis,/*fwd*/false); 22436: 60 e0 ldi r22, 0x00 ; 0 22438: 80 2f mov r24, r16 2243a: 0f 94 3f 00 call 0x2007e ; 0x2007e babystepsTodo[axis]++; //less to do next time 2243e: 88 81 ld r24, Y 22440: 99 81 ldd r25, Y+1 ; 0x01 22442: 01 96 adiw r24, 0x01 ; 1 22444: b0 cf rjmp .-160 ; 0x223a6 <__vector_14+0x186> #if (defined(FANCHECK) && defined(TACH_0) && (TACH_0 > -1)) void readFanTach() { static bool fan_state[2]; #ifdef FAN_SOFT_PWM if (READ(TACH_0) != fan_state[0]) { 22446: 96 b1 in r25, 0x06 ; 6 22448: 80 91 b9 05 lds r24, 0x05B9 ; 0x8005b9 2244c: 99 1f adc r25, r25 2244e: 99 27 eor r25, r25 22450: 99 1f adc r25, r25 22452: 98 17 cp r25, r24 22454: 91 f0 breq .+36 ; 0x2247a <__vector_14+0x25a> if(fan_measuring) fan_edge_counter[0] ++; 22456: 90 91 b6 03 lds r25, 0x03B6 ; 0x8003b6 2245a: 99 23 and r25, r25 2245c: 51 f0 breq .+20 ; 0x22472 <__vector_14+0x252> 2245e: 20 91 b5 05 lds r18, 0x05B5 ; 0x8005b5 22462: 30 91 b6 05 lds r19, 0x05B6 ; 0x8005b6 22466: 2f 5f subi r18, 0xFF ; 255 22468: 3f 4f sbci r19, 0xFF ; 255 2246a: 30 93 b6 05 sts 0x05B6, r19 ; 0x8005b6 2246e: 20 93 b5 05 sts 0x05B5, r18 ; 0x8005b5 fan_state[0] = !fan_state[0]; 22472: 91 e0 ldi r25, 0x01 ; 1 22474: 89 27 eor r24, r25 22476: 80 93 b9 05 sts 0x05B9, r24 ; 0x8005b9 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 2247a: f8 94 cli { DISABLE_SOFT_PWM_INTERRUPT(); NONATOMIC_BLOCK(NONATOMIC_FORCEOFF) { soft_pwm_isr(); } ENABLE_SOFT_PWM_INTERRUPT(); 2247c: 80 91 70 00 lds r24, 0x0070 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> 22480: 84 60 ori r24, 0x04 ; 4 22482: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7c2070> } 22486: ff 91 pop r31 22488: ef 91 pop r30 2248a: df 91 pop r29 2248c: cf 91 pop r28 2248e: bf 91 pop r27 22490: af 91 pop r26 22492: 9f 91 pop r25 22494: 8f 91 pop r24 22496: 7f 91 pop r23 22498: 6f 91 pop r22 2249a: 5f 91 pop r21 2249c: 4f 91 pop r20 2249e: 3f 91 pop r19 224a0: 2f 91 pop r18 224a2: 1f 91 pop r17 224a4: 0f 91 pop r16 224a6: ff 90 pop r15 224a8: 0f 90 pop r0 224aa: 0b be out 0x3b, r0 ; 59 224ac: 0f 90 pop r0 224ae: 0f be out 0x3f, r0 ; 63 224b0: 0f 90 pop r0 224b2: 1f 90 pop r1 224b4: 18 95 reti 000224b6 : 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) { 224b6: 4f 92 push r4 224b8: 5f 92 push r5 224ba: 6f 92 push r6 224bc: 7f 92 push r7 224be: af 92 push r10 224c0: bf 92 push r11 224c2: cf 92 push r12 224c4: df 92 push r13 224c6: ef 92 push r14 224c8: ff 92 push r15 224ca: 0f 93 push r16 224cc: 1f 93 push r17 224ce: cf 93 push r28 224d0: df 93 push r29 224d2: 24 e0 ldi r18, 0x04 ; 4 224d4: 30 e0 ldi r19, 0x00 ; 0 224d6: 41 e0 ldi r20, 0x01 ; 1 224d8: 50 e0 ldi r21, 0x00 ; 0 224da: d9 01 movw r26, r18 224dc: a3 5a subi r26, 0xA3 ; 163 224de: b9 46 sbci r27, 0x69 ; 105 float celsius = 0; byte i; for (i=1; i raw) 224e0: fd 01 movw r30, r26 224e2: 65 91 lpm r22, Z+ 224e4: 74 91 lpm r23, Z 224e6: 86 17 cp r24, r22 224e8: 97 07 cpc r25, r23 224ea: 0c f0 brlt .+2 ; 0x224ee 224ec: 80 c0 rjmp .+256 ; 0x225ee { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 224ee: 41 50 subi r20, 0x01 ; 1 224f0: 51 09 sbc r21, r1 224f2: 44 0f add r20, r20 224f4: 55 1f adc r21, r21 224f6: 44 0f add r20, r20 224f8: 55 1f adc r21, r21 224fa: 8a 01 movw r16, r20 224fc: 01 5a subi r16, 0xA1 ; 161 224fe: 19 46 sbci r17, 0x69 ; 105 22500: f8 01 movw r30, r16 22502: c5 90 lpm r12, Z+ 22504: d4 90 lpm r13, Z (raw - PGM_RD_W(BEDTEMPTABLE[i-1][0])) * 22506: 43 5a subi r20, 0xA3 ; 163 22508: 59 46 sbci r21, 0x69 ; 105 2250a: fa 01 movw r30, r20 2250c: 65 91 lpm r22, Z+ 2250e: 74 91 lpm r23, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22510: f9 01 movw r30, r18 22512: e1 5a subi r30, 0xA1 ; 161 22514: f9 46 sbci r31, 0x69 ; 105 22516: c5 91 lpm r28, Z+ 22518: d4 91 lpm r29, Z 2251a: f8 01 movw r30, r16 2251c: 05 91 lpm r16, Z+ 2251e: 14 91 lpm r17, Z (float)(PGM_RD_W(BEDTEMPTABLE[i][0]) - PGM_RD_W(BEDTEMPTABLE[i-1][0])); 22520: fd 01 movw r30, r26 22522: e5 90 lpm r14, Z+ 22524: f4 90 lpm r15, Z 22526: fa 01 movw r30, r20 22528: a5 90 lpm r10, Z+ 2252a: 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])) * 2252c: 86 1b sub r24, r22 2252e: 97 0b sbc r25, r23 22530: bc 01 movw r22, r24 22532: 99 0f add r25, r25 22534: 88 0b sbc r24, r24 22536: 99 0b sbc r25, r25 22538: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2253c: 2b 01 movw r4, r22 2253e: 3c 01 movw r6, r24 (float)(PGM_RD_W(BEDTEMPTABLE[i][1]) - PGM_RD_W(BEDTEMPTABLE[i-1][1])) / 22540: be 01 movw r22, r28 22542: 60 1b sub r22, r16 22544: 71 0b sbc r23, r17 22546: 07 2e mov r0, r23 22548: 00 0c add r0, r0 2254a: 88 0b sbc r24, r24 2254c: 99 0b sbc r25, r25 2254e: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 22552: 9b 01 movw r18, r22 22554: 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])) * 22556: c3 01 movw r24, r6 22558: b2 01 movw r22, r4 2255a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2255e: 2b 01 movw r4, r22 22560: 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])); 22562: b7 01 movw r22, r14 22564: 6a 19 sub r22, r10 22566: 7b 09 sbc r23, r11 22568: 07 2e mov r0, r23 2256a: 00 0c add r0, r0 2256c: 88 0b sbc r24, r24 2256e: 99 0b sbc r25, r25 22570: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 22574: 9b 01 movw r18, r22 22576: 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])) / 22578: c3 01 movw r24, r6 2257a: b2 01 movw r22, r4 2257c: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 22580: 2b 01 movw r4, r22 22582: 3c 01 movw r6, r24 for (i=1; i raw) { celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]) + 22584: b6 01 movw r22, r12 22586: dd 0c add r13, r13 22588: 88 0b sbc r24, r24 2258a: 99 0b sbc r25, r25 2258c: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 22590: 9b 01 movw r18, r22 22592: ac 01 movw r20, r24 22594: c3 01 movw r24, r6 22596: b2 01 movw r22, r4 22598: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 2259c: 6b 01 movw r12, r22 2259e: 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) 225a0: 20 e0 ldi r18, 0x00 ; 0 225a2: 30 e0 ldi r19, 0x00 ; 0 225a4: 40 e2 ldi r20, 0x20 ; 32 225a6: 52 e4 ldi r21, 0x42 ; 66 225a8: c7 01 movw r24, r14 225aa: b6 01 movw r22, r12 225ac: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 225b0: 87 fd sbrc r24, 7 225b2: 30 c0 rjmp .+96 ; 0x22614 225b4: 20 e0 ldi r18, 0x00 ; 0 225b6: 30 e0 ldi r19, 0x00 ; 0 225b8: 48 e4 ldi r20, 0x48 ; 72 225ba: 52 e4 ldi r21, 0x42 ; 66 225bc: c7 01 movw r24, r14 225be: b6 01 movw r22, r12 225c0: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 225c4: 18 16 cp r1, r24 225c6: 34 f1 brlt .+76 ; 0x22614 { celsius = celsius + (_first_koef * (celsius - _offset_start)); 225c8: 20 e0 ldi r18, 0x00 ; 0 225ca: 30 e0 ldi r19, 0x00 ; 0 225cc: 40 e2 ldi r20, 0x20 ; 32 225ce: 52 e4 ldi r21, 0x42 ; 66 225d0: c7 01 movw r24, r14 225d2: b6 01 movw r22, r12 225d4: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 225d8: 20 e0 ldi r18, 0x00 ; 0 225da: 30 e0 ldi r19, 0x00 ; 0 225dc: 40 e0 ldi r20, 0x00 ; 0 225de: 5f e3 ldi r21, 0x3F ; 63 225e0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 225e4: 9b 01 movw r18, r22 225e6: 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; 225e8: c7 01 movw r24, r14 225ea: b6 01 movw r22, r12 225ec: 43 c0 rjmp .+134 ; 0x22674 225ee: 4f 5f subi r20, 0xFF ; 255 225f0: 5f 4f sbci r21, 0xFF ; 255 225f2: 2c 5f subi r18, 0xFC ; 252 225f4: 3f 4f sbci r19, 0xFF ; 255 static float analog2tempBed(int raw) { #ifdef BED_USES_THERMISTOR float celsius = 0; byte i; for (i=1; i 225fc: 6e cf rjmp .-292 ; 0x224da break; } } // Overflow: Set to last value in the table if (i == BEDTEMPTABLE_LEN) celsius = PGM_RD_W(BEDTEMPTABLE[i-1][1]); 225fe: ef e4 ldi r30, 0x4F ; 79 22600: f7 e9 ldi r31, 0x97 ; 151 22602: 65 91 lpm r22, Z+ 22604: 74 91 lpm r23, Z 22606: 07 2e mov r0, r23 22608: 00 0c add r0, r0 2260a: 88 0b sbc r24, r24 2260c: 99 0b sbc r25, r25 2260e: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 22612: c4 cf rjmp .-120 ; 0x2259c if (celsius >= _offset_start && celsius <= _offset_center) { celsius = celsius + (_first_koef * (celsius - _offset_start)); } else if (celsius > _offset_center && celsius <= 100) 22614: 20 e0 ldi r18, 0x00 ; 0 22616: 30 e0 ldi r19, 0x00 ; 0 22618: 48 e4 ldi r20, 0x48 ; 72 2261a: 52 e4 ldi r21, 0x42 ; 66 2261c: c7 01 movw r24, r14 2261e: b6 01 movw r22, r12 22620: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 22624: 18 16 cp r1, r24 22626: dc f5 brge .+118 ; 0x2269e 22628: 20 e0 ldi r18, 0x00 ; 0 2262a: 30 e0 ldi r19, 0x00 ; 0 2262c: 48 ec ldi r20, 0xC8 ; 200 2262e: 52 e4 ldi r21, 0x42 ; 66 22630: c7 01 movw r24, r14 22632: b6 01 movw r22, r12 22634: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 22638: 18 16 cp r1, r24 2263a: 8c f1 brlt .+98 ; 0x2269e { celsius = celsius + (_first_koef * (_offset_center - _offset_start)) + ( _second_koef * ( celsius - ( 100 - _offset_center ) )) ; 2263c: 20 e0 ldi r18, 0x00 ; 0 2263e: 30 e0 ldi r19, 0x00 ; 0 22640: 40 ea ldi r20, 0xA0 ; 160 22642: 50 e4 ldi r21, 0x40 ; 64 22644: c7 01 movw r24, r14 22646: b6 01 movw r22, r12 22648: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2264c: 2b 01 movw r4, r22 2264e: 3c 01 movw r6, r24 22650: 20 e0 ldi r18, 0x00 ; 0 22652: 30 e0 ldi r19, 0x00 ; 0 22654: 48 e4 ldi r20, 0x48 ; 72 22656: 52 e4 ldi r21, 0x42 ; 66 22658: c7 01 movw r24, r14 2265a: b6 01 movw r22, r12 2265c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 22660: 2d ec ldi r18, 0xCD ; 205 22662: 3c ec ldi r19, 0xCC ; 204 22664: 4c ec ldi r20, 0xCC ; 204 22666: 5d e3 ldi r21, 0x3D ; 61 22668: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2266c: 9b 01 movw r18, r22 2266e: ac 01 movw r20, r24 22670: c3 01 movw r24, r6 22672: b2 01 movw r22, r4 } else if (celsius > 100) { celsius = celsius + _offset; 22674: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 22678: 6b 01 movw r12, r22 2267a: 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 } 2267c: c7 01 movw r24, r14 2267e: b6 01 movw r22, r12 22680: df 91 pop r29 22682: cf 91 pop r28 22684: 1f 91 pop r17 22686: 0f 91 pop r16 22688: ff 90 pop r15 2268a: ef 90 pop r14 2268c: df 90 pop r13 2268e: cf 90 pop r12 22690: bf 90 pop r11 22692: af 90 pop r10 22694: 7f 90 pop r7 22696: 6f 90 pop r6 22698: 5f 90 pop r5 2269a: 4f 90 pop r4 2269c: 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) 2269e: 20 e0 ldi r18, 0x00 ; 0 226a0: 30 e0 ldi r19, 0x00 ; 0 226a2: 48 ec ldi r20, 0xC8 ; 200 226a4: 52 e4 ldi r21, 0x42 ; 66 226a6: c7 01 movw r24, r14 226a8: b6 01 movw r22, r12 226aa: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 226ae: 18 16 cp r1, r24 226b0: 2c f7 brge .-54 ; 0x2267c { celsius = celsius + _offset; 226b2: 20 e0 ldi r18, 0x00 ; 0 226b4: 30 e0 ldi r19, 0x00 ; 0 226b6: 40 e2 ldi r20, 0x20 ; 32 226b8: 51 e4 ldi r21, 0x41 ; 65 226ba: 96 cf rjmp .-212 ; 0x225e8 000226bc <__vector_32>: if (pid_tuning_finished) temp_mgr_pid(); } ISR(TIMERx_COMPA_vect) { 226bc: 1f 92 push r1 226be: 0f 92 push r0 226c0: 0f b6 in r0, 0x3f ; 63 226c2: 0f 92 push r0 226c4: 11 24 eor r1, r1 226c6: 0b b6 in r0, 0x3b ; 59 226c8: 0f 92 push r0 226ca: 4f 92 push r4 226cc: 5f 92 push r5 226ce: 6f 92 push r6 226d0: 7f 92 push r7 226d2: 8f 92 push r8 226d4: 9f 92 push r9 226d6: af 92 push r10 226d8: bf 92 push r11 226da: cf 92 push r12 226dc: df 92 push r13 226de: ef 92 push r14 226e0: ff 92 push r15 226e2: 0f 93 push r16 226e4: 1f 93 push r17 226e6: 2f 93 push r18 226e8: 3f 93 push r19 226ea: 4f 93 push r20 226ec: 5f 93 push r21 226ee: 6f 93 push r22 226f0: 7f 93 push r23 226f2: 8f 93 push r24 226f4: 9f 93 push r25 226f6: af 93 push r26 226f8: bf 93 push r27 226fa: cf 93 push r28 226fc: df 93 push r29 226fe: ef 93 push r30 22700: ff 93 push r31 // immediately schedule a new conversion if(adc_values_ready != true) return; 22702: 80 91 f6 05 lds r24, 0x05F6 ; 0x8005f6 <_ZL16adc_values_ready.lto_priv.514> 22706: 88 23 and r24, r24 22708: 09 f4 brne .+2 ; 0x2270c <__vector_32+0x50> 2270a: 22 c1 rjmp .+580 ; 0x22950 <__vector_32+0x294> adc_values_ready = false; 2270c: 10 92 f6 05 sts 0x05F6, r1 ; 0x8005f6 <_ZL16adc_values_ready.lto_priv.514> adc_start_cycle(); 22710: 0e 94 b8 ba call 0x17570 ; 0x17570 // run temperature management with interrupts enabled to reduce latency DISABLE_TEMP_MGR_INTERRUPT(); 22714: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 22718: 8d 7f andi r24, 0xFD ; 253 2271a: 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(); 2271e: 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 22724: 90 91 dd 05 lds r25, 0x05DD ; 0x8005dd 22728: 0f 94 07 90 call 0x3200e ; 0x3200e 2272c: 4b 01 movw r8, r22 2272e: 5c 01 movw r10, r24 22730: 80 92 f1 05 sts 0x05F1, r8 ; 0x8005f1 22734: 90 92 f2 05 sts 0x05F2, r9 ; 0x8005f2 22738: a0 92 f3 05 sts 0x05F3, r10 ; 0x8005f3 2273c: b0 92 f4 05 sts 0x05F4, r11 ; 0x8005f4 current_temperature_bed_isr = analog2tempBed(current_temperature_bed_raw); 22740: 00 91 de 05 lds r16, 0x05DE ; 0x8005de 22744: 10 91 df 05 lds r17, 0x05DF ; 0x8005df 22748: c8 01 movw r24, r16 2274a: 0f 94 5b 12 call 0x224b6 ; 0x224b6 2274e: 6b 01 movw r12, r22 22750: 7c 01 movw r14, r24 22752: c0 92 ea 05 sts 0x05EA, r12 ; 0x8005ea 22756: d0 92 eb 05 sts 0x05EB, r13 ; 0x8005eb 2275a: e0 92 ec 05 sts 0x05EC, r14 ; 0x8005ec 2275e: f0 92 ed 05 sts 0x05ED, r15 ; 0x8005ed #ifdef PINDA_THERMISTOR current_temperature_pinda_isr = analog2tempBed(current_temperature_raw_pinda); 22762: 80 91 da 05 lds r24, 0x05DA ; 0x8005da 22766: 90 91 db 05 lds r25, 0x05DB ; 0x8005db 2276a: 0f 94 5b 12 call 0x224b6 ; 0x224b6 2276e: 60 93 d6 05 sts 0x05D6, r22 ; 0x8005d6 22772: 70 93 d7 05 sts 0x05D7, r23 ; 0x8005d7 22776: 80 93 d8 05 sts 0x05D8, r24 ; 0x8005d8 2277a: 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; 2277e: 81 e0 ldi r24, 0x01 ; 1 22780: 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; 22784: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 22788: 8d 7f andi r24, 0xFD ; 253 2278a: 80 93 cc 03 sts 0x03CC, r24 ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 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]) { 2278e: c0 91 dc 05 lds r28, 0x05DC ; 0x8005dc 22792: d0 91 dd 05 lds r29, 0x05DD ; 0x8005dd 22796: 80 91 0b 04 lds r24, 0x040B ; 0x80040b <_ZL12maxttemp_raw.lto_priv.428> 2279a: 90 91 0c 04 lds r25, 0x040C ; 0x80040c <_ZL12maxttemp_raw.lto_priv.428+0x1> 2279e: 8c 17 cp r24, r28 227a0: 9d 07 cpc r25, r29 227a2: 2c f0 brlt .+10 ; 0x227ae <__vector_32+0xf2> #else if (current_temperature_raw[0] >= maxttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::max); 227a4: 40 e0 ldi r20, 0x00 ; 0 227a6: 60 e0 ldi r22, 0x00 ; 0 227a8: 80 e0 ldi r24, 0x00 ; 0 227aa: 0f 94 b9 0e call 0x21d72 ; 0x21d72 } //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) { 227ae: 80 91 09 04 lds r24, 0x0409 ; 0x800409 <_ZL16bed_maxttemp_raw.lto_priv.429> 227b2: 90 91 0a 04 lds r25, 0x040A ; 0x80040a <_ZL16bed_maxttemp_raw.lto_priv.429+0x1> 227b6: 80 17 cp r24, r16 227b8: 91 07 cpc r25, r17 227ba: 2c f0 brlt .+10 ; 0x227c6 <__vector_32+0x10a> #else if (current_temperature_bed_raw >= bed_maxttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::max); 227bc: 40 e0 ldi r20, 0x00 ; 0 227be: 60 e0 ldi r22, 0x00 ; 0 227c0: 81 e0 ldi r24, 0x01 ; 1 227c2: 0f 94 b9 0e call 0x21d72 ; 0x21d72 { // 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]) { 227c6: 60 91 0d 04 lds r22, 0x040D ; 0x80040d <_ZL8minttemp.lto_priv.425> 227ca: 70 91 0e 04 lds r23, 0x040E ; 0x80040e <_ZL8minttemp.lto_priv.425+0x1> 227ce: 80 91 ef 05 lds r24, 0x05EF ; 0x8005ef 227d2: 90 91 f0 05 lds r25, 0x05F0 ; 0x8005f0 227d6: 68 17 cp r22, r24 227d8: 79 07 cpc r23, r25 227da: 0c f0 brlt .+2 ; 0x227de <__vector_32+0x122> 227dc: dc c0 rjmp .+440 ; 0x22996 <__vector_32+0x2da> // ~ nozzle heating is on bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting 227de: 10 91 e7 05 lds r17, 0x05E7 ; 0x8005e7 227e2: 11 11 cpse r17, r1 227e4: 12 c0 rjmp .+36 ; 0x2280a <__vector_32+0x14e> 227e6: 6b 5f subi r22, 0xFB ; 251 227e8: 7f 4f sbci r23, 0xFF ; 255 227ea: 07 2e mov r0, r23 227ec: 00 0c add r0, r0 227ee: 88 0b sbc r24, r24 227f0: 99 0b sbc r25, r25 227f2: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 227f6: 9b 01 movw r18, r22 227f8: ac 01 movw r20, r24 227fa: 11 e0 ldi r17, 0x01 ; 1 227fc: c5 01 movw r24, r10 227fe: b4 01 movw r22, r8 22800: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 22804: 18 16 cp r1, r24 22806: 0c f0 brlt .+2 ; 0x2280a <__vector_32+0x14e> 22808: 10 e0 ldi r17, 0x00 ; 0 2280a: 10 93 e7 05 sts 0x05E7, r17 ; 0x8005e7 if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) { 2280e: 68 e9 ldi r22, 0x98 ; 152 22810: 7a e3 ldi r23, 0x3A ; 58 22812: 84 ee ldi r24, 0xE4 ; 228 22814: 95 e0 ldi r25, 0x05 ; 5 22816: 0f 94 e0 0b call 0x217c0 ; 0x217c0 ::expired_cont(unsigned short)> 2281a: 81 11 cpse r24, r1 2281c: 02 c0 rjmp .+4 ; 0x22822 <__vector_32+0x166> 2281e: 11 23 and r17, r17 22820: 79 f0 breq .+30 ; 0x22840 <__vector_32+0x184> bCheckingOnHeater=true; // not necessary 22822: 81 e0 ldi r24, 0x01 ; 1 22824: 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]) { 22828: 80 91 52 02 lds r24, 0x0252 ; 0x800252 <_ZL12minttemp_raw.lto_priv.427> 2282c: 90 91 53 02 lds r25, 0x0253 ; 0x800253 <_ZL12minttemp_raw.lto_priv.427+0x1> 22830: c8 17 cp r28, r24 22832: d9 07 cpc r29, r25 22834: 2c f0 brlt .+10 ; 0x22840 <__vector_32+0x184> #else if (current_temperature_raw[0] <= minttemp_raw[0]) { #endif set_temp_error(TempErrorSource::hotend, 0, TempErrorType::min); 22836: 41 e0 ldi r20, 0x01 ; 1 22838: 60 e0 ldi r22, 0x00 ; 0 2283a: 80 e0 ldi r24, 0x00 ; 0 2283c: 0f 94 b9 0e call 0x21d72 ; 0x21d72 // ~ nozzle heating is off oTimer4minTempHeater.start(); bCheckingOnHeater=false; } // * bed checking if(target_temperature_bed_isr>BED_MINTEMP) { 22840: 80 91 e8 05 lds r24, 0x05E8 ; 0x8005e8 22844: 90 91 e9 05 lds r25, 0x05E9 ; 0x8005e9 22848: 4f 97 sbiw r24, 0x1f ; 31 2284a: 0c f4 brge .+2 ; 0x2284e <__vector_32+0x192> 2284c: ab c0 rjmp .+342 ; 0x229a4 <__vector_32+0x2e8> // ~ bed heating is on bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting 2284e: c0 91 e3 05 lds r28, 0x05E3 ; 0x8005e3 22852: c1 11 cpse r28, r1 22854: 0c c0 rjmp .+24 ; 0x2286e <__vector_32+0x1b2> 22856: c1 e0 ldi r28, 0x01 ; 1 22858: 20 e0 ldi r18, 0x00 ; 0 2285a: 30 e0 ldi r19, 0x00 ; 0 2285c: 4c e0 ldi r20, 0x0C ; 12 2285e: 52 e4 ldi r21, 0x42 ; 66 22860: c7 01 movw r24, r14 22862: b6 01 movw r22, r12 22864: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 22868: 18 16 cp r1, r24 2286a: 0c f0 brlt .+2 ; 0x2286e <__vector_32+0x1b2> 2286c: c0 e0 ldi r28, 0x00 ; 0 2286e: c0 93 e3 05 sts 0x05E3, r28 ; 0x8005e3 if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) { 22872: 60 e5 ldi r22, 0x50 ; 80 22874: 73 ec ldi r23, 0xC3 ; 195 22876: 80 ee ldi r24, 0xE0 ; 224 22878: 95 e0 ldi r25, 0x05 ; 5 2287a: 0f 94 e0 0b call 0x217c0 ; 0x217c0 ::expired_cont(unsigned short)> 2287e: 81 11 cpse r24, r1 22880: 02 c0 rjmp .+4 ; 0x22886 <__vector_32+0x1ca> 22882: cc 23 and r28, r28 22884: 99 f0 breq .+38 ; 0x228ac <__vector_32+0x1f0> bCheckingOnBed=true; // not necessary 22886: 81 e0 ldi r24, 0x01 ; 1 22888: 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) { 2288c: 20 91 de 05 lds r18, 0x05DE ; 0x8005de 22890: 30 91 df 05 lds r19, 0x05DF ; 0x8005df 22894: 80 91 50 02 lds r24, 0x0250 ; 0x800250 <_ZL16bed_minttemp_raw.lto_priv.426> 22898: 90 91 51 02 lds r25, 0x0251 ; 0x800251 <_ZL16bed_minttemp_raw.lto_priv.426+0x1> 2289c: 28 17 cp r18, r24 2289e: 39 07 cpc r19, r25 228a0: 2c f0 brlt .+10 ; 0x228ac <__vector_32+0x1f0> #else if (current_temperature_bed_raw <= bed_minttemp_raw) { #endif set_temp_error(TempErrorSource::bed, 0, TempErrorType::min); 228a2: 41 e0 ldi r20, 0x01 ; 1 228a4: 60 e0 ldi r22, 0x00 ; 0 228a6: 81 e0 ldi r24, 0x01 ; 1 228a8: 0f 94 b9 0e call 0x21d72 ; 0x21d72 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); 228ac: 60 91 f5 05 lds r22, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.501> 228b0: 70 e0 ldi r23, 0x00 ; 0 228b2: 90 e0 ldi r25, 0x00 ; 0 228b4: 80 e0 ldi r24, 0x00 ; 0 228b6: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 228ba: 6b 01 movw r12, r22 228bc: 7c 01 movw r14, r24 228be: 40 90 f1 05 lds r4, 0x05F1 ; 0x8005f1 228c2: 50 90 f2 05 lds r5, 0x05F2 ; 0x8005f2 228c6: 60 90 f3 05 lds r6, 0x05F3 ; 0x8005f3 228ca: 70 90 f4 05 lds r7, 0x05F4 ; 0x8005f4 228ce: 60 91 ef 05 lds r22, 0x05EF ; 0x8005ef 228d2: 70 91 f0 05 lds r23, 0x05F0 ; 0x8005f0 228d6: 07 2e mov r0, r23 228d8: 00 0c add r0, r0 228da: 88 0b sbc r24, r24 228dc: 99 0b sbc r25, r25 228de: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 228e2: ab 01 movw r20, r22 228e4: bc 01 movw r22, r24 228e6: a1 2c mov r10, r1 228e8: 93 01 movw r18, r6 228ea: 82 01 movw r16, r4 228ec: 81 e0 ldi r24, 0x01 ; 1 228ee: 0f 94 1d 0f call 0x21e3a ; 0x21e3a #endif #ifdef TEMP_RUNAWAY_BED_HYSTERESIS temp_runaway_check(0, target_temperature_bed_isr, current_temperature_bed_isr, soft_pwm_bed, true); 228f2: 60 91 ee 05 lds r22, 0x05EE ; 0x8005ee 228f6: 70 e0 ldi r23, 0x00 ; 0 228f8: 90 e0 ldi r25, 0x00 ; 0 228fa: 80 e0 ldi r24, 0x00 ; 0 228fc: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 22900: 6b 01 movw r12, r22 22902: 7c 01 movw r14, r24 22904: 40 90 ea 05 lds r4, 0x05EA ; 0x8005ea 22908: 50 90 eb 05 lds r5, 0x05EB ; 0x8005eb 2290c: 60 90 ec 05 lds r6, 0x05EC ; 0x8005ec 22910: 70 90 ed 05 lds r7, 0x05ED ; 0x8005ed 22914: 60 91 e8 05 lds r22, 0x05E8 ; 0x8005e8 22918: 70 91 e9 05 lds r23, 0x05E9 ; 0x8005e9 2291c: 07 2e mov r0, r23 2291e: 00 0c add r0, r0 22920: 88 0b sbc r24, r24 22922: 99 0b sbc r25, r25 22924: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 22928: ab 01 movw r20, r22 2292a: bc 01 movw r22, r24 2292c: aa 24 eor r10, r10 2292e: a3 94 inc r10 22930: 93 01 movw r18, r6 22932: 82 01 movw r16, r4 22934: 80 e0 ldi r24, 0x00 ; 0 22936: 0f 94 1d 0f call 0x21e3a ; 0x21e3a thermal_model::log_isr(); #endif #endif // PID regulation if (pid_tuning_finished) 2293a: 80 91 41 02 lds r24, 0x0241 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.424> 2293e: 81 11 cpse r24, r1 temp_mgr_pid(); 22940: 0e 94 1b fd call 0x1fa36 ; 0x1fa36 (void)__s; } static __inline__ void __iCliParam(const uint8_t *__s) { cli(); 22944: 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(); 22946: 80 91 71 00 lds r24, 0x0071 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> 2294a: 82 60 ori r24, 0x02 ; 2 2294c: 80 93 71 00 sts 0x0071, r24 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7c2071> } 22950: ff 91 pop r31 22952: ef 91 pop r30 22954: df 91 pop r29 22956: cf 91 pop r28 22958: bf 91 pop r27 2295a: af 91 pop r26 2295c: 9f 91 pop r25 2295e: 8f 91 pop r24 22960: 7f 91 pop r23 22962: 6f 91 pop r22 22964: 5f 91 pop r21 22966: 4f 91 pop r20 22968: 3f 91 pop r19 2296a: 2f 91 pop r18 2296c: 1f 91 pop r17 2296e: 0f 91 pop r16 22970: ff 90 pop r15 22972: ef 90 pop r14 22974: df 90 pop r13 22976: cf 90 pop r12 22978: bf 90 pop r11 2297a: af 90 pop r10 2297c: 9f 90 pop r9 2297e: 8f 90 pop r8 22980: 7f 90 pop r7 22982: 6f 90 pop r6 22984: 5f 90 pop r5 22986: 4f 90 pop r4 22988: 0f 90 pop r0 2298a: 0b be out 0x3b, r0 ; 59 2298c: 0f 90 pop r0 2298e: 0f be out 0x3f, r0 ; 63 22990: 0f 90 pop r0 22992: 1f 90 pop r1 22994: 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(); 22996: 84 ee ldi r24, 0xE4 ; 228 22998: 95 e0 ldi r25, 0x05 ; 5 2299a: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> bCheckingOnHeater=false; 2299e: 10 92 e7 05 sts 0x05E7, r1 ; 0x8005e7 229a2: 4e cf rjmp .-356 ; 0x22840 <__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(); 229a4: 80 ee ldi r24, 0xE0 ; 224 229a6: 95 e0 ldi r25, 0x05 ; 5 229a8: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> bCheckingOnBed=false; 229ac: 10 92 e3 05 sts 0x05E3, r1 ; 0x8005e3 229b0: 7d cf rjmp .-262 ; 0x228ac <__vector_32+0x1f0> 000229b2 : 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; 229b2: 20 91 d3 0d lds r18, 0x0DD3 ; 0x800dd3 229b6: 30 91 d4 0d lds r19, 0x0DD4 ; 0x800dd4 229ba: 40 91 d5 0d lds r20, 0x0DD5 ; 0x800dd5 229be: 50 91 d6 0d lds r21, 0x0DD6 ; 0x800dd6 229c2: 60 e0 ldi r22, 0x00 ; 0 229c4: 70 e0 ldi r23, 0x00 ; 0 229c6: 8f e7 ldi r24, 0x7F ; 127 229c8: 93 e4 ldi r25, 0x43 ; 67 229ca: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 229ce: 60 93 18 04 sts 0x0418, r22 ; 0x800418 <_ZL14iState_sum_max.lto_priv.433> 229d2: 70 93 19 04 sts 0x0419, r23 ; 0x800419 <_ZL14iState_sum_max.lto_priv.433+0x1> 229d6: 80 93 1a 04 sts 0x041A, r24 ; 0x80041a <_ZL14iState_sum_max.lto_priv.433+0x2> 229da: 90 93 1b 04 sts 0x041B, r25 ; 0x80041b <_ZL14iState_sum_max.lto_priv.433+0x3> } #endif #ifdef PIDTEMPBED temp_iState_max_bed = PID_INTEGRAL_DRIVE_MAX / cs.bedKi; 229de: 20 91 df 0d lds r18, 0x0DDF ; 0x800ddf 229e2: 30 91 e0 0d lds r19, 0x0DE0 ; 0x800de0 229e6: 40 91 e1 0d lds r20, 0x0DE1 ; 0x800de1 229ea: 50 91 e2 0d lds r21, 0x0DE2 ; 0x800de2 229ee: 60 e0 ldi r22, 0x00 ; 0 229f0: 70 e0 ldi r23, 0x00 ; 0 229f2: 8f e7 ldi r24, 0x7F ; 127 229f4: 93 e4 ldi r25, 0x43 ; 67 229f6: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 229fa: 60 93 10 04 sts 0x0410, r22 ; 0x800410 <_ZL19temp_iState_max_bed.lto_priv.431> 229fe: 70 93 11 04 sts 0x0411, r23 ; 0x800411 <_ZL19temp_iState_max_bed.lto_priv.431+0x1> 22a02: 80 93 12 04 sts 0x0412, r24 ; 0x800412 <_ZL19temp_iState_max_bed.lto_priv.431+0x2> 22a06: 90 93 13 04 sts 0x0413, r25 ; 0x800413 <_ZL19temp_iState_max_bed.lto_priv.431+0x3> #endif } 22a0a: 08 95 ret 00022a0c : startTimestamp = 0; stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { 22a0c: 0f 93 push r16 22a0e: 1f 93 push r17 return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 22a10: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 22a14: 81 30 cpi r24, 0x01 ; 1 22a16: 19 f5 brne .+70 ; 0x22a5e 22a18: 0f 94 89 0b call 0x21712 ; 0x21712 22a1c: 00 91 7c 05 lds r16, 0x057C ; 0x80057c 22a20: 10 91 7d 05 lds r17, 0x057D ; 0x80057d 22a24: 20 91 7e 05 lds r18, 0x057E ; 0x80057e 22a28: 30 91 7f 05 lds r19, 0x057F ; 0x80057f 22a2c: 60 1b sub r22, r16 22a2e: 71 0b sbc r23, r17 22a30: 82 0b sbc r24, r18 22a32: 93 0b sbc r25, r19 22a34: 28 ee ldi r18, 0xE8 ; 232 22a36: 33 e0 ldi r19, 0x03 ; 3 22a38: 40 e0 ldi r20, 0x00 ; 0 22a3a: 50 e0 ldi r21, 0x00 ; 0 22a3c: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 22a40: 60 91 78 05 lds r22, 0x0578 ; 0x800578 22a44: 70 91 79 05 lds r23, 0x0579 ; 0x800579 22a48: 80 91 7a 05 lds r24, 0x057A ; 0x80057a 22a4c: 90 91 7b 05 lds r25, 0x057B ; 0x80057b 22a50: 62 0f add r22, r18 22a52: 73 1f adc r23, r19 22a54: 84 1f adc r24, r20 22a56: 95 1f adc r25, r21 } 22a58: 1f 91 pop r17 22a5a: 0f 91 pop r16 22a5c: 08 95 ret stopTimestamp = 0; accumulator = 0; } uint32_t Stopwatch::duration() { return accumulator + MS_TO_SEC((isRunning() ? _millis() : stopTimestamp) - startTimestamp); 22a5e: 60 91 0b 06 lds r22, 0x060B ; 0x80060b 22a62: 70 91 0c 06 lds r23, 0x060C ; 0x80060c 22a66: 80 91 0d 06 lds r24, 0x060D ; 0x80060d 22a6a: 90 91 0e 06 lds r25, 0x060E ; 0x80060e 22a6e: d6 cf rjmp .-84 ; 0x22a1c 00022a70 : //! |Total print time: | MSG_TOTAL_PRINT_TIME c=19 //! | 00d 00h 00m | //! ---------------------- //! @endcode void lcd_menu_statistics() { 22a70: 4f 92 push r4 22a72: 5f 92 push r5 22a74: 6f 92 push r6 22a76: 7f 92 push r7 22a78: 8f 92 push r8 22a7a: 9f 92 push r9 22a7c: af 92 push r10 22a7e: bf 92 push r11 22a80: cf 92 push r12 22a82: df 92 push r13 22a84: ef 92 push r14 22a86: ff 92 push r15 22a88: 0f 93 push r16 22a8a: 1f 93 push r17 22a8c: cf 93 push r28 22a8e: df 93 push r29 22a90: 10 92 e3 03 sts 0x03E3, r1 ; 0x8003e3 lcd_timeoutToStatus.stop(); //infinite timeout if (printJobOngoing()) 22a94: 0e 94 91 66 call 0xcd22 ; 0xcd22 22a98: 88 23 and r24, r24 22a9a: 09 f4 brne .+2 ; 0x22a9e 22a9c: 6e c0 rjmp .+220 ; 0x22b7a { const float _met = ((float)total_filament_used) / (100000.f); 22a9e: 60 91 17 06 lds r22, 0x0617 ; 0x800617 22aa2: 70 91 18 06 lds r23, 0x0618 ; 0x800618 22aa6: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22aaa: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 22aae: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 22ab2: 20 e0 ldi r18, 0x00 ; 0 22ab4: 30 e5 ldi r19, 0x50 ; 80 22ab6: 43 ec ldi r20, 0xC3 ; 195 22ab8: 57 e4 ldi r21, 0x47 ; 71 22aba: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 22abe: 56 2e mov r5, r22 22ac0: 47 2e mov r4, r23 22ac2: ec 01 movw r28, r24 const uint32_t _t = print_job_timer.duration(); 22ac4: 0f 94 06 15 call 0x22a0c ; 0x22a0c 22ac8: 6b 01 movw r12, r22 22aca: 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(); 22acc: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 lcd_printf_P(_N( 22ad0: 81 e9 ldi r24, 0x91 ; 145 22ad2: 99 e5 ldi r25, 0x59 ; 89 22ad4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 22ad8: 18 2f mov r17, r24 22ada: 09 2f mov r16, r25 22adc: 81 e8 ldi r24, 0x81 ; 129 22ade: 99 e5 ldi r25, 0x59 ; 89 22ae0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 22ae4: 78 2e mov r7, r24 22ae6: 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; 22ae8: 8c e3 ldi r24, 0x3C ; 60 22aea: 88 2e mov r8, r24 22aec: 91 2c mov r9, r1 22aee: a1 2c mov r10, r1 22af0: b1 2c mov r11, r1 22af2: c7 01 movw r24, r14 22af4: b6 01 movw r22, r12 22af6: a5 01 movw r20, r10 22af8: 94 01 movw r18, r8 22afa: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 22afe: 7f 93 push r23 22b00: 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; 22b02: ca 01 movw r24, r20 22b04: b9 01 movw r22, r18 22b06: a5 01 movw r20, r10 22b08: 94 01 movw r18, r8 22b0a: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 22b0e: 7f 93 push r23 22b10: 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; 22b12: c7 01 movw r24, r14 22b14: b6 01 movw r22, r12 22b16: 20 e1 ldi r18, 0x10 ; 16 22b18: 3e e0 ldi r19, 0x0E ; 14 22b1a: 40 e0 ldi r20, 0x00 ; 0 22b1c: 50 e0 ldi r21, 0x00 ; 0 22b1e: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> const uint8_t _m = (_t / 60) % 60; const uint8_t _s = _t % 60; lcd_home(); lcd_printf_P(_N( 22b22: 5f 93 push r21 22b24: 4f 93 push r20 22b26: 3f 93 push r19 22b28: 2f 93 push r18 22b2a: 0f 93 push r16 22b2c: 1f 93 push r17 22b2e: df 93 push r29 22b30: cf 93 push r28 22b32: 4f 92 push r4 22b34: 5f 92 push r5 22b36: 6f 92 push r6 22b38: 7f 92 push r7 22b3a: 85 ee ldi r24, 0xE5 ; 229 22b3c: 9b e6 ldi r25, 0x6B ; 107 22b3e: 9f 93 push r25 22b40: 8f 93 push r24 22b42: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 "%S:\n" "%10ldh %02dm %02ds" ), _T(MSG_FILAMENT_USED), _met, _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); 22b46: 8d b7 in r24, 0x3d ; 61 22b48: 9e b7 in r25, 0x3e ; 62 22b4a: 42 96 adiw r24, 0x12 ; 18 22b4c: 0f b6 in r0, 0x3f ; 63 22b4e: f8 94 cli 22b50: 9e bf out 0x3e, r25 ; 62 22b52: 0f be out 0x3f, r0 ; 63 22b54: 8d bf out 0x3d, r24 ; 61 ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); } } 22b56: df 91 pop r29 22b58: cf 91 pop r28 22b5a: 1f 91 pop r17 22b5c: 0f 91 pop r16 22b5e: ff 90 pop r15 22b60: ef 90 pop r14 22b62: df 90 pop r13 22b64: cf 90 pop r12 22b66: bf 90 pop r11 22b68: af 90 pop r10 22b6a: 9f 90 pop r9 22b6c: 8f 90 pop r8 22b6e: 7f 90 pop r7 22b70: 6f 90 pop r6 22b72: 5f 90 pop r5 22b74: 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(); 22b76: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae _T(MSG_PRINT_TIME), _h, _m, _s); menu_back_if_clicked(); } else { uint32_t _filament = eeprom_read_dword((uint32_t *)EEPROM_FILAMENTUSED); // in meters 22b7a: 81 ef ldi r24, 0xF1 ; 241 22b7c: 9f e0 ldi r25, 0x0F ; 15 22b7e: 0f 94 89 a4 call 0x34912 ; 0x34912 22b82: 2b 01 movw r4, r22 22b84: 3c 01 movw r6, r24 uint32_t _time = eeprom_read_dword((uint32_t *)EEPROM_TOTALTIME); // in minutes 22b86: 8d ee ldi r24, 0xED ; 237 22b88: 9f e0 ldi r25, 0x0F ; 15 22b8a: 0f 94 89 a4 call 0x34912 ; 0x34912 22b8e: 6b 01 movw r12, r22 22b90: 7c 01 movw r14, r24 float _filament_m = (float)_filament/100; _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); 22b92: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 lcd_printf_P(_N( 22b96: 8e e6 ldi r24, 0x6E ; 110 22b98: 99 e5 ldi r25, 0x59 ; 89 22b9a: 0e 94 8b 75 call 0xeb16 ; 0xeb16 22b9e: 98 2e mov r9, r24 22ba0: 89 2e mov r8, r25 22ba2: 8d e5 ldi r24, 0x5D ; 93 22ba4: 99 e5 ldi r25, 0x59 ; 89 22ba6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 22baa: b8 2e mov r11, r24 22bac: 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; 22bae: c7 01 movw r24, r14 22bb0: b6 01 movw r22, r12 22bb2: 2c e3 ldi r18, 0x3C ; 60 22bb4: 30 e0 ldi r19, 0x00 ; 0 22bb6: 40 e0 ldi r20, 0x00 ; 0 22bb8: 50 e0 ldi r21, 0x00 ; 0 22bba: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> lcd_home(); lcd_printf_P(_N( 22bbe: 7f 93 push r23 22bc0: 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; 22bc2: ca 01 movw r24, r20 22bc4: b9 01 movw r22, r18 22bc6: 28 e1 ldi r18, 0x18 ; 24 22bc8: 30 e0 ldi r19, 0x00 ; 0 22bca: 40 e0 ldi r20, 0x00 ; 0 22bcc: 50 e0 ldi r21, 0x00 ; 0 22bce: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 22bd2: 7f 93 push r23 22bd4: 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; 22bd6: c7 01 movw r24, r14 22bd8: b6 01 movw r22, r12 22bda: 20 ea ldi r18, 0xA0 ; 160 22bdc: 35 e0 ldi r19, 0x05 ; 5 22bde: 40 e0 ldi r20, 0x00 ; 0 22be0: 50 e0 ldi r21, 0x00 ; 0 22be2: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 22be6: 5f 93 push r21 22be8: 4f 93 push r20 22bea: 3f 93 push r19 22bec: 2f 93 push r18 22bee: 8f 92 push r8 22bf0: 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; 22bf2: c3 01 movw r24, r6 22bf4: b2 01 movw r22, r4 22bf6: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 22bfa: 20 e0 ldi r18, 0x00 ; 0 22bfc: 30 e0 ldi r19, 0x00 ; 0 22bfe: 48 ec ldi r20, 0xC8 ; 200 22c00: 52 e4 ldi r21, 0x42 ; 66 22c02: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> _days = (_time / 60) / 24; _hours = (_time / 60) % 24; _minutes = _time % 60; lcd_home(); lcd_printf_P(_N( 22c06: 9f 93 push r25 22c08: 8f 93 push r24 22c0a: 7f 93 push r23 22c0c: 6f 93 push r22 22c0e: af 92 push r10 22c10: bf 92 push r11 22c12: 81 ec ldi r24, 0xC1 ; 193 22c14: 9b e6 ldi r25, 0x6B ; 107 22c16: 9f 93 push r25 22c18: 8f 93 push r24 22c1a: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 "%S:\n" "%10ldd %02dh %02dm" ), _T(MSG_TOTAL_FILAMENT), _filament_m, _T(MSG_TOTAL_PRINT_TIME), _days, _hours, _minutes); menu_back_if_clicked(); 22c1e: 8d b7 in r24, 0x3d ; 61 22c20: 9e b7 in r25, 0x3e ; 62 22c22: 42 96 adiw r24, 0x12 ; 18 22c24: 0f b6 in r0, 0x3f ; 63 22c26: f8 94 cli 22c28: 9e bf out 0x3e, r25 ; 62 22c2a: 0f be out 0x3f, r0 ; 63 22c2c: 8d bf out 0x3d, r24 ; 61 22c2e: 93 cf rjmp .-218 ; 0x22b56 00022c30 : SERIAL_ECHO(c); SERIAL_ECHO(']'); prusa_stat_farm_number(); } static void prusa_statistics_case0(uint8_t statnr) { 22c30: cf 93 push r28 22c32: c8 2f mov r28, r24 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 22c34: 8b e7 ldi r24, 0x7B ; 123 22c36: 0e 94 02 7a call 0xf404 ; 0xf404 SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); 22c3a: 8c 2f mov r24, r28 22c3c: 0f 94 42 06 call 0x20c84 ; 0x20c84 prusa_stat_farm_number(); 22c40: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 SERIAL_ECHO(current_temperature_bed); SERIAL_ECHO(']'); } static void prusa_stat_printinfo() { SERIAL_ECHOPGM("[TFU:"); 22c44: 89 e1 ldi r24, 0x19 ; 25 22c46: 9a e8 ldi r25, 0x8A ; 138 22c48: 0e 94 15 7b call 0xf62a ; 0xf62a } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 22c4c: 60 91 17 06 lds r22, 0x0617 ; 0x800617 22c50: 70 91 18 06 lds r23, 0x0618 ; 0x800618 22c54: 80 91 19 06 lds r24, 0x0619 ; 0x800619 22c58: 90 91 1a 06 lds r25, 0x061A ; 0x80061a 22c5c: 4a e0 ldi r20, 0x0A ; 10 22c5e: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_ECHO(total_filament_used); SERIAL_ECHOPGM("][PCD:"); 22c62: 82 e1 ldi r24, 0x12 ; 18 22c64: 9a e8 ldi r25, 0x8A ; 138 22c66: 0e 94 15 7b call 0xf62a ; 0xf62a 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;}; 22c6a: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 22c6e: 88 23 and r24, r24 22c70: 09 f4 brne .+2 ; 0x22c74 22c72: 5e c0 rjmp .+188 ; 0x22d30 22c74: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 22c78: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 22c7c: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 22c80: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 22c84: 00 97 sbiw r24, 0x00 ; 0 22c86: a1 05 cpc r26, r1 22c88: b1 05 cpc r27, r1 22c8a: 09 f4 brne .+2 ; 0x22c8e 22c8c: 51 c0 rjmp .+162 ; 0x22d30 22c8e: bc 01 movw r22, r24 22c90: cd 01 movw r24, r26 22c92: 6d 59 subi r22, 0x9D ; 157 22c94: 7f 4f sbci r23, 0xFF ; 255 22c96: 8f 4f sbci r24, 0xFF ; 255 22c98: 9f 4f sbci r25, 0xFF ; 255 22c9a: 24 e6 ldi r18, 0x64 ; 100 22c9c: 30 e0 ldi r19, 0x00 ; 0 22c9e: 40 e0 ldi r20, 0x00 ; 0 22ca0: 50 e0 ldi r21, 0x00 ; 0 22ca2: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 22ca6: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 22caa: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 22cae: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 22cb2: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 22cb6: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 22cba: 62 2f mov r22, r18 22cbc: 70 e0 ldi r23, 0x00 ; 0 22cbe: 90 e0 ldi r25, 0x00 ; 0 22cc0: 80 e0 ldi r24, 0x00 ; 0 22cc2: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_ECHO((int)card.percentDone()); SERIAL_ECHOPGM("][FEM:"); 22cc6: 8b e0 ldi r24, 0x0B ; 11 22cc8: 9a e8 ldi r25, 0x8A ; 138 22cca: 0e 94 15 7b call 0xf62a ; 0xf62a 22cce: 60 91 8e 02 lds r22, 0x028E ; 0x80028e 22cd2: 70 91 8f 02 lds r23, 0x028F ; 0x80028f 22cd6: 07 2e mov r0, r23 22cd8: 00 0c add r0, r0 22cda: 88 0b sbc r24, r24 22cdc: 99 0b sbc r25, r25 22cde: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_ECHO(feedmultiply); SERIAL_ECHOPGM("][FNM:"); 22ce2: 84 e0 ldi r24, 0x04 ; 4 22ce4: 9a e8 ldi r25, 0x8A ; 138 22ce6: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHO(card.longFilename[0] ? card.longFilename : card.filename); 22cea: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 22cee: 81 11 cpse r24, r1 22cf0: 21 c0 rjmp .+66 ; 0x22d34 22cf2: 89 ed ldi r24, 0xD9 ; 217 22cf4: 93 e1 ldi r25, 0x13 ; 19 } }*/ static FORCE_INLINE void print(const char *str) { write(str); 22cf6: 0e 94 0e 86 call 0x10c1c ; 0x10c1c SERIAL_ECHOPGM("][TIM:"); 22cfa: 8d ef ldi r24, 0xFD ; 253 22cfc: 99 e8 ldi r25, 0x89 ; 137 22cfe: 0e 94 15 7b call 0xf62a ; 0xf62a if (print_job_timer.isRunning()) { 22d02: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 22d06: 81 30 cpi r24, 0x01 ; 1 22d08: c1 f4 brne .+48 ; 0x22d3a SERIAL_ECHO(print_job_timer.duration()); 22d0a: 0f 94 06 15 call 0x22a0c ; 0x22a0c } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 22d0e: 4a e0 ldi r20, 0x0A ; 10 22d10: 0e 94 16 7a call 0xf42c ; 0xf42c } else { SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); 22d14: 86 ef ldi r24, 0xF6 ; 246 22d16: 99 e8 ldi r25, 0x89 ; 137 22d18: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(FW_VERSION_STR_P()); 22d1c: 8f ee ldi r24, 0xEF ; 239 22d1e: 99 e8 ldi r25, 0x89 ; 137 22d20: 0e 94 15 7b call 0xf62a ; 0xf62a } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 22d24: 8d e5 ldi r24, 0x5D ; 93 22d26: 0e 94 02 7a call 0xf404 ; 0xf404 static void prusa_statistics_case0(uint8_t statnr) { SERIAL_ECHO('{'); prusa_stat_printerstatus(statnr); prusa_stat_farm_number(); prusa_stat_printinfo(); } 22d2a: cf 91 pop r28 SERIAL_ECHO(0); } SERIAL_ECHOPGM("][FWR:"); SERIAL_ECHORPGM(FW_VERSION_STR_P()); SERIAL_ECHO(']'); prusa_stat_diameter(); 22d2c: 0d 94 5e 06 jmp 0x20cbc ; 0x20cbc 22d30: 20 e0 ldi r18, 0x00 ; 0 22d32: c3 cf rjmp .-122 ; 0x22cba 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); 22d34: 8e ee ldi r24, 0xEE ; 238 22d36: 93 e1 ldi r25, 0x13 ; 19 22d38: de cf rjmp .-68 ; 0x22cf6 22d3a: 60 e0 ldi r22, 0x00 ; 0 22d3c: 70 e0 ldi r23, 0x00 ; 0 22d3e: cb 01 movw r24, r22 22d40: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 22d44: e7 cf rjmp .-50 ; 0x22d14 00022d46 : reset(); if ((accumulator = with_time)) state = RUNNING; } void Stopwatch::reset() { state = STOPPED; 22d46: 10 92 8b 03 sts 0x038B, r1 ; 0x80038b startTimestamp = 0; 22d4a: 10 92 7c 05 sts 0x057C, r1 ; 0x80057c 22d4e: 10 92 7d 05 sts 0x057D, r1 ; 0x80057d 22d52: 10 92 7e 05 sts 0x057E, r1 ; 0x80057e 22d56: 10 92 7f 05 sts 0x057F, r1 ; 0x80057f stopTimestamp = 0; 22d5a: 10 92 0b 06 sts 0x060B, r1 ; 0x80060b 22d5e: 10 92 0c 06 sts 0x060C, r1 ; 0x80060c 22d62: 10 92 0d 06 sts 0x060D, r1 ; 0x80060d 22d66: 10 92 0e 06 sts 0x060E, r1 ; 0x80060e accumulator = 0; 22d6a: 10 92 78 05 sts 0x0578, r1 ; 0x800578 22d6e: 10 92 79 05 sts 0x0579, r1 ; 0x800579 22d72: 10 92 7a 05 sts 0x057A, r1 ; 0x80057a 22d76: 10 92 7b 05 sts 0x057B, r1 ; 0x80057b } 22d7a: 08 95 ret 00022d7c : /** * @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; } 22d7c: 80 91 8b 03 lds r24, 0x038B ; 0x80038b } else return false; } bool Stopwatch::start() { if (!isRunning()) { 22d80: 81 30 cpi r24, 0x01 ; 1 22d82: f1 f0 breq .+60 ; 0x22dc0 if (isPaused()) accumulator = duration(); 22d84: 82 30 cpi r24, 0x02 ; 2 22d86: c9 f4 brne .+50 ; 0x22dba 22d88: 0f 94 06 15 call 0x22a0c ; 0x22a0c 22d8c: 60 93 78 05 sts 0x0578, r22 ; 0x800578 22d90: 70 93 79 05 sts 0x0579, r23 ; 0x800579 22d94: 80 93 7a 05 sts 0x057A, r24 ; 0x80057a 22d98: 90 93 7b 05 sts 0x057B, r25 ; 0x80057b else reset(); state = RUNNING; 22d9c: 81 e0 ldi r24, 0x01 ; 1 22d9e: 80 93 8b 03 sts 0x038B, r24 ; 0x80038b startTimestamp = _millis(); 22da2: 0f 94 89 0b call 0x21712 ; 0x21712 22da6: 60 93 7c 05 sts 0x057C, r22 ; 0x80057c 22daa: 70 93 7d 05 sts 0x057D, r23 ; 0x80057d 22dae: 80 93 7e 05 sts 0x057E, r24 ; 0x80057e 22db2: 90 93 7f 05 sts 0x057F, r25 ; 0x80057f 22db6: 81 e0 ldi r24, 0x01 ; 1 22db8: 08 95 ret } bool Stopwatch::start() { if (!isRunning()) { if (isPaused()) accumulator = duration(); else reset(); 22dba: 0f 94 a3 16 call 0x22d46 ; 0x22d46 22dbe: ee cf rjmp .-36 ; 0x22d9c state = RUNNING; startTimestamp = _millis(); return true; } else return false; 22dc0: 80 e0 ldi r24, 0x00 ; 0 } 22dc2: 08 95 ret 00022dc4 : uint32_t Stopwatch::accumulator; uint32_t Stopwatch::startTimestamp; uint32_t Stopwatch::stopTimestamp; bool Stopwatch::stop() { if (isRunning() || isPaused()) { 22dc4: 80 91 8b 03 lds r24, 0x038B ; 0x80038b 22dc8: 81 50 subi r24, 0x01 ; 1 22dca: 82 30 cpi r24, 0x02 ; 2 22dcc: 70 f4 brcc .+28 ; 0x22dea state = STOPPED; 22dce: 10 92 8b 03 sts 0x038B, r1 ; 0x80038b stopTimestamp = _millis(); 22dd2: 0f 94 89 0b call 0x21712 ; 0x21712 22dd6: 60 93 0b 06 sts 0x060B, r22 ; 0x80060b 22dda: 70 93 0c 06 sts 0x060C, r23 ; 0x80060c 22dde: 80 93 0d 06 sts 0x060D, r24 ; 0x80060d 22de2: 90 93 0e 06 sts 0x060E, r25 ; 0x80060e 22de6: 81 e0 ldi r24, 0x01 ; 1 22de8: 08 95 ret return true; } else return false; 22dea: 80 e0 ldi r24, 0x00 ; 0 } 22dec: 08 95 ret 00022dee : #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); 22dee: 2f ef ldi r18, 0xFF ; 255 22df0: 30 e0 ldi r19, 0x00 ; 0 22df2: dc 01 movw r26, r24 22df4: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 <__usmulhisi3> 22df8: 20 ed ldi r18, 0xD0 ; 208 22dfa: 37 e0 ldi r19, 0x07 ; 7 22dfc: 40 e0 ldi r20, 0x00 ; 0 22dfe: 50 e0 ldi r21, 0x00 ; 0 22e00: 0f 94 72 a5 call 0x34ae4 ; 0x34ae4 <__divmodsi4> 22e04: b9 01 movw r22, r18 22e06: 8c e2 ldi r24, 0x2C ; 44 22e08: 0c 94 56 d1 jmp 0x1a2ac ; 0x1a2ac 00022e0c : case 16: microstep_ms(driver,MICROSTEP16); break; } } void microstep_readings() { 22e0c: cf 93 push r28 22e0e: df 93 push r29 SERIAL_PROTOCOLLNPGM("MS1,MS2 Pins"); 22e10: 88 ea ldi r24, 0xA8 ; 168 22e12: 94 e9 ldi r25, 0x94 ; 148 22e14: 0e 94 0e 7d call 0xfa1c ; 0xfa1c SERIAL_PROTOCOLPGM("X: "); 22e18: 84 ea ldi r24, 0xA4 ; 164 22e1a: 94 e9 ldi r25, 0x94 ; 148 22e1c: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOL( READ(X_MS1_PIN)); 22e20: 62 b3 in r22, 0x12 ; 18 22e22: 66 95 lsr r22 22e24: 61 70 andi r22, 0x01 ; 1 22e26: 70 e0 ldi r23, 0x00 ; 0 22e28: 90 e0 ldi r25, 0x00 ; 0 22e2a: 80 e0 ldi r24, 0x00 ; 0 22e2c: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOLLN( READ(X_MS2_PIN)); 22e30: 82 b3 in r24, 0x12 ; 18 22e32: 81 70 andi r24, 0x01 ; 1 22e34: 90 e0 ldi r25, 0x00 ; 0 22e36: 0f 94 5d 65 call 0x2caba ; 0x2caba SERIAL_PROTOCOLPGM("Y: "); 22e3a: 80 ea ldi r24, 0xA0 ; 160 22e3c: 94 e9 ldi r25, 0x94 ; 148 22e3e: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOL( READ(Y_MS1_PIN)); 22e42: c6 e0 ldi r28, 0x06 ; 6 22e44: d1 e0 ldi r29, 0x01 ; 1 22e46: 68 81 ld r22, Y 22e48: 06 2e mov r0, r22 22e4a: 00 0c add r0, r0 22e4c: 77 0b sbc r23, r23 22e4e: 88 0b sbc r24, r24 22e50: 99 0b sbc r25, r25 22e52: 66 27 eor r22, r22 22e54: 97 fd sbrc r25, 7 22e56: 63 95 inc r22 22e58: 77 27 eor r23, r23 22e5a: 88 27 eor r24, r24 22e5c: 99 27 eor r25, r25 22e5e: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOLLN( READ(Y_MS2_PIN)); 22e62: 82 b3 in r24, 0x12 ; 18 22e64: 82 fb bst r24, 2 22e66: 88 27 eor r24, r24 22e68: 80 f9 bld r24, 0 22e6a: 90 e0 ldi r25, 0x00 ; 0 22e6c: 0f 94 5d 65 call 0x2caba ; 0x2caba SERIAL_PROTOCOLPGM("Z: "); 22e70: 8c e9 ldi r24, 0x9C ; 156 22e72: 94 e9 ldi r25, 0x94 ; 148 22e74: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOL( READ(Z_MS1_PIN)); 22e78: 68 81 ld r22, Y 22e7a: 66 fb bst r22, 6 22e7c: 66 27 eor r22, r22 22e7e: 60 f9 bld r22, 0 22e80: 70 e0 ldi r23, 0x00 ; 0 22e82: 90 e0 ldi r25, 0x00 ; 0 22e84: 80 e0 ldi r24, 0x00 ; 0 22e86: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOLLN( READ(Z_MS2_PIN)); 22e8a: 88 81 ld r24, Y 22e8c: 85 fb bst r24, 5 22e8e: 88 27 eor r24, r24 22e90: 80 f9 bld r24, 0 22e92: 90 e0 ldi r25, 0x00 ; 0 22e94: 0f 94 5d 65 call 0x2caba ; 0x2caba SERIAL_PROTOCOLPGM("E0: "); 22e98: 87 e9 ldi r24, 0x97 ; 151 22e9a: 94 e9 ldi r25, 0x94 ; 148 22e9c: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOL( READ(E0_MS1_PIN)); 22ea0: 68 81 ld r22, Y 22ea2: 63 fb bst r22, 3 22ea4: 66 27 eor r22, r22 22ea6: 60 f9 bld r22, 0 22ea8: 70 e0 ldi r23, 0x00 ; 0 22eaa: 90 e0 ldi r25, 0x00 ; 0 22eac: 80 e0 ldi r24, 0x00 ; 0 22eae: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOLLN( READ(E0_MS2_PIN)); 22eb2: 88 81 ld r24, Y 22eb4: 82 95 swap r24 22eb6: 81 70 andi r24, 0x01 ; 1 22eb8: 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 } 22eba: df 91 pop r29 22ebc: 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)); 22ebe: 0d 94 5d 65 jmp 0x2caba ; 0x2caba 00022ec2 : #endif } void microstep_ms(uint8_t driver, int8_t ms1, int8_t ms2) { if(ms1 > -1) switch(driver) 22ec2: 67 fd sbrc r22, 7 22ec4: 08 c0 rjmp .+16 ; 0x22ed6 22ec6: 81 30 cpi r24, 0x01 ; 1 22ec8: 21 f1 breq .+72 ; 0x22f12 22eca: d8 f0 brcs .+54 ; 0x22f02 22ecc: 82 30 cpi r24, 0x02 ; 2 22ece: 99 f1 breq .+102 ; 0x22f36 22ed0: 83 30 cpi r24, 0x03 ; 3 22ed2: 09 f4 brne .+2 ; 0x22ed6 22ed4: 42 c0 rjmp .+132 ; 0x22f5a 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) 22ed6: 47 fd sbrc r20, 7 22ed8: 4c c0 rjmp .+152 ; 0x22f72 22eda: 81 30 cpi r24, 0x01 ; 1 22edc: 09 f4 brne .+2 ; 0x22ee0 22ede: 55 c0 rjmp .+170 ; 0x22f8a 22ee0: 08 f4 brcc .+2 ; 0x22ee4 22ee2: 4d c0 rjmp .+154 ; 0x22f7e 22ee4: 82 30 cpi r24, 0x02 ; 2 22ee6: 09 f4 brne .+2 ; 0x22eea 22ee8: 56 c0 rjmp .+172 ; 0x22f96 22eea: 83 30 cpi r24, 0x03 ; 3 22eec: 09 f0 breq .+2 ; 0x22ef0 22eee: 41 c0 rjmp .+130 ; 0x22f72 { 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; 22ef0: 9f b7 in r25, 0x3f ; 63 22ef2: 44 23 and r20, r20 22ef4: 09 f4 brne .+2 ; 0x22ef8 22ef6: 5f c0 rjmp .+190 ; 0x22fb6 22ef8: f8 94 cli 22efa: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22efe: 80 61 ori r24, 0x10 ; 16 22f00: 51 c0 rjmp .+162 ; 0x22fa4 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; 22f02: 66 23 and r22, r22 22f04: 21 f0 breq .+8 ; 0x22f0e 22f06: 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) 22f08: 47 ff sbrs r20, 7 22f0a: 39 c0 rjmp .+114 ; 0x22f7e 22f0c: 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; 22f0e: a1 98 cbi 0x14, 1 ; 20 22f10: fb cf rjmp .-10 ; 0x22f08 case 1: WRITE( Y_MS1_PIN,ms1); break; 22f12: 9f b7 in r25, 0x3f ; 63 22f14: 66 23 and r22, r22 22f16: 51 f0 breq .+20 ; 0x22f2c 22f18: f8 94 cli 22f1a: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f1e: 80 68 ori r24, 0x80 ; 128 22f20: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f24: 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) 22f26: 47 ff sbrs r20, 7 22f28: 30 c0 rjmp .+96 ; 0x22f8a 22f2a: 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; 22f2c: f8 94 cli 22f2e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f32: 8f 77 andi r24, 0x7F ; 127 22f34: f5 cf rjmp .-22 ; 0x22f20 case 2: WRITE( Z_MS1_PIN,ms1); break; 22f36: 9f b7 in r25, 0x3f ; 63 22f38: 66 23 and r22, r22 22f3a: 51 f0 breq .+20 ; 0x22f50 22f3c: f8 94 cli 22f3e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f42: 80 64 ori r24, 0x40 ; 64 22f44: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f48: 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) 22f4a: 47 ff sbrs r20, 7 22f4c: 24 c0 rjmp .+72 ; 0x22f96 22f4e: 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; 22f50: f8 94 cli 22f52: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f56: 8f 7b andi r24, 0xBF ; 191 22f58: f5 cf rjmp .-22 ; 0x22f44 case 3: WRITE(E0_MS1_PIN,ms1); break; 22f5a: 9f b7 in r25, 0x3f ; 63 22f5c: 66 23 and r22, r22 22f5e: 51 f0 breq .+20 ; 0x22f74 22f60: f8 94 cli 22f62: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f66: 88 60 ori r24, 0x08 ; 8 22f68: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f6c: 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) 22f6e: 47 ff sbrs r20, 7 22f70: bf cf rjmp .-130 ; 0x22ef0 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 } } 22f72: 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; 22f74: f8 94 cli 22f76: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22f7a: 87 7f andi r24, 0xF7 ; 247 22f7c: f5 cf rjmp .-22 ; 0x22f68 case 4: WRITE(E1_MS1_PIN,ms1); break; #endif } if(ms2 > -1) switch(driver) { case 0: WRITE( X_MS2_PIN,ms2); break; 22f7e: 44 23 and r20, r20 22f80: 11 f0 breq .+4 ; 0x22f86 22f82: a0 9a sbi 0x14, 0 ; 20 22f84: 08 95 ret 22f86: a0 98 cbi 0x14, 0 ; 20 22f88: 08 95 ret case 1: WRITE( Y_MS2_PIN,ms2); break; 22f8a: 44 23 and r20, r20 22f8c: 11 f0 breq .+4 ; 0x22f92 22f8e: a2 9a sbi 0x14, 2 ; 20 22f90: 08 95 ret 22f92: a2 98 cbi 0x14, 2 ; 20 22f94: 08 95 ret case 2: WRITE( Z_MS2_PIN,ms2); break; 22f96: 9f b7 in r25, 0x3f ; 63 22f98: 44 23 and r20, r20 22f9a: 41 f0 breq .+16 ; 0x22fac 22f9c: f8 94 cli 22f9e: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22fa2: 80 62 ori r24, 0x20 ; 32 22fa4: 80 93 08 01 sts 0x0108, r24 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22fa8: 9f bf out 0x3f, r25 ; 63 22faa: 08 95 ret 22fac: f8 94 cli 22fae: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22fb2: 8f 7d andi r24, 0xDF ; 223 22fb4: f7 cf rjmp .-18 ; 0x22fa4 case 3: WRITE(E0_MS2_PIN,ms2); break; 22fb6: f8 94 cli 22fb8: 80 91 08 01 lds r24, 0x0108 ; 0x800108 <__TEXT_REGION_LENGTH__+0x7c2108> 22fbc: 8f 7e andi r24, 0xEF ; 239 22fbe: f2 cf rjmp .-28 ; 0x22fa4 00022fc0 : } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 22fc0: 64 30 cpi r22, 0x04 ; 4 22fc2: 81 f0 breq .+32 ; 0x22fe4 22fc4: 30 f4 brcc .+12 ; 0x22fd2 22fc6: 61 30 cpi r22, 0x01 ; 1 22fc8: 49 f0 breq .+18 ; 0x22fdc { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; 22fca: 40 e0 ldi r20, 0x00 ; 0 } } void microstep_mode(uint8_t driver, uint8_t stepping_mode) { switch(stepping_mode) 22fcc: 62 30 cpi r22, 0x02 ; 2 22fce: 69 f0 breq .+26 ; 0x22fea 22fd0: 08 95 ret 22fd2: 68 30 cpi r22, 0x08 ; 8 22fd4: 49 f0 breq .+18 ; 0x22fe8 22fd6: 60 31 cpi r22, 0x10 ; 16 22fd8: 39 f0 breq .+14 ; 0x22fe8 22fda: 08 95 ret { case 1: microstep_ms(driver,MICROSTEP1); break; 22fdc: 40 e0 ldi r20, 0x00 ; 0 case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 22fde: 60 e0 ldi r22, 0x00 ; 0 case 8: microstep_ms(driver,MICROSTEP8); break; 22fe0: 0d 94 61 17 jmp 0x22ec2 ; 0x22ec2 { switch(stepping_mode) { case 1: microstep_ms(driver,MICROSTEP1); break; case 2: microstep_ms(driver,MICROSTEP2); break; case 4: microstep_ms(driver,MICROSTEP4); break; 22fe4: 41 e0 ldi r20, 0x01 ; 1 22fe6: fb cf rjmp .-10 ; 0x22fde case 8: microstep_ms(driver,MICROSTEP8); break; 22fe8: 41 e0 ldi r20, 0x01 ; 1 22fea: 61 e0 ldi r22, 0x01 ; 1 22fec: f9 cf rjmp .-14 ; 0x22fe0 00022fee : #endif } #ifdef MOTOR_CURRENT_PWM_XY_PIN void st_current_set(uint8_t driver, int current) { 22fee: db 01 movw r26, r22 if (driver == 0) analogWrite(MOTOR_CURRENT_PWM_XY_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 22ff0: 81 11 cpse r24, r1 22ff2: 0e c0 rjmp .+28 ; 0x23010 22ff4: 2f ef ldi r18, 0xFF ; 255 22ff6: 30 e0 ldi r19, 0x00 ; 0 22ff8: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 <__usmulhisi3> 22ffc: 20 ed ldi r18, 0xD0 ; 208 22ffe: 37 e0 ldi r19, 0x07 ; 7 23000: 40 e0 ldi r20, 0x00 ; 0 23002: 50 e0 ldi r21, 0x00 ; 0 23004: 0f 94 72 a5 call 0x34ae4 ; 0x34ae4 <__divmodsi4> 23008: b9 01 movw r22, r18 2300a: 8e e2 ldi r24, 0x2E ; 46 if (driver == 1) analogWrite(MOTOR_CURRENT_PWM_Z_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 2300c: 0c 94 56 d1 jmp 0x1a2ac ; 0x1a2ac 23010: 81 30 cpi r24, 0x01 ; 1 23012: 69 f4 brne .+26 ; 0x2302e 23014: 2f ef ldi r18, 0xFF ; 255 23016: 30 e0 ldi r19, 0x00 ; 0 23018: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 <__usmulhisi3> 2301c: 20 ed ldi r18, 0xD0 ; 208 2301e: 37 e0 ldi r19, 0x07 ; 7 23020: 40 e0 ldi r20, 0x00 ; 0 23022: 50 e0 ldi r21, 0x00 ; 0 23024: 0f 94 72 a5 call 0x34ae4 ; 0x34ae4 <__divmodsi4> 23028: b9 01 movw r22, r18 2302a: 8d e2 ldi r24, 0x2D ; 45 2302c: ef cf rjmp .-34 ; 0x2300c if (driver == 2) analogWrite(MOTOR_CURRENT_PWM_E_PIN, (long)current * 255L / (long)MOTOR_CURRENT_PWM_RANGE); 2302e: 82 30 cpi r24, 0x02 ; 2 23030: 19 f4 brne .+6 ; 0x23038 23032: cb 01 movw r24, r22 23034: 0d 94 f7 16 jmp 0x22dee ; 0x22dee } 23038: 08 95 ret 0002303a : #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); 2303a: 8f ef ldi r24, 0xFF ; 255 2303c: 9f e0 ldi r25, 0x0F ; 15 2303e: 0f 94 81 a4 call 0x34902 ; 0x34902 SilentModeMenu = SilentMode; 23042: 80 93 bb 03 sts 0x03BB, r24 ; 0x8003bb SET_OUTPUT(MOTOR_CURRENT_PWM_XY_PIN); 23046: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2304a: 98 60 ori r25, 0x08 ; 8 2304c: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_Z_PIN); 23050: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 23054: 90 61 ori r25, 0x10 ; 16 23056: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> SET_OUTPUT(MOTOR_CURRENT_PWM_E_PIN); 2305a: 90 91 0a 01 lds r25, 0x010A ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> 2305e: 90 62 ori r25, 0x20 ; 32 23060: 90 93 0a 01 sts 0x010A, r25 ; 0x80010a <__TEXT_REGION_LENGTH__+0x7c210a> if((SilentMode == SILENT_MODE_OFF) || (farm_mode) ){ 23064: 88 23 and r24, r24 23066: 21 f0 breq .+8 ; 0x23070 23068: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 2306c: 88 23 and r24, r24 2306e: 59 f1 breq .+86 ; 0x230c6 motor_current_setting[0] = motor_current_setting_loud[0]; 23070: 8c e1 ldi r24, 0x1C ; 28 23072: 92 e0 ldi r25, 0x02 ; 2 23074: 90 93 60 02 sts 0x0260, r25 ; 0x800260 23078: 80 93 5f 02 sts 0x025F, r24 ; 0x80025f motor_current_setting[1] = motor_current_setting_loud[1]; 2307c: 8e e3 ldi r24, 0x3E ; 62 2307e: 93 e0 ldi r25, 0x03 ; 3 23080: 90 93 62 02 sts 0x0262, r25 ; 0x800262 23084: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[2] = motor_current_setting_loud[2]; 23088: 84 ef ldi r24, 0xF4 ; 244 2308a: 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]; 2308c: 90 93 64 02 sts 0x0264, r25 ; 0x800264 23090: 80 93 63 02 sts 0x0263, r24 ; 0x800263 } st_current_set(0, motor_current_setting[0]); 23094: 60 91 5f 02 lds r22, 0x025F ; 0x80025f 23098: 70 91 60 02 lds r23, 0x0260 ; 0x800260 2309c: 80 e0 ldi r24, 0x00 ; 0 2309e: 0f 94 f7 17 call 0x22fee ; 0x22fee st_current_set(1, motor_current_setting[1]); 230a2: 6e e3 ldi r22, 0x3E ; 62 230a4: 73 e0 ldi r23, 0x03 ; 3 230a6: 81 e0 ldi r24, 0x01 ; 1 230a8: 0f 94 f7 17 call 0x22fee ; 0x22fee 230ac: 80 91 63 02 lds r24, 0x0263 ; 0x800263 230b0: 90 91 64 02 lds r25, 0x0264 ; 0x800264 230b4: 0f 94 f7 16 call 0x22dee ; 0x22dee 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); 230b8: 80 91 21 01 lds r24, 0x0121 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> 230bc: 88 7f andi r24, 0xF8 ; 248 230be: 81 60 ori r24, 0x01 ; 1 230c0: 80 93 21 01 sts 0x0121, r24 ; 0x800121 <__TEXT_REGION_LENGTH__+0x7c2121> #endif } 230c4: 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]; 230c6: 8e e0 ldi r24, 0x0E ; 14 230c8: 91 e0 ldi r25, 0x01 ; 1 230ca: 90 93 60 02 sts 0x0260, r25 ; 0x800260 230ce: 80 93 5f 02 sts 0x025F, r24 ; 0x80025f motor_current_setting[1] = motor_current_setting_silent[1]; 230d2: 8e e3 ldi r24, 0x3E ; 62 230d4: 93 e0 ldi r25, 0x03 ; 3 230d6: 90 93 62 02 sts 0x0262, r25 ; 0x800262 230da: 80 93 61 02 sts 0x0261, r24 ; 0x800261 motor_current_setting[2] = motor_current_setting_silent[2]; 230de: 82 ec ldi r24, 0xC2 ; 194 230e0: 91 e0 ldi r25, 0x01 ; 1 230e2: d4 cf rjmp .-88 ; 0x2308c 000230e4 : } long st_get_position(uint8_t axis) { long count_pos; CRITICAL_SECTION_START; 230e4: 2f b7 in r18, 0x3f ; 63 230e6: f8 94 cli count_pos = count_position[axis]; 230e8: 94 e0 ldi r25, 0x04 ; 4 230ea: 89 9f mul r24, r25 230ec: f0 01 movw r30, r0 230ee: 11 24 eor r1, r1 230f0: e4 5b subi r30, 0xB4 ; 180 230f2: f9 4f sbci r31, 0xF9 ; 249 230f4: 60 81 ld r22, Z 230f6: 71 81 ldd r23, Z+1 ; 0x01 230f8: 82 81 ldd r24, Z+2 ; 0x02 230fa: 93 81 ldd r25, Z+3 ; 0x03 CRITICAL_SECTION_END; 230fc: 2f bf out 0x3f, r18 ; 63 return count_pos; } 230fe: 08 95 ret 00023100 : y = count_position[Y_AXIS]; CRITICAL_SECTION_END; } float st_get_position_mm(uint8_t axis) { 23100: cf 93 push r28 23102: c8 2f mov r28, r24 float steper_position_in_steps = st_get_position(axis); 23104: 0f 94 72 18 call 0x230e4 ; 0x230e4 23108: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> return steper_position_in_steps / cs.axis_steps_per_mm[axis]; 2310c: 24 e0 ldi r18, 0x04 ; 4 2310e: c2 9f mul r28, r18 23110: f0 01 movw r30, r0 23112: 11 24 eor r1, r1 23114: e5 59 subi r30, 0x95 ; 149 23116: f2 4f sbci r31, 0xF2 ; 242 23118: 20 81 ld r18, Z 2311a: 31 81 ldd r19, Z+1 ; 0x01 2311c: 42 81 ldd r20, Z+2 ; 0x02 2311e: 53 81 ldd r21, Z+3 ; 0x03 23120: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> } 23124: cf 91 pop r28 23126: 08 95 ret 00023128 : 23128: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 2312c: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f // Block until all buffered steps are executed void st_synchronize() { while(blocks_queued()) 23130: 98 17 cp r25, r24 23132: 29 f0 breq .+10 ; 0x2313e manage_inactivity(true); lcd_update(0); } #else //TMC2130 // Vojtech: Don't disable motors inside the planner! delay_keep_alive(0); 23134: 90 e0 ldi r25, 0x00 ; 0 23136: 80 e0 ldi r24, 0x00 ; 0 23138: 0e 94 07 8d call 0x11a0e ; 0x11a0e 2313c: f5 cf rjmp .-22 ; 0x23128 #endif //TMC2130 } } 2313e: 08 95 ret 00023140 : _delay(2000); lcd_clear(); } void lcd_load_filament_color_check() { 23140: cf 92 push r12 23142: ef 92 push r14 23144: ff 92 push r15 23146: 0f 93 push r16 23148: 1f 93 push r17 2314a: cf 93 push r28 2314c: 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); 2314e: 88 e0 ldi r24, 0x08 ; 8 23150: 99 e5 ldi r25, 0x59 ; 89 23152: 0e 94 8b 75 call 0xeb16 ; 0xeb16 23156: 7c 01 movw r14, r24 23158: 88 ea ldi r24, 0xA8 ; 168 2315a: 98 e4 ldi r25, 0x48 ; 72 2315c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 23160: 8c 01 movw r16, r24 23162: 82 ea ldi r24, 0xA2 ; 162 23164: 98 e4 ldi r25, 0x48 ; 72 23166: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2316a: ec 01 movw r28, r24 2316c: 8d ed ldi r24, 0xDD ; 221 2316e: 98 e5 ldi r25, 0x58 ; 88 23170: 0e 94 8b 75 call 0xeb16 ; 0xeb16 23174: 28 e0 ldi r18, 0x08 ; 8 23176: c2 2e mov r12, r18 23178: 9e 01 movw r18, r28 2317a: 40 e0 ldi r20, 0x00 ; 0 2317c: 60 e0 ldi r22, 0x00 ; 0 2317e: 0e 94 8c e2 call 0x1c518 ; 0x1c518 while (clean == LCD_MIDDLE_BUTTON_CHOICE) { 23182: 81 30 cpi r24, 0x01 ; 1 23184: 29 f4 brne .+10 ; 0x23190 load_filament_final_feed(); 23186: 0e 94 3e 64 call 0xc87c ; 0xc87c st_synchronize(); 2318a: 0f 94 94 18 call 0x23128 ; 0x23128 2318e: df cf rjmp .-66 ; 0x2314e 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) { 23190: 82 30 cpi r24, 0x02 ; 2 23192: 61 f4 brne .+24 ; 0x231ac unload_filament(FILAMENTCHANGE_FINALRETRACT); 23194: 60 e0 ldi r22, 0x00 ; 0 23196: 70 e0 ldi r23, 0x00 ; 0 23198: cb 01 movw r24, r22 } } 2319a: df 91 pop r29 2319c: cf 91 pop r28 2319e: 1f 91 pop r17 231a0: 0f 91 pop r16 231a2: ff 90 pop r15 231a4: ef 90 pop r14 231a6: 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); 231a8: 0c 94 66 e1 jmp 0x1c2cc ; 0x1c2cc } } 231ac: df 91 pop r29 231ae: cf 91 pop r28 231b0: 1f 91 pop r17 231b2: 0f 91 pop r16 231b4: ff 90 pop r15 231b6: ef 90 pop r14 231b8: cf 90 pop r12 231ba: 08 95 ret 000231bc : void st_reset_timer() { // Clear a possible pending interrupt on OCR1A overflow. TIFR1 |= 1 << OCF1A; 231bc: b1 9a sbi 0x16, 1 ; 22 // Reset the counter. TCNT1 = 0; 231be: 10 92 85 00 sts 0x0085, r1 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 231c2: 10 92 84 00 sts 0x0084, r1 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> // Wake up after 1ms from now. OCR1A = 2000; 231c6: 80 ed ldi r24, 0xD0 ; 208 231c8: 97 e0 ldi r25, 0x07 ; 7 231ca: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 231ce: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> #ifdef LIN_ADVANCE nextMainISR = 0; 231d2: 10 92 4f 04 sts 0x044F, r1 ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 231d6: 10 92 4e 04 sts 0x044E, r1 ; 0x80044e <_ZL11nextMainISR.lto_priv.436> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 231da: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> 231de: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 231e2: 01 97 sbiw r24, 0x01 ; 1 231e4: 8e 3f cpi r24, 0xFE ; 254 231e6: 9f 4f sbci r25, 0xFF ; 255 231e8: 20 f4 brcc .+8 ; 0x231f2 nextAdvanceISR = 0; 231ea: 10 92 4d 04 sts 0x044D, r1 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 231ee: 10 92 4c 04 sts 0x044C, r1 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> #endif } 231f2: 08 95 ret 000231f4 <__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) { 231f4: 1f 92 push r1 231f6: 0f 92 push r0 231f8: 0f b6 in r0, 0x3f ; 63 231fa: 0f 92 push r0 231fc: 11 24 eor r1, r1 231fe: 0b b6 in r0, 0x3b ; 59 23200: 0f 92 push r0 23202: 4f 92 push r4 23204: 5f 92 push r5 23206: 6f 92 push r6 23208: 7f 92 push r7 2320a: 8f 92 push r8 2320c: cf 92 push r12 2320e: df 92 push r13 23210: ef 92 push r14 23212: ff 92 push r15 23214: 1f 93 push r17 23216: 2f 93 push r18 23218: 3f 93 push r19 2321a: 4f 93 push r20 2321c: 5f 93 push r21 2321e: 6f 93 push r22 23220: 7f 93 push r23 23222: 8f 93 push r24 23224: 9f 93 push r25 23226: af 93 push r26 23228: bf 93 push r27 2322a: cf 93 push r28 2322c: df 93 push r29 2322e: ef 93 push r30 23230: ff 93 push r31 } } FORCE_INLINE void advance_isr_scheduler() { // Integrate the final timer value, accounting for scheduling adjustments if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) 23232: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> 23236: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 2323a: 9c 01 movw r18, r24 2323c: 21 50 subi r18, 0x01 ; 1 2323e: 31 09 sbc r19, r1 23240: 2e 3f cpi r18, 0xFE ; 254 23242: 3f 4f sbci r19, 0xFF ; 255 23244: 90 f4 brcc .+36 ; 0x2326a <__vector_17+0x76> { if(nextAdvanceISR > OCR1A) 23246: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2324a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2324e: 28 17 cp r18, r24 23250: 39 07 cpc r19, r25 23252: 08 f0 brcs .+2 ; 0x23256 <__vector_17+0x62> 23254: f9 c0 rjmp .+498 ; 0x23448 <__vector_17+0x254> nextAdvanceISR -= OCR1A; 23256: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2325a: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2325e: 82 1b sub r24, r18 23260: 93 0b sbc r25, r19 23262: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 23266: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> else nextAdvanceISR = 0; } if(nextMainISR > OCR1A) 2326a: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2326e: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 23272: 80 91 4e 04 lds r24, 0x044E ; 0x80044e <_ZL11nextMainISR.lto_priv.436> 23276: 90 91 4f 04 lds r25, 0x044F ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 2327a: 28 17 cp r18, r24 2327c: 39 07 cpc r19, r25 2327e: 08 f0 brcs .+2 ; 0x23282 <__vector_17+0x8e> 23280: e8 c0 rjmp .+464 ; 0x23452 <__vector_17+0x25e> nextMainISR -= OCR1A; 23282: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 23286: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2328a: 82 1b sub r24, r18 2328c: 93 0b sbc r25, r19 2328e: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 23292: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.436> else nextMainISR = 0; // Run main stepping ISR if flagged if (!nextMainISR) 23296: 80 91 4e 04 lds r24, 0x044E ; 0x80044e <_ZL11nextMainISR.lto_priv.436> 2329a: 90 91 4f 04 lds r25, 0x044F ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 2329e: 89 2b or r24, r25 232a0: 11 f0 breq .+4 ; 0x232a6 <__vector_17+0xb2> 232a2: 0d 94 e5 21 jmp 0x243ca ; 0x243ca <__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) 232a6: e0 91 51 12 lds r30, 0x1251 ; 0x801251 232aa: f0 91 52 12 lds r31, 0x1252 ; 0x801252 232ae: 30 97 sbiw r30, 0x00 ; 0 232b0: 09 f0 breq .+2 ; 0x232b4 <__vector_17+0xc0> 232b2: 82 c1 rjmp .+772 ; 0x235b8 <__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) { 232b4: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 232b8: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 232bc: 98 17 cp r25, r24 232be: 09 f4 brne .+2 ; 0x232c2 <__vector_17+0xce> 232c0: 35 c3 rjmp .+1642 ; 0x2392c <__vector_17+0x738> return(NULL); } block_t *block = &block_buffer[block_buffer_tail]; 232c2: c0 91 3f 0d lds r28, 0x0D3F ; 0x800d3f 232c6: 2c 2f mov r18, r28 232c8: 30 e0 ldi r19, 0x00 ; 0 232ca: 5e e6 ldi r21, 0x6E ; 110 232cc: c5 9f mul r28, r21 232ce: e0 01 movw r28, r0 232d0: 11 24 eor r1, r1 232d2: c2 5a subi r28, 0xA2 ; 162 232d4: d9 4f sbci r29, 0xF9 ; 249 block->busy = true; 232d6: fe 01 movw r30, r28 232d8: e9 5b subi r30, 0xB9 ; 185 232da: ff 4f sbci r31, 0xFF ; 255 232dc: 41 e0 ldi r20, 0x01 ; 1 232de: 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(); 232e0: d0 93 52 12 sts 0x1252, r29 ; 0x801252 232e4: c0 93 51 12 sts 0x1251, r28 ; 0x801251 if (current_block != NULL) { 232e8: 20 97 sbiw r28, 0x00 ; 0 232ea: 09 f4 brne .+2 ; 0x232ee <__vector_17+0xfa> 232ec: 1f c3 rjmp .+1598 ; 0x2392c <__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; 232ee: 10 92 74 05 sts 0x0574, r1 ; 0x800574 232f2: 10 92 75 05 sts 0x0575, r1 ; 0x800575 232f6: 10 92 76 05 sts 0x0576, r1 ; 0x800576 232fa: 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; 232fe: 10 92 73 05 sts 0x0573, r1 ; 0x800573 acc_step_rate = uint16_t(current_block->initial_rate); 23302: 8a ad ldd r24, Y+58 ; 0x3a 23304: 9b ad ldd r25, Y+59 ; 0x3b 23306: 90 93 72 05 sts 0x0572, r25 ; 0x800572 2330a: 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; 2330e: 81 34 cpi r24, 0x41 ; 65 23310: ac e9 ldi r26, 0x9C ; 156 23312: 9a 07 cpc r25, r26 23314: 08 f0 brcs .+2 ; 0x23318 <__vector_17+0x124> 23316: a2 c0 rjmp .+324 ; 0x2345c <__vector_17+0x268> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 23318: 81 32 cpi r24, 0x21 ; 33 2331a: be e4 ldi r27, 0x4E ; 78 2331c: 9b 07 cpc r25, r27 2331e: 08 f4 brcc .+2 ; 0x23322 <__vector_17+0x12e> 23320: a0 c0 rjmp .+320 ; 0x23462 <__vector_17+0x26e> step_rate = (step_rate >> 2)&0x3fff; 23322: 96 95 lsr r25 23324: 87 95 ror r24 23326: 96 95 lsr r25 23328: 87 95 ror r24 step_loops = 4; 2332a: 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; 2332c: 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 23330: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 23332: 81 15 cp r24, r1 23334: f8 e0 ldi r31, 0x08 ; 8 23336: 9f 07 cpc r25, r31 23338: 08 f4 brcc .+2 ; 0x2333c <__vector_17+0x148> 2333a: a4 c0 rjmp .+328 ; 0x23484 <__vector_17+0x290> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2333c: e9 2f mov r30, r25 2333e: ff 27 eor r31, r31 23340: ee 0f add r30, r30 23342: ff 1f adc r31, r31 23344: ee 0f add r30, r30 23346: ff 1f adc r31, r31 23348: af 01 movw r20, r30 2334a: 49 56 subi r20, 0x69 ; 105 2334c: 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); 2334e: fa 01 movw r30, r20 23350: 32 96 adiw r30, 0x02 ; 2 23352: a5 91 lpm r26, Z+ 23354: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 23356: fa 01 movw r30, r20 23358: 45 91 lpm r20, Z+ 2335a: 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. ); 2335c: b8 9f mul r27, r24 2335e: b0 01 movw r22, r0 23360: a8 9f mul r26, r24 23362: 00 0c add r0, r0 23364: 61 1d adc r22, r1 23366: 11 24 eor r1, r1 23368: 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); 2336a: 46 1b sub r20, r22 2336c: 57 0b sbc r21, r23 acceleration_time = calc_timer(acc_step_rate, step_loops); 2336e: ca 01 movw r24, r20 23370: 44 36 cpi r20, 0x64 ; 100 23372: 51 05 cpc r21, r1 23374: 10 f4 brcc .+4 ; 0x2337a <__vector_17+0x186> 23376: 84 e6 ldi r24, 0x64 ; 100 23378: 90 e0 ldi r25, 0x00 ; 0 2337a: b0 e0 ldi r27, 0x00 ; 0 2337c: a0 e0 ldi r26, 0x00 ; 0 2337e: 80 93 6c 05 sts 0x056C, r24 ; 0x80056c 23382: 90 93 6d 05 sts 0x056D, r25 ; 0x80056d 23386: a0 93 6e 05 sts 0x056E, r26 ; 0x80056e 2338a: b0 93 6f 05 sts 0x056F, r27 ; 0x80056f #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 2338e: 4e e6 ldi r20, 0x6E ; 110 23390: 42 9f mul r20, r18 23392: c0 01 movw r24, r0 23394: 43 9f mul r20, r19 23396: 90 0d add r25, r0 23398: 11 24 eor r1, r1 2339a: 82 5a subi r24, 0xA2 ; 162 2339c: 99 4f sbci r25, 0xF9 ; 249 2339e: fc 01 movw r30, r24 233a0: e4 5b subi r30, 0xB4 ; 180 233a2: ff 4f sbci r31, 0xFF ; 255 233a4: 40 81 ld r20, Z 233a6: 44 23 and r20, r20 233a8: 49 f0 breq .+18 ; 0x233bc <__vector_17+0x1c8> target_adv_steps = current_block->max_adv_steps; 233aa: 81 5b subi r24, 0xB1 ; 177 233ac: 9f 4f sbci r25, 0xFF ; 255 233ae: dc 01 movw r26, r24 233b0: 8d 91 ld r24, X+ 233b2: 9c 91 ld r25, X 233b4: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b 233b8: 80 93 6a 05 sts 0x056A, r24 ; 0x80056a } e_steps = 0; 233bc: 10 92 69 05 sts 0x0569, r1 ; 0x800569 nextAdvanceISR = ADV_NEVER; 233c0: 8f ef ldi r24, 0xFF ; 255 233c2: 9f ef ldi r25, 0xFF ; 255 233c4: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 233c8: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> LA_phase = -1; 233cc: 80 93 68 05 sts 0x0568, r24 ; 0x800568 #endif if (current_block->flag & BLOCK_FLAG_E_RESET) { 233d0: 8e e6 ldi r24, 0x6E ; 110 233d2: 82 9f mul r24, r18 233d4: f0 01 movw r30, r0 233d6: 83 9f mul r24, r19 233d8: f0 0d add r31, r0 233da: 11 24 eor r1, r1 233dc: e2 5a subi r30, 0xA2 ; 162 233de: f9 4f sbci r31, 0xF9 ; 249 233e0: 85 a9 ldd r24, Z+53 ; 0x35 233e2: 84 ff sbrs r24, 4 233e4: 08 c0 rjmp .+16 ; 0x233f6 <__vector_17+0x202> count_position[E_AXIS] = 0; 233e6: 10 92 58 06 sts 0x0658, r1 ; 0x800658 233ea: 10 92 59 06 sts 0x0659, r1 ; 0x800659 233ee: 10 92 5a 06 sts 0x065A, r1 ; 0x80065a 233f2: 10 92 5b 06 sts 0x065B, r1 ; 0x80065b } if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) { 233f6: 83 ff sbrs r24, 3 233f8: 61 c0 rjmp .+194 ; 0x234bc <__vector_17+0x2c8> const int16_t value = -(current_block->step_event_count.lo >> 1); 233fa: 8e e6 ldi r24, 0x6E ; 110 233fc: 82 9f mul r24, r18 233fe: f0 01 movw r30, r0 23400: 83 9f mul r24, r19 23402: f0 0d add r31, r0 23404: 11 24 eor r1, r1 23406: e2 5a subi r30, 0xA2 ; 162 23408: f9 4f sbci r31, 0xF9 ; 249 2340a: 80 89 ldd r24, Z+16 ; 0x10 2340c: 91 89 ldd r25, Z+17 ; 0x11 2340e: 96 95 lsr r25 23410: 87 95 ror r24 23412: 91 95 neg r25 23414: 81 95 neg r24 23416: 91 09 sbc r25, r1 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].lo = value; 23418: 90 93 59 05 sts 0x0559, r25 ; 0x800559 2341c: 80 93 58 05 sts 0x0558, r24 ; 0x800558 23420: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23424: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 23428: 90 93 61 05 sts 0x0561, r25 ; 0x800561 2342c: 80 93 60 05 sts 0x0560, r24 ; 0x800560 23430: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23434: 80 93 64 05 sts 0x0564, r24 ; 0x800564 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].lo != 0; 23438: 81 e0 ldi r24, 0x01 ; 1 2343a: 24 85 ldd r18, Z+12 ; 0x0c 2343c: 35 85 ldd r19, Z+13 ; 0x0d 2343e: 23 2b or r18, r19 23440: 09 f0 breq .+2 ; 0x23444 <__vector_17+0x250> 23442: 7d c0 rjmp .+250 ; 0x2353e <__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; 23444: 80 e0 ldi r24, 0x00 ; 0 23446: 7b c0 rjmp .+246 ; 0x2353e <__vector_17+0x34a> if(nextAdvanceISR && nextAdvanceISR != ADV_NEVER) { if(nextAdvanceISR > OCR1A) nextAdvanceISR -= OCR1A; else nextAdvanceISR = 0; 23448: 10 92 4d 04 sts 0x044D, r1 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 2344c: 10 92 4c 04 sts 0x044C, r1 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> 23450: 0c cf rjmp .-488 ; 0x2326a <__vector_17+0x76> } if(nextMainISR > OCR1A) nextMainISR -= OCR1A; else nextMainISR = 0; 23452: 10 92 4f 04 sts 0x044F, r1 ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 23456: 10 92 4e 04 sts 0x044E, r1 ; 0x80044e <_ZL11nextMainISR.lto_priv.436> 2345a: 1d cf rjmp .-454 ; 0x23296 <__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; 2345c: 80 e4 ldi r24, 0x40 ; 64 2345e: 9c e9 ldi r25, 0x9C ; 156 23460: 60 cf rjmp .-320 ; 0x23322 <__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 23462: 81 31 cpi r24, 0x11 ; 17 23464: e7 e2 ldi r30, 0x27 ; 39 23466: 9e 07 cpc r25, r30 23468: 20 f0 brcs .+8 ; 0x23472 <__vector_17+0x27e> step_rate = (step_rate >> 1)&0x7fff; 2346a: 96 95 lsr r25 2346c: 87 95 ror r24 step_loops = 2; 2346e: 42 e0 ldi r20, 0x02 ; 2 23470: 5d cf rjmp .-326 ; 0x2332c <__vector_17+0x138> } else { step_loops = 1; 23472: 40 93 70 05 sts 0x0570, r20 ; 0x800570 23476: 80 32 cpi r24, 0x20 ; 32 23478: 91 05 cpc r25, r1 2347a: 08 f0 brcs .+2 ; 0x2347e <__vector_17+0x28a> 2347c: 59 cf rjmp .-334 ; 0x23330 <__vector_17+0x13c> 2347e: 80 e2 ldi r24, 0x20 ; 32 23480: 90 e0 ldi r25, 0x00 ; 0 23482: 56 cf rjmp .-340 ; 0x23330 <__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; 23484: bc 01 movw r22, r24 23486: 76 95 lsr r23 23488: 67 95 ror r22 2348a: 6c 7f andi r22, 0xFC ; 252 2348c: 69 56 subi r22, 0x69 ; 105 2348e: 73 47 sbci r23, 0x73 ; 115 timer = (unsigned short)pgm_read_word_near(table_address); 23490: fb 01 movw r30, r22 23492: 45 91 lpm r20, Z+ 23494: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 23496: fb 01 movw r30, r22 23498: 32 96 adiw r30, 0x02 ; 2 2349a: a5 91 lpm r26, Z+ 2349c: b4 91 lpm r27, Z 2349e: 87 70 andi r24, 0x07 ; 7 234a0: 99 27 eor r25, r25 234a2: 8a 9f mul r24, r26 234a4: b0 01 movw r22, r0 234a6: 8b 9f mul r24, r27 234a8: 70 0d add r23, r0 234aa: 9a 9f mul r25, r26 234ac: 70 0d add r23, r0 234ae: 11 24 eor r1, r1 234b0: e3 e0 ldi r30, 0x03 ; 3 234b2: 76 95 lsr r23 234b4: 67 95 ror r22 234b6: ea 95 dec r30 234b8: e1 f7 brne .-8 ; 0x234b2 <__vector_17+0x2be> 234ba: 57 cf rjmp .-338 ; 0x2336a <__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); 234bc: 8e e6 ldi r24, 0x6E ; 110 234be: 82 9f mul r24, r18 234c0: f0 01 movw r30, r0 234c2: 83 9f mul r24, r19 234c4: f0 0d add r31, r0 234c6: 11 24 eor r1, r1 234c8: e2 5a subi r30, 0xA2 ; 162 234ca: f9 4f sbci r31, 0xF9 ; 249 234cc: 80 89 ldd r24, Z+16 ; 0x10 234ce: 91 89 ldd r25, Z+17 ; 0x11 234d0: a2 89 ldd r26, Z+18 ; 0x12 234d2: b3 89 ldd r27, Z+19 ; 0x13 234d4: b6 95 lsr r27 234d6: a7 95 ror r26 234d8: 97 95 ror r25 234da: 87 95 ror r24 234dc: b0 95 com r27 234de: a0 95 com r26 234e0: 90 95 com r25 234e2: 81 95 neg r24 234e4: 9f 4f sbci r25, 0xFF ; 255 234e6: af 4f sbci r26, 0xFF ; 255 234e8: bf 4f sbci r27, 0xFF ; 255 for (uint8_t axis = 0; axis < NUM_AXIS; axis++) { counter[axis].wide = value; 234ea: 80 93 58 05 sts 0x0558, r24 ; 0x800558 234ee: 90 93 59 05 sts 0x0559, r25 ; 0x800559 234f2: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 234f6: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b 234fa: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 234fe: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23502: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 23506: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f 2350a: 80 93 60 05 sts 0x0560, r24 ; 0x800560 2350e: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23512: a0 93 62 05 sts 0x0562, r26 ; 0x800562 23516: b0 93 63 05 sts 0x0563, r27 ; 0x800563 2351a: 80 93 64 05 sts 0x0564, r24 ; 0x800564 2351e: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23522: a0 93 66 05 sts 0x0566, r26 ; 0x800566 23526: b0 93 67 05 sts 0x0567, r27 ; 0x800567 } #ifdef LIN_ADVANCE e_extruding = current_block->steps[E_AXIS].wide != 0; 2352a: 81 e0 ldi r24, 0x01 ; 1 2352c: 44 85 ldd r20, Z+12 ; 0x0c 2352e: 55 85 ldd r21, Z+13 ; 0x0d 23530: 66 85 ldd r22, Z+14 ; 0x0e 23532: 77 85 ldd r23, Z+15 ; 0x0f 23534: 45 2b or r20, r21 23536: 46 2b or r20, r22 23538: 47 2b or r20, r23 2353a: 09 f4 brne .+2 ; 0x2353e <__vector_17+0x34a> 2353c: 83 cf rjmp .-250 ; 0x23444 <__vector_17+0x250> 2353e: 80 93 57 05 sts 0x0557, r24 ; 0x800557 #endif } step_events_completed.wide = 0; 23542: 10 92 53 05 sts 0x0553, r1 ; 0x800553 23546: 10 92 54 05 sts 0x0554, r1 ; 0x800554 2354a: 10 92 55 05 sts 0x0555, r1 ; 0x800555 2354e: 10 92 56 05 sts 0x0556, r1 ; 0x800556 // Set directions. out_bits = current_block->direction_bits; 23552: 88 8d ldd r24, Y+24 ; 0x18 23554: 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); 2355c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 23560: 8d 7f andi r24, 0xFD ; 253 23562: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=-1; 23566: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(X_DIR_PIN, !INVERT_X_DIR); count_direction[X_AXIS]=1; 23568: 80 93 5b 02 sts 0x025B, r24 ; 0x80025b } if((out_bits & (1< 23570: 81 ff sbrs r24, 1 23572: cc c1 rjmp .+920 ; 0x2390c <__vector_17+0x718> WRITE_NC(Y_DIR_PIN, INVERT_Y_DIR); 23574: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 23578: 8e 7f andi r24, 0xFE ; 254 2357a: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=-1; 2357e: 8f ef ldi r24, 0xFF ; 255 } else { WRITE_NC(Y_DIR_PIN, !INVERT_Y_DIR); count_direction[Y_AXIS]=1; 23580: 80 93 5c 02 sts 0x025C, r24 ; 0x80025c } if ((out_bits & (1< 23588: 82 ff sbrs r24, 2 2358a: c7 c1 rjmp .+910 ; 0x2391a <__vector_17+0x726> WRITE_NC(Z_DIR_PIN,INVERT_Z_DIR); 2358c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 23590: 8b 7f andi r24, 0xFB ; 251 23592: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=-1; 23596: 8f ef ldi r24, 0xFF ; 255 } else { // +direction WRITE_NC(Z_DIR_PIN,!INVERT_Z_DIR); count_direction[Z_AXIS]=1; 23598: 80 93 5d 02 sts 0x025D, r24 ; 0x80025d } if ((out_bits & (1 << E_AXIS)) != 0) { // -direction 2359c: 80 91 52 05 lds r24, 0x0552 ; 0x800552 235a0: 83 ff sbrs r24, 3 235a2: c2 c1 rjmp .+900 ; 0x23928 <__vector_17+0x734> #ifndef LIN_ADVANCE WRITE(E0_DIR_PIN, INVERT_E0_DIR); #endif /* LIN_ADVANCE */ count_direction[E_AXIS] = -1; 235a4: 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; 235a6: 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) 235aa: e0 91 51 12 lds r30, 0x1251 ; 0x801251 235ae: f0 91 52 12 lds r31, 0x1252 ; 0x801252 235b2: 30 97 sbiw r30, 0x00 ; 0 235b4: 09 f4 brne .+2 ; 0x235b8 <__vector_17+0x3c4> 235b6: 09 c7 rjmp .+3602 ; 0x243ca <__vector_17+0x11d6> } // Check limit switches. FORCE_INLINE void stepper_check_endstops() { if(check_endstops) 235b8: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.385> 235bc: 50 91 4f 05 lds r21, 0x054F ; 0x80054f 235c0: 88 23 and r24, r24 235c2: 09 f4 brne .+2 ; 0x235c6 <__vector_17+0x3d2> 235c4: 6c c0 rjmp .+216 ; 0x2369e <__vector_17+0x4aa> { uint8_t _endstop_hit = endstop_hit; 235c6: 20 91 5e 04 lds r18, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.440> uint8_t _endstop = endstop; 235ca: 80 91 51 05 lds r24, 0x0551 ; 0x800551 uint8_t _old_endstop = old_endstop; 235ce: 90 91 50 05 lds r25, 0x0550 ; 0x800550 #ifndef COREXY if ((out_bits & (1< 235d6: 30 ff sbrs r19, 0 235d8: 1d c0 rjmp .+58 ; 0x23614 <__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)); 235da: 1e 9b sbis 0x03, 6 ; 3 235dc: c6 c1 rjmp .+908 ; 0x2396a <__vector_17+0x776> 235de: 81 60 ori r24, 0x01 ; 1 #endif if((_endstop & _old_endstop & _BV(X_AXIS)) && (current_block->steps[X_AXIS].wide > 0)) { 235e0: 49 2f mov r20, r25 235e2: 41 70 andi r20, 0x01 ; 1 235e4: 48 23 and r20, r24 235e6: b1 f0 breq .+44 ; 0x23614 <__vector_17+0x420> 235e8: c0 80 ld r12, Z 235ea: d1 80 ldd r13, Z+1 ; 0x01 235ec: e2 80 ldd r14, Z+2 ; 0x02 235ee: f3 80 ldd r15, Z+3 ; 0x03 235f0: 1c 14 cp r1, r12 235f2: 1d 04 cpc r1, r13 235f4: 1e 04 cpc r1, r14 235f6: 1f 04 cpc r1, r15 235f8: 6c f4 brge .+26 ; 0x23614 <__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); 235fa: 21 60 ori r18, 0x01 ; 1 step_events_completed.wide = current_block->step_event_count.wide; 235fc: c0 88 ldd r12, Z+16 ; 0x10 235fe: d1 88 ldd r13, Z+17 ; 0x11 23600: e2 88 ldd r14, Z+18 ; 0x12 23602: f3 88 ldd r15, Z+19 ; 0x13 23604: c0 92 53 05 sts 0x0553, r12 ; 0x800553 23608: d0 92 54 05 sts 0x0554, r13 ; 0x800554 2360c: e0 92 55 05 sts 0x0555, r14 ; 0x800555 23610: 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)); 23618: 1d 9b sbis 0x03, 5 ; 3 2361a: a9 c1 rjmp .+850 ; 0x2396e <__vector_17+0x77a> 2361c: 82 60 ori r24, 0x02 ; 2 #endif if((_endstop & _old_endstop & _BV(Y_AXIS)) && (current_block->steps[Y_AXIS].wide > 0)) { 2361e: 49 2f mov r20, r25 23620: 42 70 andi r20, 0x02 ; 2 23622: 48 23 and r20, r24 23624: b1 f0 breq .+44 ; 0x23652 <__vector_17+0x45e> 23626: c4 80 ldd r12, Z+4 ; 0x04 23628: d5 80 ldd r13, Z+5 ; 0x05 2362a: e6 80 ldd r14, Z+6 ; 0x06 2362c: f7 80 ldd r15, Z+7 ; 0x07 2362e: 1c 14 cp r1, r12 23630: 1d 04 cpc r1, r13 23632: 1e 04 cpc r1, r14 23634: 1f 04 cpc r1, r15 23636: 6c f4 brge .+26 ; 0x23652 <__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); 23638: 22 60 ori r18, 0x02 ; 2 step_events_completed.wide = current_block->step_event_count.wide; 2363a: c0 88 ldd r12, Z+16 ; 0x10 2363c: d1 88 ldd r13, Z+17 ; 0x11 2363e: e2 88 ldd r14, Z+18 ; 0x12 23640: f3 88 ldd r15, Z+19 ; 0x13 23642: c0 92 53 05 sts 0x0553, r12 ; 0x800553 23646: d0 92 54 05 sts 0x0554, r13 ; 0x800554 2364a: e0 92 55 05 sts 0x0555, r14 ; 0x800555 2364e: 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) { 23656: 51 11 cpse r21, r1 23658: 1c c0 rjmp .+56 ; 0x23692 <__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)); 2365a: 1c 9b sbis 0x03, 4 ; 3 2365c: 8a c1 rjmp .+788 ; 0x23972 <__vector_17+0x77e> 2365e: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if((_endstop & _old_endstop & _BV(Z_AXIS)) && (current_block->steps[Z_AXIS].wide > 0)) { 23660: 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)) { 23662: 98 23 and r25, r24 23664: b1 f0 breq .+44 ; 0x23692 <__vector_17+0x49e> 23666: c0 84 ldd r12, Z+8 ; 0x08 23668: d1 84 ldd r13, Z+9 ; 0x09 2366a: e2 84 ldd r14, Z+10 ; 0x0a 2366c: f3 84 ldd r15, Z+11 ; 0x0b 2366e: 1c 14 cp r1, r12 23670: 1d 04 cpc r1, r13 23672: 1e 04 cpc r1, r14 23674: 1f 04 cpc r1, r15 23676: 6c f4 brge .+26 ; 0x23692 <__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); 23678: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 2367a: c0 88 ldd r12, Z+16 ; 0x10 2367c: d1 88 ldd r13, Z+17 ; 0x11 2367e: e2 88 ldd r14, Z+18 ; 0x12 23680: f3 88 ldd r15, Z+19 ; 0x13 23682: c0 92 53 05 sts 0x0553, r12 ; 0x800553 23686: d0 92 54 05 sts 0x0554, r13 ; 0x800554 2368a: e0 92 55 05 sts 0x0555, r14 ; 0x800555 2368e: f0 92 56 05 sts 0x0556, r15 ; 0x800556 } #endif } endstop = _endstop; 23692: 80 93 51 05 sts 0x0551, r24 ; 0x800551 old_endstop = _endstop; //apply current endstop state to the old endstop 23696: 80 93 50 05 sts 0x0550, r24 ; 0x800550 endstop_hit = _endstop_hit; 2369a: 20 93 5e 04 sts 0x045E, r18 ; 0x80045e <_ZL11endstop_hit.lto_priv.440> } // 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) { 2369e: 55 23 and r21, r21 236a0: f9 f0 breq .+62 ; 0x236e0 <__vector_17+0x4ec> uint8_t _endstop_hit = endstop_hit; 236a2: 20 91 5e 04 lds r18, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.440> uint8_t _endstop = endstop; 236a6: 80 91 51 05 lds r24, 0x0551 ; 0x800551 uint8_t _old_endstop = old_endstop; 236aa: 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)); 236ae: 1c 9b sbis 0x03, 4 ; 3 236b0: 69 c1 rjmp .+722 ; 0x23984 <__vector_17+0x790> 236b2: 84 60 ori r24, 0x04 ; 4 #endif //TMC2130_SG_HOMING if(_endstop & _old_endstop & _BV(Z_AXIS)) { 236b4: 94 70 andi r25, 0x04 ; 4 236b6: 98 23 and r25, r24 236b8: 69 f0 breq .+26 ; 0x236d4 <__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); 236ba: 24 60 ori r18, 0x04 ; 4 step_events_completed.wide = current_block->step_event_count.wide; 236bc: 40 89 ldd r20, Z+16 ; 0x10 236be: 51 89 ldd r21, Z+17 ; 0x11 236c0: 62 89 ldd r22, Z+18 ; 0x12 236c2: 73 89 ldd r23, Z+19 ; 0x13 236c4: 40 93 53 05 sts 0x0553, r20 ; 0x800553 236c8: 50 93 54 05 sts 0x0554, r21 ; 0x800554 236cc: 60 93 55 05 sts 0x0555, r22 ; 0x800555 236d0: 70 93 56 05 sts 0x0556, r23 ; 0x800556 } endstop = _endstop; 236d4: 80 93 51 05 sts 0x0551, r24 ; 0x800551 old_endstop = _endstop; //apply current endstop state to the old endstop 236d8: 80 93 50 05 sts 0x0550, r24 ; 0x800550 endstop_hit = _endstop_hit; 236dc: 20 93 5e 04 sts 0x045E, r18 ; 0x80045e <_ZL11endstop_hit.lto_priv.440> stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 236e0: 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) 236e2: c0 e0 ldi r28, 0x00 ; 0 stepper_next_block(); if (current_block != NULL) { stepper_check_endstops(); if (current_block->flag & BLOCK_FLAG_DDA_LOWRES) 236e4: 83 ff sbrs r24, 3 236e6: 50 c1 rjmp .+672 ; 0x23988 <__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) 236e8: 80 91 70 05 lds r24, 0x0570 ; 0x800570 236ec: c8 17 cp r28, r24 236ee: 08 f0 brcs .+2 ; 0x236f2 <__vector_17+0x4fe> 236f0: bd c2 rjmp .+1402 ; 0x23c6c <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 236f2: 0f 94 b8 00 call 0x20170 ; 0x20170 // Step in X axis counter[X_AXIS].lo += current_block->steps[X_AXIS].lo; 236f6: e0 91 51 12 lds r30, 0x1251 ; 0x801251 236fa: f0 91 52 12 lds r31, 0x1252 ; 0x801252 236fe: 80 81 ld r24, Z 23700: 91 81 ldd r25, Z+1 ; 0x01 23702: 20 91 58 05 lds r18, 0x0558 ; 0x800558 23706: 30 91 59 05 lds r19, 0x0559 ; 0x800559 2370a: 82 0f add r24, r18 2370c: 93 1f adc r25, r19 2370e: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23712: 80 93 58 05 sts 0x0558, r24 ; 0x800558 if (counter[X_AXIS].lo > 0) { 23716: 18 16 cp r1, r24 23718: 19 06 cpc r1, r25 2371a: 6c f5 brge .+90 ; 0x23776 <__vector_17+0x582> STEP_NC_HI(X_AXIS); 2371c: 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; 2371e: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23722: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23726: 80 91 58 05 lds r24, 0x0558 ; 0x800558 2372a: 90 91 59 05 lds r25, 0x0559 ; 0x800559 2372e: 20 89 ldd r18, Z+16 ; 0x10 23730: 31 89 ldd r19, Z+17 ; 0x11 23732: 82 1b sub r24, r18 23734: 93 0b sbc r25, r19 23736: 90 93 59 05 sts 0x0559, r25 ; 0x800559 2373a: 80 93 58 05 sts 0x0558, r24 ; 0x800558 count_position[X_AXIS]+=count_direction[X_AXIS]; 2373e: 90 91 5b 02 lds r25, 0x025B ; 0x80025b 23742: 40 91 4c 06 lds r20, 0x064C ; 0x80064c 23746: 50 91 4d 06 lds r21, 0x064D ; 0x80064d 2374a: 60 91 4e 06 lds r22, 0x064E ; 0x80064e 2374e: 70 91 4f 06 lds r23, 0x064F ; 0x80064f 23752: 89 2f mov r24, r25 23754: 99 0f add r25, r25 23756: 99 0b sbc r25, r25 23758: aa 0b sbc r26, r26 2375a: bb 0b sbc r27, r27 2375c: 84 0f add r24, r20 2375e: 95 1f adc r25, r21 23760: a6 1f adc r26, r22 23762: b7 1f adc r27, r23 23764: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c 23768: 90 93 4d 06 sts 0x064D, r25 ; 0x80064d 2376c: a0 93 4e 06 sts 0x064E, r26 ; 0x80064e 23770: b0 93 4f 06 sts 0x064F, r27 ; 0x80064f STEP_NC_LO(X_AXIS); 23774: 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; 23776: e0 91 51 12 lds r30, 0x1251 ; 0x801251 2377a: f0 91 52 12 lds r31, 0x1252 ; 0x801252 2377e: 84 81 ldd r24, Z+4 ; 0x04 23780: 95 81 ldd r25, Z+5 ; 0x05 23782: 20 91 5c 05 lds r18, 0x055C ; 0x80055c 23786: 30 91 5d 05 lds r19, 0x055D ; 0x80055d 2378a: 82 0f add r24, r18 2378c: 93 1f adc r25, r19 2378e: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23792: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c if (counter[Y_AXIS].lo > 0) { 23796: 18 16 cp r1, r24 23798: 19 06 cpc r1, r25 2379a: 4c f5 brge .+82 ; 0x237ee <__vector_17+0x5fa> STEP_NC_HI(Y_AXIS); 2379c: 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; 2379e: e0 91 51 12 lds r30, 0x1251 ; 0x801251 237a2: f0 91 52 12 lds r31, 0x1252 ; 0x801252 237a6: 20 89 ldd r18, Z+16 ; 0x10 237a8: 31 89 ldd r19, Z+17 ; 0x11 237aa: 82 1b sub r24, r18 237ac: 93 0b sbc r25, r19 237ae: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 237b2: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c count_position[Y_AXIS]+=count_direction[Y_AXIS]; 237b6: 90 91 5c 02 lds r25, 0x025C ; 0x80025c 237ba: 40 91 50 06 lds r20, 0x0650 ; 0x800650 237be: 50 91 51 06 lds r21, 0x0651 ; 0x800651 237c2: 60 91 52 06 lds r22, 0x0652 ; 0x800652 237c6: 70 91 53 06 lds r23, 0x0653 ; 0x800653 237ca: 89 2f mov r24, r25 237cc: 99 0f add r25, r25 237ce: 99 0b sbc r25, r25 237d0: aa 0b sbc r26, r26 237d2: bb 0b sbc r27, r27 237d4: 84 0f add r24, r20 237d6: 95 1f adc r25, r21 237d8: a6 1f adc r26, r22 237da: b7 1f adc r27, r23 237dc: 80 93 50 06 sts 0x0650, r24 ; 0x800650 237e0: 90 93 51 06 sts 0x0651, r25 ; 0x800651 237e4: a0 93 52 06 sts 0x0652, r26 ; 0x800652 237e8: b0 93 53 06 sts 0x0653, r27 ; 0x800653 STEP_NC_LO(Y_AXIS); 237ec: 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; 237ee: e0 91 51 12 lds r30, 0x1251 ; 0x801251 237f2: f0 91 52 12 lds r31, 0x1252 ; 0x801252 237f6: 80 85 ldd r24, Z+8 ; 0x08 237f8: 91 85 ldd r25, Z+9 ; 0x09 237fa: 20 91 60 05 lds r18, 0x0560 ; 0x800560 237fe: 30 91 61 05 lds r19, 0x0561 ; 0x800561 23802: 82 0f add r24, r18 23804: 93 1f adc r25, r19 23806: 90 93 61 05 sts 0x0561, r25 ; 0x800561 2380a: 80 93 60 05 sts 0x0560, r24 ; 0x800560 if (counter[Z_AXIS].lo > 0) { 2380e: 18 16 cp r1, r24 23810: 19 06 cpc r1, r25 23812: 4c f5 brge .+82 ; 0x23866 <__vector_17+0x672> STEP_NC_HI(Z_AXIS); 23814: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].lo -= current_block->step_event_count.lo; 23816: e0 91 51 12 lds r30, 0x1251 ; 0x801251 2381a: f0 91 52 12 lds r31, 0x1252 ; 0x801252 2381e: 20 89 ldd r18, Z+16 ; 0x10 23820: 31 89 ldd r19, Z+17 ; 0x11 23822: 82 1b sub r24, r18 23824: 93 0b sbc r25, r19 23826: 90 93 61 05 sts 0x0561, r25 ; 0x800561 2382a: 80 93 60 05 sts 0x0560, r24 ; 0x800560 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 2382e: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 23832: 40 91 54 06 lds r20, 0x0654 ; 0x800654 23836: 50 91 55 06 lds r21, 0x0655 ; 0x800655 2383a: 60 91 56 06 lds r22, 0x0656 ; 0x800656 2383e: 70 91 57 06 lds r23, 0x0657 ; 0x800657 23842: 89 2f mov r24, r25 23844: 99 0f add r25, r25 23846: 99 0b sbc r25, r25 23848: aa 0b sbc r26, r26 2384a: bb 0b sbc r27, r27 2384c: 84 0f add r24, r20 2384e: 95 1f adc r25, r21 23850: a6 1f adc r26, r22 23852: b7 1f adc r27, r23 23854: 80 93 54 06 sts 0x0654, r24 ; 0x800654 23858: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2385c: a0 93 56 06 sts 0x0656, r26 ; 0x800656 23860: b0 93 57 06 sts 0x0657, r27 ; 0x800657 STEP_NC_LO(Z_AXIS); 23864: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].lo += current_block->steps[E_AXIS].lo; 23866: e0 91 51 12 lds r30, 0x1251 ; 0x801251 2386a: f0 91 52 12 lds r31, 0x1252 ; 0x801252 2386e: 80 91 64 05 lds r24, 0x0564 ; 0x800564 23872: 90 91 65 05 lds r25, 0x0565 ; 0x800565 23876: 24 85 ldd r18, Z+12 ; 0x0c 23878: 35 85 ldd r19, Z+13 ; 0x0d 2387a: 82 0f add r24, r18 2387c: 93 1f adc r25, r19 2387e: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23882: 80 93 64 05 sts 0x0564, r24 ; 0x800564 23886: 20 89 ldd r18, Z+16 ; 0x10 23888: 31 89 ldd r19, Z+17 ; 0x11 if (counter[E_AXIS].lo > 0) { 2388a: 18 16 cp r1, r24 2388c: 19 06 cpc r1, r25 2388e: 44 f5 brge .+80 ; 0x238e0 <__vector_17+0x6ec> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].lo -= current_block->step_event_count.lo; 23890: 82 1b sub r24, r18 23892: 93 0b sbc r25, r19 23894: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23898: 80 93 64 05 sts 0x0564, r24 ; 0x800564 count_position[E_AXIS] += count_direction[E_AXIS]; 2389c: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 238a0: 40 91 58 06 lds r20, 0x0658 ; 0x800658 238a4: 50 91 59 06 lds r21, 0x0659 ; 0x800659 238a8: 60 91 5a 06 lds r22, 0x065A ; 0x80065a 238ac: 70 91 5b 06 lds r23, 0x065B ; 0x80065b 238b0: 89 2f mov r24, r25 238b2: 99 0f add r25, r25 238b4: 99 0b sbc r25, r25 238b6: aa 0b sbc r26, r26 238b8: bb 0b sbc r27, r27 238ba: 84 0f add r24, r20 238bc: 95 1f adc r25, r21 238be: a6 1f adc r26, r22 238c0: b7 1f adc r27, r23 238c2: 80 93 58 06 sts 0x0658, r24 ; 0x800658 238c6: 90 93 59 06 sts 0x0659, r25 ; 0x800659 238ca: a0 93 5a 06 sts 0x065A, r26 ; 0x80065a 238ce: b0 93 5b 06 sts 0x065B, r27 ; 0x80065b #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 238d2: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 238d6: 80 91 69 05 lds r24, 0x0569 ; 0x800569 238da: 89 0f add r24, r25 238dc: 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) 238e0: 80 91 53 05 lds r24, 0x0553 ; 0x800553 238e4: 90 91 54 05 lds r25, 0x0554 ; 0x800554 238e8: 01 96 adiw r24, 0x01 ; 1 238ea: 90 93 54 05 sts 0x0554, r25 ; 0x800554 238ee: 80 93 53 05 sts 0x0553, r24 ; 0x800553 238f2: 82 17 cp r24, r18 238f4: 93 07 cpc r25, r19 238f6: 08 f0 brcs .+2 ; 0x238fa <__vector_17+0x706> 238f8: b9 c1 rjmp .+882 ; 0x23c6c <__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) 238fa: cf 5f subi r28, 0xFF ; 255 238fc: f5 ce rjmp .-534 ; 0x236e8 <__vector_17+0x4f4> // Set the direction bits (X_AXIS=A_AXIS and Y_AXIS=B_AXIS for COREXY) if((out_bits & (1< 23902: 82 60 ori r24, 0x02 ; 2 23904: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[X_AXIS]=1; 23908: 81 e0 ldi r24, 0x01 ; 1 2390a: 2e ce rjmp .-932 ; 0x23568 <__vector_17+0x374> } if((out_bits & (1< 23910: 81 60 ori r24, 0x01 ; 1 23912: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Y_AXIS]=1; 23916: 81 e0 ldi r24, 0x01 ; 1 23918: 33 ce rjmp .-922 ; 0x23580 <__vector_17+0x38c> } if ((out_bits & (1< 2391e: 84 60 ori r24, 0x04 ; 4 23920: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> count_direction[Z_AXIS]=1; 23924: 81 e0 ldi r24, 0x01 ; 1 23926: 38 ce rjmp .-912 ; 0x23598 <__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; 23928: 81 e0 ldi r24, 0x01 ; 1 2392a: 3d ce rjmp .-902 ; 0x235a6 <__vector_17+0x3b2> } } else { _NEXT_ISR(2000); // 1kHz. 2392c: 80 ed ldi r24, 0xD0 ; 208 2392e: 97 e0 ldi r25, 0x07 ; 7 23930: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 23934: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.436> 23938: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.438+0x1> 2393c: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.438> #ifdef LIN_ADVANCE // reset LA state when there's no block nextAdvanceISR = ADV_NEVER; 23940: 8f ef ldi r24, 0xFF ; 255 23942: 9f ef ldi r25, 0xFF ; 255 23944: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 23948: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> e_steps = 0; 2394c: 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) 23950: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> 23954: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 23958: 00 97 sbiw r24, 0x00 ; 0 2395a: 09 f4 brne .+2 ; 0x2395e <__vector_17+0x76a> 2395c: 26 ce rjmp .-948 ; 0x235aa <__vector_17+0x3b6> --current_adv_steps; 2395e: 01 97 sbiw r24, 0x01 ; 1 23960: 90 93 49 04 sts 0x0449, r25 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 23964: 80 93 48 04 sts 0x0448, r24 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> 23968: 20 ce rjmp .-960 ; 0x235aa <__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)); 2396a: 8e 7f andi r24, 0xFE ; 254 2396c: 39 ce rjmp .-910 ; 0x235e0 <__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)); 2396e: 8d 7f andi r24, 0xFD ; 253 23970: 56 ce rjmp .-852 ; 0x2361e <__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)); 23972: 8b 7f andi r24, 0xFB ; 251 23974: 75 ce rjmp .-790 ; 0x23660 <__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)); 23976: 01 99 sbic 0x00, 1 ; 0 23978: 03 c0 rjmp .+6 ; 0x23980 <__vector_17+0x78c> 2397a: 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)) { 2397c: 90 74 andi r25, 0x40 ; 64 2397e: 71 ce rjmp .-798 ; 0x23662 <__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)); 23980: 8f 7b andi r24, 0xBF ; 191 23982: fc cf rjmp .-8 ; 0x2397c <__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)); 23984: 8b 7f andi r24, 0xFB ; 251 23986: 96 ce rjmp .-724 ; 0x236b4 <__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) 23988: 80 91 70 05 lds r24, 0x0570 ; 0x800570 2398c: c8 17 cp r28, r24 2398e: 08 f0 brcs .+2 ; 0x23992 <__vector_17+0x79e> 23990: 6d c1 rjmp .+730 ; 0x23c6c <__vector_17+0xa78> MSerial.checkRx(); // Check for serial chars. 23992: 0f 94 b8 00 call 0x20170 ; 0x20170 // Step in X axis counter[X_AXIS].wide += current_block->steps[X_AXIS].wide; 23996: e0 91 51 12 lds r30, 0x1251 ; 0x801251 2399a: f0 91 52 12 lds r31, 0x1252 ; 0x801252 2399e: 80 81 ld r24, Z 239a0: 91 81 ldd r25, Z+1 ; 0x01 239a2: a2 81 ldd r26, Z+2 ; 0x02 239a4: b3 81 ldd r27, Z+3 ; 0x03 239a6: 40 91 58 05 lds r20, 0x0558 ; 0x800558 239aa: 50 91 59 05 lds r21, 0x0559 ; 0x800559 239ae: 60 91 5a 05 lds r22, 0x055A ; 0x80055a 239b2: 70 91 5b 05 lds r23, 0x055B ; 0x80055b 239b6: 84 0f add r24, r20 239b8: 95 1f adc r25, r21 239ba: a6 1f adc r26, r22 239bc: b7 1f adc r27, r23 239be: 80 93 58 05 sts 0x0558, r24 ; 0x800558 239c2: 90 93 59 05 sts 0x0559, r25 ; 0x800559 239c6: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 239ca: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b if (counter[X_AXIS].wide > 0) { 239ce: 18 16 cp r1, r24 239d0: 19 06 cpc r1, r25 239d2: 1a 06 cpc r1, r26 239d4: 1b 06 cpc r1, r27 239d6: cc f5 brge .+114 ; 0x23a4a <__vector_17+0x856> STEP_NC_HI(X_AXIS); 239d8: 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; 239da: e0 91 51 12 lds r30, 0x1251 ; 0x801251 239de: f0 91 52 12 lds r31, 0x1252 ; 0x801252 239e2: 80 91 58 05 lds r24, 0x0558 ; 0x800558 239e6: 90 91 59 05 lds r25, 0x0559 ; 0x800559 239ea: a0 91 5a 05 lds r26, 0x055A ; 0x80055a 239ee: b0 91 5b 05 lds r27, 0x055B ; 0x80055b 239f2: 40 89 ldd r20, Z+16 ; 0x10 239f4: 51 89 ldd r21, Z+17 ; 0x11 239f6: 62 89 ldd r22, Z+18 ; 0x12 239f8: 73 89 ldd r23, Z+19 ; 0x13 239fa: 84 1b sub r24, r20 239fc: 95 0b sbc r25, r21 239fe: a6 0b sbc r26, r22 23a00: b7 0b sbc r27, r23 23a02: 80 93 58 05 sts 0x0558, r24 ; 0x800558 23a06: 90 93 59 05 sts 0x0559, r25 ; 0x800559 23a0a: a0 93 5a 05 sts 0x055A, r26 ; 0x80055a 23a0e: b0 93 5b 05 sts 0x055B, r27 ; 0x80055b count_position[X_AXIS]+=count_direction[X_AXIS]; 23a12: 90 91 5b 02 lds r25, 0x025B ; 0x80025b 23a16: 40 91 4c 06 lds r20, 0x064C ; 0x80064c 23a1a: 50 91 4d 06 lds r21, 0x064D ; 0x80064d 23a1e: 60 91 4e 06 lds r22, 0x064E ; 0x80064e 23a22: 70 91 4f 06 lds r23, 0x064F ; 0x80064f 23a26: 89 2f mov r24, r25 23a28: 99 0f add r25, r25 23a2a: 99 0b sbc r25, r25 23a2c: aa 0b sbc r26, r26 23a2e: bb 0b sbc r27, r27 23a30: 84 0f add r24, r20 23a32: 95 1f adc r25, r21 23a34: a6 1f adc r26, r22 23a36: b7 1f adc r27, r23 23a38: 80 93 4c 06 sts 0x064C, r24 ; 0x80064c 23a3c: 90 93 4d 06 sts 0x064D, r25 ; 0x80064d 23a40: a0 93 4e 06 sts 0x064E, r26 ; 0x80064e 23a44: b0 93 4f 06 sts 0x064F, r27 ; 0x80064f STEP_NC_LO(X_AXIS); 23a48: 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; 23a4a: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23a4e: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23a52: 84 81 ldd r24, Z+4 ; 0x04 23a54: 95 81 ldd r25, Z+5 ; 0x05 23a56: a6 81 ldd r26, Z+6 ; 0x06 23a58: b7 81 ldd r27, Z+7 ; 0x07 23a5a: 40 91 5c 05 lds r20, 0x055C ; 0x80055c 23a5e: 50 91 5d 05 lds r21, 0x055D ; 0x80055d 23a62: 60 91 5e 05 lds r22, 0x055E ; 0x80055e 23a66: 70 91 5f 05 lds r23, 0x055F ; 0x80055f 23a6a: 84 0f add r24, r20 23a6c: 95 1f adc r25, r21 23a6e: a6 1f adc r26, r22 23a70: b7 1f adc r27, r23 23a72: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 23a76: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23a7a: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 23a7e: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f if (counter[Y_AXIS].wide > 0) { 23a82: 18 16 cp r1, r24 23a84: 19 06 cpc r1, r25 23a86: 1a 06 cpc r1, r26 23a88: 1b 06 cpc r1, r27 23a8a: 8c f5 brge .+98 ; 0x23aee <__vector_17+0x8fa> STEP_NC_HI(Y_AXIS); 23a8c: 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; 23a8e: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23a92: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23a96: 40 89 ldd r20, Z+16 ; 0x10 23a98: 51 89 ldd r21, Z+17 ; 0x11 23a9a: 62 89 ldd r22, Z+18 ; 0x12 23a9c: 73 89 ldd r23, Z+19 ; 0x13 23a9e: 84 1b sub r24, r20 23aa0: 95 0b sbc r25, r21 23aa2: a6 0b sbc r26, r22 23aa4: b7 0b sbc r27, r23 23aa6: 80 93 5c 05 sts 0x055C, r24 ; 0x80055c 23aaa: 90 93 5d 05 sts 0x055D, r25 ; 0x80055d 23aae: a0 93 5e 05 sts 0x055E, r26 ; 0x80055e 23ab2: b0 93 5f 05 sts 0x055F, r27 ; 0x80055f count_position[Y_AXIS]+=count_direction[Y_AXIS]; 23ab6: 90 91 5c 02 lds r25, 0x025C ; 0x80025c 23aba: 40 91 50 06 lds r20, 0x0650 ; 0x800650 23abe: 50 91 51 06 lds r21, 0x0651 ; 0x800651 23ac2: 60 91 52 06 lds r22, 0x0652 ; 0x800652 23ac6: 70 91 53 06 lds r23, 0x0653 ; 0x800653 23aca: 89 2f mov r24, r25 23acc: 99 0f add r25, r25 23ace: 99 0b sbc r25, r25 23ad0: aa 0b sbc r26, r26 23ad2: bb 0b sbc r27, r27 23ad4: 84 0f add r24, r20 23ad6: 95 1f adc r25, r21 23ad8: a6 1f adc r26, r22 23ada: b7 1f adc r27, r23 23adc: 80 93 50 06 sts 0x0650, r24 ; 0x800650 23ae0: 90 93 51 06 sts 0x0651, r25 ; 0x800651 23ae4: a0 93 52 06 sts 0x0652, r26 ; 0x800652 23ae8: b0 93 53 06 sts 0x0653, r27 ; 0x800653 STEP_NC_LO(Y_AXIS); 23aec: 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; 23aee: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23af2: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23af6: 80 85 ldd r24, Z+8 ; 0x08 23af8: 91 85 ldd r25, Z+9 ; 0x09 23afa: a2 85 ldd r26, Z+10 ; 0x0a 23afc: b3 85 ldd r27, Z+11 ; 0x0b 23afe: 40 91 60 05 lds r20, 0x0560 ; 0x800560 23b02: 50 91 61 05 lds r21, 0x0561 ; 0x800561 23b06: 60 91 62 05 lds r22, 0x0562 ; 0x800562 23b0a: 70 91 63 05 lds r23, 0x0563 ; 0x800563 23b0e: 84 0f add r24, r20 23b10: 95 1f adc r25, r21 23b12: a6 1f adc r26, r22 23b14: b7 1f adc r27, r23 23b16: 80 93 60 05 sts 0x0560, r24 ; 0x800560 23b1a: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23b1e: a0 93 62 05 sts 0x0562, r26 ; 0x800562 23b22: b0 93 63 05 sts 0x0563, r27 ; 0x800563 if (counter[Z_AXIS].wide > 0) { 23b26: 18 16 cp r1, r24 23b28: 19 06 cpc r1, r25 23b2a: 1a 06 cpc r1, r26 23b2c: 1b 06 cpc r1, r27 23b2e: 8c f5 brge .+98 ; 0x23b92 <__vector_17+0x99e> STEP_NC_HI(Z_AXIS); 23b30: 42 9a sbi 0x08, 2 ; 8 counter[Z_AXIS].wide -= current_block->step_event_count.wide; 23b32: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23b36: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23b3a: 40 89 ldd r20, Z+16 ; 0x10 23b3c: 51 89 ldd r21, Z+17 ; 0x11 23b3e: 62 89 ldd r22, Z+18 ; 0x12 23b40: 73 89 ldd r23, Z+19 ; 0x13 23b42: 84 1b sub r24, r20 23b44: 95 0b sbc r25, r21 23b46: a6 0b sbc r26, r22 23b48: b7 0b sbc r27, r23 23b4a: 80 93 60 05 sts 0x0560, r24 ; 0x800560 23b4e: 90 93 61 05 sts 0x0561, r25 ; 0x800561 23b52: a0 93 62 05 sts 0x0562, r26 ; 0x800562 23b56: b0 93 63 05 sts 0x0563, r27 ; 0x800563 count_position[Z_AXIS]+=count_direction[Z_AXIS]; 23b5a: 90 91 5d 02 lds r25, 0x025D ; 0x80025d 23b5e: 40 91 54 06 lds r20, 0x0654 ; 0x800654 23b62: 50 91 55 06 lds r21, 0x0655 ; 0x800655 23b66: 60 91 56 06 lds r22, 0x0656 ; 0x800656 23b6a: 70 91 57 06 lds r23, 0x0657 ; 0x800657 23b6e: 89 2f mov r24, r25 23b70: 99 0f add r25, r25 23b72: 99 0b sbc r25, r25 23b74: aa 0b sbc r26, r26 23b76: bb 0b sbc r27, r27 23b78: 84 0f add r24, r20 23b7a: 95 1f adc r25, r21 23b7c: a6 1f adc r26, r22 23b7e: b7 1f adc r27, r23 23b80: 80 93 54 06 sts 0x0654, r24 ; 0x800654 23b84: 90 93 55 06 sts 0x0655, r25 ; 0x800655 23b88: a0 93 56 06 sts 0x0656, r26 ; 0x800656 23b8c: b0 93 57 06 sts 0x0657, r27 ; 0x800657 STEP_NC_LO(Z_AXIS); 23b90: 42 98 cbi 0x08, 2 ; 8 } // Step in E axis counter[E_AXIS].wide += current_block->steps[E_AXIS].wide; 23b92: e0 91 51 12 lds r30, 0x1251 ; 0x801251 23b96: f0 91 52 12 lds r31, 0x1252 ; 0x801252 23b9a: 80 91 64 05 lds r24, 0x0564 ; 0x800564 23b9e: 90 91 65 05 lds r25, 0x0565 ; 0x800565 23ba2: a0 91 66 05 lds r26, 0x0566 ; 0x800566 23ba6: b0 91 67 05 lds r27, 0x0567 ; 0x800567 23baa: 44 85 ldd r20, Z+12 ; 0x0c 23bac: 55 85 ldd r21, Z+13 ; 0x0d 23bae: 66 85 ldd r22, Z+14 ; 0x0e 23bb0: 77 85 ldd r23, Z+15 ; 0x0f 23bb2: 84 0f add r24, r20 23bb4: 95 1f adc r25, r21 23bb6: a6 1f adc r26, r22 23bb8: b7 1f adc r27, r23 23bba: 80 93 64 05 sts 0x0564, r24 ; 0x800564 23bbe: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23bc2: a0 93 66 05 sts 0x0566, r26 ; 0x800566 23bc6: b0 93 67 05 sts 0x0567, r27 ; 0x800567 23bca: 40 89 ldd r20, Z+16 ; 0x10 23bcc: 51 89 ldd r21, Z+17 ; 0x11 23bce: 62 89 ldd r22, Z+18 ; 0x12 23bd0: 73 89 ldd r23, Z+19 ; 0x13 if (counter[E_AXIS].wide > 0) { 23bd2: 18 16 cp r1, r24 23bd4: 19 06 cpc r1, r25 23bd6: 1a 06 cpc r1, r26 23bd8: 1b 06 cpc r1, r27 23bda: 74 f5 brge .+92 ; 0x23c38 <__vector_17+0xa44> #ifndef LIN_ADVANCE STEP_NC_HI(E_AXIS); #endif /* LIN_ADVANCE */ counter[E_AXIS].wide -= current_block->step_event_count.wide; 23bdc: 84 1b sub r24, r20 23bde: 95 0b sbc r25, r21 23be0: a6 0b sbc r26, r22 23be2: b7 0b sbc r27, r23 23be4: 80 93 64 05 sts 0x0564, r24 ; 0x800564 23be8: 90 93 65 05 sts 0x0565, r25 ; 0x800565 23bec: a0 93 66 05 sts 0x0566, r26 ; 0x800566 23bf0: b0 93 67 05 sts 0x0567, r27 ; 0x800567 count_position[E_AXIS] += count_direction[E_AXIS]; 23bf4: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 23bf8: c0 90 58 06 lds r12, 0x0658 ; 0x800658 23bfc: d0 90 59 06 lds r13, 0x0659 ; 0x800659 23c00: e0 90 5a 06 lds r14, 0x065A ; 0x80065a 23c04: f0 90 5b 06 lds r15, 0x065B ; 0x80065b 23c08: 89 2f mov r24, r25 23c0a: 99 0f add r25, r25 23c0c: 99 0b sbc r25, r25 23c0e: aa 0b sbc r26, r26 23c10: bb 0b sbc r27, r27 23c12: 8c 0d add r24, r12 23c14: 9d 1d adc r25, r13 23c16: ae 1d adc r26, r14 23c18: bf 1d adc r27, r15 23c1a: 80 93 58 06 sts 0x0658, r24 ; 0x800658 23c1e: 90 93 59 06 sts 0x0659, r25 ; 0x800659 23c22: a0 93 5a 06 sts 0x065A, r26 ; 0x80065a 23c26: b0 93 5b 06 sts 0x065B, r27 ; 0x80065b #ifdef LIN_ADVANCE e_steps += count_direction[E_AXIS]; 23c2a: 90 91 5e 02 lds r25, 0x025E ; 0x80025e 23c2e: 80 91 69 05 lds r24, 0x0569 ; 0x800569 23c32: 89 0f add r24, r25 23c34: 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) 23c38: 80 91 53 05 lds r24, 0x0553 ; 0x800553 23c3c: 90 91 54 05 lds r25, 0x0554 ; 0x800554 23c40: a0 91 55 05 lds r26, 0x0555 ; 0x800555 23c44: b0 91 56 05 lds r27, 0x0556 ; 0x800556 23c48: 01 96 adiw r24, 0x01 ; 1 23c4a: a1 1d adc r26, r1 23c4c: b1 1d adc r27, r1 23c4e: 80 93 53 05 sts 0x0553, r24 ; 0x800553 23c52: 90 93 54 05 sts 0x0554, r25 ; 0x800554 23c56: a0 93 55 05 sts 0x0555, r26 ; 0x800555 23c5a: b0 93 56 05 sts 0x0556, r27 ; 0x800556 23c5e: 84 17 cp r24, r20 23c60: 95 07 cpc r25, r21 23c62: a6 07 cpc r26, r22 23c64: b7 07 cpc r27, r23 23c66: 10 f4 brcc .+4 ; 0x23c6c <__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) 23c68: cf 5f subi r28, 0xFF ; 255 23c6a: 8e ce rjmp .-740 ; 0x23988 <__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); 23c6c: 80 91 69 05 lds r24, 0x0569 ; 0x800569 23c70: 88 23 and r24, r24 23c72: 39 f0 breq .+14 ; 0x23c82 <__vector_17+0xa8e> 23c74: 87 ff sbrs r24, 7 23c76: f2 c0 rjmp .+484 ; 0x23e5c <__vector_17+0xc68> 23c78: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 23c7c: 80 64 ori r24, 0x40 ; 64 23c7e: 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) { 23c82: 40 91 53 05 lds r20, 0x0553 ; 0x800553 23c86: 50 91 54 05 lds r21, 0x0554 ; 0x800554 23c8a: 60 91 55 05 lds r22, 0x0555 ; 0x800555 23c8e: 70 91 56 05 lds r23, 0x0556 ; 0x800556 23c92: c0 91 51 12 lds r28, 0x1251 ; 0x801251 23c96: d0 91 52 12 lds r29, 0x1252 ; 0x801252 23c9a: 89 8d ldd r24, Y+25 ; 0x19 23c9c: 9a 8d ldd r25, Y+26 ; 0x1a 23c9e: ab 8d ldd r26, Y+27 ; 0x1b 23ca0: bc 8d ldd r27, Y+28 ; 0x1c 23ca2: 84 17 cp r24, r20 23ca4: 95 07 cpc r25, r21 23ca6: a6 07 cpc r26, r22 23ca8: b7 07 cpc r27, r23 23caa: 08 f4 brcc .+2 ; 0x23cae <__vector_17+0xaba> 23cac: 37 c1 rjmp .+622 ; 0x23f1c <__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); 23cae: c0 90 6c 05 lds r12, 0x056C ; 0x80056c 23cb2: d0 90 6d 05 lds r13, 0x056D ; 0x80056d 23cb6: e0 90 6e 05 lds r14, 0x056E ; 0x80056e 23cba: 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. ); 23cbe: 2c 89 ldd r18, Y+20 ; 0x14 23cc0: 3d 89 ldd r19, Y+21 ; 0x15 23cc2: 4e 89 ldd r20, Y+22 ; 0x16 23cc4: aa 27 eor r26, r26 23cc6: c3 9e mul r12, r19 23cc8: b1 2d mov r27, r1 23cca: d4 9e mul r13, r20 23ccc: c0 01 movw r24, r0 23cce: e4 9e mul r14, r20 23cd0: 90 0d add r25, r0 23cd2: e3 9e mul r14, r19 23cd4: 80 0d add r24, r0 23cd6: 91 1d adc r25, r1 23cd8: c4 9e mul r12, r20 23cda: b0 0d add r27, r0 23cdc: 81 1d adc r24, r1 23cde: 9a 1f adc r25, r26 23ce0: d3 9e mul r13, r19 23ce2: b0 0d add r27, r0 23ce4: 81 1d adc r24, r1 23ce6: 9a 1f adc r25, r26 23ce8: e2 9e mul r14, r18 23cea: b0 0d add r27, r0 23cec: 81 1d adc r24, r1 23cee: 9a 1f adc r25, r26 23cf0: d2 9e mul r13, r18 23cf2: b1 0d add r27, r1 23cf4: 8a 1f adc r24, r26 23cf6: 9a 1f adc r25, r26 23cf8: bb 0f add r27, r27 23cfa: 8a 1f adc r24, r26 23cfc: 9a 1f adc r25, r26 23cfe: 11 24 eor r1, r1 acc_step_rate += uint16_t(current_block->initial_rate); 23d00: 2a ad ldd r18, Y+58 ; 0x3a 23d02: 3b ad ldd r19, Y+59 ; 0x3b 23d04: 82 0f add r24, r18 23d06: 93 1f adc r25, r19 23d08: 90 93 72 05 sts 0x0572, r25 ; 0x800572 23d0c: 80 93 71 05 sts 0x0571, r24 ; 0x800571 // upper limit if(acc_step_rate > uint16_t(current_block->nominal_rate)) 23d10: 2e a9 ldd r18, Y+54 ; 0x36 23d12: 3f a9 ldd r19, Y+55 ; 0x37 23d14: 28 17 cp r18, r24 23d16: 39 07 cpc r19, r25 23d18: 20 f4 brcc .+8 ; 0x23d22 <__vector_17+0xb2e> acc_step_rate = current_block->nominal_rate; 23d1a: 30 93 72 05 sts 0x0572, r19 ; 0x800572 23d1e: 20 93 71 05 sts 0x0571, r18 ; 0x800571 // step_rate to timer interval uint16_t timer = calc_timer(acc_step_rate, step_loops); 23d22: 80 91 71 05 lds r24, 0x0571 ; 0x800571 23d26: 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; 23d2a: 81 34 cpi r24, 0x41 ; 65 23d2c: bc e9 ldi r27, 0x9C ; 156 23d2e: 9b 07 cpc r25, r27 23d30: 08 f0 brcs .+2 ; 0x23d34 <__vector_17+0xb40> 23d32: 98 c0 rjmp .+304 ; 0x23e64 <__vector_17+0xc70> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 23d34: 81 32 cpi r24, 0x21 ; 33 23d36: ee e4 ldi r30, 0x4E ; 78 23d38: 9e 07 cpc r25, r30 23d3a: 08 f4 brcc .+2 ; 0x23d3e <__vector_17+0xb4a> 23d3c: 96 c0 rjmp .+300 ; 0x23e6a <__vector_17+0xc76> step_rate = (step_rate >> 2)&0x3fff; 23d3e: 96 95 lsr r25 23d40: 87 95 ror r24 23d42: 96 95 lsr r25 23d44: 87 95 ror r24 step_loops = 4; 23d46: 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; 23d48: 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 23d4c: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 23d4e: 81 15 cp r24, r1 23d50: 28 e0 ldi r18, 0x08 ; 8 23d52: 92 07 cpc r25, r18 23d54: 08 f4 brcc .+2 ; 0x23d58 <__vector_17+0xb64> 23d56: 9b c0 rjmp .+310 ; 0x23e8e <__vector_17+0xc9a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 23d58: e9 2f mov r30, r25 23d5a: ff 27 eor r31, r31 23d5c: ee 0f add r30, r30 23d5e: ff 1f adc r31, r31 23d60: ee 0f add r30, r30 23d62: ff 1f adc r31, r31 23d64: 9f 01 movw r18, r30 23d66: 29 56 subi r18, 0x69 ; 105 23d68: 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); 23d6a: f9 01 movw r30, r18 23d6c: 32 96 adiw r30, 0x02 ; 2 23d6e: 45 91 lpm r20, Z+ 23d70: 54 91 lpm r21, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 23d72: f9 01 movw r30, r18 23d74: 25 91 lpm r18, Z+ 23d76: 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. ); 23d78: 58 9f mul r21, r24 23d7a: b0 01 movw r22, r0 23d7c: 48 9f mul r20, r24 23d7e: 00 0c add r0, r0 23d80: 61 1d adc r22, r1 23d82: 11 24 eor r1, r1 23d84: 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); 23d86: 26 1b sub r18, r22 23d88: 37 0b sbc r19, r23 23d8a: c9 01 movw r24, r18 23d8c: 24 36 cpi r18, 0x64 ; 100 23d8e: 31 05 cpc r19, r1 23d90: 10 f4 brcc .+4 ; 0x23d96 <__vector_17+0xba2> 23d92: 84 e6 ldi r24, 0x64 ; 100 23d94: 90 e0 ldi r25, 0x00 ; 0 _NEXT_ISR(timer); 23d96: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 23d9a: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.436> 23d9e: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.438+0x1> 23da2: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.438> acceleration_time += timer; 23da6: c8 0e add r12, r24 23da8: d9 1e adc r13, r25 23daa: e1 1c adc r14, r1 23dac: f1 1c adc r15, r1 23dae: c0 92 6c 05 sts 0x056C, r12 ; 0x80056c 23db2: d0 92 6d 05 sts 0x056D, r13 ; 0x80056d 23db6: e0 92 6e 05 sts 0x056E, r14 ; 0x80056e 23dba: f0 92 6f 05 sts 0x056F, r15 ; 0x80056f #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 23dbe: fe 01 movw r30, r28 23dc0: e4 5b subi r30, 0xB4 ; 180 23dc2: ff 4f sbci r31, 0xFF ; 255 23dc4: 80 81 ld r24, Z 23dc6: 81 11 cpse r24, r1 23dc8: 80 c0 rjmp .+256 ; 0x23eca <__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; 23dca: 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) { 23dcc: 80 ff sbrs r24, 0 23dce: 16 c0 rjmp .+44 ; 0x23dfc <__vector_17+0xc08> LA_phase = -1; 23dd0: 9f ef ldi r25, 0xFF ; 255 23dd2: 90 93 68 05 sts 0x0568, r25 ; 0x800568 if (current_adv_steps == target_adv_steps) { 23dd6: e0 91 48 04 lds r30, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> 23dda: f0 91 49 04 lds r31, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 23dde: 20 91 6a 05 lds r18, 0x056A ; 0x80056a 23de2: 30 91 6b 05 lds r19, 0x056B ; 0x80056b 23de6: e2 17 cp r30, r18 23de8: f3 07 cpc r31, r19 23dea: 09 f0 breq .+2 ; 0x23dee <__vector_17+0xbfa> 23dec: 27 c2 rjmp .+1102 ; 0x2423c <__vector_17+0x1048> // nothing to be done in this phase, cancel any pending eisr la_state = 0; nextAdvanceISR = ADV_NEVER; 23dee: 8f ef ldi r24, 0xFF ; 255 23df0: 9f ef ldi r25, 0xFF ; 255 23df2: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 23df6: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> 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; 23dfa: 80 e0 ldi r24, 0x00 ; 0 eISR_Err += current_block->advance_rate; LA_phase = 0; } } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { 23dfc: 80 fd sbrc r24, 0 23dfe: 07 c0 rjmp .+14 ; 0x23e0e <__vector_17+0xc1a> 23e00: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> 23e04: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 23e08: 01 96 adiw r24, 0x01 ; 1 23e0a: 09 f4 brne .+2 ; 0x23e0e <__vector_17+0xc1a> 23e0c: b7 c2 rjmp .+1390 ; 0x2437c <__vector_17+0x1188> // update timers & phase for the next iteration advance_spread(main_Rate); 23e0e: e0 91 4a 04 lds r30, 0x044A ; 0x80044a <_ZL9main_Rate.lto_priv.438> 23e12: f0 91 4b 04 lds r31, 0x044B ; 0x80044b <_ZL9main_Rate.lto_priv.438+0x1> else return ((uint32_t)0xAAAB * q) >> 17; } FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; 23e16: 80 91 49 05 lds r24, 0x0549 ; 0x800549 23e1a: 90 91 4a 05 lds r25, 0x054A ; 0x80054a 23e1e: a0 91 4b 05 lds r26, 0x054B ; 0x80054b 23e22: b0 91 4c 05 lds r27, 0x054C ; 0x80054c 23e26: 2c 01 movw r4, r24 23e28: 3d 01 movw r6, r26 23e2a: 4e 0e add r4, r30 23e2c: 5f 1e adc r5, r31 23e2e: 61 1c adc r6, r1 23e30: 71 1c adc r7, r1 uint8_t ticks = 0; while(eISR_Err >= current_block->advance_rate) 23e32: 9e 01 movw r18, r28 23e34: 23 5b subi r18, 0xB3 ; 179 23e36: 3f 4f sbci r19, 0xFF ; 255 23e38: d9 01 movw r26, r18 23e3a: cd 90 ld r12, X+ 23e3c: dc 90 ld r13, X 23e3e: f1 2c mov r15, r1 23e40: e1 2c mov r14, r1 FORCE_INLINE void advance_spread(uint16_t timer) { eISR_Err += timer; uint8_t ticks = 0; 23e42: 60 e0 ldi r22, 0x00 ; 0 while(eISR_Err >= current_block->advance_rate) 23e44: 4c 14 cp r4, r12 23e46: 5d 04 cpc r5, r13 23e48: 6e 04 cpc r6, r14 23e4a: 7f 04 cpc r7, r15 23e4c: 08 f4 brcc .+2 ; 0x23e50 <__vector_17+0xc5c> 23e4e: 26 c2 rjmp .+1100 ; 0x2429c <__vector_17+0x10a8> { ++ticks; 23e50: 6f 5f subi r22, 0xFF ; 255 eISR_Err -= current_block->advance_rate; 23e52: 4c 18 sub r4, r12 23e54: 5d 08 sbc r5, r13 23e56: 6e 08 sbc r6, r14 23e58: 7f 08 sbc r7, r15 23e5a: f4 cf rjmp .-24 ; 0x23e44 <__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); 23e5c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 23e60: 8f 7b andi r24, 0xBF ; 191 23e62: 0d cf rjmp .-486 ; 0x23c7e <__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; 23e64: 80 e4 ldi r24, 0x40 ; 64 23e66: 9c e9 ldi r25, 0x9C ; 156 23e68: 6a cf rjmp .-300 ; 0x23d3e <__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 23e6a: 81 31 cpi r24, 0x11 ; 17 23e6c: f7 e2 ldi r31, 0x27 ; 39 23e6e: 9f 07 cpc r25, r31 23e70: 20 f0 brcs .+8 ; 0x23e7a <__vector_17+0xc86> step_rate = (step_rate >> 1)&0x7fff; 23e72: 96 95 lsr r25 23e74: 87 95 ror r24 step_loops = 2; 23e76: 22 e0 ldi r18, 0x02 ; 2 23e78: 67 cf rjmp .-306 ; 0x23d48 <__vector_17+0xb54> } else { step_loops = 1; 23e7a: 21 e0 ldi r18, 0x01 ; 1 23e7c: 20 93 70 05 sts 0x0570, r18 ; 0x800570 23e80: 80 32 cpi r24, 0x20 ; 32 23e82: 91 05 cpc r25, r1 23e84: 08 f0 brcs .+2 ; 0x23e88 <__vector_17+0xc94> 23e86: 62 cf rjmp .-316 ; 0x23d4c <__vector_17+0xb58> 23e88: 80 e2 ldi r24, 0x20 ; 32 23e8a: 90 e0 ldi r25, 0x00 ; 0 23e8c: 5f cf rjmp .-322 ; 0x23d4c <__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; 23e8e: ac 01 movw r20, r24 23e90: 56 95 lsr r21 23e92: 47 95 ror r20 23e94: 4c 7f andi r20, 0xFC ; 252 23e96: 49 56 subi r20, 0x69 ; 105 23e98: 53 47 sbci r21, 0x73 ; 115 timer = (unsigned short)pgm_read_word_near(table_address); 23e9a: fa 01 movw r30, r20 23e9c: 25 91 lpm r18, Z+ 23e9e: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 23ea0: fa 01 movw r30, r20 23ea2: 32 96 adiw r30, 0x02 ; 2 23ea4: 65 91 lpm r22, Z+ 23ea6: 74 91 lpm r23, Z 23ea8: 87 70 andi r24, 0x07 ; 7 23eaa: 99 27 eor r25, r25 23eac: 86 9f mul r24, r22 23eae: a0 01 movw r20, r0 23eb0: 87 9f mul r24, r23 23eb2: 50 0d add r21, r0 23eb4: 96 9f mul r25, r22 23eb6: 50 0d add r21, r0 23eb8: 11 24 eor r1, r1 23eba: 73 e0 ldi r23, 0x03 ; 3 23ebc: 56 95 lsr r21 23ebe: 47 95 ror r20 23ec0: 7a 95 dec r23 23ec2: e1 f7 brne .-8 ; 0x23ebc <__vector_17+0xcc8> 23ec4: 24 1b sub r18, r20 23ec6: 35 0b sbc r19, r21 23ec8: 60 cf rjmp .-320 ; 0x23d8a <__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) { 23eca: 40 91 53 05 lds r20, 0x0553 ; 0x800553 23ece: 50 91 54 05 lds r21, 0x0554 ; 0x800554 23ed2: 60 91 55 05 lds r22, 0x0555 ; 0x800555 23ed6: 70 91 56 05 lds r23, 0x0556 ; 0x800556 23eda: 80 91 70 05 lds r24, 0x0570 ; 0x800570 23ede: 90 e0 ldi r25, 0x00 ; 0 23ee0: b0 e0 ldi r27, 0x00 ; 0 23ee2: a0 e0 ldi r26, 0x00 ; 0 23ee4: 84 17 cp r24, r20 23ee6: 95 07 cpc r25, r21 23ee8: a6 07 cpc r26, r22 23eea: b7 07 cpc r27, r23 23eec: 08 f4 brcc .+2 ; 0x23ef0 <__vector_17+0xcfc> 23eee: 6d cf rjmp .-294 ; 0x23dca <__vector_17+0xbd6> la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps > target_adv_steps) 23ef0: 80 91 57 05 lds r24, 0x0557 ; 0x800557 23ef4: 81 11 cpse r24, r1 23ef6: 02 c0 rjmp .+4 ; 0x23efc <__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; 23ef8: 83 e0 ldi r24, 0x03 ; 3 23efa: 68 cf rjmp .-304 ; 0x23dcc <__vector_17+0xbd8> if (e_extruding && current_adv_steps > target_adv_steps) 23efc: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> 23f00: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 23f04: 20 91 6a 05 lds r18, 0x056A ; 0x80056a 23f08: 30 91 6b 05 lds r19, 0x056B ; 0x80056b 23f0c: 28 17 cp r18, r24 23f0e: 39 07 cpc r19, r25 23f10: 98 f7 brcc .-26 ; 0x23ef8 <__vector_17+0xd04> target_adv_steps = current_adv_steps; 23f12: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b 23f16: 80 93 6a 05 sts 0x056A, r24 ; 0x80056a 23f1a: ee cf rjmp .-36 ; 0x23ef8 <__vector_17+0xd04> } } #endif } else if (step_events_completed.wide > current_block->decelerate_after) { 23f1c: 80 91 53 05 lds r24, 0x0553 ; 0x800553 23f20: 90 91 54 05 lds r25, 0x0554 ; 0x800554 23f24: a0 91 55 05 lds r26, 0x0555 ; 0x800555 23f28: b0 91 56 05 lds r27, 0x0556 ; 0x800556 23f2c: 4d 8d ldd r20, Y+29 ; 0x1d 23f2e: 5e 8d ldd r21, Y+30 ; 0x1e 23f30: 6f 8d ldd r22, Y+31 ; 0x1f 23f32: 78 a1 ldd r23, Y+32 ; 0x20 23f34: 48 17 cp r20, r24 23f36: 59 07 cpc r21, r25 23f38: 6a 07 cpc r22, r26 23f3a: 7b 07 cpc r23, r27 23f3c: 08 f0 brcs .+2 ; 0x23f40 <__vector_17+0xd4c> 23f3e: e3 c0 rjmp .+454 ; 0x24106 <__vector_17+0xf12> uint16_t step_rate = MUL24x24R24(deceleration_time, current_block->acceleration_rate); 23f40: c0 90 74 05 lds r12, 0x0574 ; 0x800574 23f44: d0 90 75 05 lds r13, 0x0575 ; 0x800575 23f48: e0 90 76 05 lds r14, 0x0576 ; 0x800576 23f4c: 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. ); 23f50: 6c 88 ldd r6, Y+20 ; 0x14 23f52: 7d 88 ldd r7, Y+21 ; 0x15 23f54: 8e 88 ldd r8, Y+22 ; 0x16 23f56: aa 27 eor r26, r26 23f58: c7 9c mul r12, r7 23f5a: b1 2d mov r27, r1 23f5c: d8 9c mul r13, r8 23f5e: f0 01 movw r30, r0 23f60: e8 9c mul r14, r8 23f62: f0 0d add r31, r0 23f64: e7 9c mul r14, r7 23f66: e0 0d add r30, r0 23f68: f1 1d adc r31, r1 23f6a: c8 9c mul r12, r8 23f6c: b0 0d add r27, r0 23f6e: e1 1d adc r30, r1 23f70: fa 1f adc r31, r26 23f72: d7 9c mul r13, r7 23f74: b0 0d add r27, r0 23f76: e1 1d adc r30, r1 23f78: fa 1f adc r31, r26 23f7a: e6 9c mul r14, r6 23f7c: b0 0d add r27, r0 23f7e: e1 1d adc r30, r1 23f80: fa 1f adc r31, r26 23f82: d6 9c mul r13, r6 23f84: b1 0d add r27, r1 23f86: ea 1f adc r30, r26 23f88: fa 1f adc r31, r26 23f8a: bb 0f add r27, r27 23f8c: ea 1f adc r30, r26 23f8e: fa 1f adc r31, r26 23f90: 11 24 eor r1, r1 if (step_rate > acc_step_rate) { // Check step_rate stays positive 23f92: 20 91 71 05 lds r18, 0x0571 ; 0x800571 23f96: 30 91 72 05 lds r19, 0x0572 ; 0x800572 23f9a: 8e ad ldd r24, Y+62 ; 0x3e 23f9c: 9f ad ldd r25, Y+63 ; 0x3f 23f9e: 2e 17 cp r18, r30 23fa0: 3f 07 cpc r19, r31 23fa2: 30 f0 brcs .+12 ; 0x23fb0 <__vector_17+0xdbc> step_rate = uint16_t(current_block->final_rate); } else { step_rate = acc_step_rate - step_rate; // Decelerate from acceleration end point. 23fa4: 2e 1b sub r18, r30 23fa6: 3f 0b sbc r19, r31 23fa8: 82 17 cp r24, r18 23faa: 93 07 cpc r25, r19 23fac: 08 f4 brcc .+2 ; 0x23fb0 <__vector_17+0xdbc> 23fae: 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; 23fb0: 81 34 cpi r24, 0x41 ; 65 23fb2: ac e9 ldi r26, 0x9C ; 156 23fb4: 9a 07 cpc r25, r26 23fb6: 08 f0 brcs .+2 ; 0x23fba <__vector_17+0xdc6> 23fb8: 75 c0 rjmp .+234 ; 0x240a4 <__vector_17+0xeb0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 23fba: 81 32 cpi r24, 0x21 ; 33 23fbc: be e4 ldi r27, 0x4E ; 78 23fbe: 9b 07 cpc r25, r27 23fc0: 08 f4 brcc .+2 ; 0x23fc4 <__vector_17+0xdd0> 23fc2: 73 c0 rjmp .+230 ; 0x240aa <__vector_17+0xeb6> step_rate = (step_rate >> 2)&0x3fff; 23fc4: 96 95 lsr r25 23fc6: 87 95 ror r24 23fc8: 96 95 lsr r25 23fca: 87 95 ror r24 step_loops = 4; 23fcc: 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; 23fce: 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 23fd2: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 23fd4: 81 15 cp r24, r1 23fd6: f8 e0 ldi r31, 0x08 ; 8 23fd8: 9f 07 cpc r25, r31 23fda: 08 f4 brcc .+2 ; 0x23fde <__vector_17+0xdea> 23fdc: 78 c0 rjmp .+240 ; 0x240ce <__vector_17+0xeda> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 23fde: e9 2f mov r30, r25 23fe0: ff 27 eor r31, r31 23fe2: ee 0f add r30, r30 23fe4: ff 1f adc r31, r31 23fe6: ee 0f add r30, r30 23fe8: ff 1f adc r31, r31 23fea: 9f 01 movw r18, r30 23fec: 29 56 subi r18, 0x69 ; 105 23fee: 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); 23ff0: f9 01 movw r30, r18 23ff2: 32 96 adiw r30, 0x02 ; 2 23ff4: a5 91 lpm r26, Z+ 23ff6: b4 91 lpm r27, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 23ff8: f9 01 movw r30, r18 23ffa: 25 91 lpm r18, Z+ 23ffc: 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. ); 23ffe: b8 9f mul r27, r24 24000: f0 01 movw r30, r0 24002: a8 9f mul r26, r24 24004: 00 0c add r0, r0 24006: e1 1d adc r30, r1 24008: 11 24 eor r1, r1 2400a: 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); 2400c: 2e 1b sub r18, r30 2400e: 3f 0b sbc r19, r31 24010: c9 01 movw r24, r18 24012: 24 36 cpi r18, 0x64 ; 100 24014: 31 05 cpc r19, r1 24016: 10 f4 brcc .+4 ; 0x2401c <__vector_17+0xe28> 24018: 84 e6 ldi r24, 0x64 ; 100 2401a: 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); 2401c: 90 93 4f 04 sts 0x044F, r25 ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 24020: 80 93 4e 04 sts 0x044E, r24 ; 0x80044e <_ZL11nextMainISR.lto_priv.436> 24024: 90 93 4b 04 sts 0x044B, r25 ; 0x80044b <_ZL9main_Rate.lto_priv.438+0x1> 24028: 80 93 4a 04 sts 0x044A, r24 ; 0x80044a <_ZL9main_Rate.lto_priv.438> deceleration_time += timer; 2402c: c8 0e add r12, r24 2402e: d9 1e adc r13, r25 24030: e1 1c adc r14, r1 24032: f1 1c adc r15, r1 24034: c0 92 74 05 sts 0x0574, r12 ; 0x800574 24038: d0 92 75 05 sts 0x0575, r13 ; 0x800575 2403c: e0 92 76 05 sts 0x0576, r14 ; 0x800576 24040: f0 92 77 05 sts 0x0577, r15 ; 0x800577 #ifdef LIN_ADVANCE if (current_block->use_advance_lead) { 24044: fe 01 movw r30, r28 24046: e4 5b subi r30, 0xB4 ; 180 24048: ff 4f sbci r31, 0xFF ; 255 2404a: 80 81 ld r24, Z 2404c: 88 23 and r24, r24 2404e: 09 f4 brne .+2 ; 0x24052 <__vector_17+0xe5e> 24050: bc ce rjmp .-648 ; 0x23dca <__vector_17+0xbd6> if (step_events_completed.wide <= current_block->decelerate_after + step_loops) { 24052: 80 91 53 05 lds r24, 0x0553 ; 0x800553 24056: 90 91 54 05 lds r25, 0x0554 ; 0x800554 2405a: a0 91 55 05 lds r26, 0x0555 ; 0x800555 2405e: b0 91 56 05 lds r27, 0x0556 ; 0x800556 24062: 20 91 70 05 lds r18, 0x0570 ; 0x800570 24066: 42 0f add r20, r18 24068: 51 1d adc r21, r1 2406a: 61 1d adc r22, r1 2406c: 71 1d adc r23, r1 2406e: 48 17 cp r20, r24 24070: 59 07 cpc r21, r25 24072: 6a 07 cpc r22, r26 24074: 7b 07 cpc r23, r27 24076: 08 f4 brcc .+2 ; 0x2407a <__vector_17+0xe86> 24078: a8 ce rjmp .-688 ; 0x23dca <__vector_17+0xbd6> target_adv_steps = current_block->final_adv_steps; 2407a: 35 96 adiw r30, 0x05 ; 5 2407c: 20 81 ld r18, Z 2407e: 31 81 ldd r19, Z+1 ; 0x01 24080: 30 93 6b 05 sts 0x056B, r19 ; 0x80056b 24084: 20 93 6a 05 sts 0x056A, r18 ; 0x80056a la_state = ADV_INIT | ADV_ACC_VARY; if (e_extruding && current_adv_steps < target_adv_steps) 24088: 80 91 57 05 lds r24, 0x0557 ; 0x800557 2408c: 88 23 and r24, r24 2408e: 09 f4 brne .+2 ; 0x24092 <__vector_17+0xe9e> 24090: 33 cf rjmp .-410 ; 0x23ef8 <__vector_17+0xd04> 24092: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> 24096: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 2409a: 82 17 cp r24, r18 2409c: 93 07 cpc r25, r19 2409e: 08 f0 brcs .+2 ; 0x240a2 <__vector_17+0xeae> 240a0: 2b cf rjmp .-426 ; 0x23ef8 <__vector_17+0xd04> 240a2: 37 cf rjmp .-402 ; 0x23f12 <__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; 240a4: 80 e4 ldi r24, 0x40 ; 64 240a6: 9c e9 ldi r25, 0x9C ; 156 240a8: 8d cf rjmp .-230 ; 0x23fc4 <__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 240aa: 81 31 cpi r24, 0x11 ; 17 240ac: e7 e2 ldi r30, 0x27 ; 39 240ae: 9e 07 cpc r25, r30 240b0: 20 f0 brcs .+8 ; 0x240ba <__vector_17+0xec6> step_rate = (step_rate >> 1)&0x7fff; 240b2: 96 95 lsr r25 240b4: 87 95 ror r24 step_loops = 2; 240b6: 22 e0 ldi r18, 0x02 ; 2 240b8: 8a cf rjmp .-236 ; 0x23fce <__vector_17+0xdda> } else { step_loops = 1; 240ba: 21 e0 ldi r18, 0x01 ; 1 240bc: 20 93 70 05 sts 0x0570, r18 ; 0x800570 240c0: 80 32 cpi r24, 0x20 ; 32 240c2: 91 05 cpc r25, r1 240c4: 08 f0 brcs .+2 ; 0x240c8 <__vector_17+0xed4> 240c6: 85 cf rjmp .-246 ; 0x23fd2 <__vector_17+0xdde> 240c8: 80 e2 ldi r24, 0x20 ; 32 240ca: 90 e0 ldi r25, 0x00 ; 0 240cc: 82 cf rjmp .-252 ; 0x23fd2 <__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; 240ce: dc 01 movw r26, r24 240d0: b6 95 lsr r27 240d2: a7 95 ror r26 240d4: ac 7f andi r26, 0xFC ; 252 240d6: a9 56 subi r26, 0x69 ; 105 240d8: b3 47 sbci r27, 0x73 ; 115 timer = (unsigned short)pgm_read_word_near(table_address); 240da: fd 01 movw r30, r26 240dc: 25 91 lpm r18, Z+ 240de: 34 91 lpm r19, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 240e0: fd 01 movw r30, r26 240e2: 32 96 adiw r30, 0x02 ; 2 240e4: a5 91 lpm r26, Z+ 240e6: b4 91 lpm r27, Z 240e8: 87 70 andi r24, 0x07 ; 7 240ea: 99 27 eor r25, r25 240ec: 8a 9f mul r24, r26 240ee: f0 01 movw r30, r0 240f0: 8b 9f mul r24, r27 240f2: f0 0d add r31, r0 240f4: 9a 9f mul r25, r26 240f6: f0 0d add r31, r0 240f8: 11 24 eor r1, r1 240fa: a3 e0 ldi r26, 0x03 ; 3 240fc: f6 95 lsr r31 240fe: e7 95 ror r30 24100: aa 95 dec r26 24102: e1 f7 brne .-8 ; 0x240fc <__vector_17+0xf08> 24104: 83 cf rjmp .-250 ; 0x2400c <__vector_17+0xe18> } } #endif } else { if (! step_loops_nominal) { 24106: 80 91 73 05 lds r24, 0x0573 ; 0x800573 2410a: 88 23 and r24, r24 2410c: 71 f0 breq .+28 ; 0x2412a <__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; 2410e: 80 e0 ldi r24, 0x00 ; 0 if (e_extruding) target_adv_steps = current_adv_steps; } #endif } _NEXT_ISR(OCR1A_nominal); 24110: 20 91 4d 05 lds r18, 0x054D ; 0x80054d 24114: 30 91 4e 05 lds r19, 0x054E ; 0x80054e 24118: 30 93 4f 04 sts 0x044F, r19 ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 2411c: 20 93 4e 04 sts 0x044E, r18 ; 0x80044e <_ZL11nextMainISR.lto_priv.436> 24120: 30 93 4b 04 sts 0x044B, r19 ; 0x80044b <_ZL9main_Rate.lto_priv.438+0x1> 24124: 20 93 4a 04 sts 0x044A, r18 ; 0x80044a <_ZL9main_Rate.lto_priv.438> 24128: 51 ce rjmp .-862 ; 0x23dcc <__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); 2412a: 8e a9 ldd r24, Y+54 ; 0x36 2412c: 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; 2412e: 81 34 cpi r24, 0x41 ; 65 24130: 2c e9 ldi r18, 0x9C ; 156 24132: 92 07 cpc r25, r18 24134: 08 f0 brcs .+2 ; 0x24138 <__vector_17+0xf44> 24136: 4e c0 rjmp .+156 ; 0x241d4 <__vector_17+0xfe0> if(step_rate > 20000) { // If steprate > 20kHz >> step 4 times 24138: 81 32 cpi r24, 0x21 ; 33 2413a: 4e e4 ldi r20, 0x4E ; 78 2413c: 94 07 cpc r25, r20 2413e: 08 f4 brcc .+2 ; 0x24142 <__vector_17+0xf4e> 24140: 4c c0 rjmp .+152 ; 0x241da <__vector_17+0xfe6> step_rate = (step_rate >> 2)&0x3fff; 24142: 96 95 lsr r25 24144: 87 95 ror r24 24146: 96 95 lsr r25 24148: 87 95 ror r24 step_loops = 4; 2414a: 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; 2414c: 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 24150: 80 97 sbiw r24, 0x20 ; 32 if(step_rate >= (8*256)){ // higher step rate 24152: 81 15 cp r24, r1 24154: a8 e0 ldi r26, 0x08 ; 8 24156: 9a 07 cpc r25, r26 24158: 08 f4 brcc .+2 ; 0x2415c <__vector_17+0xf68> 2415a: 51 c0 rjmp .+162 ; 0x241fe <__vector_17+0x100a> unsigned short table_address = (unsigned short)&speed_lookuptable_fast[(unsigned char)(step_rate>>8)][0]; 2415c: e9 2f mov r30, r25 2415e: ff 27 eor r31, r31 24160: ee 0f add r30, r30 24162: ff 1f adc r31, r31 24164: ee 0f add r30, r30 24166: ff 1f adc r31, r31 24168: 9f 01 movw r18, r30 2416a: 29 56 subi r18, 0x69 ; 105 2416c: 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); 2416e: f9 01 movw r30, r18 24170: 32 96 adiw r30, 0x02 ; 2 24172: 65 91 lpm r22, Z+ 24174: 74 91 lpm r23, Z timer = (unsigned short)pgm_read_word_near(table_address) - MUL8x16R8(tmp_step_rate, gain); 24176: f9 01 movw r30, r18 24178: 25 91 lpm r18, Z+ 2417a: 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. ); 2417c: 78 9f mul r23, r24 2417e: a0 01 movw r20, r0 24180: 68 9f mul r22, r24 24182: 00 0c add r0, r0 24184: 41 1d adc r20, r1 24186: 11 24 eor r1, r1 24188: 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); 2418a: c9 01 movw r24, r18 2418c: 84 1b sub r24, r20 2418e: 95 0b sbc r25, r21 24190: 84 36 cpi r24, 0x64 ; 100 24192: 91 05 cpc r25, r1 24194: 10 f4 brcc .+4 ; 0x2419a <__vector_17+0xfa6> 24196: 84 e6 ldi r24, 0x64 ; 100 24198: 90 e0 ldi r25, 0x00 ; 0 2419a: 90 93 4e 05 sts 0x054E, r25 ; 0x80054e 2419e: 80 93 4d 05 sts 0x054D, r24 ; 0x80054d step_loops_nominal = step_loops; 241a2: 80 91 70 05 lds r24, 0x0570 ; 0x800570 241a6: 80 93 73 05 sts 0x0573, r24 ; 0x800573 #ifdef LIN_ADVANCE if(current_block->use_advance_lead) { 241aa: fe 01 movw r30, r28 241ac: e4 5b subi r30, 0xB4 ; 180 241ae: ff 4f sbci r31, 0xFF ; 255 241b0: 80 81 ld r24, Z 241b2: 88 23 and r24, r24 241b4: 09 f4 brne .+2 ; 0x241b8 <__vector_17+0xfc4> 241b6: ab cf rjmp .-170 ; 0x2410e <__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) 241b8: 80 91 57 05 lds r24, 0x0557 ; 0x800557 241bc: 88 23 and r24, r24 241be: 41 f0 breq .+16 ; 0x241d0 <__vector_17+0xfdc> target_adv_steps = current_adv_steps; 241c0: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> 241c4: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 241c8: 90 93 6b 05 sts 0x056B, r25 ; 0x80056b 241cc: 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; 241d0: 81 e0 ldi r24, 0x01 ; 1 241d2: 9e cf rjmp .-196 ; 0x24110 <__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; 241d4: 80 e4 ldi r24, 0x40 ; 64 241d6: 9c e9 ldi r25, 0x9C ; 156 241d8: b4 cf rjmp .-152 ; 0x24142 <__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 241da: 81 31 cpi r24, 0x11 ; 17 241dc: 57 e2 ldi r21, 0x27 ; 39 241de: 95 07 cpc r25, r21 241e0: 20 f0 brcs .+8 ; 0x241ea <__vector_17+0xff6> step_rate = (step_rate >> 1)&0x7fff; 241e2: 96 95 lsr r25 241e4: 87 95 ror r24 step_loops = 2; 241e6: 22 e0 ldi r18, 0x02 ; 2 241e8: b1 cf rjmp .-158 ; 0x2414c <__vector_17+0xf58> } else { step_loops = 1; 241ea: 21 e0 ldi r18, 0x01 ; 1 241ec: 20 93 70 05 sts 0x0570, r18 ; 0x800570 241f0: 80 32 cpi r24, 0x20 ; 32 241f2: 91 05 cpc r25, r1 241f4: 08 f0 brcs .+2 ; 0x241f8 <__vector_17+0x1004> 241f6: ac cf rjmp .-168 ; 0x24150 <__vector_17+0xf5c> 241f8: 80 e2 ldi r24, 0x20 ; 32 241fa: 90 e0 ldi r25, 0x00 ; 0 241fc: a9 cf rjmp .-174 ; 0x24150 <__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; 241fe: 9c 01 movw r18, r24 24200: 36 95 lsr r19 24202: 27 95 ror r18 24204: 2c 7f andi r18, 0xFC ; 252 24206: 29 56 subi r18, 0x69 ; 105 24208: 33 47 sbci r19, 0x73 ; 115 timer = (unsigned short)pgm_read_word_near(table_address); 2420a: f9 01 movw r30, r18 2420c: 45 91 lpm r20, Z+ 2420e: 54 91 lpm r21, Z timer -= (((unsigned short)pgm_read_word_near(table_address+2) * (unsigned char)(step_rate & 0x0007))>>3); 24210: f9 01 movw r30, r18 24212: 32 96 adiw r30, 0x02 ; 2 24214: 65 91 lpm r22, Z+ 24216: 74 91 lpm r23, Z 24218: 87 70 andi r24, 0x07 ; 7 2421a: 99 27 eor r25, r25 2421c: 86 9f mul r24, r22 2421e: 90 01 movw r18, r0 24220: 87 9f mul r24, r23 24222: 30 0d add r19, r0 24224: 96 9f mul r25, r22 24226: 30 0d add r19, r0 24228: 11 24 eor r1, r1 2422a: a3 e0 ldi r26, 0x03 ; 3 2422c: 36 95 lsr r19 2422e: 27 95 ror r18 24230: aa 95 dec r26 24232: e1 f7 brne .-8 ; 0x2422c <__vector_17+0x1038> 24234: ca 01 movw r24, r20 24236: 82 1b sub r24, r18 24238: 93 0b sbc r25, r19 2423a: aa cf rjmp .-172 ; 0x24190 <__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; 2423c: de 01 movw r26, r28 2423e: a3 5b subi r26, 0xB3 ; 179 24240: bf 4f sbci r27, 0xFF ; 255 24242: 4d 91 ld r20, X+ 24244: 5c 91 ld r21, X 24246: 11 97 sbiw r26, 0x01 ; 1 24248: 70 e0 ldi r23, 0x00 ; 0 2424a: 60 e0 ldi r22, 0x00 ; 0 2424c: 40 93 49 05 sts 0x0549, r20 ; 0x800549 24250: 50 93 4a 05 sts 0x054A, r21 ; 0x80054a 24254: 60 93 4b 05 sts 0x054B, r22 ; 0x80054b 24258: 70 93 4c 05 sts 0x054C, r23 ; 0x80054c e_step_loops = current_block->advance_step_loops; 2425c: 16 96 adiw r26, 0x06 ; 6 2425e: 9c 91 ld r25, X 24260: 90 93 48 05 sts 0x0548, r25 ; 0x800548 if ((la_state & ADV_ACC_VARY) && e_extruding && (current_adv_steps > target_adv_steps)) { 24264: 98 2f mov r25, r24 24266: 92 70 andi r25, 0x02 ; 2 24268: 09 f4 brne .+2 ; 0x2426c <__vector_17+0x1078> 2426a: c8 cd rjmp .-1136 ; 0x23dfc <__vector_17+0xc08> 2426c: 90 91 57 05 lds r25, 0x0557 ; 0x800557 24270: 99 23 and r25, r25 24272: 09 f4 brne .+2 ; 0x24276 <__vector_17+0x1082> 24274: c3 cd rjmp .-1146 ; 0x23dfc <__vector_17+0xc08> 24276: 2e 17 cp r18, r30 24278: 3f 07 cpc r19, r31 2427a: 08 f0 brcs .+2 ; 0x2427e <__vector_17+0x108a> 2427c: bf cd rjmp .-1154 ; 0x23dfc <__vector_17+0xc08> // LA could reverse the direction of extrusion in this phase eISR_Err += current_block->advance_rate; 2427e: 44 0f add r20, r20 24280: 55 1f adc r21, r21 24282: 66 1f adc r22, r22 24284: 77 1f adc r23, r23 24286: 40 93 49 05 sts 0x0549, r20 ; 0x800549 2428a: 50 93 4a 05 sts 0x054A, r21 ; 0x80054a 2428e: 60 93 4b 05 sts 0x054B, r22 ; 0x80054b 24292: 70 93 4c 05 sts 0x054C, r23 ; 0x80054c LA_phase = 0; 24296: 10 92 68 05 sts 0x0568, r1 ; 0x800568 2429a: b0 cd rjmp .-1184 ; 0x23dfc <__vector_17+0xc08> 2429c: 40 92 49 05 sts 0x0549, r4 ; 0x800549 242a0: 50 92 4a 05 sts 0x054A, r5 ; 0x80054a 242a4: 60 92 4b 05 sts 0x054B, r6 ; 0x80054b 242a8: 70 92 4c 05 sts 0x054C, r7 ; 0x80054c while(eISR_Err >= current_block->advance_rate) { ++ticks; eISR_Err -= current_block->advance_rate; } if(!ticks) 242ac: 61 11 cpse r22, r1 242ae: 1d c0 rjmp .+58 ; 0x242ea <__vector_17+0x10f6> { eISR_Rate = timer; 242b0: f0 93 47 05 sts 0x0547, r31 ; 0x800547 242b4: e0 93 46 05 sts 0x0546, r30 ; 0x800546 nextAdvanceISR = timer; 242b8: f0 93 4d 04 sts 0x044D, r31 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 242bc: e0 93 4c 04 sts 0x044C, r30 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> } } if (la_state & ADV_INIT || nextAdvanceISR != ADV_NEVER) { // update timers & phase for the next iteration advance_spread(main_Rate); if (LA_phase >= 0) { 242c0: 80 91 68 05 lds r24, 0x0568 ; 0x800568 242c4: 87 fd sbrc r24, 7 242c6: 5a c0 rjmp .+180 ; 0x2437c <__vector_17+0x1188> if (step_loops == e_step_loops) 242c8: 80 91 70 05 lds r24, 0x0570 ; 0x800570 242cc: 10 91 48 05 lds r17, 0x0548 ; 0x800548 242d0: c3 5b subi r28, 0xB3 ; 179 242d2: df 4f sbci r29, 0xFF ; 255 242d4: 28 81 ld r18, Y 242d6: 39 81 ldd r19, Y+1 ; 0x01 242d8: 81 13 cpse r24, r17 242da: 35 c0 rjmp .+106 ; 0x24346 <__vector_17+0x1152> LA_phase = (current_block->advance_rate < main_Rate); 242dc: 81 e0 ldi r24, 0x01 ; 1 242de: 2e 17 cp r18, r30 242e0: 3f 07 cpc r19, r31 242e2: 08 f4 brcc .+2 ; 0x242e6 <__vector_17+0x10f2> 242e4: 49 c0 rjmp .+146 ; 0x24378 <__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); 242e6: 80 e0 ldi r24, 0x00 ; 0 242e8: 47 c0 rjmp .+142 ; 0x24378 <__vector_17+0x1184> eISR_Rate = timer; nextAdvanceISR = timer; return; } if (ticks <= 3) 242ea: 64 30 cpi r22, 0x04 ; 4 242ec: 28 f5 brcc .+74 ; 0x24338 <__vector_17+0x1144> eISR_Rate = fastdiv(timer, ticks + 1); 242ee: 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); 242f0: 63 30 cpi r22, 0x03 ; 3 242f2: a9 f0 breq .+42 ; 0x2431e <__vector_17+0x112a> 242f4: 66 95 lsr r22 242f6: af 01 movw r20, r30 242f8: 02 c0 rjmp .+4 ; 0x242fe <__vector_17+0x110a> 242fa: 56 95 lsr r21 242fc: 47 95 ror r20 242fe: 6a 95 dec r22 24300: e2 f7 brpl .-8 ; 0x242fa <__vector_17+0x1106> 24302: 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); 24304: 70 93 47 05 sts 0x0547, r23 ; 0x800547 24308: 60 93 46 05 sts 0x0546, r22 ; 0x800546 } nextAdvanceISR = eISR_Rate; 2430c: 80 91 46 05 lds r24, 0x0546 ; 0x800546 24310: 90 91 47 05 lds r25, 0x0547 ; 0x800547 24314: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 24318: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> 2431c: d1 cf rjmp .-94 ; 0x242c0 <__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; 2431e: 9f 01 movw r18, r30 24320: ab ea ldi r26, 0xAB ; 171 24322: ba ea ldi r27, 0xAA ; 170 24324: 0f 94 21 a5 call 0x34a42 ; 0x34a42 <__umulhisi3> 24328: 41 e1 ldi r20, 0x11 ; 17 2432a: 96 95 lsr r25 2432c: 87 95 ror r24 2432e: 77 95 ror r23 24330: 67 95 ror r22 24332: 4a 95 dec r20 24334: d1 f7 brne .-12 ; 0x2432a <__vector_17+0x1136> 24336: e6 cf rjmp .-52 ; 0x24304 <__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); 24338: 70 e0 ldi r23, 0x00 ; 0 2433a: 6f 5f subi r22, 0xFF ; 255 2433c: 7f 4f sbci r23, 0xFF ; 255 2433e: cf 01 movw r24, r30 24340: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> 24344: df cf rjmp .-66 ; 0x24304 <__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); 24346: 83 30 cpi r24, 0x03 ; 3 24348: 09 f4 brne .+2 ; 0x2434c <__vector_17+0x1158> 2434a: a2 c0 rjmp .+324 ; 0x24490 <__vector_17+0x129c> 2434c: 86 95 lsr r24 2434e: a9 01 movw r20, r18 24350: 02 c0 rjmp .+4 ; 0x24356 <__vector_17+0x1162> 24352: 56 95 lsr r21 24354: 47 95 ror r20 24356: 8a 95 dec r24 24358: e2 f7 brpl .-8 ; 0x24352 <__vector_17+0x115e> 2435a: 13 30 cpi r17, 0x03 ; 3 2435c: 09 f4 brne .+2 ; 0x24360 <__vector_17+0x116c> 2435e: a6 c0 rjmp .+332 ; 0x244ac <__vector_17+0x12b8> 24360: 16 95 lsr r17 24362: bf 01 movw r22, r30 24364: 02 c0 rjmp .+4 ; 0x2436a <__vector_17+0x1176> 24366: 76 95 lsr r23 24368: 67 95 ror r22 2436a: 1a 95 dec r17 2436c: e2 f7 brpl .-8 ; 0x24366 <__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); 2436e: 81 e0 ldi r24, 0x01 ; 1 24370: 46 17 cp r20, r22 24372: 57 07 cpc r21, r23 24374: 08 f0 brcs .+2 ; 0x24378 <__vector_17+0x1184> 24376: b7 cf rjmp .-146 ; 0x242e6 <__vector_17+0x10f2> 24378: 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(); 2437c: 0f 94 b8 00 call 0x20170 ; 0x20170 #endif // If current block is finished, reset pointer if (step_events_completed.wide >= current_block->step_event_count.wide) { 24380: 40 91 53 05 lds r20, 0x0553 ; 0x800553 24384: 50 91 54 05 lds r21, 0x0554 ; 0x800554 24388: 60 91 55 05 lds r22, 0x0555 ; 0x800555 2438c: 70 91 56 05 lds r23, 0x0556 ; 0x800556 24390: e0 91 51 12 lds r30, 0x1251 ; 0x801251 24394: f0 91 52 12 lds r31, 0x1252 ; 0x801252 24398: 80 89 ldd r24, Z+16 ; 0x10 2439a: 91 89 ldd r25, Z+17 ; 0x11 2439c: a2 89 ldd r26, Z+18 ; 0x12 2439e: b3 89 ldd r27, Z+19 ; 0x13 243a0: 48 17 cp r20, r24 243a2: 59 07 cpc r21, r25 243a4: 6a 07 cpc r22, r26 243a6: 7b 07 cpc r23, r27 243a8: 80 f0 brcs .+32 ; 0x243ca <__vector_17+0x11d6> current_block = NULL; 243aa: 10 92 52 12 sts 0x1252, r1 ; 0x801252 243ae: 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) { 243b2: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 243b6: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 243ba: 98 17 cp r25, r24 243bc: 31 f0 breq .+12 ; 0x243ca <__vector_17+0x11d6> block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 243be: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 243c2: 8f 5f subi r24, 0xFF ; 255 243c4: 8f 70 andi r24, 0x0F ; 15 243c6: 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; 243ca: 60 91 4c 04 lds r22, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> 243ce: 70 91 4d 04 lds r23, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> if (eisr) 243d2: 61 15 cp r22, r1 243d4: 71 05 cpc r23, r1 243d6: 09 f0 breq .+2 ; 0x243da <__vector_17+0x11e6> 243d8: 46 c0 rjmp .+140 ; 0x24466 <__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) { 243da: 40 91 48 04 lds r20, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> 243de: 50 91 49 04 lds r21, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 243e2: 20 91 6a 05 lds r18, 0x056A ; 0x80056a 243e6: 30 91 6b 05 lds r19, 0x056B ; 0x80056b 243ea: 80 91 69 05 lds r24, 0x0569 ; 0x800569 243ee: 24 17 cp r18, r20 243f0: 35 07 cpc r19, r21 243f2: 08 f0 brcs .+2 ; 0x243f6 <__vector_17+0x1202> 243f4: 6c c0 rjmp .+216 ; 0x244ce <__vector_17+0x12da> // decompression if (e_step_loops != 1) { 243f6: 90 91 48 05 lds r25, 0x0548 ; 0x800548 243fa: 91 30 cpi r25, 0x01 ; 1 243fc: 41 f0 breq .+16 ; 0x2440e <__vector_17+0x121a> uint16_t d_steps = current_adv_steps - target_adv_steps; 243fe: 42 1b sub r20, r18 24400: 53 0b sbc r21, r19 if (d_steps < e_step_loops) 24402: 94 17 cp r25, r20 24404: 15 06 cpc r1, r21 24406: 19 f0 breq .+6 ; 0x2440e <__vector_17+0x121a> 24408: 10 f0 brcs .+4 ; 0x2440e <__vector_17+0x121a> e_step_loops = d_steps; 2440a: 40 93 48 05 sts 0x0548, r20 ; 0x800548 } e_steps -= e_step_loops; 2440e: 90 91 48 05 lds r25, 0x0548 ; 0x800548 24412: 89 1b sub r24, r25 24414: 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); 24418: 88 23 and r24, r24 2441a: 39 f0 breq .+14 ; 0x2442a <__vector_17+0x1236> 2441c: 87 ff sbrs r24, 7 2441e: 53 c0 rjmp .+166 ; 0x244c6 <__vector_17+0x12d2> 24420: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24424: 80 64 ori r24, 0x40 ; 64 24426: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps -= e_step_loops; 2442a: 20 91 48 05 lds r18, 0x0548 ; 0x800548 2442e: 80 91 48 04 lds r24, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> 24432: 90 91 49 04 lds r25, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 24436: 82 1b sub r24, r18 24438: 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; 2443a: 90 93 49 04 sts 0x0449, r25 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 2443e: 80 93 48 04 sts 0x0448, r24 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> } if (current_adv_steps == target_adv_steps) { 24442: 20 91 48 04 lds r18, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> 24446: 30 91 49 04 lds r19, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 2444a: 80 91 6a 05 lds r24, 0x056A ; 0x80056a 2444e: 90 91 6b 05 lds r25, 0x056B ; 0x80056b 24452: 28 17 cp r18, r24 24454: 39 07 cpc r19, r25 24456: 09 f0 breq .+2 ; 0x2445a <__vector_17+0x1266> 24458: 66 c0 rjmp .+204 ; 0x24526 <__vector_17+0x1332> // advance steps completed nextAdvanceISR = ADV_NEVER; 2445a: 8f ef ldi r24, 0xFF ; 255 2445c: 9f ef ldi r25, 0xFF ; 255 } else { // schedule another tick nextAdvanceISR = eISR_Rate; 2445e: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 24462: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 24466: 40 91 69 05 lds r20, 0x0569 ; 0x800569 2446a: 41 11 cpse r20, r1 2446c: 61 c0 rjmp .+194 ; 0x24530 <__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) 2446e: 80 91 4c 04 lds r24, 0x044C ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> 24472: 90 91 4d 04 lds r25, 0x044D ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 24476: 20 91 4e 04 lds r18, 0x044E ; 0x80044e <_ZL11nextMainISR.lto_priv.436> 2447a: 30 91 4f 04 lds r19, 0x044F ; 0x80044f <_ZL11nextMainISR.lto_priv.436+0x1> 2447e: 8f 3f cpi r24, 0xFF ; 255 24480: 98 07 cpc r25, r24 24482: 09 f0 breq .+2 ; 0x24486 <__vector_17+0x1292> 24484: 98 c0 rjmp .+304 ; 0x245b6 <__vector_17+0x13c2> OCR1A = nextAdvanceISR; else OCR1A = nextMainISR; 24486: 30 93 89 00 sts 0x0089, r19 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 2448a: 20 93 88 00 sts 0x0088, r18 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 2448e: 9e c0 rjmp .+316 ; 0x245cc <__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; 24490: ab ea ldi r26, 0xAB ; 171 24492: ba ea ldi r27, 0xAA ; 170 24494: 0f 94 21 a5 call 0x34a42 ; 0x34a42 <__umulhisi3> 24498: ab 01 movw r20, r22 2449a: bc 01 movw r22, r24 2449c: 31 e1 ldi r19, 0x11 ; 17 2449e: 76 95 lsr r23 244a0: 67 95 ror r22 244a2: 57 95 ror r21 244a4: 47 95 ror r20 244a6: 3a 95 dec r19 244a8: d1 f7 brne .-12 ; 0x2449e <__vector_17+0x12aa> 244aa: 57 cf rjmp .-338 ; 0x2435a <__vector_17+0x1166> 244ac: 9f 01 movw r18, r30 244ae: ab ea ldi r26, 0xAB ; 171 244b0: ba ea ldi r27, 0xAA ; 170 244b2: 0f 94 21 a5 call 0x34a42 ; 0x34a42 <__umulhisi3> 244b6: 21 e1 ldi r18, 0x11 ; 17 244b8: 96 95 lsr r25 244ba: 87 95 ror r24 244bc: 77 95 ror r23 244be: 67 95 ror r22 244c0: 2a 95 dec r18 244c2: d1 f7 brne .-12 ; 0x244b8 <__vector_17+0x12c4> 244c4: 54 cf rjmp .-344 ; 0x2436e <__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); 244c6: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 244ca: 8f 7b andi r24, 0xBF ; 191 244cc: ac cf rjmp .-168 ; 0x24426 <__vector_17+0x1232> current_adv_steps -= e_step_loops; } else if (current_adv_steps < target_adv_steps) { 244ce: 42 17 cp r20, r18 244d0: 53 07 cpc r21, r19 244d2: 08 f0 brcs .+2 ; 0x244d6 <__vector_17+0x12e2> 244d4: b6 cf rjmp .-148 ; 0x24442 <__vector_17+0x124e> // compression if (e_step_loops != 1) { 244d6: 90 91 48 05 lds r25, 0x0548 ; 0x800548 244da: 91 30 cpi r25, 0x01 ; 1 244dc: 41 f0 breq .+16 ; 0x244ee <__vector_17+0x12fa> uint16_t d_steps = target_adv_steps - current_adv_steps; 244de: 24 1b sub r18, r20 244e0: 35 0b sbc r19, r21 if (d_steps < e_step_loops) 244e2: 92 17 cp r25, r18 244e4: 13 06 cpc r1, r19 244e6: 19 f0 breq .+6 ; 0x244ee <__vector_17+0x12fa> 244e8: 10 f0 brcs .+4 ; 0x244ee <__vector_17+0x12fa> e_step_loops = d_steps; 244ea: 20 93 48 05 sts 0x0548, r18 ; 0x800548 } e_steps += e_step_loops; 244ee: 90 91 48 05 lds r25, 0x0548 ; 0x800548 244f2: 89 0f add r24, r25 244f4: 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); 244f8: 88 23 and r24, r24 244fa: 39 f0 breq .+14 ; 0x2450a <__vector_17+0x1316> 244fc: 87 ff sbrs r24, 7 244fe: 0f c0 rjmp .+30 ; 0x2451e <__vector_17+0x132a> 24500: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24504: 80 64 ori r24, 0x40 ; 64 24506: 80 93 0b 01 sts 0x010B, r24 ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> current_adv_steps += e_step_loops; 2450a: 80 91 48 05 lds r24, 0x0548 ; 0x800548 2450e: 20 91 48 04 lds r18, 0x0448 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> 24512: 30 91 49 04 lds r19, 0x0449 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 24516: 82 0f add r24, r18 24518: 93 2f mov r25, r19 2451a: 91 1d adc r25, r1 2451c: 8e cf rjmp .-228 ; 0x2443a <__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); 2451e: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24522: 8f 7b andi r24, 0xBF ; 191 24524: f0 cf rjmp .-32 ; 0x24506 <__vector_17+0x1312> // advance steps completed nextAdvanceISR = ADV_NEVER; } else { // schedule another tick nextAdvanceISR = eISR_Rate; 24526: 80 91 46 05 lds r24, 0x0546 ; 0x800546 2452a: 90 91 47 05 lds r25, 0x0547 ; 0x800547 2452e: 97 cf rjmp .-210 ; 0x2445e <__vector_17+0x126a> WRITE_NC(LOGIC_ANALYZER_CH1, false); #endif } // Tick E steps if any if (e_steps && (LA_phase < 0 || LA_phase == eisr)) { 24530: 80 91 68 05 lds r24, 0x0568 ; 0x800568 24534: 87 fd sbrc r24, 7 24536: 0e c0 rjmp .+28 ; 0x24554 <__vector_17+0x1360> 24538: 08 2e mov r0, r24 2453a: 00 0c add r0, r0 2453c: 99 0b sbc r25, r25 WRITE_NC(LOGIC_ANALYZER_CH0, false); #endif } // Run the next advance isr if triggered bool eisr = !nextAdvanceISR; 2453e: 21 e0 ldi r18, 0x01 ; 1 24540: 30 e0 ldi r19, 0x00 ; 0 24542: 61 15 cp r22, r1 24544: 71 05 cpc r23, r1 24546: 11 f0 breq .+4 ; 0x2454c <__vector_17+0x1358> 24548: 30 e0 ldi r19, 0x00 ; 0 2454a: 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)) { 2454c: 82 17 cp r24, r18 2454e: 93 07 cpc r25, r19 24550: 09 f0 breq .+2 ; 0x24554 <__vector_17+0x1360> 24552: 8d cf rjmp .-230 ; 0x2446e <__vector_17+0x127a> uint8_t max_ticks = (eisr? e_step_loops: step_loops); 24554: 20 91 48 05 lds r18, 0x0548 ; 0x800548 24558: 67 2b or r22, r23 2455a: 11 f0 breq .+4 ; 0x24560 <__vector_17+0x136c> 2455c: 20 91 70 05 lds r18, 0x0570 ; 0x800570 max_ticks = min(abs(e_steps), max_ticks); 24560: 84 2f mov r24, r20 24562: 04 2e mov r0, r20 24564: 00 0c add r0, r0 24566: 99 0b sbc r25, r25 24568: 97 ff sbrs r25, 7 2456a: 03 c0 rjmp .+6 ; 0x24572 <__vector_17+0x137e> 2456c: 91 95 neg r25 2456e: 81 95 neg r24 24570: 91 09 sbc r25, r1 24572: 30 e0 ldi r19, 0x00 ; 0 24574: 28 17 cp r18, r24 24576: 39 07 cpc r19, r25 24578: 0c f4 brge .+2 ; 0x2457c <__vector_17+0x1388> 2457a: c9 01 movw r24, r18 2457c: 47 ff sbrs r20, 7 2457e: 17 c0 rjmp .+46 ; 0x245ae <__vector_17+0x13ba> 24580: 61 e0 ldi r22, 0x01 ; 1 24582: 4f ef ldi r20, 0xFF ; 255 24584: 5f ef ldi r21, 0xFF ; 255 bool rev = (e_steps < 0); do { STEP_NC_HI(E_AXIS); 24586: 43 9a sbi 0x08, 3 ; 8 e_steps += (rev? 1: -1); 24588: 90 91 69 05 lds r25, 0x0569 ; 0x800569 2458c: 96 0f add r25, r22 2458e: 90 93 69 05 sts 0x0569, r25 ; 0x800569 STEP_NC_LO(E_AXIS); 24592: 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; 24594: 20 91 02 17 lds r18, 0x1702 ; 0x801702 24598: 30 91 03 17 lds r19, 0x1703 ; 0x801703 2459c: 24 0f add r18, r20 2459e: 35 1f adc r19, r21 245a0: 30 93 03 17 sts 0x1703, r19 ; 0x801703 245a4: 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); 245a8: 81 50 subi r24, 0x01 ; 1 245aa: 69 f7 brne .-38 ; 0x24586 <__vector_17+0x1392> 245ac: 60 cf rjmp .-320 ; 0x2446e <__vector_17+0x127a> 245ae: 6f ef ldi r22, 0xFF ; 255 245b0: 41 e0 ldi r20, 0x01 ; 1 245b2: 50 e0 ldi r21, 0x00 ; 0 245b4: e8 cf rjmp .-48 ; 0x24586 <__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) 245b6: ac 01 movw r20, r24 245b8: 48 5d subi r20, 0xD8 ; 216 245ba: 5f 4f sbci r21, 0xFF ; 255 245bc: 42 17 cp r20, r18 245be: 53 07 cpc r21, r19 245c0: 08 f0 brcs .+2 ; 0x245c4 <__vector_17+0x13d0> 245c2: 61 cf rjmp .-318 ; 0x24486 <__vector_17+0x1292> OCR1A = nextAdvanceISR; 245c4: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 245c8: 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) { 245cc: 20 91 88 00 lds r18, 0x0088 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> 245d0: 30 91 89 00 lds r19, 0x0089 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 245d4: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 245d8: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 245dc: 40 96 adiw r24, 0x10 ; 16 245de: 28 17 cp r18, r24 245e0: 39 07 cpc r19, r25 245e2: 48 f4 brcc .+18 ; 0x245f6 <__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; 245e4: 80 91 84 00 lds r24, 0x0084 ; 0x800084 <__TEXT_REGION_LENGTH__+0x7c2084> 245e8: 90 91 85 00 lds r25, 0x0085 ; 0x800085 <__TEXT_REGION_LENGTH__+0x7c2085> 245ec: 40 96 adiw r24, 0x10 ; 16 245ee: 90 93 89 00 sts 0x0089, r25 ; 0x800089 <__TEXT_REGION_LENGTH__+0x7c2089> 245f2: 80 93 88 00 sts 0x0088, r24 ; 0x800088 <__TEXT_REGION_LENGTH__+0x7c2088> } } 245f6: ff 91 pop r31 245f8: ef 91 pop r30 245fa: df 91 pop r29 245fc: cf 91 pop r28 245fe: bf 91 pop r27 24600: af 91 pop r26 24602: 9f 91 pop r25 24604: 8f 91 pop r24 24606: 7f 91 pop r23 24608: 6f 91 pop r22 2460a: 5f 91 pop r21 2460c: 4f 91 pop r20 2460e: 3f 91 pop r19 24610: 2f 91 pop r18 24612: 1f 91 pop r17 24614: ff 90 pop r15 24616: ef 90 pop r14 24618: df 90 pop r13 2461a: cf 90 pop r12 2461c: 8f 90 pop r8 2461e: 7f 90 pop r7 24620: 6f 90 pop r6 24622: 5f 90 pop r5 24624: 4f 90 pop r4 24626: 0f 90 pop r0 24628: 0b be out 0x3b, r0 ; 59 2462a: 0f 90 pop r0 2462c: 0f be out 0x3f, r0 ; 63 2462e: 0f 90 pop r0 24630: 1f 90 pop r1 24632: 18 95 reti 00024634 : return old; } bool enable_z_endstop(bool check) { bool old = check_z_endstop; 24634: 90 91 4f 05 lds r25, 0x054F ; 0x80054f check_z_endstop = check; 24638: 80 93 4f 05 sts 0x054F, r24 ; 0x80054f CRITICAL_SECTION_START; 2463c: 2f b7 in r18, 0x3f ; 63 2463e: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 24640: 80 91 5e 04 lds r24, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.440> 24644: 8b 7f andi r24, 0xFB ; 251 24646: 80 93 5e 04 sts 0x045E, r24 ; 0x80045e <_ZL11endstop_hit.lto_priv.440> CRITICAL_SECTION_END; 2464a: 2f bf out 0x3f, r18 ; 63 return old; } 2464c: 89 2f mov r24, r25 2464e: 08 95 ret 00024650 : return old; } bool endstop_z_hit_on_purpose() { bool hit = endstop_hit & _BV(Z_AXIS); 24650: 80 91 5e 04 lds r24, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.440> CRITICAL_SECTION_START; 24654: 2f b7 in r18, 0x3f ; 63 24656: f8 94 cli endstop_hit &= ~_BV(Z_AXIS); 24658: 90 91 5e 04 lds r25, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.440> 2465c: 9b 7f andi r25, 0xFB ; 251 2465e: 90 93 5e 04 sts 0x045E, r25 ; 0x80045e <_ZL11endstop_hit.lto_priv.440> CRITICAL_SECTION_END; 24662: 2f bf out 0x3f, r18 ; 63 return hit; } 24664: 82 fb bst r24, 2 24666: 88 27 eor r24, r24 24668: 80 f9 bld r24, 0 2466a: 08 95 ret 0002466c : } } bool endstops_hit_on_purpose() { uint8_t old = endstop_hit; 2466c: 90 91 5e 04 lds r25, 0x045E ; 0x80045e <_ZL11endstop_hit.lto_priv.440> endstop_hit = 0; 24670: 10 92 5e 04 sts 0x045E, r1 ; 0x80045e <_ZL11endstop_hit.lto_priv.440> return old; 24674: 81 e0 ldi r24, 0x01 ; 1 24676: 91 11 cpse r25, r1 24678: 01 c0 rjmp .+2 ; 0x2467c 2467a: 80 e0 ldi r24, 0x00 ; 0 } 2467c: 08 95 ret 0002467e : } } void Sound_MakeSound(eSOUND_TYPE eSoundType) { switch(eSoundMode) 2467e: 90 91 47 04 lds r25, 0x0447 ; 0x800447 24682: 91 30 cpi r25, 0x01 ; 1 24684: a1 f0 breq .+40 ; 0x246ae 24686: 28 f0 brcs .+10 ; 0x24692 24688: 92 30 cpi r25, 0x02 ; 2 2468a: a9 f0 breq .+42 ; 0x246b6 2468c: 93 30 cpi r25, 0x03 ; 3 2468e: c1 f0 breq .+48 ; 0x246c0 24690: 08 95 ret { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) 24692: 81 11 cpse r24, r1 24694: 02 c0 rjmp .+4 ; 0x2469a 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(); 24696: 0d 94 20 01 jmp 0x20240 ; 0x20240 switch(eSoundMode) { case e_SOUND_MODE_LOUD: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 2469a: 82 30 cpi r24, 0x02 ; 2 2469c: 11 f4 brne .+4 ; 0x246a2 break; case e_SOUND_MODE_BLIND: if(eSoundType==e_SOUND_TYPE_ButtonEcho) Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) Sound_DoSound_Prompt(); 2469e: 0d 94 ed 05 jmp 0x20bda ; 0x20bda 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) 246a2: 85 30 cpi r24, 0x05 ; 5 246a4: 09 f0 breq .+2 ; 0x246a8 246a6: 4d c0 rjmp .+154 ; 0x24742 Sound_DoSound_Alert(false); 246a8: 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); 246aa: 0d 94 fe 00 jmp 0x201fc ; 0x201fc 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) 246ae: 88 23 and r24, r24 246b0: 91 f3 breq .-28 ; 0x24696 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 246b2: 82 30 cpi r24, 0x02 ; 2 246b4: a1 f3 breq .-24 ; 0x2469e Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 246b6: 85 30 cpi r24, 0x05 ; 5 246b8: 09 f0 breq .+2 ; 0x246bc 246ba: 43 c0 rjmp .+134 ; 0x24742 Sound_DoSound_Alert(true); 246bc: 81 e0 ldi r24, 0x01 ; 1 246be: f5 cf rjmp .-22 ; 0x246aa 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) 246c0: 88 23 and r24, r24 246c2: 49 f3 breq .-46 ; 0x24696 Sound_DoSound_Echo(); if(eSoundType==e_SOUND_TYPE_StandardPrompt) 246c4: 82 30 cpi r24, 0x02 ; 2 246c6: 59 f3 breq .-42 ; 0x2469e Sound_DoSound_Prompt(); if(eSoundType==e_SOUND_TYPE_StandardAlert) 246c8: 85 30 cpi r24, 0x05 ; 5 246ca: 71 f3 breq .-36 ; 0x246a8 Sound_DoSound_Alert(false); if(eSoundType==e_SOUND_TYPE_EncoderMove) 246cc: 86 30 cpi r24, 0x06 ; 6 246ce: e1 f4 brne .+56 ; 0x24708 246d0: 85 e0 ldi r24, 0x05 ; 5 246d2: 27 e2 ldi r18, 0x27 ; 39 246d4: 31 e0 ldi r19, 0x01 ; 1 { uint8_t nI; for(nI=0;nI<5;nI++) { WRITE(BEEPER,HIGH); 246d6: 4f b7 in r20, 0x3f ; 63 246d8: f8 94 cli 246da: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 246de: 94 60 ori r25, 0x04 ; 4 246e0: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 246e4: 4f bf out 0x3f, r20 ; 63 246e6: f9 01 movw r30, r18 246e8: 31 97 sbiw r30, 0x01 ; 1 246ea: f1 f7 brne .-4 ; 0x246e8 delayMicroseconds(75); WRITE(BEEPER,LOW); 246ec: 4f b7 in r20, 0x3f ; 63 246ee: f8 94 cli 246f0: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 246f4: 9b 7f andi r25, 0xFB ; 251 246f6: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 246fa: 4f bf out 0x3f, r20 ; 63 246fc: f9 01 movw r30, r18 246fe: 31 97 sbiw r30, 0x01 ; 1 24700: f1 f7 brne .-4 ; 0x246fe 24702: 81 50 subi r24, 0x01 ; 1 static void Sound_DoSound_Encoder_Move(void) { uint8_t nI; for(nI=0;nI<5;nI++) 24704: 41 f7 brne .-48 ; 0x246d6 24706: 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) 24708: 87 30 cpi r24, 0x07 ; 7 2470a: d9 f4 brne .+54 ; 0x24742 2470c: 84 e1 ldi r24, 0x14 ; 20 2470e: 23 e7 ldi r18, 0x73 ; 115 24710: 31 e0 ldi r19, 0x01 ; 1 backlight_wake(1); uint8_t nI; for(nI=0; nI<20; nI++) { WRITE(BEEPER,HIGH); 24712: 4f b7 in r20, 0x3f ; 63 24714: f8 94 cli 24716: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2471a: 94 60 ori r25, 0x04 ; 4 2471c: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24720: 4f bf out 0x3f, r20 ; 63 24722: f9 01 movw r30, r18 24724: 31 97 sbiw r30, 0x01 ; 1 24726: f1 f7 brne .-4 ; 0x24724 delayMicroseconds(94); WRITE(BEEPER,LOW); 24728: 4f b7 in r20, 0x3f ; 63 2472a: f8 94 cli 2472c: 90 91 02 01 lds r25, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24730: 9b 7f andi r25, 0xFB ; 251 24732: 90 93 02 01 sts 0x0102, r25 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24736: 4f bf out 0x3f, r20 ; 63 24738: f9 01 movw r30, r18 2473a: 31 97 sbiw r30, 0x01 ; 1 2473c: f1 f7 brne .-4 ; 0x2473a 2473e: 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++) 24740: 41 f7 brne .-48 ; 0x24712 Sound_DoSound_Blind_Alert(); break; default: break; } } 24742: 08 95 ret 00024744 : static void __attribute__((noinline)) mFilamentResetMenuStack() { menu_back(bFilamentPreheatState ? 1 : 2); } void mFilamentItem(uint16_t nTemp, uint16_t nTempBed) { 24744: 0f 93 push r16 24746: 1f 93 push r17 24748: cf 93 push r28 2474a: df 93 push r29 2474c: 8c 01 movw r16, r24 2474e: 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; 24750: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 24754: 80 93 5d 12 sts 0x125D, r24 ; 0x80125d setTargetHotend((float)nTemp); if (!shouldPreheatOnlyNozzle()) setTargetBed((float)nTempBed); 24758: 0f 94 16 02 call 0x2042c ; 0x2042c 2475c: 81 11 cpse r24, r1 2475e: 04 c0 rjmp .+8 ; 0x24768 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 24760: d0 93 5a 12 sts 0x125A, r29 ; 0x80125a 24764: c0 93 59 12 sts 0x1259, r28 ; 0x801259 { const FilamentAction action = eFilamentAction; 24768: c0 91 94 03 lds r28, 0x0394 ; 0x800394 if (action == FilamentAction::Preheat || action == FilamentAction::Lay1Cal) 2476c: 87 ef ldi r24, 0xF7 ; 247 2476e: 8c 0f add r24, r28 24770: 82 30 cpi r24, 0x02 ; 2 24772: f8 f4 brcc .+62 ; 0x247b2 { lcd_return_to_status(); 24774: 0f 94 6e 05 call 0x20adc ; 0x20adc if (action == FilamentAction::Lay1Cal) 24778: ca 30 cpi r28, 0x0A ; 10 2477a: 41 f4 brne .+16 ; 0x2478c { lcd_commands_type = LcdCommands::Layer1Cal; 2477c: 84 e0 ldi r24, 0x04 ; 4 2477e: 80 93 5e 0d sts 0x0D5E, r24 ; 0x800d5e } menu_back(); clearFilamentAction(); } } } 24782: df 91 pop r29 24784: cf 91 pop r28 24786: 1f 91 pop r17 24788: 0f 91 pop r16 2478a: 08 95 ret { lcd_commands_type = LcdCommands::Layer1Cal; } else { raise_z_above(MIN_Z_FOR_PREHEAT); 2478c: 60 e0 ldi r22, 0x00 ; 0 2478e: 70 e0 ldi r23, 0x00 ; 0 24790: 80 e2 ldi r24, 0x20 ; 32 24792: 91 e4 ldi r25, 0x41 ; 65 24794: 0e 94 47 6d call 0xda8e ; 0xda8e if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 24798: 8f e5 ldi r24, 0x5F ; 95 2479a: 9f e0 ldi r25, 0x0F ; 15 2479c: 0f 94 81 a4 call 0x34902 ; 0x34902 247a0: 88 23 and r24, r24 247a2: 79 f3 breq .-34 ; 0x24782 lcd_wizard(WizState::LoadFilHot); 247a4: 88 e0 ldi r24, 0x08 ; 8 } menu_back(); clearFilamentAction(); } } } 247a6: df 91 pop r29 247a8: cf 91 pop r28 247aa: 1f 91 pop r17 247ac: 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); 247ae: 0c 94 84 e9 jmp 0x1d308 ; 0x1d308 247b2: 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) 247b6: 80 91 16 06 lds r24, 0x0616 ; 0x800616 247ba: 81 11 cpse r24, r1 247bc: 12 c0 rjmp .+36 ; 0x247e2 247be: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 247c2: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 247c6: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 247ca: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 247ce: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 247d2: 60 1b sub r22, r16 247d4: 71 0b sbc r23, r17 247d6: 6c 5f subi r22, 0xFC ; 252 247d8: 7f 4f sbci r23, 0xFF ; 255 247da: 69 30 cpi r22, 0x09 ; 9 247dc: 71 05 cpc r23, r1 247de: 08 f0 brcs .+2 ; 0x247e2 247e0: 60 c0 rjmp .+192 ; 0x248a2 { menu_func_t filamentActionMenu = nullptr; switch (eFilamentAction) 247e2: c1 50 subi r28, 0x01 ; 1 247e4: c8 30 cpi r28, 0x08 ; 8 247e6: 88 f5 brcc .+98 ; 0x2484a 247e8: ec 2f mov r30, r28 247ea: f0 e0 ldi r31, 0x00 ; 0 247ec: 88 27 eor r24, r24 247ee: e4 50 subi r30, 0x04 ; 4 247f0: fc 4d sbci r31, 0xDC ; 220 247f2: 8e 4f sbci r24, 0xFE ; 254 247f4: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> 247f8: 3c 37 cpi r19, 0x7C ; 124 247fa: 3c 37 cpi r19, 0x7C ; 124 247fc: 3c 37 cpi r19, 0x7C ; 124 247fe: b4 37 cpi r27, 0x74 ; 116 24800: e2 38 cpi r30, 0x82 ; 130 24802: 4e 37 cpi r20, 0x7E ; 126 24804: 0c 38 cpi r16, 0x8C ; 140 24806: 2c 38 cpi r18, 0x8C ; 140 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament } break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; 24808: cf e4 ldi r28, 0x4F ; 79 2480a: de ec ldi r29, 0xCE ; 206 case FilamentAction::Preheat: case FilamentAction::Lay1Cal: // handled earlier break; } if (bFilamentWaitingFlag) { 2480c: 80 91 14 06 lds r24, 0x0614 ; 0x800614 24810: 88 23 and r24, r24 24812: 29 f0 breq .+10 ; 0x2481e Sound_MakeSound(e_SOUND_TYPE_StandardPrompt); 24814: 82 e0 ldi r24, 0x02 ; 2 24816: 0f 94 3f 23 call 0x2467e ; 0x2467e bFilamentWaitingFlag = false; 2481a: 10 92 14 06 sts 0x0614, r1 ; 0x800614 } if (filamentActionMenu) { 2481e: 20 97 sbiw r28, 0x00 ; 0 24820: 09 f4 brne .+2 ; 0x24824 24822: af cf rjmp .-162 ; 0x24782 // Reset the menu stack and filament action before entering action menu mFilamentResetMenuStack(); 24824: 0f 94 aa 02 call 0x20554 ; 0x20554 // The menu should clear eFilamentAction when the // 'action' is done menu_submenu(filamentActionMenu, true); 24828: 61 e0 ldi r22, 0x01 ; 1 2482a: ce 01 movw r24, r28 } menu_back(); clearFilamentAction(); } } } 2482c: df 91 pop r29 2482e: cf 91 pop r28 24830: 1f 91 pop r17 24832: 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); 24834: 0c 94 2e 63 jmp 0xc65c ; 0xc65c switch (eFilamentAction) { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); 24838: 80 91 14 06 lds r24, 0x0614 ; 0x800614 2483c: 88 23 and r24, r24 2483e: 41 f0 breq .+16 ; 0x24850 24840: 61 e0 ldi r22, 0x01 ; 1 24842: 8c ee ldi r24, 0xEC ; 236 24844: 97 e3 ldi r25, 0x37 ; 55 24846: 0e 94 2e 63 call 0xc65c ; 0xc65c // 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; 2484a: d0 e0 ldi r29, 0x00 ; 0 2484c: c0 e0 ldi r28, 0x00 ; 0 2484e: de cf rjmp .-68 ; 0x2480c case FilamentAction::AutoLoad: case FilamentAction::UnLoad: if (bFilamentWaitingFlag) menu_submenu(mFilamentPrompt, true); else { mFilamentResetMenuStack(); 24850: 0f 94 aa 02 call 0x20554 ; 0x20554 if (eFilamentAction == FilamentAction::AutoLoad) { 24854: 80 91 94 03 lds r24, 0x0394 ; 0x800394 24858: 82 30 cpi r24, 0x02 ; 2 2485a: 19 f4 brne .+6 ; 0x24862 // loading no longer cancellable eFilamentAction = FilamentAction::Load; 2485c: 81 e0 ldi r24, 0x01 ; 1 2485e: 80 93 94 03 sts 0x0394, r24 ; 0x800394 } if (eFilamentAction == FilamentAction::Load) 24862: 80 91 94 03 lds r24, 0x0394 ; 0x800394 24866: 81 30 cpi r24, 0x01 ; 1 24868: 31 f4 brne .+12 ; 0x24876 enquecommand_P(MSG_M701); // load filament 2486a: 61 e0 ldi r22, 0x01 ; 1 2486c: 8c eb ldi r24, 0xBC ; 188 2486e: 9b e6 ldi r25, 0x6B ; 107 else if (eFilamentAction == FilamentAction::UnLoad) enquecommand_P(MSG_M702); // unload filament 24870: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 24874: ea cf rjmp .-44 ; 0x2484a eFilamentAction = FilamentAction::Load; } if (eFilamentAction == FilamentAction::Load) enquecommand_P(MSG_M701); // load filament else if (eFilamentAction == FilamentAction::UnLoad) 24876: 83 30 cpi r24, 0x03 ; 3 24878: 41 f7 brne .-48 ; 0x2484a enquecommand_P(MSG_M702); // unload filament 2487a: 61 e0 ldi r22, 0x01 ; 1 2487c: 8c e6 ldi r24, 0x6C ; 108 2487e: 99 e6 ldi r25, 0x69 ; 105 24880: f7 cf rjmp .-18 ; 0x24870 break; case FilamentAction::MmuLoad: filamentActionMenu = mmu_load_to_nozzle_menu; break; case FilamentAction::MmuLoadingTest: filamentActionMenu = mmu_loading_test_menu; 24882: c9 ec ldi r28, 0xC9 ; 201 24884: dd ec ldi r29, 0xCD ; 205 24886: c2 cf rjmp .-124 ; 0x2480c break; case FilamentAction::MmuUnLoad: mFilamentResetMenuStack(); 24888: 0f 94 aa 02 call 0x20554 ; 0x20554 MMU2::mmu2.unload(); 2488c: 0f 94 12 9e call 0x33c24 ; 0x33c24 // 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(); 24890: 0f 94 6f 09 call 0x212de ; 0x212de 24894: da cf rjmp .-76 ; 0x2484a break; case FilamentAction::MmuEject: filamentActionMenu = mmu_fil_eject_menu; 24896: c7 e4 ldi r28, 0x47 ; 71 24898: de ec ldi r29, 0xCE ; 206 2489a: b8 cf rjmp .-144 ; 0x2480c break; case FilamentAction::MmuCut: #ifdef MMU_HAS_CUTTER filamentActionMenu = mmu_cut_filament_menu; 2489c: cf e3 ldi r28, 0x3F ; 63 2489e: de ec ldi r29, 0xCE ; 206 248a0: b5 cf rjmp .-150 ; 0x2480c menu_submenu(filamentActionMenu, true); } } else // still preheating, continue updating LCD UI { if (!bFilamentWaitingFlag || lcd_draw_update) 248a2: 80 91 14 06 lds r24, 0x0614 ; 0x800614 248a6: 88 23 and r24, r24 248a8: 21 f0 breq .+8 ; 0x248b2 248aa: 80 91 59 02 lds r24, 0x0259 ; 0x800259 248ae: 88 23 and r24, r24 248b0: 71 f1 breq .+92 ; 0x2490e // 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; 248b2: 81 e0 ldi r24, 0x01 ; 1 248b4: 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; 248b8: 80 93 59 02 sts 0x0259, r24 ; 0x800259 lcd_clear(); 248bc: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 3, _T(MSG_CANCEL)); 248c0: 87 e2 ldi r24, 0x27 ; 39 248c2: 9d e3 ldi r25, 0x3D ; 61 248c4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 248c8: ac 01 movw r20, r24 248ca: 63 e0 ldi r22, 0x03 ; 3 248cc: 80 e0 ldi r24, 0x00 ; 0 248ce: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_set_cursor(0, 1); 248d2: 61 e0 ldi r22, 0x01 ; 1 248d4: 80 e0 ldi r24, 0x00 ; 0 248d6: 0e 94 ab 6f call 0xdf56 ; 0xdf56 switch (eFilamentAction) 248da: e0 91 94 03 lds r30, 0x0394 ; 0x800394 248de: e1 50 subi r30, 0x01 ; 1 248e0: e8 30 cpi r30, 0x08 ; 8 248e2: a8 f4 brcc .+42 ; 0x2490e 248e4: f0 e0 ldi r31, 0x00 ; 0 248e6: 88 27 eor r24, r24 248e8: e7 58 subi r30, 0x87 ; 135 248ea: fb 4d sbci r31, 0xDB ; 219 248ec: 8e 4f sbci r24, 0xFE ; 254 248ee: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> 248f2: e8 38 cpi r30, 0x88 ; 136 248f4: e8 38 cpi r30, 0x88 ; 136 248f6: 32 37 cpi r19, 0x72 ; 114 248f8: e8 38 cpi r30, 0x88 ; 136 248fa: 32 37 cpi r19, 0x72 ; 114 248fc: d6 37 cpi r29, 0x76 ; 118 248fe: da 38 cpi r29, 0x8A ; 138 24900: e8 38 cpi r30, 0x88 ; 136 { case FilamentAction::Load: case FilamentAction::AutoLoad: case FilamentAction::MmuLoad: case FilamentAction::MmuLoadingTest: lcd_puts_P(_T(MSG_PREHEATING_TO_LOAD)); 24902: 8d eb ldi r24, 0xBD ; 189 24904: 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)); 24906: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2490a: 0e 94 6e 6f call 0xdedc ; 0xdedc // handled earlier break; } } if (bFilamentWaitingFlag) { 2490e: 80 91 14 06 lds r24, 0x0614 ; 0x800614 24912: 81 11 cpse r24, r1 lcd_print_target_temps_first_line(); 24914: 0f 94 52 0a call 0x214a4 ; 0x214a4 } if (lcd_clicked()) 24918: 0e 94 c6 73 call 0xe78c ; 0xe78c 2491c: 88 23 and r24, r24 2491e: 09 f4 brne .+2 ; 0x24922 24920: 30 cf rjmp .-416 ; 0x24782 { // Filament action canceled while preheating bFilamentWaitingFlag = false; 24922: 10 92 14 06 sts 0x0614, r1 ; 0x800614 if (!bFilamentPreheatState) 24926: 80 91 15 06 lds r24, 0x0615 ; 0x800615 2492a: 81 11 cpse r24, r1 2492c: 0e c0 rjmp .+28 ; 0x2494a return target_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 2492e: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 24932: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d { setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); 24936: 0e 94 86 66 call 0xcd0c ; 0xcd0c 2493a: 81 11 cpse r24, r1 2493c: 04 c0 rjmp .+8 ; 0x24946 resetPID(0); }; FORCE_INLINE void setTargetBed(const float &celsius) { target_temperature_bed = celsius; 2493e: 10 92 5a 12 sts 0x125A, r1 ; 0x80125a 24942: 10 92 59 12 sts 0x1259, r1 ; 0x801259 menu_back(); 24946: 0e 94 6c 63 call 0xc6d8 ; 0xc6d8 } menu_back(); 2494a: 0e 94 6c 63 call 0xc6d8 ; 0xc6d8 clearFilamentAction(); } } } 2494e: df 91 pop r29 24950: cf 91 pop r28 24952: 1f 91 pop r17 24954: 0f 91 pop r16 setTargetHotend(0); if (!printingIsPaused()) setTargetBed(0); menu_back(); } menu_back(); clearFilamentAction(); 24956: 0d 94 6f 09 jmp 0x212de ; 0x212de 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)); 2495a: 86 ea ldi r24, 0xA6 ; 166 2495c: 98 e5 ldi r25, 0x58 ; 88 2495e: d3 cf rjmp .-90 ; 0x24906 break; case FilamentAction::MmuEject: lcd_puts_P(_T(MSG_PREHEATING_TO_EJECT)); 24960: 80 e9 ldi r24, 0x90 ; 144 24962: 98 e5 ldi r25, 0x58 ; 88 24964: d0 cf rjmp .-96 ; 0x24906 break; case FilamentAction::MmuCut: lcd_puts_P(_T(MSG_PREHEATING_TO_CUT)); 24966: 8c e7 ldi r24, 0x7C ; 124 24968: 98 e5 ldi r25, 0x58 ; 88 2496a: cd cf rjmp .-102 ; 0x24906 0002496c : } } } static void setFilamentAction(FilamentAction action) { eFilamentAction = action; 2496c: 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) ); 24970: 40 91 01 13 lds r20, 0x1301 ; 0x801301 24974: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 24978: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 2497c: 41 30 cpi r20, 0x01 ; 1 2497e: 59 f0 breq .+22 ; 0x24996 setFilamentAction(action); // For MMU: If FINDA doesn't detect filament on Cut or Eject action, // then preheating is unnecessary bFilamentSkipPreheat = ( MMU2::mmu2.Enabled() && !MMU2::mmu2.FindaDetectsFilament() 24980: 10 92 16 06 sts 0x0616, r1 ; 0x800616 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { 24984: 80 91 57 02 lds r24, 0x0257 ; 0x800257 24988: 90 91 58 02 lds r25, 0x0258 ; 0x800258 2498c: 28 17 cp r18, r24 2498e: 39 07 cpc r19, r25 24990: 5c f4 brge .+22 ; 0x249a8 bFilamentPreheatState = true; mFilamentItem(target_temperature[0], target_temperature_bed); bFilamentSkipPreheat = false; // Reset flag } else { lcd_generic_preheat_menu(); 24992: 0d 94 72 09 jmp 0x212e4 ; 0x212e4 setFilamentAction(action); // For MMU: If FINDA doesn't detect filament on Cut or Eject action, // then preheating is unnecessary bFilamentSkipPreheat = ( MMU2::mmu2.Enabled() && !MMU2::mmu2.FindaDetectsFilament() 24996: 90 91 d7 12 lds r25, 0x12D7 ; 0x8012d7 2499a: 91 11 cpse r25, r1 2499c: f1 cf rjmp .-30 ; 0x24980 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); 2499e: 86 50 subi r24, 0x06 ; 6 249a0: 82 30 cpi r24, 0x02 ; 2 249a2: 70 f7 brcc .-36 ; 0x24980 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() 249a4: 40 93 16 06 sts 0x0616, r20 ; 0x800616 && (action == FilamentAction::MmuCut || action == FilamentAction::MmuEject) ); if (bFilamentSkipPreheat || target_temperature[0] >= extrude_min_temp) { bFilamentPreheatState = true; 249a8: 81 e0 ldi r24, 0x01 ; 1 249aa: 80 93 15 06 sts 0x0615, r24 ; 0x800615 mFilamentItem(target_temperature[0], target_temperature_bed); 249ae: 60 91 59 12 lds r22, 0x1259 ; 0x801259 249b2: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 249b6: c9 01 movw r24, r18 249b8: 0f 94 a2 23 call 0x24744 ; 0x24744 bFilamentSkipPreheat = false; // Reset flag 249bc: 10 92 16 06 sts 0x0616, r1 ; 0x800616 } else { lcd_generic_preheat_menu(); } } 249c0: 08 95 ret 000249c2 : { preheat_or_continue(FilamentAction::Load); } void lcd_AutoLoadFilament() { preheat_or_continue(FilamentAction::AutoLoad); 249c2: 82 e0 ldi r24, 0x02 ; 2 249c4: 0d 94 b6 24 jmp 0x2496c ; 0x2496c 000249c8 : } } static void lcd_LoadFilament() { preheat_or_continue(FilamentAction::Load); 249c8: 81 e0 ldi r24, 0x01 ; 1 249ca: 0d 94 b6 24 jmp 0x2496c ; 0x2496c 000249ce : MENU_END(); } static void lcd_unLoadFilament() { preheat_or_continue(FilamentAction::UnLoad); 249ce: 83 e0 ldi r24, 0x03 ; 3 249d0: 0d 94 b6 24 jmp 0x2496c ; 0x2496c 000249d4 : } } static void mFilamentItem_farm() { bFilamentPreheatState = false; 249d4: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, FARM_PREHEAT_HPB_TEMP); 249d8: 60 e5 ldi r22, 0x50 ; 80 249da: 70 e0 ldi r23, 0x00 ; 0 249dc: 8a ef ldi r24, 0xFA ; 250 249de: 90 e0 ldi r25, 0x00 ; 0 249e0: 0d 94 a2 23 jmp 0x24744 ; 0x24744 000249e4 : } static void mFilamentItem_farm_nozzle() { bFilamentPreheatState = false; 249e4: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(FARM_PREHEAT_HOTEND_TEMP, 0); 249e8: 70 e0 ldi r23, 0x00 ; 0 249ea: 60 e0 ldi r22, 0x00 ; 0 249ec: 8a ef ldi r24, 0xFA ; 250 249ee: 90 e0 ldi r25, 0x00 ; 0 249f0: 0d 94 a2 23 jmp 0x24744 ; 0x24744 000249f4 : } static void mFilamentItem_PLA() { bFilamentPreheatState = false; 249f4: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PLA_PREHEAT_HOTEND_TEMP, PLA_PREHEAT_HPB_TEMP); 249f8: 6c e3 ldi r22, 0x3C ; 60 249fa: 70 e0 ldi r23, 0x00 ; 0 249fc: 87 ed ldi r24, 0xD7 ; 215 249fe: 90 e0 ldi r25, 0x00 ; 0 24a00: 0d 94 a2 23 jmp 0x24744 ; 0x24744 00024a04 : } static void mFilamentItem_PET() { bFilamentPreheatState = false; 24a04: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PET_PREHEAT_HOTEND_TEMP, PET_PREHEAT_HPB_TEMP); 24a08: 65 e5 ldi r22, 0x55 ; 85 24a0a: 70 e0 ldi r23, 0x00 ; 0 24a0c: 86 ee ldi r24, 0xE6 ; 230 24a0e: 90 e0 ldi r25, 0x00 ; 0 24a10: 0d 94 a2 23 jmp 0x24744 ; 0x24744 00024a14 : } static void mFilamentItem_ASA() { bFilamentPreheatState = false; 24a14: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(ASA_PREHEAT_HOTEND_TEMP, ASA_PREHEAT_HPB_TEMP); 24a18: 69 e6 ldi r22, 0x69 ; 105 24a1a: 70 e0 ldi r23, 0x00 ; 0 24a1c: 84 e0 ldi r24, 0x04 ; 4 24a1e: 91 e0 ldi r25, 0x01 ; 1 24a20: 0d 94 a2 23 jmp 0x24744 ; 0x24744 00024a24 : } static void mFilamentItem_PC() { bFilamentPreheatState = false; 24a24: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); 24a28: 69 e6 ldi r22, 0x69 ; 105 24a2a: 70 e0 ldi r23, 0x00 ; 0 24a2c: 83 e1 ldi r24, 0x13 ; 19 24a2e: 91 e0 ldi r25, 0x01 ; 1 24a30: 0d 94 a2 23 jmp 0x24744 ; 0x24744 00024a34 : mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); } static void mFilamentItem_PVB() { bFilamentPreheatState = false; 24a34: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PVB_PREHEAT_HOTEND_TEMP, PVB_PREHEAT_HPB_TEMP); 24a38: 6b e4 ldi r22, 0x4B ; 75 24a3a: 70 e0 ldi r23, 0x00 ; 0 24a3c: 87 ed ldi r24, 0xD7 ; 215 24a3e: 90 e0 ldi r25, 0x00 ; 0 24a40: 0d 94 a2 23 jmp 0x24744 ; 0x24744 00024a44 : mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); } static void mFilamentItem_PA() { bFilamentPreheatState = false; 24a44: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); 24a48: 6a e5 ldi r22, 0x5A ; 90 24a4a: 70 e0 ldi r23, 0x00 ; 0 24a4c: 83 e1 ldi r24, 0x13 ; 19 24a4e: 91 e0 ldi r25, 0x01 ; 1 24a50: 0d 94 a2 23 jmp 0x24744 ; 0x24744 00024a54 : mFilamentItem(PC_PREHEAT_HOTEND_TEMP, PC_PREHEAT_HPB_TEMP); } static void mFilamentItem_ABS() { bFilamentPreheatState = false; 24a54: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(ABS_PREHEAT_HOTEND_TEMP, ABS_PREHEAT_HPB_TEMP); 24a58: 64 e6 ldi r22, 0x64 ; 100 24a5a: 70 e0 ldi r23, 0x00 ; 0 24a5c: 8f ef ldi r24, 0xFF ; 255 24a5e: 90 e0 ldi r25, 0x00 ; 0 24a60: 0d 94 a2 23 jmp 0x24744 ; 0x24744 00024a64 : mFilamentItem(PA_PREHEAT_HOTEND_TEMP, PA_PREHEAT_HPB_TEMP); } static void mFilamentItem_HIPS() { bFilamentPreheatState = false; 24a64: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(HIPS_PREHEAT_HOTEND_TEMP, HIPS_PREHEAT_HPB_TEMP); 24a68: 64 e6 ldi r22, 0x64 ; 100 24a6a: 70 e0 ldi r23, 0x00 ; 0 24a6c: 8c ed ldi r24, 0xDC ; 220 24a6e: 90 e0 ldi r25, 0x00 ; 0 24a70: 0d 94 a2 23 jmp 0x24744 ; 0x24744 00024a74 : } static void mFilamentItem_PP() { bFilamentPreheatState = false; 24a74: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(PP_PREHEAT_HOTEND_TEMP, PP_PREHEAT_HPB_TEMP); 24a78: 64 e6 ldi r22, 0x64 ; 100 24a7a: 70 e0 ldi r23, 0x00 ; 0 24a7c: 8e ef ldi r24, 0xFE ; 254 24a7e: 90 e0 ldi r25, 0x00 ; 0 24a80: 0d 94 a2 23 jmp 0x24744 ; 0x24744 00024a84 : } static void mFilamentItem_FLEX() { bFilamentPreheatState = false; 24a84: 10 92 15 06 sts 0x0615, r1 ; 0x800615 mFilamentItem(FLEX_PREHEAT_HOTEND_TEMP, FLEX_PREHEAT_HPB_TEMP); 24a88: 62 e3 ldi r22, 0x32 ; 50 24a8a: 70 e0 ldi r23, 0x00 ; 0 24a8c: 80 ef ldi r24, 0xF0 ; 240 24a8e: 90 e0 ldi r25, 0x00 ; 0 24a90: 0d 94 a2 23 jmp 0x24744 ; 0x24744 00024a94 : } 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){ 24a94: cf 92 push r12 24a96: df 92 push r13 24a98: ef 92 push r14 24a9a: ff 92 push r15 if (critical || eSoundMode != e_SOUND_MODE_SILENT) { 24a9c: 41 11 cpse r20, r1 24a9e: 04 c0 rjmp .+8 ; 0x24aa8 24aa0: 20 91 47 04 lds r18, 0x0447 ; 0x800447 24aa4: 22 30 cpi r18, 0x02 ; 2 24aa6: d1 f0 breq .+52 ; 0x24adc 24aa8: 9b 01 movw r18, r22 24aaa: 6c 01 movw r12, r24 24aac: f1 2c mov r15, r1 24aae: e1 2c mov r14, r1 if(!tone_) { 24ab0: 67 2b or r22, r23 24ab2: c9 f4 brne .+50 ; 0x24ae6 WRITE(BEEPER, HIGH); 24ab4: 9f b7 in r25, 0x3f ; 63 24ab6: f8 94 cli 24ab8: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24abc: 84 60 ori r24, 0x04 ; 4 24abe: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24ac2: 9f bf out 0x3f, r25 ; 63 _delay(ms); 24ac4: c7 01 movw r24, r14 24ac6: b6 01 movw r22, r12 24ac8: 0f 94 56 0b call 0x216ac ; 0x216ac 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); 24acc: 9f b7 in r25, 0x3f ; 63 24ace: f8 94 cli 24ad0: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24ad4: 8b 7f andi r24, 0xFB ; 251 24ad6: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 24ada: 9f bf out 0x3f, r25 ; 63 _tone(BEEPER, tone_); _delay(ms); _noTone(BEEPER); } } } 24adc: ff 90 pop r15 24ade: ef 90 pop r14 24ae0: df 90 pop r13 24ae2: cf 90 pop r12 24ae4: 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); 24ae6: 22 0f add r18, r18 24ae8: 33 1f adc r19, r19 24aea: 50 e0 ldi r21, 0x00 ; 0 24aec: 40 e0 ldi r20, 0x00 ; 0 24aee: 60 e0 ldi r22, 0x00 ; 0 24af0: 74 e2 ldi r23, 0x24 ; 36 24af2: 84 ef ldi r24, 0xF4 ; 244 24af4: 90 e0 ldi r25, 0x00 ; 0 24af6: 0f 94 72 a5 call 0x34ae4 ; 0x34ae4 <__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; 24afa: 91 e0 ldi r25, 0x01 ; 1 uint32_t pwm_freq = F_CPU / (2 * frequency); if (pwm_freq > UINT16_MAX) { 24afc: 21 15 cp r18, r1 24afe: 31 05 cpc r19, r1 24b00: 81 e0 ldi r24, 0x01 ; 1 24b02: 48 07 cpc r20, r24 24b04: 51 05 cpc r21, r1 24b06: 44 f0 brlt .+16 ; 0x24b18 pwm_freq /= 64; // Increase prescaler to 64 24b08: 86 e0 ldi r24, 0x06 ; 6 24b0a: 56 95 lsr r21 24b0c: 47 95 ror r20 24b0e: 37 95 ror r19 24b10: 27 95 ror r18 24b12: 8a 95 dec r24 24b14: d1 f7 brne .-12 ; 0x24b0a prescalarbits = 0b011; 24b16: 93 e0 ldi r25, 0x03 ; 3 } uint16_t ocr = pwm_freq - 1; 24b18: 21 50 subi r18, 0x01 ; 1 24b1a: 31 09 sbc r19, r1 CRITICAL_SECTION_START; 24b1c: 4f b7 in r20, 0x3f ; 63 24b1e: f8 94 cli // Set calcualted prescaler TCCR4B = (TCCR4B & 0b11111000) | prescalarbits; 24b20: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 24b24: 88 7f andi r24, 0xF8 ; 248 24b26: 89 2b or r24, r25 24b28: 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); 24b2c: 60 91 ac 00 lds r22, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 24b30: 70 91 ad 00 lds r23, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24b34: 26 9f mul r18, r22 24b36: c0 01 movw r24, r0 24b38: 27 9f mul r18, r23 24b3a: 90 0d add r25, r0 24b3c: 36 9f mul r19, r22 24b3e: 90 0d add r25, r0 24b40: 11 24 eor r1, r1 24b42: 50 91 72 00 lds r21, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24b46: 6f ef ldi r22, 0xFF ; 255 24b48: 70 e0 ldi r23, 0x00 ; 0 24b4a: 51 ff sbrs r21, 1 24b4c: 04 c0 rjmp .+8 ; 0x24b56 24b4e: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 24b52: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24b56: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> 24b5a: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24b5e: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN // Set calcualted ocr OCR4A = ocr; 24b62: 30 93 a9 00 sts 0x00A9, r19 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24b66: 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); 24b6a: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24b6e: 83 60 ori r24, 0x03 ; 3 24b70: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 24b74: 4f bf out 0x3f, r20 ; 63 WRITE(BEEPER, HIGH); _delay(ms); WRITE(BEEPER, LOW); } else { _tone(BEEPER, tone_); _delay(ms); 24b76: c7 01 movw r24, r14 24b78: b6 01 movw r22, r12 24b7a: 0f 94 56 0b call 0x216ac ; 0x216ac } void noTone4(_UNUSED uint8_t _pin) { CRITICAL_SECTION_START; 24b7e: 2f b7 in r18, 0x3f ; 63 24b80: f8 94 cli // Revert prescaler to CLK/1024 TCCR4B = (TCCR4B & 0b11111000) | _BV(CS42) | _BV(CS40); 24b82: 80 91 a1 00 lds r24, 0x00A1 ; 0x8000a1 <__TEXT_REGION_LENGTH__+0x7c20a1> 24b86: 88 7f andi r24, 0xF8 ; 248 24b88: 85 60 ori r24, 0x05 ; 5 24b8a: 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); 24b8e: 40 91 ac 00 lds r20, 0x00AC ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> 24b92: 50 91 ad 00 lds r21, 0x00AD ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24b96: 3f ef ldi r19, 0xFF ; 255 24b98: 34 9f mul r19, r20 24b9a: c0 01 movw r24, r0 24b9c: 35 9f mul r19, r21 24b9e: 90 0d add r25, r0 24ba0: 11 24 eor r1, r1 24ba2: 30 91 72 00 lds r19, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24ba6: 6f ef ldi r22, 0xFF ; 255 24ba8: 70 e0 ldi r23, 0x00 ; 0 24baa: 31 ff sbrs r19, 1 24bac: 04 c0 rjmp .+8 ; 0x24bb6 24bae: 60 91 a8 00 lds r22, 0x00A8 ; 0x8000a8 <__TEXT_REGION_LENGTH__+0x7c20a8> 24bb2: 70 91 a9 00 lds r23, 0x00A9 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24bb6: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> 24bba: 70 93 ad 00 sts 0x00AD, r23 ; 0x8000ad <__TEXT_REGION_LENGTH__+0x7c20ad> 24bbe: 60 93 ac 00 sts 0x00AC, r22 ; 0x8000ac <__TEXT_REGION_LENGTH__+0x7c20ac> #endif //EXTRUDER_0_AUTO_FAN_PIN OCR4A = 255U; 24bc2: 8f ef ldi r24, 0xFF ; 255 24bc4: 90 e0 ldi r25, 0x00 ; 0 24bc6: 90 93 a9 00 sts 0x00A9, r25 ; 0x8000a9 <__TEXT_REGION_LENGTH__+0x7c20a9> 24bca: 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)); 24bce: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> 24bd2: 8c 7f andi r24, 0xFC ; 252 24bd4: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__TEXT_REGION_LENGTH__+0x7c2072> CRITICAL_SECTION_END; 24bd8: 2f bf out 0x3f, r18 ; 63 24bda: 78 cf rjmp .-272 ; 0x24acc 00024bdc : /// 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() { 24bdc: cf 93 push r28 #if BEEPER > 0 if (eSoundMode == e_SOUND_MODE_SILENT) return; 24bde: c0 91 47 04 lds r28, 0x0447 ; 0x800447 24be2: c2 30 cpi r28, 0x02 ; 2 24be4: 59 f1 breq .+86 ; 0x24c3c // Handle case where only one beep is needed if (eSoundMode == e_SOUND_MODE_ONCE) { 24be6: c1 30 cpi r28, 0x01 ; 1 24be8: 69 f4 brne .+26 ; 0x24c04 if (bFirst) return; 24bea: 80 91 c1 04 lds r24, 0x04C1 ; 0x8004c1 <_ZL6bFirst.lto_priv.497> 24bee: 81 11 cpse r24, r1 24bf0: 25 c0 rjmp .+74 ; 0x24c3c Sound_MakeCustom(80, 0, false); 24bf2: 40 e0 ldi r20, 0x00 ; 0 24bf4: 70 e0 ldi r23, 0x00 ; 0 24bf6: 60 e0 ldi r22, 0x00 ; 0 24bf8: 80 e5 ldi r24, 0x50 ; 80 24bfa: 90 e0 ldi r25, 0x00 ; 0 24bfc: 0f 94 4a 25 call 0x24a94 ; 0x24a94 bFirst = true; 24c00: c0 93 c1 04 sts 0x04C1, r28 ; 0x8004c1 <_ZL6bFirst.lto_priv.497> } // Handle case where there should be continous beeps if (beep_timer.expired_cont(CONTINOUS_BEEP_PERIOD)) { 24c04: 60 ed ldi r22, 0xD0 ; 208 24c06: 77 e0 ldi r23, 0x07 ; 7 24c08: 8e eb ldi r24, 0xBE ; 190 24c0a: 94 e0 ldi r25, 0x04 ; 4 24c0c: 0f 94 e0 0b call 0x217c0 ; 0x217c0 ::expired_cont(unsigned short)> 24c10: 88 23 and r24, r24 24c12: a1 f0 breq .+40 ; 0x24c3c beep_timer.start(); 24c14: 8e eb ldi r24, 0xBE ; 190 24c16: 94 e0 ldi r25, 0x04 ; 4 24c18: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> if (eSoundMode == e_SOUND_MODE_LOUD) { 24c1c: 80 91 47 04 lds r24, 0x0447 ; 0x800447 24c20: 81 11 cpse r24, r1 24c22: 08 c0 rjmp .+16 ; 0x24c34 Sound_MakeCustom(80, 0, false); 24c24: 40 e0 ldi r20, 0x00 ; 0 24c26: 70 e0 ldi r23, 0x00 ; 0 24c28: 60 e0 ldi r22, 0x00 ; 0 24c2a: 80 e5 ldi r24, 0x50 ; 80 24c2c: 90 e0 ldi r25, 0x00 ; 0 // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); } } #endif // BEEPER > 0 } 24c2e: 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); 24c30: 0d 94 4a 25 jmp 0x24a94 ; 0x24a94 } else { // Assist (lower volume sound) Sound_MakeSound(e_SOUND_TYPE_ButtonEcho); 24c34: 80 e0 ldi r24, 0x00 ; 0 } } #endif // BEEPER > 0 } 24c36: 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); 24c38: 0d 94 3f 23 jmp 0x2467e ; 0x2467e } } #endif // BEEPER > 0 } 24c3c: cf 91 pop r28 24c3e: 08 95 ret 00024c40 : { #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; 24c40: 98 b1 in r25, 0x08 ; 8 24c42: 90 7f andi r25, 0xF0 ; 240 PORTC = portC | (axes_mask & 0x0f); //set step signals by mask 24c44: 89 2b or r24, r25 24c46: 88 b9 out 0x08, r24 ; 8 asm("nop"); 24c48: 00 00 nop PORTC = portC; //set step signals to zero 24c4a: 98 b9 out 0x08, r25 ; 8 asm("nop"); 24c4c: 00 00 nop #endif #endif //((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3) || (MOTHERBOARD == BOARD_EINSY_1_0a)) } 24c4e: 08 95 ret 00024c50 : sm4_calc_delay_cb_t sm4_calc_delay_cb = 0; void sm4_set_dir(uint8_t axis, uint8_t dir) { switch (axis) 24c50: 82 30 cpi r24, 0x02 ; 2 24c52: b9 f0 breq .+46 ; 0x24c82 24c54: 83 30 cpi r24, 0x03 ; 3 24c56: e9 f0 breq .+58 ; 0x24c92 24c58: 81 30 cpi r24, 0x01 ; 1 24c5a: 59 f0 breq .+22 ; 0x24c72 { #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; 24c5c: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24c60: 61 11 cpse r22, r1 24c62: 05 c0 rjmp .+10 ; 0x24c6e 24c64: 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; 24c66: 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"); 24c6a: 00 00 nop } 24c6c: 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; 24c6e: 8d 7f andi r24, 0xFD ; 253 24c70: fa cf rjmp .-12 ; 0x24c66 case 1: if (dir == INVERT_Y_DIR) PORTL |= 1; else PORTL &= ~1; break; 24c72: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24c76: 61 11 cpse r22, r1 24c78: 02 c0 rjmp .+4 ; 0x24c7e 24c7a: 81 60 ori r24, 0x01 ; 1 24c7c: f4 cf rjmp .-24 ; 0x24c66 24c7e: 8e 7f andi r24, 0xFE ; 254 24c80: f2 cf rjmp .-28 ; 0x24c66 case 2: if (dir == INVERT_Z_DIR) PORTL |= 4; else PORTL &= ~4; break; 24c82: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24c86: 61 11 cpse r22, r1 24c88: 02 c0 rjmp .+4 ; 0x24c8e 24c8a: 84 60 ori r24, 0x04 ; 4 24c8c: ec cf rjmp .-40 ; 0x24c66 24c8e: 8b 7f andi r24, 0xFB ; 251 24c90: ea cf rjmp .-44 ; 0x24c66 case 3: if (dir == INVERT_E0_DIR) PORTL |= 64; else PORTL &= ~64; break; 24c92: 80 91 0b 01 lds r24, 0x010B ; 0x80010b <__TEXT_REGION_LENGTH__+0x7c210b> 24c96: 61 30 cpi r22, 0x01 ; 1 24c98: 11 f4 brne .+4 ; 0x24c9e 24c9a: 80 64 ori r24, 0x40 ; 64 24c9c: e4 cf rjmp .-56 ; 0x24c66 24c9e: 8f 7b andi r24, 0xBF ; 191 24ca0: e2 cf rjmp .-60 ; 0x24c66 00024ca2 : buf[nbyte] = SPDR; } //------------------------------------------------------------------------------ /** SPI send a byte */ static void spiSend(uint8_t b) { SPDR = b; 24ca2: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24ca4: 0d b4 in r0, 0x2d ; 45 24ca6: 07 fe sbrs r0, 7 24ca8: fd cf rjmp .-6 ; 0x24ca4 } 24caa: 08 95 ret 00024cac : SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; } //------------------------------------------------------------------------------ /** SPI receive a byte */ static uint8_t spiRec() { SPDR = 0XFF; 24cac: 8f ef ldi r24, 0xFF ; 255 24cae: 8e bd out 0x2e, r24 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24cb0: 0d b4 in r0, 0x2d ; 45 24cb2: 07 fe sbrs r0, 7 24cb4: fd cf rjmp .-6 ; 0x24cb0 return SPDR; 24cb6: 8e b5 in r24, 0x2e ; 46 } 24cb8: 08 95 ret 00024cba : } } #endif // SOFTWARE_SPI //------------------------------------------------------------------------------ // send command and return error code. Return zero for OK uint8_t Sd2Card::cardCommand(uint8_t cmd, uint32_t arg) { 24cba: 8f 92 push r8 24cbc: 9f 92 push r9 24cbe: af 92 push r10 24cc0: bf 92 push r11 24cc2: ef 92 push r14 24cc4: ff 92 push r15 24cc6: 0f 93 push r16 24cc8: 1f 93 push r17 24cca: cf 93 push r28 24ccc: 7c 01 movw r14, r24 24cce: c6 2f mov r28, r22 24cd0: 49 01 movw r8, r18 24cd2: 5a 01 movw r10, r20 WRITE(SDSS, 1); } //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); 24cd4: fc 01 movw r30, r24 24cd6: 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); 24cd8: 89 2f mov r24, r25 24cda: 80 6a ori r24, 0xA0 ; 160 24cdc: 86 95 lsr r24 24cde: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 24ce0: 90 fd sbrc r25, 0 24ce2: 03 c0 rjmp .+6 ; 0x24cea 24ce4: 81 e0 ldi r24, 0x01 ; 1 24ce6: 96 30 cpi r25, 0x06 ; 6 24ce8: 09 f4 brne .+2 ; 0x24cec 24cea: 80 e0 ldi r24, 0x00 ; 0 24cec: 8d bd out 0x2d, r24 ; 45 //------------------------------------------------------------------------------ void Sd2Card::chipSelectLow() { #ifndef SOFTWARE_SPI spiInit(spiRate_); #endif // SOFTWARE_SPI WRITE(SDSS, 0); 24cee: 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); 24cf0: 8c e2 ldi r24, 0x2C ; 44 24cf2: 91 e0 ldi r25, 0x01 ; 1 24cf4: 0f 94 7c 65 call 0x2caf8 ; 0x2caf8 // send command spiSend(cmd | 0x40); 24cf8: 8c 2f mov r24, r28 24cfa: 80 64 ori r24, 0x40 ; 64 24cfc: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 24d00: 08 e1 ldi r16, 0x18 ; 24 24d02: 10 e0 ldi r17, 0x00 ; 0 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); 24d04: d5 01 movw r26, r10 24d06: c4 01 movw r24, r8 24d08: 00 2e mov r0, r16 24d0a: 04 c0 rjmp .+8 ; 0x24d14 24d0c: b6 95 lsr r27 24d0e: a7 95 ror r26 24d10: 97 95 ror r25 24d12: 87 95 ror r24 24d14: 0a 94 dec r0 24d16: d2 f7 brpl .-12 ; 0x24d0c 24d18: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 24d1c: 08 50 subi r16, 0x08 ; 8 24d1e: 11 09 sbc r17, r1 24d20: 08 3f cpi r16, 0xF8 ; 248 24d22: ff ef ldi r31, 0xFF ; 255 24d24: 1f 07 cpc r17, r31 24d26: 71 f7 brne .-36 ; 0x24d04 // send CRC uint8_t crc = 0XFF; if (cmd == CMD0) crc = 0X95; // correct crc for CMD0 with arg 0 24d28: 85 e9 ldi r24, 0x95 ; 149 24d2a: cc 23 and r28, r28 24d2c: 21 f0 breq .+8 ; 0x24d36 if (cmd == CMD8) crc = 0X87; // correct crc for CMD8 with arg 0X1AA 24d2e: 87 e8 ldi r24, 0x87 ; 135 24d30: c8 30 cpi r28, 0x08 ; 8 24d32: 09 f0 breq .+2 ; 0x24d36 // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 24d34: 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); 24d36: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 // skip stuff byte for stop read if (cmd == CMD12) spiRec(); 24d3a: cc 30 cpi r28, 0x0C ; 12 24d3c: 11 f4 brne .+4 ; 0x24d42 24d3e: 0f 94 56 26 call 0x24cac ; 0x24cac // send argument for (int8_t s = 24; s >= 0; s -= 8) spiSend(arg >> s); // send CRC uint8_t crc = 0XFF; 24d42: 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 */ } 24d44: 0f 94 56 26 call 0x24cac ; 0x24cac 24d48: f7 01 movw r30, r14 24d4a: 82 83 std Z+2, r24 ; 0x02 24d4c: 87 ff sbrs r24, 7 24d4e: 04 c0 rjmp .+8 ; 0x24d58 24d50: cf 3f cpi r28, 0xFF ; 255 24d52: 11 f0 breq .+4 ; 0x24d58 24d54: cf 5f subi r28, 0xFF ; 255 24d56: f6 cf rjmp .-20 ; 0x24d44 return status_; } 24d58: cf 91 pop r28 24d5a: 1f 91 pop r17 24d5c: 0f 91 pop r16 24d5e: ff 90 pop r15 24d60: ef 90 pop r14 24d62: bf 90 pop r11 24d64: af 90 pop r10 24d66: 9f 90 pop r9 24d68: 8f 90 pop r8 24d6a: 08 95 ret 00024d6c : * \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) { 24d6c: 0f 93 push r16 24d6e: 1f 93 push r17 24d70: cf 93 push r28 24d72: df 93 push r29 24d74: ec 01 movw r28, r24 24d76: 89 01 movw r16, r18 // use address if not SDHC card if (type() != SD_CARD_TYPE_SDHC) blockNumber <<= 9; 24d78: 8b 81 ldd r24, Y+3 ; 0x03 24d7a: 83 30 cpi r24, 0x03 ; 3 24d7c: 39 f0 breq .+14 ; 0x24d8c 24d7e: 89 e0 ldi r24, 0x09 ; 9 24d80: 44 0f add r20, r20 24d82: 55 1f adc r21, r21 24d84: 66 1f adc r22, r22 24d86: 77 1f adc r23, r23 24d88: 8a 95 dec r24 24d8a: d1 f7 brne .-12 ; 0x24d80 if (cardCommand(CMD24, blockNumber)) { 24d8c: 9a 01 movw r18, r20 24d8e: ab 01 movw r20, r22 24d90: 68 e1 ldi r22, 0x18 ; 24 24d92: ce 01 movw r24, r28 24d94: 0f 94 5d 26 call 0x24cba ; 0x24cba 24d98: 88 23 and r24, r24 24d9a: 19 f0 breq .+6 ; 0x24da2 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 24d9c: 86 e0 ldi r24, 0x06 ; 6 24d9e: 88 83 st Y, r24 24da0: 39 c0 rjmp .+114 ; 0x24e14 } //------------------------------------------------------------------------------ /** 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; 24da2: 8e ef ldi r24, 0xFE ; 254 24da4: 8e bd out 0x2e, r24 ; 46 24da6: f8 01 movw r30, r16 24da8: c8 01 movw r24, r16 24daa: 9e 5f subi r25, 0xFE ; 254 for (uint16_t i = 0; i < 512; i += 2) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24dac: 0d b4 in r0, 0x2d ; 45 24dae: 07 fe sbrs r0, 7 24db0: fd cf rjmp .-6 ; 0x24dac SPDR = buf[i]; 24db2: 20 81 ld r18, Z 24db4: 2e bd out 0x2e, r18 ; 46 while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24db6: 0d b4 in r0, 0x2d ; 45 24db8: 07 fe sbrs r0, 7 24dba: fd cf rjmp .-6 ; 0x24db6 SPDR = buf[i + 1]; 24dbc: 21 81 ldd r18, Z+1 ; 0x01 24dbe: 2e bd out 0x2e, r18 ; 46 24dc0: 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) { 24dc2: e8 17 cp r30, r24 24dc4: f9 07 cpc r31, r25 24dc6: 91 f7 brne .-28 ; 0x24dac 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 */ } 24dc8: 0d b4 in r0, 0x2d ; 45 24dca: 07 fe sbrs r0, 7 24dcc: fd cf rjmp .-6 ; 0x24dc8 //------------------------------------------------------------------------------ // 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 24dce: 8f ef ldi r24, 0xFF ; 255 24dd0: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 spiSend(0xff); // dummy crc 24dd4: 8f ef ldi r24, 0xFF ; 255 24dd6: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 status_ = spiRec(); 24dda: 0f 94 56 26 call 0x24cac ; 0x24cac 24dde: 8a 83 std Y+2, r24 ; 0x02 if ((status_ & DATA_RES_MASK) != DATA_RES_ACCEPTED) { 24de0: 8f 71 andi r24, 0x1F ; 31 24de2: 85 30 cpi r24, 0x05 ; 5 24de4: 99 f4 brne .+38 ; 0x24e0c goto fail; } if (!writeData(DATA_START_BLOCK, src)) goto fail; // wait for flash programming to complete if (!waitNotBusy(SD_WRITE_TIMEOUT)) { 24de6: 88 e5 ldi r24, 0x58 ; 88 24de8: 92 e0 ldi r25, 0x02 ; 2 24dea: 0f 94 7c 65 call 0x2caf8 ; 0x2caf8 24dee: 18 2f mov r17, r24 24df0: 87 e1 ldi r24, 0x17 ; 23 24df2: 11 23 and r17, r17 24df4: a1 f2 breq .-88 ; 0x24d9e error(SD_CARD_ERROR_WRITE_TIMEOUT); goto fail; } // response is r2 so get and check two bytes for nonzero if (cardCommand(CMD13, 0) || spiRec()) { 24df6: 20 e0 ldi r18, 0x00 ; 0 24df8: 30 e0 ldi r19, 0x00 ; 0 24dfa: a9 01 movw r20, r18 24dfc: 6d e0 ldi r22, 0x0D ; 13 24dfe: ce 01 movw r24, r28 24e00: 0f 94 5d 26 call 0x24cba ; 0x24cba 24e04: 88 23 and r24, r24 24e06: 51 f0 breq .+20 ; 0x24e1c 24e08: 86 e1 ldi r24, 0x16 ; 22 24e0a: c9 cf rjmp .-110 ; 0x24d9e 24e0c: 83 e1 ldi r24, 0x13 ; 19 24e0e: 88 83 st Y, r24 goto fail; } return true; fail: chipSelectHigh(); 24e10: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 } chipSelectHigh(); return true; fail: chipSelectHigh(); 24e14: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 return false; 24e18: 10 e0 ldi r17, 0x00 ; 0 24e1a: 06 c0 rjmp .+12 ; 0x24e28 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()) { 24e1c: 0f 94 56 26 call 0x24cac ; 0x24cac 24e20: 81 11 cpse r24, r1 24e22: f2 cf rjmp .-28 ; 0x24e08 error(SD_CARD_ERROR_WRITE_PROGRAMMING); goto fail; } chipSelectHigh(); 24e24: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 return true; fail: chipSelectHigh(); return false; } 24e28: 81 2f mov r24, r17 24e2a: df 91 pop r29 24e2c: cf 91 pop r28 24e2e: 1f 91 pop r17 24e30: 0f 91 pop r16 24e32: 08 95 ret 00024e34 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { 24e34: cf 93 push r28 if (cacheDirty_) { 24e36: 80 91 42 0e lds r24, 0x0E42 ; 0x800e42 } cacheMirrorBlock_ = 0; } cacheDirty_ = 0; } return true; 24e3a: c1 e0 ldi r28, 0x01 ; 1 fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheFlush() { if (cacheDirty_) { 24e3c: 88 23 and r24, r24 24e3e: a1 f0 breq .+40 ; 0x24e68 if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { 24e40: 40 91 3a 0e lds r20, 0x0E3A ; 0x800e3a 24e44: 50 91 3b 0e lds r21, 0x0E3B ; 0x800e3b 24e48: 60 91 3c 0e lds r22, 0x0E3C ; 0x800e3c 24e4c: 70 91 3d 0e lds r23, 0x0E3D ; 0x800e3d 24e50: 26 e4 ldi r18, 0x46 ; 70 24e52: 3e e0 ldi r19, 0x0E ; 14 24e54: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 24e58: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 24e5c: 0f 94 b6 26 call 0x24d6c ; 0x24d6c 24e60: c8 2f mov r28, r24 24e62: 81 11 cpse r24, r1 24e64: 04 c0 rjmp .+8 ; 0x24e6e cacheDirty_ = 0; } return true; fail: return false; 24e66: c0 e0 ldi r28, 0x00 ; 0 } 24e68: 8c 2f mov r24, r28 24e6a: cf 91 pop r28 24e6c: 08 95 ret if (cacheDirty_) { if (!sdCard_->writeBlock(cacheBlockNumber_, cacheBuffer_.data)) { goto fail; } // mirror FAT tables if (cacheMirrorBlock_) { 24e6e: 40 91 3e 0e lds r20, 0x0E3E ; 0x800e3e 24e72: 50 91 3f 0e lds r21, 0x0E3F ; 0x800e3f 24e76: 60 91 40 0e lds r22, 0x0E40 ; 0x800e40 24e7a: 70 91 41 0e lds r23, 0x0E41 ; 0x800e41 24e7e: 41 15 cp r20, r1 24e80: 51 05 cpc r21, r1 24e82: 61 05 cpc r22, r1 24e84: 71 05 cpc r23, r1 24e86: 91 f0 breq .+36 ; 0x24eac if (!sdCard_->writeBlock(cacheMirrorBlock_, cacheBuffer_.data)) { 24e88: 26 e4 ldi r18, 0x46 ; 70 24e8a: 3e e0 ldi r19, 0x0E ; 14 24e8c: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 24e90: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 24e94: 0f 94 b6 26 call 0x24d6c ; 0x24d6c 24e98: 88 23 and r24, r24 24e9a: 29 f3 breq .-54 ; 0x24e66 goto fail; } cacheMirrorBlock_ = 0; 24e9c: 10 92 3e 0e sts 0x0E3E, r1 ; 0x800e3e 24ea0: 10 92 3f 0e sts 0x0E3F, r1 ; 0x800e3f 24ea4: 10 92 40 0e sts 0x0E40, r1 ; 0x800e40 24ea8: 10 92 41 0e sts 0x0E41, r1 ; 0x800e41 } cacheDirty_ = 0; 24eac: 10 92 42 0e sts 0x0E42, r1 ; 0x800e42 24eb0: db cf rjmp .-74 ; 0x24e68 00024eb2 : * \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) { 24eb2: 2f 92 push r2 24eb4: 3f 92 push r3 24eb6: 4f 92 push r4 24eb8: 5f 92 push r5 24eba: 6f 92 push r6 24ebc: 7f 92 push r7 24ebe: 8f 92 push r8 24ec0: 9f 92 push r9 24ec2: af 92 push r10 24ec4: bf 92 push r11 24ec6: cf 92 push r12 24ec8: df 92 push r13 24eca: ef 92 push r14 24ecc: ff 92 push r15 24ece: 0f 93 push r16 24ed0: 1f 93 push r17 24ed2: cf 93 push r28 24ed4: df 93 push r29 24ed6: ec 01 movw r28, r24 24ed8: 2a 01 movw r4, r20 24eda: 3b 01 movw r6, r22 24edc: 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; 24ede: 8b 81 ldd r24, Y+3 ; 0x03 24ee0: 83 30 cpi r24, 0x03 ; 3 24ee2: 39 f0 breq .+14 ; 0x24ef2 24ee4: 69 e0 ldi r22, 0x09 ; 9 24ee6: 44 0c add r4, r4 24ee8: 55 1c adc r5, r5 24eea: 66 1c adc r6, r6 24eec: 77 1c adc r7, r7 24eee: 6a 95 dec r22 24ef0: d1 f7 brne .-12 ; 0x24ee6 retry2: 24ef2: 43 e0 ldi r20, 0x03 ; 3 24ef4: 94 2e mov r9, r20 24ef6: 56 01 movw r10, r12 24ef8: 81 e0 ldi r24, 0x01 ; 1 24efa: a8 1a sub r10, r24 24efc: 8e ef ldi r24, 0xFE ; 254 24efe: b8 0a sbc r11, r24 24f00: 16 01 movw r2, r12 24f02: ee ef ldi r30, 0xFE ; 254 24f04: 3e 1a sub r3, r30 24f06: 54 e0 ldi r21, 0x04 ; 4 24f08: 85 2e mov r8, r21 retryCnt --; 24f0a: 9a 94 dec r9 if (cardCommand(CMD17, blockNumber)) { 24f0c: a3 01 movw r20, r6 24f0e: 92 01 movw r18, r4 24f10: 61 e1 ldi r22, 0x11 ; 17 24f12: ce 01 movw r24, r28 24f14: 0f 94 5d 26 call 0x24cba ; 0x24cba 24f18: 88 23 and r24, r24 24f1a: 79 f0 breq .+30 ; 0x24f3a 24f1c: 88 82 st Y, r8 error(SD_CARD_ERROR_CMD17); if (retryCnt > 0) goto retry; 24f1e: 99 20 and r9, r9 24f20: 09 f4 brne .+2 ; 0x24f24 24f22: 7a c0 rjmp .+244 ; 0x25018 if (retryCnt > 0) goto retry; goto fail; } return true; retry: chipSelectHigh(); 24f24: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 cardCommand(CMD12, 0);//Try sending a stop command, but ignore the result. 24f28: 20 e0 ldi r18, 0x00 ; 0 24f2a: 30 e0 ldi r19, 0x00 ; 0 24f2c: a9 01 movw r20, r18 24f2e: 6c e0 ldi r22, 0x0C ; 12 24f30: ce 01 movw r24, r28 24f32: 0f 94 5d 26 call 0x24cba ; 0x24cba errorCode_ = 0; 24f36: 18 82 st Y, r1 24f38: e8 cf rjmp .-48 ; 0x24f0a #endif //------------------------------------------------------------------------------ bool Sd2Card::readData(uint8_t* dst, uint16_t count) { // wait for start block token uint16_t t0 = _millis(); 24f3a: 0f 94 89 0b call 0x21712 ; 0x21712 24f3e: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 24f40: 0f 94 56 26 call 0x24cac ; 0x24cac 24f44: 8a 83 std Y+2, r24 ; 0x02 24f46: 8f 3f cpi r24, 0xFF ; 255 24f48: 91 f4 brne .+36 ; 0x24f6e if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 24f4a: 0f 94 89 0b call 0x21712 ; 0x21712 24f4e: 60 1b sub r22, r16 24f50: 71 0b sbc r23, r17 24f52: 6d 32 cpi r22, 0x2D ; 45 24f54: 71 40 sbci r23, 0x01 ; 1 24f56: a0 f3 brcs .-24 ; 0x24f40 24f58: 81 e1 ldi r24, 0x11 ; 17 24f5a: 88 83 st Y, r24 if (flash_air_compatible_) spiSend(0XFF); return true; fail: chipSelectHigh(); 24f5c: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 24f60: 8c 81 ldd r24, Y+4 ; 0x04 24f62: 88 23 and r24, r24 24f64: e1 f2 breq .-72 ; 0x24f1e spiSend(0XFF); 24f66: 8f ef ldi r24, 0xFF ; 255 24f68: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 24f6c: d8 cf rjmp .-80 ; 0x24f1e if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 24f6e: 8e 3f cpi r24, 0xFE ; 254 24f70: 11 f0 breq .+4 ; 0x24f76 24f72: 8f e0 ldi r24, 0x0F ; 15 24f74: f2 cf rjmp .-28 ; 0x24f5a //------------------------------------------------------------------------------ /** 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; 24f76: 8f ef ldi r24, 0xFF ; 255 24f78: 8e bd out 0x2e, r24 ; 46 24f7a: d6 01 movw r26, r12 24f7c: f6 01 movw r30, r12 for (uint16_t i = 0; i < nbyte; i++) { while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24f7e: 0d b4 in r0, 0x2d ; 45 24f80: 07 fe sbrs r0, 7 24f82: fd cf rjmp .-6 ; 0x24f7e buf[i] = SPDR; 24f84: 9e b5 in r25, 0x2e ; 46 24f86: 91 93 st Z+, r25 SPDR = 0XFF; 24f88: 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++) { 24f8a: ea 15 cp r30, r10 24f8c: fb 05 cpc r31, r11 24f8e: b9 f7 brne .-18 ; 0x24f7e while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } buf[i] = SPDR; SPDR = 0XFF; } while (!(SPSR & (1 << SPIF))) { /* Intentionally left empty */ } 24f90: 0d b4 in r0, 0x2d ; 45 24f92: 07 fe sbrs r0, 7 24f94: fd cf rjmp .-6 ; 0x24f90 buf[nbyte] = SPDR; 24f96: 8e b5 in r24, 0x2e ; 46 24f98: f5 01 movw r30, r10 24f9a: 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; 24f9c: f1 2c mov r15, r1 24f9e: 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); 24fa0: 8d 91 ld r24, X+ 24fa2: ef 2d mov r30, r15 24fa4: ff 27 eor r31, r31 24fa6: e8 27 eor r30, r24 24fa8: ee 0f add r30, r30 24faa: ff 1f adc r31, r31 24fac: e2 57 subi r30, 0x72 ; 114 24fae: f5 47 sbci r31, 0x75 ; 117 24fb0: 85 91 lpm r24, Z+ 24fb2: 94 91 lpm r25, Z 24fb4: fe 2c mov r15, r14 24fb6: ee 24 eor r14, r14 24fb8: e8 26 eor r14, r24 24fba: 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++) { 24fbc: 2a 16 cp r2, r26 24fbe: 3b 06 cpc r3, r27 24fc0: 79 f7 brne .-34 ; 0x24fa0 spiRead(dst, count); #ifdef SD_CHECK_AND_RETRY { uint16_t calcCrc = CRC_CCITT(dst, count); uint16_t recvCrc = spiRec() << 8; 24fc2: 0f 94 56 26 call 0x24cac ; 0x24cac 24fc6: 08 2f mov r16, r24 24fc8: 10 e0 ldi r17, 0x00 ; 0 24fca: 10 2f mov r17, r16 24fcc: 00 27 eor r16, r16 recvCrc |= spiRec(); 24fce: 0f 94 56 26 call 0x24cac ; 0x24cac 24fd2: 08 2b or r16, r24 if (calcCrc != recvCrc) 24fd4: 0e 15 cp r16, r14 24fd6: 1f 05 cpc r17, r15 24fd8: 19 f0 breq .+6 ; 0x24fe0 24fda: f0 e2 ldi r31, 0x20 ; 32 24fdc: f8 83 st Y, r31 24fde: be cf rjmp .-132 ; 0x24f5c #else // discard CRC spiRec(); spiRec(); #endif chipSelectHigh(); 24fe0: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 // Toshiba FlashAir Patch. Purge pending status byte. if (flash_air_compatible_) 24fe4: cc 81 ldd r28, Y+4 ; 0x04 24fe6: cc 23 and r28, r28 24fe8: d9 f0 breq .+54 ; 0x25020 spiSend(0XFF); 24fea: 8f ef ldi r24, 0xFF ; 255 24fec: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 #endif fail: chipSelectHigh(); return false; } 24ff0: 8c 2f mov r24, r28 24ff2: df 91 pop r29 24ff4: cf 91 pop r28 24ff6: 1f 91 pop r17 24ff8: 0f 91 pop r16 24ffa: ff 90 pop r15 24ffc: ef 90 pop r14 24ffe: df 90 pop r13 25000: cf 90 pop r12 25002: bf 90 pop r11 25004: af 90 pop r10 25006: 9f 90 pop r9 25008: 8f 90 pop r8 2500a: 7f 90 pop r7 2500c: 6f 90 pop r6 2500e: 5f 90 pop r5 25010: 4f 90 pop r4 25012: 3f 90 pop r3 25014: 2f 90 pop r2 25016: 08 95 ret } return readData(dst, 512); #endif fail: chipSelectHigh(); 25018: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 return false; 2501c: c0 e0 ldi r28, 0x00 ; 0 2501e: e8 cf rjmp .-48 ; 0x24ff0 if (!readData(dst, 512)) { if (retryCnt > 0) goto retry; goto fail; } return true; 25020: c1 e0 ldi r28, 0x01 ; 1 25022: e6 cf rjmp .-52 ; 0x24ff0 00025024 : fail: return false; } //------------------------------------------------------------------------------ bool SdVolume::cacheRawBlock(uint32_t blockNumber, bool dirty) { 25024: cf 92 push r12 25026: df 92 push r13 25028: ef 92 push r14 2502a: ff 92 push r15 2502c: cf 93 push r28 2502e: 6b 01 movw r12, r22 25030: 7c 01 movw r14, r24 25032: c4 2f mov r28, r20 if (cacheBlockNumber_ != blockNumber) { 25034: 80 91 3a 0e lds r24, 0x0E3A ; 0x800e3a 25038: 90 91 3b 0e lds r25, 0x0E3B ; 0x800e3b 2503c: a0 91 3c 0e lds r26, 0x0E3C ; 0x800e3c 25040: b0 91 3d 0e lds r27, 0x0E3D ; 0x800e3d 25044: 8c 15 cp r24, r12 25046: 9d 05 cpc r25, r13 25048: ae 05 cpc r26, r14 2504a: bf 05 cpc r27, r15 2504c: 01 f1 breq .+64 ; 0x2508e if (!cacheFlush()) goto fail; 2504e: 0f 94 1a 27 call 0x24e34 ; 0x24e34 25052: 81 11 cpse r24, r1 25054: 08 c0 rjmp .+16 ; 0x25066 } if (dirty) cacheDirty_ = true; return true; fail: return false; 25056: c0 e0 ldi r28, 0x00 ; 0 } 25058: 8c 2f mov r24, r28 2505a: cf 91 pop r28 2505c: ff 90 pop r15 2505e: ef 90 pop r14 25060: df 90 pop r13 25062: cf 90 pop r12 25064: 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; 25066: 26 e4 ldi r18, 0x46 ; 70 25068: 3e e0 ldi r19, 0x0E ; 14 2506a: b7 01 movw r22, r14 2506c: a6 01 movw r20, r12 2506e: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 25072: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 25076: 0f 94 59 27 call 0x24eb2 ; 0x24eb2 2507a: 88 23 and r24, r24 2507c: 61 f3 breq .-40 ; 0x25056 cacheBlockNumber_ = blockNumber; 2507e: c0 92 3a 0e sts 0x0E3A, r12 ; 0x800e3a 25082: d0 92 3b 0e sts 0x0E3B, r13 ; 0x800e3b 25086: e0 92 3c 0e sts 0x0E3C, r14 ; 0x800e3c 2508a: f0 92 3d 0e sts 0x0E3D, r15 ; 0x800e3d } if (dirty) cacheDirty_ = true; 2508e: cc 23 and r28, r28 25090: 21 f0 breq .+8 ; 0x2509a 25092: 81 e0 ldi r24, 0x01 ; 1 25094: 80 93 42 0e sts 0x0E42, r24 ; 0x800e42 25098: df cf rjmp .-66 ; 0x25058 return true; 2509a: c1 e0 ldi r28, 0x01 ; 1 2509c: dd cf rjmp .-70 ; 0x25058 0002509e : fail: return false; } //------------------------------------------------------------------------------ // Store a FAT entry bool SdVolume::fatPut(uint32_t cluster, uint32_t value) { 2509e: 4f 92 push r4 250a0: 5f 92 push r5 250a2: 6f 92 push r6 250a4: 7f 92 push r7 250a6: 8f 92 push r8 250a8: 9f 92 push r9 250aa: af 92 push r10 250ac: bf 92 push r11 250ae: cf 92 push r12 250b0: df 92 push r13 250b2: ef 92 push r14 250b4: ff 92 push r15 250b6: 0f 93 push r16 250b8: 1f 93 push r17 250ba: cf 93 push r28 250bc: df 93 push r29 250be: ec 01 movw r28, r24 uint32_t lba; // error if reserved cluster if (cluster < 2) goto fail; 250c0: 42 30 cpi r20, 0x02 ; 2 250c2: 51 05 cpc r21, r1 250c4: 61 05 cpc r22, r1 250c6: 71 05 cpc r23, r1 250c8: 90 f4 brcc .+36 ; 0x250ee // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; return true; fail: return false; 250ca: 80 e0 ldi r24, 0x00 ; 0 } 250cc: df 91 pop r29 250ce: cf 91 pop r28 250d0: 1f 91 pop r17 250d2: 0f 91 pop r16 250d4: ff 90 pop r15 250d6: ef 90 pop r14 250d8: df 90 pop r13 250da: cf 90 pop r12 250dc: bf 90 pop r11 250de: af 90 pop r10 250e0: 9f 90 pop r9 250e2: 8f 90 pop r8 250e4: 7f 90 pop r7 250e6: 6f 90 pop r6 250e8: 5f 90 pop r5 250ea: 4f 90 pop r4 250ec: 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; 250ee: 89 85 ldd r24, Y+9 ; 0x09 250f0: 9a 85 ldd r25, Y+10 ; 0x0a 250f2: ab 85 ldd r26, Y+11 ; 0x0b 250f4: bc 85 ldd r27, Y+12 ; 0x0c 250f6: 01 96 adiw r24, 0x01 ; 1 250f8: a1 1d adc r26, r1 250fa: b1 1d adc r27, r1 250fc: 84 17 cp r24, r20 250fe: 95 07 cpc r25, r21 25100: a6 07 cpc r26, r22 25102: b7 07 cpc r27, r23 25104: 10 f3 brcs .-60 ; 0x250ca tmp = ((cacheBuffer_.data[index] & 0XF0)) | tmp >> 4; } cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { 25106: 8f 89 ldd r24, Y+23 ; 0x17 25108: 80 31 cpi r24, 0x10 ; 16 2510a: c9 f5 brne .+114 ; 0x2517e lba = fatStartBlock_ + (cluster >> 8); 2510c: 85 2e mov r8, r21 2510e: 96 2e mov r9, r22 25110: a7 2e mov r10, r23 25112: bb 24 eor r11, r11 25114: 8b 89 ldd r24, Y+19 ; 0x13 25116: 9c 89 ldd r25, Y+20 ; 0x14 25118: ad 89 ldd r26, Y+21 ; 0x15 2511a: be 89 ldd r27, Y+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 2511c: 88 0e add r8, r24 2511e: 99 1e adc r9, r25 25120: aa 1e adc r10, r26 25122: bb 1e adc r11, r27 25124: 28 01 movw r4, r16 25126: 39 01 movw r6, r18 25128: 6a 01 movw r12, r20 2512a: 7b 01 movw r14, r22 } else { goto fail; } if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; 2512c: 41 e0 ldi r20, 0x01 ; 1 2512e: c5 01 movw r24, r10 25130: b4 01 movw r22, r8 25132: 0f 94 12 28 call 0x25024 ; 0x25024 25136: 88 23 and r24, r24 25138: 41 f2 breq .-112 ; 0x250ca // store entry if (fatType_ == 16) { 2513a: 9f 89 ldd r25, Y+23 ; 0x17 2513c: 90 31 cpi r25, 0x10 ; 16 2513e: 81 f5 brne .+96 ; 0x251a0 cacheBuffer_.fat16[cluster & 0XFF] = value; 25140: dd 24 eor r13, r13 25142: ee 24 eor r14, r14 25144: ff 24 eor r15, r15 25146: f6 01 movw r30, r12 25148: ee 0f add r30, r30 2514a: ff 1f adc r31, r31 2514c: ea 5b subi r30, 0xBA ; 186 2514e: f1 4f sbci r31, 0xF1 ; 241 25150: 11 83 std Z+1, r17 ; 0x01 25152: 00 83 st Z, r16 } else { cacheBuffer_.fat32[cluster & 0X7F] = value; } // mirror second FAT if (fatCount_ > 1) cacheMirrorBlock_ = lba + blocksPerFat_; 25154: 9a 89 ldd r25, Y+18 ; 0x12 25156: 92 30 cpi r25, 0x02 ; 2 25158: 08 f4 brcc .+2 ; 0x2515c 2515a: b8 cf rjmp .-144 ; 0x250cc 2515c: 4d 81 ldd r20, Y+5 ; 0x05 2515e: 5e 81 ldd r21, Y+6 ; 0x06 25160: 6f 81 ldd r22, Y+7 ; 0x07 25162: 78 85 ldd r23, Y+8 ; 0x08 25164: 84 0e add r8, r20 25166: 95 1e adc r9, r21 25168: a6 1e adc r10, r22 2516a: b7 1e adc r11, r23 2516c: 80 92 3e 0e sts 0x0E3E, r8 ; 0x800e3e 25170: 90 92 3f 0e sts 0x0E3F, r9 ; 0x800e3f 25174: a0 92 40 0e sts 0x0E40, r10 ; 0x800e40 25178: b0 92 41 0e sts 0x0E41, r11 ; 0x800e41 2517c: a7 cf rjmp .-178 ; 0x250cc cacheBuffer_.data[index] = tmp; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 2517e: 80 32 cpi r24, 0x20 ; 32 25180: 09 f0 breq .+2 ; 0x25184 25182: a3 cf rjmp .-186 ; 0x250ca lba = fatStartBlock_ + (cluster >> 7); 25184: 8b 89 ldd r24, Y+19 ; 0x13 25186: 9c 89 ldd r25, Y+20 ; 0x14 25188: ad 89 ldd r26, Y+21 ; 0x15 2518a: be 89 ldd r27, Y+22 ; 0x16 2518c: 4a 01 movw r8, r20 2518e: 5b 01 movw r10, r22 25190: e7 e0 ldi r30, 0x07 ; 7 25192: b6 94 lsr r11 25194: a7 94 ror r10 25196: 97 94 ror r9 25198: 87 94 ror r8 2519a: ea 95 dec r30 2519c: d1 f7 brne .-12 ; 0x25192 2519e: be cf rjmp .-132 ; 0x2511c if (!cacheRawBlock(lba, CACHE_FOR_WRITE)) goto fail; // store entry if (fatType_ == 16) { cacheBuffer_.fat16[cluster & 0XFF] = value; } else { cacheBuffer_.fat32[cluster & 0X7F] = value; 251a0: e8 94 clt 251a2: c7 f8 bld r12, 7 251a4: dd 24 eor r13, r13 251a6: ee 24 eor r14, r14 251a8: ff 24 eor r15, r15 251aa: f6 01 movw r30, r12 251ac: ee 0f add r30, r30 251ae: ff 1f adc r31, r31 251b0: ee 0f add r30, r30 251b2: ff 1f adc r31, r31 251b4: ea 5b subi r30, 0xBA ; 186 251b6: f1 4f sbci r31, 0xF1 ; 241 251b8: 40 82 st Z, r4 251ba: 51 82 std Z+1, r5 ; 0x01 251bc: 62 82 std Z+2, r6 ; 0x02 251be: 73 82 std Z+3, r7 ; 0x03 251c0: c9 cf rjmp .-110 ; 0x25154 000251c2 : fail: return false; } //------------------------------------------------------------------------------ // Fetch a FAT entry bool SdVolume::fatGet(uint32_t cluster, uint32_t* value) { 251c2: cf 92 push r12 251c4: df 92 push r13 251c6: ef 92 push r14 251c8: ff 92 push r15 251ca: 0f 93 push r16 251cc: 1f 93 push r17 251ce: cf 93 push r28 251d0: df 93 push r29 251d2: fc 01 movw r30, r24 uint32_t lba; if (cluster > (clusterCount_ + 1)) goto fail; 251d4: 81 85 ldd r24, Z+9 ; 0x09 251d6: 92 85 ldd r25, Z+10 ; 0x0a 251d8: a3 85 ldd r26, Z+11 ; 0x0b 251da: b4 85 ldd r27, Z+12 ; 0x0c 251dc: 01 96 adiw r24, 0x01 ; 1 251de: a1 1d adc r26, r1 251e0: b1 1d adc r27, r1 251e2: 84 17 cp r24, r20 251e4: 95 07 cpc r25, r21 251e6: a6 07 cpc r26, r22 251e8: b7 07 cpc r27, r23 251ea: 50 f4 brcc .+20 ; 0x25200 *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; } return true; fail: return false; 251ec: 80 e0 ldi r24, 0x00 ; 0 } 251ee: df 91 pop r29 251f0: cf 91 pop r28 251f2: 1f 91 pop r17 251f4: 0f 91 pop r16 251f6: ff 90 pop r15 251f8: ef 90 pop r14 251fa: df 90 pop r13 251fc: cf 90 pop r12 251fe: 08 95 ret } tmp |= cacheBuffer_.data[index] << 8; *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { 25200: 87 89 ldd r24, Z+23 ; 0x17 25202: 80 31 cpi r24, 0x10 ; 16 25204: a9 f5 brne .+106 ; 0x25270 lba = fatStartBlock_ + (cluster >> 8); 25206: bb 27 eor r27, r27 25208: a7 2f mov r26, r23 2520a: 96 2f mov r25, r22 2520c: 85 2f mov r24, r21 2520e: c3 88 ldd r12, Z+19 ; 0x13 25210: d4 88 ldd r13, Z+20 ; 0x14 25212: e5 88 ldd r14, Z+21 ; 0x15 25214: f6 88 ldd r15, Z+22 ; 0x16 } else if (fatType_ == 32) { lba = fatStartBlock_ + (cluster >> 7); 25216: 8c 0d add r24, r12 25218: 9d 1d adc r25, r13 2521a: ae 1d adc r26, r14 2521c: bf 1d adc r27, r15 2521e: e9 01 movw r28, r18 25220: 6a 01 movw r12, r20 25222: 7b 01 movw r14, r22 25224: 8f 01 movw r16, r30 } else { goto fail; } if (lba != cacheBlockNumber_) { 25226: 40 91 3a 0e lds r20, 0x0E3A ; 0x800e3a 2522a: 50 91 3b 0e lds r21, 0x0E3B ; 0x800e3b 2522e: 60 91 3c 0e lds r22, 0x0E3C ; 0x800e3c 25232: 70 91 3d 0e lds r23, 0x0E3D ; 0x800e3d 25236: 84 17 cp r24, r20 25238: 95 07 cpc r25, r21 2523a: a6 07 cpc r26, r22 2523c: b7 07 cpc r27, r23 2523e: 49 f5 brne .+82 ; 0x25292 if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; } if (fatType_ == 16) { 25240: f8 01 movw r30, r16 25242: 87 89 ldd r24, Z+23 ; 0x17 25244: 80 31 cpi r24, 0x10 ; 16 25246: 69 f5 brne .+90 ; 0x252a2 *value = cacheBuffer_.fat16[cluster & 0XFF]; 25248: b7 01 movw r22, r14 2524a: a6 01 movw r20, r12 2524c: 55 27 eor r21, r21 2524e: 66 27 eor r22, r22 25250: 77 27 eor r23, r23 25252: 44 0f add r20, r20 25254: 55 1f adc r21, r21 25256: 4a 5b subi r20, 0xBA ; 186 25258: 51 4f sbci r21, 0xF1 ; 241 2525a: fa 01 movw r30, r20 2525c: 80 81 ld r24, Z 2525e: 91 81 ldd r25, Z+1 ; 0x01 25260: b0 e0 ldi r27, 0x00 ; 0 25262: a0 e0 ldi r26, 0x00 ; 0 } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 25264: 88 83 st Y, r24 25266: 99 83 std Y+1, r25 ; 0x01 25268: aa 83 std Y+2, r26 ; 0x02 2526a: bb 83 std Y+3, r27 ; 0x03 2526c: 81 e0 ldi r24, 0x01 ; 1 2526e: bf cf rjmp .-130 ; 0x251ee *value = cluster & 1 ? tmp >> 4 : tmp & 0XFFF; return true; } if (fatType_ == 16) { lba = fatStartBlock_ + (cluster >> 8); } else if (fatType_ == 32) { 25270: 80 32 cpi r24, 0x20 ; 32 25272: 09 f0 breq .+2 ; 0x25276 25274: bb cf rjmp .-138 ; 0x251ec lba = fatStartBlock_ + (cluster >> 7); 25276: c3 88 ldd r12, Z+19 ; 0x13 25278: d4 88 ldd r13, Z+20 ; 0x14 2527a: e5 88 ldd r14, Z+21 ; 0x15 2527c: f6 88 ldd r15, Z+22 ; 0x16 2527e: db 01 movw r26, r22 25280: ca 01 movw r24, r20 25282: c7 e0 ldi r28, 0x07 ; 7 25284: b6 95 lsr r27 25286: a7 95 ror r26 25288: 97 95 ror r25 2528a: 87 95 ror r24 2528c: ca 95 dec r28 2528e: d1 f7 brne .-12 ; 0x25284 25290: c2 cf rjmp .-124 ; 0x25216 } else { goto fail; } if (lba != cacheBlockNumber_) { if (!cacheRawBlock(lba, CACHE_FOR_READ)) goto fail; 25292: 40 e0 ldi r20, 0x00 ; 0 25294: bc 01 movw r22, r24 25296: cd 01 movw r24, r26 25298: 0f 94 12 28 call 0x25024 ; 0x25024 2529c: 81 11 cpse r24, r1 2529e: d0 cf rjmp .-96 ; 0x25240 252a0: a5 cf rjmp .-182 ; 0x251ec } if (fatType_ == 16) { *value = cacheBuffer_.fat16[cluster & 0XFF]; } else { *value = cacheBuffer_.fat32[cluster & 0X7F] & FAT32MASK; 252a2: b7 01 movw r22, r14 252a4: a6 01 movw r20, r12 252a6: 4f 77 andi r20, 0x7F ; 127 252a8: 55 27 eor r21, r21 252aa: 66 27 eor r22, r22 252ac: 77 27 eor r23, r23 252ae: 44 0f add r20, r20 252b0: 55 1f adc r21, r21 252b2: 44 0f add r20, r20 252b4: 55 1f adc r21, r21 252b6: 4a 5b subi r20, 0xBA ; 186 252b8: 51 4f sbci r21, 0xF1 ; 241 252ba: fa 01 movw r30, r20 252bc: 80 81 ld r24, Z 252be: 91 81 ldd r25, Z+1 ; 0x01 252c0: a2 81 ldd r26, Z+2 ; 0x02 252c2: b3 81 ldd r27, Z+3 ; 0x03 252c4: bf 70 andi r27, 0x0F ; 15 252c6: ce cf rjmp .-100 ; 0x25264 000252c8 : fail: return false; } //------------------------------------------------------------------------------ // return the size in bytes of a cluster chain bool SdVolume::chainSize(uint32_t cluster, uint32_t* size) { 252c8: 4f 92 push r4 252ca: 5f 92 push r5 252cc: 6f 92 push r6 252ce: 7f 92 push r7 252d0: af 92 push r10 252d2: bf 92 push r11 252d4: cf 92 push r12 252d6: df 92 push r13 252d8: ef 92 push r14 252da: ff 92 push r15 252dc: 0f 93 push r16 252de: 1f 93 push r17 252e0: cf 93 push r28 252e2: df 93 push r29 252e4: 00 d0 rcall .+0 ; 0x252e6 252e6: 1f 92 push r1 252e8: cd b7 in r28, 0x3d ; 61 252ea: de b7 in r29, 0x3e ; 62 252ec: 8c 01 movw r16, r24 252ee: 49 83 std Y+1, r20 ; 0x01 252f0: 5a 83 std Y+2, r21 ; 0x02 252f2: 6b 83 std Y+3, r22 ; 0x03 252f4: 7c 83 std Y+4, r23 ; 0x04 252f6: 59 01 movw r10, r18 uint32_t s = 0; 252f8: c1 2c mov r12, r1 252fa: d1 2c mov r13, r1 252fc: 76 01 movw r14, r12 do { if (!fatGet(cluster, &cluster)) goto fail; s += 512UL << clusterSizeShift_; 252fe: 41 2c mov r4, r1 25300: 82 e0 ldi r24, 0x02 ; 2 25302: 58 2e mov r5, r24 25304: 61 2c mov r6, r1 25306: 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; 25308: 49 81 ldd r20, Y+1 ; 0x01 2530a: 5a 81 ldd r21, Y+2 ; 0x02 2530c: 6b 81 ldd r22, Y+3 ; 0x03 2530e: 7c 81 ldd r23, Y+4 ; 0x04 25310: 9e 01 movw r18, r28 25312: 2f 5f subi r18, 0xFF ; 255 25314: 3f 4f sbci r19, 0xFF ; 255 25316: c8 01 movw r24, r16 25318: 0f 94 e1 28 call 0x251c2 ; 0x251c2 2531c: 88 23 and r24, r24 2531e: 19 f1 breq .+70 ; 0x25366 s += 512UL << clusterSizeShift_; 25320: f8 01 movw r30, r16 25322: 85 85 ldd r24, Z+13 ; 0x0d 25324: a3 01 movw r20, r6 25326: 92 01 movw r18, r4 25328: 04 c0 rjmp .+8 ; 0x25332 2532a: 22 0f add r18, r18 2532c: 33 1f adc r19, r19 2532e: 44 1f adc r20, r20 25330: 55 1f adc r21, r21 25332: 8a 95 dec r24 25334: d2 f7 brpl .-12 ; 0x2532a 25336: da 01 movw r26, r20 25338: c9 01 movw r24, r18 2533a: c8 0e add r12, r24 2533c: d9 1e adc r13, r25 2533e: ea 1e adc r14, r26 25340: fb 1e adc r15, r27 } while (!isEOC(cluster)); 25342: 49 81 ldd r20, Y+1 ; 0x01 25344: 5a 81 ldd r21, Y+2 ; 0x02 25346: 6b 81 ldd r22, Y+3 ; 0x03 25348: 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; 2534a: 87 89 ldd r24, Z+23 ; 0x17 2534c: 80 31 cpi r24, 0x10 ; 16 2534e: f1 f4 brne .+60 ; 0x2538c 25350: 81 e0 ldi r24, 0x01 ; 1 25352: 48 3f cpi r20, 0xF8 ; 248 25354: 5f 4f sbci r21, 0xFF ; 255 25356: 61 05 cpc r22, r1 25358: 71 05 cpc r23, r1 2535a: b0 f2 brcs .-84 ; 0x25308 *size = s; 2535c: f5 01 movw r30, r10 2535e: c0 82 st Z, r12 25360: d1 82 std Z+1, r13 ; 0x01 25362: e2 82 std Z+2, r14 ; 0x02 25364: f3 82 std Z+3, r15 ; 0x03 return true; fail: return false; } 25366: 0f 90 pop r0 25368: 0f 90 pop r0 2536a: 0f 90 pop r0 2536c: 0f 90 pop r0 2536e: df 91 pop r29 25370: cf 91 pop r28 25372: 1f 91 pop r17 25374: 0f 91 pop r16 25376: ff 90 pop r15 25378: ef 90 pop r14 2537a: df 90 pop r13 2537c: cf 90 pop r12 2537e: bf 90 pop r11 25380: af 90 pop r10 25382: 7f 90 pop r7 25384: 6f 90 pop r6 25386: 5f 90 pop r5 25388: 4f 90 pop r4 2538a: 08 95 ret return cluster >= FAT32EOC_MIN; 2538c: 81 e0 ldi r24, 0x01 ; 1 2538e: 48 3f cpi r20, 0xF8 ; 248 25390: 5f 4f sbci r21, 0xFF ; 255 25392: 6f 4f sbci r22, 0xFF ; 255 25394: 7f 40 sbci r23, 0x0F ; 15 25396: 08 f4 brcc .+2 ; 0x2539a 25398: b7 cf rjmp .-146 ; 0x25308 2539a: e0 cf rjmp .-64 ; 0x2535c 0002539c : * \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) { 2539c: 0f 93 push r16 2539e: 1f 93 push r17 253a0: cf 93 push r28 253a2: df 93 push r29 // error if file is already open if (isOpen()) goto fail; 253a4: fc 01 movw r30, r24 253a6: 23 81 ldd r18, Z+3 ; 0x03 253a8: 22 23 and r18, r18 253aa: 31 f0 breq .+12 ; 0x253b8 dirBlock_ = 0; dirIndex_ = 0; return true; fail: return false; 253ac: 80 e0 ldi r24, 0x00 ; 0 } 253ae: df 91 pop r29 253b0: cf 91 pop r28 253b2: 1f 91 pop r17 253b4: 0f 91 pop r16 253b6: 08 95 ret 253b8: 8b 01 movw r16, r22 253ba: ec 01 movw r28, r24 253bc: fb 01 movw r30, r22 253be: 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)) { 253c0: 80 31 cpi r24, 0x10 ; 16 253c2: 39 f5 brne .+78 ; 0x25412 type_ = FAT_FILE_TYPE_ROOT_FIXED; 253c4: 82 e0 ldi r24, 0x02 ; 2 253c6: 8b 83 std Y+3, r24 ; 0x03 firstCluster_ = 0; 253c8: 1d 8a std Y+21, r1 ; 0x15 253ca: 1e 8a std Y+22, r1 ; 0x16 253cc: 1f 8a std Y+23, r1 ; 0x17 253ce: 18 8e std Y+24, r1 ; 0x18 fileSize_ = 32 * vol->rootDirEntryCount(); 253d0: 80 8d ldd r24, Z+24 ; 0x18 253d2: 91 8d ldd r25, Z+25 ; 0x19 253d4: b0 e0 ldi r27, 0x00 ; 0 253d6: a0 e0 ldi r26, 0x00 ; 0 253d8: 25 e0 ldi r18, 0x05 ; 5 253da: 88 0f add r24, r24 253dc: 99 1f adc r25, r25 253de: aa 1f adc r26, r26 253e0: bb 1f adc r27, r27 253e2: 2a 95 dec r18 253e4: d1 f7 brne .-12 ; 0x253da 253e6: 89 8b std Y+17, r24 ; 0x11 253e8: 9a 8b std Y+18, r25 ; 0x12 253ea: ab 8b std Y+19, r26 ; 0x13 253ec: 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; 253ee: 1a 8f std Y+26, r17 ; 0x1a 253f0: 09 8f std Y+25, r16 ; 0x19 // read only flags_ = O_READ; 253f2: 81 e0 ldi r24, 0x01 ; 1 253f4: 89 83 std Y+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 253f6: 1c 82 std Y+4, r1 ; 0x04 253f8: 1d 82 std Y+5, r1 ; 0x05 253fa: 1e 82 std Y+6, r1 ; 0x06 253fc: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 253fe: 18 86 std Y+8, r1 ; 0x08 25400: 19 86 std Y+9, r1 ; 0x09 25402: 1a 86 std Y+10, r1 ; 0x0a 25404: 1b 86 std Y+11, r1 ; 0x0b // root has no directory entry dirBlock_ = 0; 25406: 1c 86 std Y+12, r1 ; 0x0c 25408: 1d 86 std Y+13, r1 ; 0x0d 2540a: 1e 86 std Y+14, r1 ; 0x0e 2540c: 1f 86 std Y+15, r1 ; 0x0f dirIndex_ = 0; 2540e: 18 8a std Y+16, r1 ; 0x10 25410: ce cf rjmp .-100 ; 0x253ae 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) { 25412: 80 32 cpi r24, 0x20 ; 32 25414: 59 f6 brne .-106 ; 0x253ac type_ = FAT_FILE_TYPE_ROOT32; 25416: 83 e0 ldi r24, 0x03 ; 3 25418: 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_;} 2541a: 42 8d ldd r20, Z+26 ; 0x1a 2541c: 53 8d ldd r21, Z+27 ; 0x1b 2541e: 64 8d ldd r22, Z+28 ; 0x1c 25420: 75 8d ldd r23, Z+29 ; 0x1d firstCluster_ = vol->rootDirStart(); 25422: 4d 8b std Y+21, r20 ; 0x15 25424: 5e 8b std Y+22, r21 ; 0x16 25426: 6f 8b std Y+23, r22 ; 0x17 25428: 78 8f std Y+24, r23 ; 0x18 if (!vol->chainSize(firstCluster_, &fileSize_)) goto fail; 2542a: 9e 01 movw r18, r28 2542c: 2f 5e subi r18, 0xEF ; 239 2542e: 3f 4f sbci r19, 0xFF ; 255 25430: c8 01 movw r24, r16 25432: 0f 94 64 29 call 0x252c8 ; 0x252c8 25436: 81 11 cpse r24, r1 25438: da cf rjmp .-76 ; 0x253ee 2543a: b8 cf rjmp .-144 ; 0x253ac 0002543c : vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; } bool SdFile::gfComputeNextFileBlock() { 2543c: cf 92 push r12 2543e: df 92 push r13 25440: ef 92 push r14 25442: ff 92 push r15 25444: 1f 93 push r17 25446: cf 93 push r28 25448: df 93 push r29 2544a: ec 01 movw r28, r24 2544c: eb 81 ldd r30, Y+3 ; 0x03 // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 2544e: e1 11 cpse r30, r1 25450: 09 c0 rjmp .+18 ; 0x25464 25452: 80 e0 ldi r24, 0x00 ; 0 } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; } return true; } 25454: df 91 pop r29 25456: cf 91 pop r28 25458: 1f 91 pop r17 2545a: ff 90 pop r15 2545c: ef 90 pop r14 2545e: df 90 pop r13 25460: cf 90 pop r12 25462: 08 95 ret return true; } bool SdFile::gfComputeNextFileBlock() { // error if not open or write only if (!isOpen() || !(flags_ & O_READ)) return false; 25464: 89 81 ldd r24, Y+1 ; 0x01 25466: 80 ff sbrs r24, 0 25468: f4 cf rjmp .-24 ; 0x25452 gfOffset = curPosition_ & 0X1FF; // offset in block 2546a: 48 85 ldd r20, Y+8 ; 0x08 2546c: 59 85 ldd r21, Y+9 ; 0x09 2546e: 6a 85 ldd r22, Y+10 ; 0x0a 25470: 7b 85 ldd r23, Y+11 ; 0x0b 25472: 9a 01 movw r18, r20 25474: 31 70 andi r19, 0x01 ; 1 25476: 3a a3 std Y+34, r19 ; 0x22 25478: 29 a3 std Y+33, r18 ; 0x21 2547a: 89 8d ldd r24, Y+25 ; 0x19 2547c: 9a 8d ldd r25, Y+26 ; 0x1a 2547e: 6a 01 movw r12, r20 25480: 7b 01 movw r14, r22 25482: f9 e0 ldi r31, 0x09 ; 9 25484: f6 94 lsr r15 25486: e7 94 ror r14 25488: d7 94 ror r13 2548a: c7 94 ror r12 2548c: fa 95 dec r31 2548e: d1 f7 brne .-12 ; 0x25484 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 25490: e2 30 cpi r30, 0x02 ; 2 25492: 79 f4 brne .+30 ; 0x254b2 // 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); 25494: fc 01 movw r30, r24 25496: 82 8d ldd r24, Z+26 ; 0x1a 25498: 93 8d ldd r25, Z+27 ; 0x1b 2549a: a4 8d ldd r26, Z+28 ; 0x1c 2549c: b5 8d ldd r27, Z+29 ; 0x1d 2549e: 8c 0d add r24, r12 254a0: 9d 1d adc r25, r13 254a2: ae 1d adc r26, r14 254a4: bf 1d adc r27, r15 } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; } } gfBlock = vol_->clusterStartBlock(curCluster_) + blockOfCluster; 254a6: 8d 8f std Y+29, r24 ; 0x1d 254a8: 9e 8f std Y+30, r25 ; 0x1e 254aa: af 8f std Y+31, r26 ; 0x1f 254ac: b8 a3 std Y+32, r27 ; 0x20 } return true; 254ae: 81 e0 ldi r24, 0x01 ; 1 254b0: d1 cf rjmp .-94 ; 0x25454 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);} 254b2: fc 01 movw r30, r24 254b4: 14 81 ldd r17, Z+4 ; 0x04 254b6: 11 50 subi r17, 0x01 ; 1 254b8: 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) { 254ba: 23 2b or r18, r19 254bc: 71 f4 brne .+28 ; 0x254da 254be: 11 11 cpse r17, r1 254c0: 0c c0 rjmp .+24 ; 0x254da // start of new cluster if (curPosition_ == 0) { 254c2: 45 2b or r20, r21 254c4: 46 2b or r20, r22 254c6: 47 2b or r20, r23 254c8: 31 f5 brne .+76 ; 0x25516 // use first cluster in file curCluster_ = firstCluster_; 254ca: 8d 89 ldd r24, Y+21 ; 0x15 254cc: 9e 89 ldd r25, Y+22 ; 0x16 254ce: af 89 ldd r26, Y+23 ; 0x17 254d0: b8 8d ldd r27, Y+24 ; 0x18 254d2: 8c 83 std Y+4, r24 ; 0x04 254d4: 9d 83 std Y+5, r25 ; 0x05 254d6: ae 83 std Y+6, r26 ; 0x06 254d8: 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; 254da: e9 8d ldd r30, Y+25 ; 0x19 254dc: fa 8d ldd r31, Y+26 ; 0x1a uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 254de: 8c 81 ldd r24, Y+4 ; 0x04 254e0: 9d 81 ldd r25, Y+5 ; 0x05 254e2: ae 81 ldd r26, Y+6 ; 0x06 254e4: bf 81 ldd r27, Y+7 ; 0x07 254e6: 02 97 sbiw r24, 0x02 ; 2 254e8: a1 09 sbc r26, r1 254ea: b1 09 sbc r27, r1 254ec: 25 85 ldd r18, Z+13 ; 0x0d 254ee: 04 c0 rjmp .+8 ; 0x254f8 254f0: 88 0f add r24, r24 254f2: 99 1f adc r25, r25 254f4: aa 1f adc r26, r26 254f6: bb 1f adc r27, r27 254f8: 2a 95 dec r18 254fa: d2 f7 brpl .-12 ; 0x254f0 254fc: 46 85 ldd r20, Z+14 ; 0x0e 254fe: 57 85 ldd r21, Z+15 ; 0x0f 25500: 60 89 ldd r22, Z+16 ; 0x10 25502: 71 89 ldd r23, Z+17 ; 0x11 25504: 84 0f add r24, r20 25506: 95 1f adc r25, r21 25508: a6 1f adc r26, r22 2550a: b7 1f adc r27, r23 2550c: 81 0f add r24, r17 2550e: 91 1d adc r25, r1 25510: a1 1d adc r26, r1 25512: b1 1d adc r27, r1 25514: c8 cf rjmp .-112 ; 0x254a6 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) return false; 25516: 4c 81 ldd r20, Y+4 ; 0x04 25518: 5d 81 ldd r21, Y+5 ; 0x05 2551a: 6e 81 ldd r22, Y+6 ; 0x06 2551c: 7f 81 ldd r23, Y+7 ; 0x07 2551e: 9e 01 movw r18, r28 25520: 2c 5f subi r18, 0xFC ; 252 25522: 3f 4f sbci r19, 0xFF ; 255 25524: 0f 94 e1 28 call 0x251c2 ; 0x251c2 25528: 81 11 cpse r24, r1 2552a: d7 cf rjmp .-82 ; 0x254da 2552c: 92 cf rjmp .-220 ; 0x25452 0002552e : * \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) { 2552e: 8f 92 push r8 25530: 9f 92 push r9 25532: af 92 push r10 25534: bf 92 push r11 25536: cf 92 push r12 25538: df 92 push r13 2553a: ef 92 push r14 2553c: ff 92 push r15 2553e: 0f 93 push r16 25540: 1f 93 push r17 25542: cf 93 push r28 25544: df 93 push r29 25546: ec 01 movw r28, r24 25548: 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; 2554a: 81 11 cpse r24, r1 2554c: 0e c0 rjmp .+28 ; 0x2556a done: return true; fail: return false; 2554e: 80 e0 ldi r24, 0x00 ; 0 } 25550: df 91 pop r29 25552: cf 91 pop r28 25554: 1f 91 pop r17 25556: 0f 91 pop r16 25558: ff 90 pop r15 2555a: ef 90 pop r14 2555c: df 90 pop r13 2555e: cf 90 pop r12 25560: bf 90 pop r11 25562: af 90 pop r10 25564: 9f 90 pop r9 25566: 8f 90 pop r8 25568: 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; 2556a: 09 89 ldd r16, Y+17 ; 0x11 2556c: 1a 89 ldd r17, Y+18 ; 0x12 2556e: 2b 89 ldd r18, Y+19 ; 0x13 25570: 3c 89 ldd r19, Y+20 ; 0x14 25572: 04 17 cp r16, r20 25574: 15 07 cpc r17, r21 25576: 26 07 cpc r18, r22 25578: 37 07 cpc r19, r23 2557a: 48 f3 brcs .-46 ; 0x2554e 2557c: 4a 01 movw r8, r20 2557e: 5b 01 movw r10, r22 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 25580: 82 30 cpi r24, 0x02 ; 2 25582: 31 f4 brne .+12 ; 0x25590 curPosition_ = pos; 25584: 88 86 std Y+8, r8 ; 0x08 25586: 99 86 std Y+9, r9 ; 0x09 25588: aa 86 std Y+10, r10 ; 0x0a 2558a: bb 86 std Y+11, r11 ; 0x0b if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; } curPosition_ = pos; done: return true; 2558c: 81 e0 ldi r24, 0x01 ; 1 2558e: e0 cf rjmp .-64 ; 0x25550 if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { curPosition_ = pos; goto done; } if (pos == 0) { 25590: 81 14 cp r8, r1 25592: 91 04 cpc r9, r1 25594: a1 04 cpc r10, r1 25596: b1 04 cpc r11, r1 25598: 49 f4 brne .+18 ; 0x255ac // set position to start of file curCluster_ = 0; 2559a: 1c 82 std Y+4, r1 ; 0x04 2559c: 1d 82 std Y+5, r1 ; 0x05 2559e: 1e 82 std Y+6, r1 ; 0x06 255a0: 1f 82 std Y+7, r1 ; 0x07 curPosition_ = 0; 255a2: 18 86 std Y+8, r1 ; 0x08 255a4: 19 86 std Y+9, r1 ; 0x09 255a6: 1a 86 std Y+10, r1 ; 0x0a 255a8: 1b 86 std Y+11, r1 ; 0x0b 255aa: f0 cf rjmp .-32 ; 0x2558c goto done; } // calculate cluster index for cur and new position nCur = (curPosition_ - 1) >> (vol_->clusterSizeShift_ + 9); 255ac: 08 85 ldd r16, Y+8 ; 0x08 255ae: 19 85 ldd r17, Y+9 ; 0x09 255b0: 2a 85 ldd r18, Y+10 ; 0x0a 255b2: 3b 85 ldd r19, Y+11 ; 0x0b 255b4: e9 8d ldd r30, Y+25 ; 0x19 255b6: fa 8d ldd r31, Y+26 ; 0x1a 255b8: 85 85 ldd r24, Z+13 ; 0x0d 255ba: 90 e0 ldi r25, 0x00 ; 0 255bc: 09 96 adiw r24, 0x09 ; 9 255be: b9 01 movw r22, r18 255c0: a8 01 movw r20, r16 255c2: 41 50 subi r20, 0x01 ; 1 255c4: 51 09 sbc r21, r1 255c6: 61 09 sbc r22, r1 255c8: 71 09 sbc r23, r1 255ca: 08 2e mov r0, r24 255cc: 04 c0 rjmp .+8 ; 0x255d6 255ce: 76 95 lsr r23 255d0: 67 95 ror r22 255d2: 57 95 ror r21 255d4: 47 95 ror r20 255d6: 0a 94 dec r0 255d8: d2 f7 brpl .-12 ; 0x255ce nNew = (pos - 1) >> (vol_->clusterSizeShift_ + 9); 255da: 75 01 movw r14, r10 255dc: 64 01 movw r12, r8 255de: e1 e0 ldi r30, 0x01 ; 1 255e0: ce 1a sub r12, r30 255e2: d1 08 sbc r13, r1 255e4: e1 08 sbc r14, r1 255e6: f1 08 sbc r15, r1 255e8: 04 c0 rjmp .+8 ; 0x255f2 255ea: f6 94 lsr r15 255ec: e7 94 ror r14 255ee: d7 94 ror r13 255f0: c7 94 ror r12 255f2: 8a 95 dec r24 255f4: d2 f7 brpl .-12 ; 0x255ea if (nNew < nCur || curPosition_ == 0) { 255f6: c4 16 cp r12, r20 255f8: d5 06 cpc r13, r21 255fa: e6 06 cpc r14, r22 255fc: f7 06 cpc r15, r23 255fe: 20 f0 brcs .+8 ; 0x25608 25600: 01 2b or r16, r17 25602: 02 2b or r16, r18 25604: 03 2b or r16, r19 25606: 11 f5 brne .+68 ; 0x2564c // must follow chain from first cluster curCluster_ = firstCluster_; 25608: 8d 89 ldd r24, Y+21 ; 0x15 2560a: 9e 89 ldd r25, Y+22 ; 0x16 2560c: af 89 ldd r26, Y+23 ; 0x17 2560e: b8 8d ldd r27, Y+24 ; 0x18 25610: 8c 83 std Y+4, r24 ; 0x04 25612: 9d 83 std Y+5, r25 ; 0x05 25614: ae 83 std Y+6, r26 ; 0x06 25616: bf 83 std Y+7, r27 ; 0x07 } else { // advance from curPosition nNew -= nCur; } while (nNew--) { if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 25618: 8e 01 movw r16, r28 2561a: 0c 5f subi r16, 0xFC ; 252 2561c: 1f 4f sbci r17, 0xFF ; 255 curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; } while (nNew--) { 2561e: c1 14 cp r12, r1 25620: d1 04 cpc r13, r1 25622: e1 04 cpc r14, r1 25624: f1 04 cpc r15, r1 25626: 09 f4 brne .+2 ; 0x2562a 25628: ad cf rjmp .-166 ; 0x25584 if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 2562a: 4c 81 ldd r20, Y+4 ; 0x04 2562c: 5d 81 ldd r21, Y+5 ; 0x05 2562e: 6e 81 ldd r22, Y+6 ; 0x06 25630: 7f 81 ldd r23, Y+7 ; 0x07 25632: 98 01 movw r18, r16 25634: 89 8d ldd r24, Y+25 ; 0x19 25636: 9a 8d ldd r25, Y+26 ; 0x1a 25638: 0f 94 e1 28 call 0x251c2 ; 0x251c2 2563c: 91 e0 ldi r25, 0x01 ; 1 2563e: c9 1a sub r12, r25 25640: d1 08 sbc r13, r1 25642: e1 08 sbc r14, r1 25644: f1 08 sbc r15, r1 25646: 81 11 cpse r24, r1 25648: ea cf rjmp .-44 ; 0x2561e 2564a: 81 cf rjmp .-254 ; 0x2554e if (nNew < nCur || curPosition_ == 0) { // must follow chain from first cluster curCluster_ = firstCluster_; } else { // advance from curPosition nNew -= nCur; 2564c: c4 1a sub r12, r20 2564e: d5 0a sbc r13, r21 25650: e6 0a sbc r14, r22 25652: f7 0a sbc r15, r23 25654: e1 cf rjmp .-62 ; 0x25618 00025656 : 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() { 25656: 3f 92 push r3 25658: 4f 92 push r4 2565a: 5f 92 push r5 2565c: 6f 92 push r6 2565e: 7f 92 push r7 25660: 8f 92 push r8 25662: 9f 92 push r9 25664: af 92 push r10 25666: bf 92 push r11 25668: cf 92 push r12 2566a: df 92 push r13 2566c: ef 92 push r14 2566e: ff 92 push r15 25670: 0f 93 push r16 25672: 1f 93 push r17 25674: cf 93 push r28 25676: df 93 push r29 25678: cd b7 in r28, 0x3d ; 61 2567a: de b7 in r29, 0x3e ; 62 2567c: 2c 97 sbiw r28, 0x0c ; 12 2567e: 0f b6 in r0, 0x3f ; 63 25680: f8 94 cli 25682: de bf out 0x3e, r29 ; 62 25684: 0f be out 0x3f, r0 ; 63 25686: cd bf out 0x3d, r28 ; 61 25688: 5c 01 movw r10, r24 if (!vol_->allocContiguous(1, &curCluster_)) goto fail; 2568a: dc 01 movw r26, r24 2568c: 59 96 adiw r26, 0x19 ; 25 2568e: 8d 90 ld r8, X+ 25690: 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; 25692: f4 01 movw r30, r8 25694: 81 85 ldd r24, Z+9 ; 0x09 25696: 92 85 ldd r25, Z+10 ; 0x0a 25698: a3 85 ldd r26, Z+11 ; 0x0b 2569a: b4 85 ldd r27, Z+12 ; 0x0c 2569c: 9c 01 movw r18, r24 2569e: ad 01 movw r20, r26 256a0: 2f 5f subi r18, 0xFF ; 255 256a2: 3f 4f sbci r19, 0xFF ; 255 256a4: 4f 4f sbci r20, 0xFF ; 255 256a6: 5f 4f sbci r21, 0xFF ; 255 256a8: 29 87 std Y+9, r18 ; 0x09 256aa: 3a 87 std Y+10, r19 ; 0x0a 256ac: 4b 87 std Y+11, r20 ; 0x0b 256ae: 5c 87 std Y+12, r21 ; 0x0c // flag to save place to start next search bool setStart; // set search start cluster if (*curCluster) { 256b0: d5 01 movw r26, r10 256b2: 14 96 adiw r26, 0x04 ; 4 256b4: 4d 90 ld r4, X+ 256b6: 5d 90 ld r5, X+ 256b8: 6d 90 ld r6, X+ 256ba: 7c 90 ld r7, X 256bc: 17 97 sbiw r26, 0x07 ; 7 256be: 41 14 cp r4, r1 256c0: 51 04 cpc r5, r1 256c2: 61 04 cpc r6, r1 256c4: 71 04 cpc r7, r1 256c6: 09 f4 brne .+2 ; 0x256ca 256c8: 59 c0 rjmp .+178 ; 0x2577c // try to make file contiguous bgnCluster = *curCluster + 1; 256ca: bf ef ldi r27, 0xFF ; 255 256cc: 4b 1a sub r4, r27 256ce: 5b 0a sbc r5, r27 256d0: 6b 0a sbc r6, r27 256d2: 7b 0a sbc r7, r27 // don't save new start location setStart = false; 256d4: 31 2c mov r3, r1 // save next search start if one cluster setStart = count == 1; } // end of group endCluster = bgnCluster; 256d6: 73 01 movw r14, r6 256d8: 62 01 movw r12, r4 // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 256da: 1d 82 std Y+5, r1 ; 0x05 256dc: 1e 82 std Y+6, r1 ; 0x06 256de: 1f 82 std Y+7, r1 ; 0x07 256e0: 18 86 std Y+8, r1 ; 0x08 // can't find space checked all clusters if (n >= clusterCount_) goto fail; 256e2: f4 01 movw r30, r8 256e4: 81 85 ldd r24, Z+9 ; 0x09 256e6: 92 85 ldd r25, Z+10 ; 0x0a 256e8: a3 85 ldd r26, Z+11 ; 0x0b 256ea: b4 85 ldd r27, Z+12 ; 0x0c 256ec: 2d 81 ldd r18, Y+5 ; 0x05 256ee: 3e 81 ldd r19, Y+6 ; 0x06 256f0: 4f 81 ldd r20, Y+7 ; 0x07 256f2: 58 85 ldd r21, Y+8 ; 0x08 256f4: 28 17 cp r18, r24 256f6: 39 07 cpc r19, r25 256f8: 4a 07 cpc r20, r26 256fa: 5b 07 cpc r21, r27 256fc: 08 f0 brcs .+2 ; 0x25700 256fe: 56 c0 rjmp .+172 ; 0x257ac // past end - start from beginning of FAT if (endCluster > fatEnd) { 25700: 89 85 ldd r24, Y+9 ; 0x09 25702: 9a 85 ldd r25, Y+10 ; 0x0a 25704: ab 85 ldd r26, Y+11 ; 0x0b 25706: bc 85 ldd r27, Y+12 ; 0x0c 25708: 8c 15 cp r24, r12 2570a: 9d 05 cpc r25, r13 2570c: ae 05 cpc r26, r14 2570e: bf 05 cpc r27, r15 25710: 50 f4 brcc .+20 ; 0x25726 bgnCluster = endCluster = 2; 25712: 82 e0 ldi r24, 0x02 ; 2 25714: c8 2e mov r12, r24 25716: d1 2c mov r13, r1 25718: e1 2c mov r14, r1 2571a: f1 2c mov r15, r1 2571c: 92 e0 ldi r25, 0x02 ; 2 2571e: 49 2e mov r4, r25 25720: 51 2c mov r5, r1 25722: 61 2c mov r6, r1 25724: 71 2c mov r7, r1 } uint32_t f; if (!fatGet(endCluster, &f)) goto fail; 25726: 9e 01 movw r18, r28 25728: 2f 5f subi r18, 0xFF ; 255 2572a: 3f 4f sbci r19, 0xFF ; 255 2572c: b7 01 movw r22, r14 2572e: a6 01 movw r20, r12 25730: c4 01 movw r24, r8 25732: 0f 94 e1 28 call 0x251c2 ; 0x251c2 25736: 88 23 and r24, r24 25738: c9 f1 breq .+114 ; 0x257ac if (f != 0) { 2573a: 89 81 ldd r24, Y+1 ; 0x01 2573c: 9a 81 ldd r25, Y+2 ; 0x02 2573e: ab 81 ldd r26, Y+3 ; 0x03 25740: bc 81 ldd r27, Y+4 ; 0x04 25742: 89 2b or r24, r25 25744: 8a 2b or r24, r26 25746: 8b 2b or r24, r27 25748: 01 f1 breq .+64 ; 0x2578a // cluster in use try next cluster as bgnCluster bgnCluster = endCluster + 1; 2574a: 26 01 movw r4, r12 2574c: 37 01 movw r6, r14 2574e: 9f ef ldi r25, 0xFF ; 255 25750: 49 1a sub r4, r25 25752: 59 0a sbc r5, r25 25754: 69 0a sbc r6, r25 25756: 79 0a sbc r7, r25 } // end of group endCluster = bgnCluster; // search the FAT for free clusters for (uint32_t n = 0;; n++, endCluster++) { 25758: 2d 81 ldd r18, Y+5 ; 0x05 2575a: 3e 81 ldd r19, Y+6 ; 0x06 2575c: 4f 81 ldd r20, Y+7 ; 0x07 2575e: 58 85 ldd r21, Y+8 ; 0x08 25760: 2f 5f subi r18, 0xFF ; 255 25762: 3f 4f sbci r19, 0xFF ; 255 25764: 4f 4f sbci r20, 0xFF ; 255 25766: 5f 4f sbci r21, 0xFF ; 255 25768: 2d 83 std Y+5, r18 ; 0x05 2576a: 3e 83 std Y+6, r19 ; 0x06 2576c: 4f 83 std Y+7, r20 ; 0x07 2576e: 58 87 std Y+8, r21 ; 0x08 25770: 3f ef ldi r19, 0xFF ; 255 25772: c3 1a sub r12, r19 25774: d3 0a sbc r13, r19 25776: e3 0a sbc r14, r19 25778: f3 0a sbc r15, r19 2577a: b3 cf rjmp .-154 ; 0x256e2 // don't save new start location setStart = false; } else { // start at likely place for free cluster bgnCluster = allocSearchStart_; 2577c: 40 80 ld r4, Z 2577e: 51 80 ldd r5, Z+1 ; 0x01 25780: 62 80 ldd r6, Z+2 ; 0x02 25782: 73 80 ldd r7, Z+3 ; 0x03 // save next search start if one cluster setStart = count == 1; 25784: 33 24 eor r3, r3 25786: 33 94 inc r3 25788: a6 cf rjmp .-180 ; 0x256d6 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) { 2578a: c4 14 cp r12, r4 2578c: d5 04 cpc r13, r5 2578e: e6 04 cpc r14, r6 25790: f7 04 cpc r15, r7 25792: 11 f7 brne .-60 ; 0x25758 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); 25794: 0f ef ldi r16, 0xFF ; 255 25796: 1f ef ldi r17, 0xFF ; 255 25798: 2f ef ldi r18, 0xFF ; 255 2579a: 3f e0 ldi r19, 0x0F ; 15 2579c: b7 01 movw r22, r14 2579e: a6 01 movw r20, r12 257a0: c4 01 movw r24, r8 257a2: 0f 94 4f 28 call 0x2509e ; 0x2509e 257a6: 78 2e mov r7, r24 // done - found space break; } } // mark end of chain if (!fatPutEOC(endCluster)) goto fail; 257a8: 81 11 cpse r24, r1 257aa: 1a c0 rjmp .+52 ; 0x257e0 flags_ |= F_FILE_DIR_DIRTY; } return true; fail: return false; 257ac: 71 2c mov r7, r1 } 257ae: 87 2d mov r24, r7 257b0: 2c 96 adiw r28, 0x0c ; 12 257b2: 0f b6 in r0, 0x3f ; 63 257b4: f8 94 cli 257b6: de bf out 0x3e, r29 ; 62 257b8: 0f be out 0x3f, r0 ; 63 257ba: cd bf out 0x3d, r28 ; 61 257bc: df 91 pop r29 257be: cf 91 pop r28 257c0: 1f 91 pop r17 257c2: 0f 91 pop r16 257c4: ff 90 pop r15 257c6: ef 90 pop r14 257c8: df 90 pop r13 257ca: cf 90 pop r12 257cc: bf 90 pop r11 257ce: af 90 pop r10 257d0: 9f 90 pop r9 257d2: 8f 90 pop r8 257d4: 7f 90 pop r7 257d6: 6f 90 pop r6 257d8: 5f 90 pop r5 257da: 4f 90 pop r4 257dc: 3f 90 pop r3 257de: 08 95 ret // link clusters while (endCluster > bgnCluster) { if (!fatPut(endCluster - 1, endCluster)) goto fail; endCluster--; } if (*curCluster != 0) { 257e0: f5 01 movw r30, r10 257e2: 44 81 ldd r20, Z+4 ; 0x04 257e4: 55 81 ldd r21, Z+5 ; 0x05 257e6: 66 81 ldd r22, Z+6 ; 0x06 257e8: 77 81 ldd r23, Z+7 ; 0x07 257ea: 41 15 cp r20, r1 257ec: 51 05 cpc r21, r1 257ee: 61 05 cpc r22, r1 257f0: 71 05 cpc r23, r1 257f2: 39 f0 breq .+14 ; 0x25802 // connect chains if (!fatPut(*curCluster, bgnCluster)) goto fail; 257f4: 97 01 movw r18, r14 257f6: 86 01 movw r16, r12 257f8: c4 01 movw r24, r8 257fa: 0f 94 4f 28 call 0x2509e ; 0x2509e 257fe: 88 23 and r24, r24 25800: a9 f2 breq .-86 ; 0x257ac } // return first cluster number to caller *curCluster = bgnCluster; 25802: d5 01 movw r26, r10 25804: 14 96 adiw r26, 0x04 ; 4 25806: cd 92 st X+, r12 25808: dd 92 st X+, r13 2580a: ed 92 st X+, r14 2580c: fc 92 st X, r15 2580e: 17 97 sbiw r26, 0x07 ; 7 // remember possible next free cluster if (setStart) allocSearchStart_ = bgnCluster + 1; 25810: 33 20 and r3, r3 25812: 51 f0 breq .+20 ; 0x25828 25814: d7 01 movw r26, r14 25816: c6 01 movw r24, r12 25818: 01 96 adiw r24, 0x01 ; 1 2581a: a1 1d adc r26, r1 2581c: b1 1d adc r27, r1 2581e: f4 01 movw r30, r8 25820: 80 83 st Z, r24 25822: 91 83 std Z+1, r25 ; 0x01 25824: a2 83 std Z+2, r26 ; 0x02 25826: 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) { 25828: f5 01 movw r30, r10 2582a: 85 89 ldd r24, Z+21 ; 0x15 2582c: 96 89 ldd r25, Z+22 ; 0x16 2582e: a7 89 ldd r26, Z+23 ; 0x17 25830: b0 8d ldd r27, Z+24 ; 0x18 25832: 89 2b or r24, r25 25834: 8a 2b or r24, r26 25836: 8b 2b or r24, r27 25838: 09 f0 breq .+2 ; 0x2583c 2583a: b9 cf rjmp .-142 ; 0x257ae firstCluster_ = curCluster_; 2583c: c5 8a std Z+21, r12 ; 0x15 2583e: d6 8a std Z+22, r13 ; 0x16 25840: e7 8a std Z+23, r14 ; 0x17 25842: f0 8e std Z+24, r15 ; 0x18 flags_ |= F_FILE_DIR_DIRTY; 25844: 81 81 ldd r24, Z+1 ; 0x01 25846: 80 68 ori r24, 0x80 ; 128 25848: 81 83 std Z+1, r24 ; 0x01 2584a: b1 cf rjmp .-158 ; 0x257ae 0002584c : return false; } //------------------------------------------------------------------------------ // cache a file's directory entry // return pointer to cached entry or null for failure dir_t* SdBaseFile::cacheDirEntry(uint8_t action) { 2584c: cf 93 push r28 2584e: df 93 push r29 25850: ec 01 movw r28, r24 if (!vol_->cacheRawBlock(dirBlock_, action)) goto fail; 25852: 46 2f mov r20, r22 25854: 41 70 andi r20, 0x01 ; 1 25856: 6c 85 ldd r22, Y+12 ; 0x0c 25858: 7d 85 ldd r23, Y+13 ; 0x0d 2585a: 8e 85 ldd r24, Y+14 ; 0x0e 2585c: 9f 85 ldd r25, Y+15 ; 0x0f 2585e: 0f 94 12 28 call 0x25024 ; 0x25024 25862: 88 23 and r24, r24 25864: 51 f0 breq .+20 ; 0x2587a return vol_->cache()->dir + dirIndex_; 25866: 88 89 ldd r24, Y+16 ; 0x10 25868: 20 e2 ldi r18, 0x20 ; 32 2586a: 82 9f mul r24, r18 2586c: c0 01 movw r24, r0 2586e: 11 24 eor r1, r1 25870: 8a 5b subi r24, 0xBA ; 186 25872: 91 4f sbci r25, 0xF1 ; 241 fail: return 0; } 25874: df 91 pop r29 25876: cf 91 pop r28 25878: 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; 2587a: 90 e0 ldi r25, 0x00 ; 0 2587c: 80 e0 ldi r24, 0x00 ; 0 2587e: fa cf rjmp .-12 ; 0x25874 00025880 : * \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() { 25880: cf 93 push r28 25882: df 93 push r29 25884: ec 01 movw r28, r24 // only allow open files and directories if (!isOpen()) goto fail; 25886: 8b 81 ldd r24, Y+3 ; 0x03 25888: 88 23 and r24, r24 2588a: 49 f1 breq .+82 ; 0x258de if (flags_ & F_FILE_DIR_DIRTY) { 2588c: 89 81 ldd r24, Y+1 ; 0x01 2588e: 87 ff sbrs r24, 7 25890: 22 c0 rjmp .+68 ; 0x258d6 dir_t* d = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 25892: 61 e0 ldi r22, 0x01 ; 1 25894: ce 01 movw r24, r28 25896: 0f 94 26 2c call 0x2584c ; 0x2584c 2589a: fc 01 movw r30, r24 // check for deleted by another open file object if (!d || d->name[0] == DIR_NAME_DELETED) goto fail; 2589c: 89 2b or r24, r25 2589e: f9 f0 breq .+62 ; 0x258de 258a0: 80 81 ld r24, Z 258a2: 85 3e cpi r24, 0xE5 ; 229 258a4: e1 f0 breq .+56 ; 0x258de // do not set filesize for dir files if (!isDir()) d->fileSize = fileSize_; 258a6: 8b 81 ldd r24, Y+3 ; 0x03 258a8: 82 30 cpi r24, 0x02 ; 2 258aa: 40 f4 brcc .+16 ; 0x258bc 258ac: 89 89 ldd r24, Y+17 ; 0x11 258ae: 9a 89 ldd r25, Y+18 ; 0x12 258b0: ab 89 ldd r26, Y+19 ; 0x13 258b2: bc 89 ldd r27, Y+20 ; 0x14 258b4: 84 8f std Z+28, r24 ; 0x1c 258b6: 95 8f std Z+29, r25 ; 0x1d 258b8: a6 8f std Z+30, r26 ; 0x1e 258ba: b7 8f std Z+31, r27 ; 0x1f // update first cluster fields d->firstClusterLow = firstCluster_ & 0XFFFF; 258bc: 8d 89 ldd r24, Y+21 ; 0x15 258be: 9e 89 ldd r25, Y+22 ; 0x16 258c0: 93 8f std Z+27, r25 ; 0x1b 258c2: 82 8f std Z+26, r24 ; 0x1a d->firstClusterHigh = firstCluster_ >> 16; 258c4: 8d 89 ldd r24, Y+21 ; 0x15 258c6: 9e 89 ldd r25, Y+22 ; 0x16 258c8: af 89 ldd r26, Y+23 ; 0x17 258ca: b8 8d ldd r27, Y+24 ; 0x18 258cc: b5 8b std Z+21, r27 ; 0x15 258ce: 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; 258d0: 89 81 ldd r24, Y+1 ; 0x01 258d2: 8f 77 andi r24, 0x7F ; 127 258d4: 89 83 std Y+1, r24 ; 0x01 return vol_->cacheFlush(); fail: writeError = true; return false; } 258d6: df 91 pop r29 258d8: cf 91 pop r28 d->lastAccessDate = d->lastWriteDate; } // clear directory dirty flags_ &= ~F_FILE_DIR_DIRTY; } return vol_->cacheFlush(); 258da: 0d 94 1a 27 jmp 0x24e34 ; 0x24e34 fail: writeError = true; 258de: 81 e0 ldi r24, 0x01 ; 1 258e0: 88 83 st Y, r24 return false; } 258e2: 80 e0 ldi r24, 0x00 ; 0 258e4: df 91 pop r29 258e6: cf 91 pop r28 258e8: 08 95 ret 000258ea : * * \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() { 258ea: cf 93 push r28 258ec: df 93 push r29 258ee: ec 01 movw r28, r24 bool rtn = sync(); 258f0: 0f 94 40 2c call 0x25880 ; 0x25880 type_ = FAT_FILE_TYPE_CLOSED; 258f4: 1b 82 std Y+3, r1 ; 0x03 return rtn; } 258f6: df 91 pop r29 258f8: cf 91 pop r28 258fa: 08 95 ret 000258fc : * \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) { 258fc: cf 93 push r28 258fe: df 93 push r29 25900: eb 01 movw r28, r22 25902: fc 01 movw r30, r24 25904: 23 81 ldd r18, Z+3 ; 0x03 if (!isOpen()) return false; 25906: 21 11 cpse r18, r1 25908: 04 c0 rjmp .+8 ; 0x25912 2590a: 80 e0 ldi r24, 0x00 ; 0 if (!p) return false; // format name dirName(*p, name); return true; } 2590c: df 91 pop r29 2590e: cf 91 pop r28 25910: 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; 25912: 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()) { 25914: 22 30 cpi r18, 0x02 ; 2 25916: 28 f4 brcc .+10 ; 0x25922 name[0] = '/'; 25918: 8f e2 ldi r24, 0x2F ; 47 2591a: 88 83 st Y, r24 name[1] = '\0'; 2591c: 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; 2591e: 81 e0 ldi r24, 0x01 ; 1 25920: f5 cf rjmp .-22 ; 0x2590c name[0] = '/'; name[1] = '\0'; return true; } // cache entry dir_t* p = cacheDirEntry(SdVolume::CACHE_FOR_READ); 25922: 60 e0 ldi r22, 0x00 ; 0 25924: 0f 94 26 2c call 0x2584c ; 0x2584c if (!p) return false; 25928: 00 97 sbiw r24, 0x00 ; 0 2592a: 79 f3 breq .-34 ; 0x2590a 2592c: 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; 2592e: 60 e0 ldi r22, 0x00 ; 0 for (uint8_t i = 0; i < 11; i++) { 25930: 80 e0 ldi r24, 0x00 ; 0 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; 25932: 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; 25934: 2d 91 ld r18, X+ 25936: 20 32 cpi r18, 0x20 ; 32 25938: 99 f0 breq .+38 ; 0x25960 if (i == 8) name[j++] = '.'; 2593a: 88 30 cpi r24, 0x08 ; 8 2593c: 31 f4 brne .+12 ; 0x2594a 2593e: 9e 01 movw r18, r28 25940: 26 0f add r18, r22 25942: 31 1d adc r19, r1 25944: f9 01 movw r30, r18 25946: 90 83 st Z, r25 25948: 6f 5f subi r22, 0xFF ; 255 name[j++] = dir.name[i]; 2594a: 9e 01 movw r18, r28 2594c: 26 0f add r18, r22 2594e: 31 1d adc r19, r1 25950: ad 01 movw r20, r26 25952: 41 50 subi r20, 0x01 ; 1 25954: 51 09 sbc r21, r1 25956: fa 01 movw r30, r20 25958: 40 81 ld r20, Z 2595a: f9 01 movw r30, r18 2595c: 40 83 st Z, r20 2595e: 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++) { 25960: 8f 5f subi r24, 0xFF ; 255 25962: 8b 30 cpi r24, 0x0B ; 11 25964: 39 f7 brne .-50 ; 0x25934 if (dir.name[i] == ' ')continue; if (i == 8) name[j++] = '.'; name[j++] = dir.name[i]; } name[j] = 0; 25966: fe 01 movw r30, r28 25968: e6 0f add r30, r22 2596a: f1 1d adc r31, r1 2596c: 10 82 st Z, r1 2596e: d7 cf rjmp .-82 ; 0x2591e 00025970 : * 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) { 25970: 2f 92 push r2 25972: 3f 92 push r3 25974: 4f 92 push r4 25976: 5f 92 push r5 25978: 6f 92 push r6 2597a: 7f 92 push r7 2597c: 8f 92 push r8 2597e: 9f 92 push r9 25980: af 92 push r10 25982: bf 92 push r11 25984: cf 92 push r12 25986: df 92 push r13 25988: ef 92 push r14 2598a: ff 92 push r15 2598c: 0f 93 push r16 2598e: 1f 93 push r17 25990: cf 93 push r28 25992: df 93 push r29 25994: 00 d0 rcall .+0 ; 0x25996 25996: 1f 92 push r1 25998: cd b7 in r28, 0x3d ; 61 2599a: de b7 in r29, 0x3e ; 62 2599c: 9c 83 std Y+4, r25 ; 0x04 2599e: 8b 83 std Y+3, r24 ; 0x03 259a0: 4b 01 movw r8, r22 259a2: 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; 259a4: dc 01 movw r26, r24 259a6: 13 96 adiw r26, 0x03 ; 3 259a8: 8c 91 ld r24, X 259aa: 81 11 cpse r24, r1 259ac: 19 c0 rjmp .+50 ; 0x259e0 toRead -= n; } return nbyte; fail: return -1; 259ae: 8f ef ldi r24, 0xFF ; 255 259b0: 9f ef ldi r25, 0xFF ; 255 } 259b2: 0f 90 pop r0 259b4: 0f 90 pop r0 259b6: 0f 90 pop r0 259b8: 0f 90 pop r0 259ba: df 91 pop r29 259bc: cf 91 pop r28 259be: 1f 91 pop r17 259c0: 0f 91 pop r16 259c2: ff 90 pop r15 259c4: ef 90 pop r14 259c6: df 90 pop r13 259c8: cf 90 pop r12 259ca: bf 90 pop r11 259cc: af 90 pop r10 259ce: 9f 90 pop r9 259d0: 8f 90 pop r8 259d2: 7f 90 pop r7 259d4: 6f 90 pop r6 259d6: 5f 90 pop r5 259d8: 4f 90 pop r4 259da: 3f 90 pop r3 259dc: 2f 90 pop r2 259de: 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; 259e0: eb 81 ldd r30, Y+3 ; 0x03 259e2: fc 81 ldd r31, Y+4 ; 0x04 259e4: 81 81 ldd r24, Z+1 ; 0x01 259e6: 80 ff sbrs r24, 0 259e8: e2 cf rjmp .-60 ; 0x259ae // max bytes left in file if (nbyte >= (fileSize_ - curPosition_)) { 259ea: 01 89 ldd r16, Z+17 ; 0x11 259ec: 12 89 ldd r17, Z+18 ; 0x12 259ee: 23 89 ldd r18, Z+19 ; 0x13 259f0: 34 89 ldd r19, Z+20 ; 0x14 259f2: 40 85 ldd r20, Z+8 ; 0x08 259f4: 51 85 ldd r21, Z+9 ; 0x09 259f6: 62 85 ldd r22, Z+10 ; 0x0a 259f8: 73 85 ldd r23, Z+11 ; 0x0b 259fa: c7 01 movw r24, r14 259fc: b0 e0 ldi r27, 0x00 ; 0 259fe: a0 e0 ldi r26, 0x00 ; 0 25a00: 28 01 movw r4, r16 25a02: 39 01 movw r6, r18 25a04: 44 1a sub r4, r20 25a06: 55 0a sbc r5, r21 25a08: 66 0a sbc r6, r22 25a0a: 77 0a sbc r7, r23 25a0c: 84 15 cp r24, r4 25a0e: 95 05 cpc r25, r5 25a10: a6 05 cpc r26, r6 25a12: b7 05 cpc r27, r7 25a14: 18 f0 brcs .+6 ; 0x25a1c nbyte = fileSize_ - curPosition_; 25a16: 78 01 movw r14, r16 25a18: e4 1a sub r14, r20 25a1a: f5 0a sbc r15, r21 } // amount left to read toRead = nbyte; 25a1c: 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; 25a1e: 8b 81 ldd r24, Y+3 ; 0x03 25a20: 9c 81 ldd r25, Y+4 ; 0x04 25a22: 04 96 adiw r24, 0x04 ; 4 25a24: 9a 83 std Y+2, r25 ; 0x02 25a26: 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; 25a28: 61 2c mov r6, r1 25a2a: 32 e0 ldi r19, 0x02 ; 2 25a2c: 73 2e mov r7, r19 if (nbyte >= (fileSize_ - curPosition_)) { nbyte = fileSize_ - curPosition_; } // amount left to read toRead = nbyte; while (toRead > 0) { 25a2e: c1 14 cp r12, r1 25a30: d1 04 cpc r13, r1 25a32: 09 f4 brne .+2 ; 0x25a36 25a34: b7 c0 rjmp .+366 ; 0x25ba4 offset = curPosition_ & 0X1FF; // offset in block 25a36: ab 81 ldd r26, Y+3 ; 0x03 25a38: bc 81 ldd r27, Y+4 ; 0x04 25a3a: 18 96 adiw r26, 0x08 ; 8 25a3c: 4d 91 ld r20, X+ 25a3e: 5d 91 ld r21, X+ 25a40: 6d 91 ld r22, X+ 25a42: 7c 91 ld r23, X 25a44: 1b 97 sbiw r26, 0x0b ; 11 25a46: 5a 01 movw r10, r20 25a48: b1 e0 ldi r27, 0x01 ; 1 25a4a: bb 22 and r11, r27 25a4c: eb 81 ldd r30, Y+3 ; 0x03 25a4e: fc 81 ldd r31, Y+4 ; 0x04 25a50: 81 8d ldd r24, Z+25 ; 0x19 25a52: 92 8d ldd r25, Z+26 ; 0x1a 25a54: 1a 01 movw r2, r20 25a56: 2b 01 movw r4, r22 25a58: 29 e0 ldi r18, 0x09 ; 9 25a5a: 56 94 lsr r5 25a5c: 47 94 ror r4 25a5e: 37 94 ror r3 25a60: 27 94 ror r2 25a62: 2a 95 dec r18 25a64: d1 f7 brne .-12 ; 0x25a5a if (type_ == FAT_FILE_TYPE_ROOT_FIXED) { 25a66: 23 81 ldd r18, Z+3 ; 0x03 25a68: 22 30 cpi r18, 0x02 ; 2 25a6a: 91 f5 brne .+100 ; 0x25ad0 block = vol_->rootDirStart() + (curPosition_ >> 9); 25a6c: dc 01 movw r26, r24 25a6e: 5a 96 adiw r26, 0x1a ; 26 25a70: 6d 91 ld r22, X+ 25a72: 7d 91 ld r23, X+ 25a74: 8d 91 ld r24, X+ 25a76: 9c 91 ld r25, X 25a78: 5d 97 sbiw r26, 0x1d ; 29 25a7a: 62 0d add r22, r2 25a7c: 73 1d adc r23, r3 25a7e: 84 1d adc r24, r4 25a80: 95 1d adc r25, r5 25a82: 83 01 movw r16, r6 25a84: 0a 19 sub r16, r10 25a86: 1b 09 sbc r17, r11 25a88: c0 16 cp r12, r16 25a8a: d1 06 cpc r13, r17 25a8c: 08 f4 brcc .+2 ; 0x25a90 25a8e: 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()) { 25a90: 01 15 cp r16, r1 25a92: b2 e0 ldi r27, 0x02 ; 2 25a94: 1b 07 cpc r17, r27 25a96: 71 f4 brne .+28 ; 0x25ab4 25a98: 20 91 3a 0e lds r18, 0x0E3A ; 0x800e3a 25a9c: 30 91 3b 0e lds r19, 0x0E3B ; 0x800e3b 25aa0: 40 91 3c 0e lds r20, 0x0E3C ; 0x800e3c 25aa4: 50 91 3d 0e lds r21, 0x0E3D ; 0x800e3d 25aa8: 62 17 cp r22, r18 25aaa: 73 07 cpc r23, r19 25aac: 84 07 cpc r24, r20 25aae: 95 07 cpc r25, r21 25ab0: 09 f0 breq .+2 ; 0x25ab4 25ab2: 59 c0 rjmp .+178 ; 0x25b66 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; 25ab4: 40 e0 ldi r20, 0x00 ; 0 25ab6: 0f 94 12 28 call 0x25024 ; 0x25024 25aba: 88 23 and r24, r24 25abc: 09 f4 brne .+2 ; 0x25ac0 25abe: 77 cf rjmp .-274 ; 0x259ae uint8_t* src = vol_->cache()->data + offset; 25ac0: b5 01 movw r22, r10 25ac2: 6a 5b subi r22, 0xBA ; 186 25ac4: 71 4f sbci r23, 0xF1 ; 241 memcpy(dst, src, n); 25ac6: a8 01 movw r20, r16 25ac8: c4 01 movw r24, r8 25aca: 0f 94 aa aa call 0x35554 ; 0x35554 25ace: 57 c0 rjmp .+174 ; 0x25b7e 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);} 25ad0: fc 01 movw r30, r24 25ad2: 14 81 ldd r17, Z+4 ; 0x04 25ad4: 11 50 subi r17, 0x01 ; 1 25ad6: 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) { 25ad8: a1 14 cp r10, r1 25ada: b1 04 cpc r11, r1 25adc: 81 f4 brne .+32 ; 0x25afe 25ade: 11 11 cpse r17, r1 25ae0: 0e c0 rjmp .+28 ; 0x25afe // start of new cluster if (curPosition_ == 0) { 25ae2: 45 2b or r20, r21 25ae4: 46 2b or r20, r22 25ae6: 47 2b or r20, r23 25ae8: 79 f5 brne .+94 ; 0x25b48 // use first cluster in file curCluster_ = firstCluster_; 25aea: eb 81 ldd r30, Y+3 ; 0x03 25aec: fc 81 ldd r31, Y+4 ; 0x04 25aee: 85 89 ldd r24, Z+21 ; 0x15 25af0: 96 89 ldd r25, Z+22 ; 0x16 25af2: a7 89 ldd r26, Z+23 ; 0x17 25af4: b0 8d ldd r27, Z+24 ; 0x18 25af6: 84 83 std Z+4, r24 ; 0x04 25af8: 95 83 std Z+5, r25 ; 0x05 25afa: a6 83 std Z+6, r26 ; 0x06 25afc: 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; 25afe: ab 81 ldd r26, Y+3 ; 0x03 25b00: bc 81 ldd r27, Y+4 ; 0x04 25b02: 59 96 adiw r26, 0x19 ; 25 25b04: ed 91 ld r30, X+ 25b06: fc 91 ld r31, X 25b08: 5a 97 sbiw r26, 0x1a ; 26 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 25b0a: 14 96 adiw r26, 0x04 ; 4 25b0c: 6d 91 ld r22, X+ 25b0e: 7d 91 ld r23, X+ 25b10: 8d 91 ld r24, X+ 25b12: 9c 91 ld r25, X 25b14: 17 97 sbiw r26, 0x07 ; 7 25b16: 62 50 subi r22, 0x02 ; 2 25b18: 71 09 sbc r23, r1 25b1a: 81 09 sbc r24, r1 25b1c: 91 09 sbc r25, r1 25b1e: 25 85 ldd r18, Z+13 ; 0x0d 25b20: 04 c0 rjmp .+8 ; 0x25b2a 25b22: 66 0f add r22, r22 25b24: 77 1f adc r23, r23 25b26: 88 1f adc r24, r24 25b28: 99 1f adc r25, r25 25b2a: 2a 95 dec r18 25b2c: d2 f7 brpl .-12 ; 0x25b22 25b2e: 26 85 ldd r18, Z+14 ; 0x0e 25b30: 37 85 ldd r19, Z+15 ; 0x0f 25b32: 40 89 ldd r20, Z+16 ; 0x10 25b34: 51 89 ldd r21, Z+17 ; 0x11 25b36: 62 0f add r22, r18 25b38: 73 1f adc r23, r19 25b3a: 84 1f adc r24, r20 25b3c: 95 1f adc r25, r21 25b3e: 61 0f add r22, r17 25b40: 71 1d adc r23, r1 25b42: 81 1d adc r24, r1 25b44: 91 1d adc r25, r1 25b46: 9d cf rjmp .-198 ; 0x25a82 if (curPosition_ == 0) { // use first cluster in file curCluster_ = firstCluster_; } else { // get next cluster from FAT if (!vol_->fatGet(curCluster_, &curCluster_)) goto fail; 25b48: ab 81 ldd r26, Y+3 ; 0x03 25b4a: bc 81 ldd r27, Y+4 ; 0x04 25b4c: 14 96 adiw r26, 0x04 ; 4 25b4e: 4d 91 ld r20, X+ 25b50: 5d 91 ld r21, X+ 25b52: 6d 91 ld r22, X+ 25b54: 7c 91 ld r23, X 25b56: 17 97 sbiw r26, 0x07 ; 7 25b58: 29 81 ldd r18, Y+1 ; 0x01 25b5a: 3a 81 ldd r19, Y+2 ; 0x02 25b5c: 0f 94 e1 28 call 0x251c2 ; 0x251c2 25b60: 81 11 cpse r24, r1 25b62: cd cf rjmp .-102 ; 0x25afe 25b64: 24 cf rjmp .-440 ; 0x259ae 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);} 25b66: 94 01 movw r18, r8 25b68: ab 01 movw r20, r22 25b6a: bc 01 movw r22, r24 25b6c: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 25b70: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 25b74: 0f 94 59 27 call 0x24eb2 ; 0x24eb2 // 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; 25b78: 88 23 and r24, r24 25b7a: 09 f4 brne .+2 ; 0x25b7e 25b7c: 18 cf rjmp .-464 ; 0x259ae // 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; 25b7e: 80 0e add r8, r16 25b80: 91 1e adc r9, r17 curPosition_ += n; 25b82: eb 81 ldd r30, Y+3 ; 0x03 25b84: fc 81 ldd r31, Y+4 ; 0x04 25b86: 80 85 ldd r24, Z+8 ; 0x08 25b88: 91 85 ldd r25, Z+9 ; 0x09 25b8a: a2 85 ldd r26, Z+10 ; 0x0a 25b8c: b3 85 ldd r27, Z+11 ; 0x0b 25b8e: 80 0f add r24, r16 25b90: 91 1f adc r25, r17 25b92: a1 1d adc r26, r1 25b94: b1 1d adc r27, r1 25b96: 80 87 std Z+8, r24 ; 0x08 25b98: 91 87 std Z+9, r25 ; 0x09 25b9a: a2 87 std Z+10, r26 ; 0x0a 25b9c: b3 87 std Z+11, r27 ; 0x0b toRead -= n; 25b9e: c0 1a sub r12, r16 25ba0: d1 0a sbc r13, r17 25ba2: 45 cf rjmp .-374 ; 0x25a2e } return nbyte; 25ba4: c7 01 movw r24, r14 25ba6: 05 cf rjmp .-502 ; 0x259b2 00025ba8 : * 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) { 25ba8: df 92 push r13 25baa: ef 92 push r14 25bac: ff 92 push r15 25bae: 0f 93 push r16 25bb0: 1f 93 push r17 25bb2: cf 93 push r28 25bb4: df 93 push r29 25bb6: 8c 01 movw r16, r24 25bb8: eb 01 movw r28, r22 25bba: 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; 25bbc: 8d e0 ldi r24, 0x0D ; 13 25bbe: d8 2e mov r13, r24 { longFilename[0] = '\0'; } while (1) { n = read(dir, sizeof(dir_t)); 25bc0: 40 e2 ldi r20, 0x20 ; 32 25bc2: 50 e0 ldi r21, 0x00 ; 0 25bc4: be 01 movw r22, r28 25bc6: c8 01 movw r24, r16 25bc8: 0f 94 b8 2c call 0x25970 ; 0x25970 if (n != sizeof(dir_t)) return n == 0 ? 0 : -1; 25bcc: 80 32 cpi r24, 0x20 ; 32 25bce: 91 05 cpc r25, r1 25bd0: 71 f0 breq .+28 ; 0x25bee 25bd2: 21 e0 ldi r18, 0x01 ; 1 25bd4: 89 2b or r24, r25 25bd6: 09 f4 brne .+2 ; 0x25bda 25bd8: 20 e0 ldi r18, 0x00 ; 0 25bda: 82 2f mov r24, r18 25bdc: 81 95 neg r24 } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; } } 25bde: df 91 pop r29 25be0: cf 91 pop r28 25be2: 1f 91 pop r17 25be4: 0f 91 pop r16 25be6: ff 90 pop r15 25be8: ef 90 pop r14 25bea: df 90 pop r13 25bec: 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; 25bee: 28 81 ld r18, Y 25bf0: 22 23 and r18, r18 25bf2: 09 f4 brne .+2 ; 0x25bf6 25bf4: 3f c0 rjmp .+126 ; 0x25c74 // skip empty entries and entry for . and .. if (dir->name[0] == DIR_NAME_DELETED || dir->name[0] == '.') continue; 25bf6: 25 3e cpi r18, 0xE5 ; 229 25bf8: 19 f3 breq .-58 ; 0x25bc0 25bfa: 2e 32 cpi r18, 0x2E ; 46 25bfc: 09 f3 breq .-62 ; 0x25bc0 //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) 25bfe: 3b 85 ldd r19, Y+11 ; 0x0b 25c00: 3f 73 andi r19, 0x3F ; 63 25c02: 3f 30 cpi r19, 0x0F ; 15 25c04: 99 f5 brne .+102 ; 0x25c6c 25c06: e1 14 cp r14, r1 25c08: f1 04 cpc r15, r1 25c0a: 81 f1 breq .+96 ; 0x25c6c { 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) 25c0c: 4a 8d ldd r20, Y+26 ; 0x1a 25c0e: 5b 8d ldd r21, Y+27 ; 0x1b 25c10: 45 2b or r20, r21 25c12: 61 f5 brne .+88 ; 0x25c6c 25c14: 2f 71 andi r18, 0x1F ; 31 25c16: 3f ef ldi r19, 0xFF ; 255 25c18: 32 0f add r19, r18 25c1a: 34 30 cpi r19, 0x04 ; 4 25c1c: 38 f5 brcc .+78 ; 0x25c6c { //TODO: Store the filename checksum to verify if a none-long filename aware system modified the file table. n = ((VFAT->sequenceNumber & 0x1F) - 1) * 13; 25c1e: 21 50 subi r18, 0x01 ; 1 25c20: 33 0b sbc r19, r19 25c22: d2 9e mul r13, r18 25c24: c0 01 movw r24, r0 25c26: d3 9e mul r13, r19 25c28: 90 0d add r25, r0 25c2a: 11 24 eor r1, r1 longFilename[n+0] = VFAT->name1[0]; 25c2c: f7 01 movw r30, r14 25c2e: e8 0f add r30, r24 25c30: f9 1f adc r31, r25 25c32: 29 81 ldd r18, Y+1 ; 0x01 25c34: 20 83 st Z, r18 longFilename[n+1] = VFAT->name1[1]; 25c36: 2b 81 ldd r18, Y+3 ; 0x03 25c38: 21 83 std Z+1, r18 ; 0x01 longFilename[n+2] = VFAT->name1[2]; 25c3a: 2d 81 ldd r18, Y+5 ; 0x05 25c3c: 22 83 std Z+2, r18 ; 0x02 longFilename[n+3] = VFAT->name1[3]; 25c3e: 2f 81 ldd r18, Y+7 ; 0x07 25c40: 23 83 std Z+3, r18 ; 0x03 longFilename[n+4] = VFAT->name1[4]; 25c42: 29 85 ldd r18, Y+9 ; 0x09 25c44: 24 83 std Z+4, r18 ; 0x04 longFilename[n+5] = VFAT->name2[0]; 25c46: 2e 85 ldd r18, Y+14 ; 0x0e 25c48: 25 83 std Z+5, r18 ; 0x05 longFilename[n+6] = VFAT->name2[1]; 25c4a: 28 89 ldd r18, Y+16 ; 0x10 25c4c: 26 83 std Z+6, r18 ; 0x06 longFilename[n+7] = VFAT->name2[2]; 25c4e: 2a 89 ldd r18, Y+18 ; 0x12 25c50: 27 83 std Z+7, r18 ; 0x07 longFilename[n+8] = VFAT->name2[3]; 25c52: 2c 89 ldd r18, Y+20 ; 0x14 25c54: 20 87 std Z+8, r18 ; 0x08 longFilename[n+9] = VFAT->name2[4]; 25c56: 2e 89 ldd r18, Y+22 ; 0x16 25c58: 21 87 std Z+9, r18 ; 0x09 longFilename[n+10] = VFAT->name2[5]; 25c5a: 28 8d ldd r18, Y+24 ; 0x18 25c5c: 22 87 std Z+10, r18 ; 0x0a longFilename[n+11] = VFAT->name3[0]; 25c5e: 2c 8d ldd r18, Y+28 ; 0x1c 25c60: 23 87 std Z+11, r18 ; 0x0b longFilename[n+12] = VFAT->name3[1]; 25c62: 2e 8d ldd r18, Y+30 ; 0x1e 25c64: 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) 25c66: 28 81 ld r18, Y 25c68: 26 fd sbrc r18, 6 longFilename[n+13] = '\0'; 25c6a: 15 86 std Z+13, r1 ; 0x0d } } // return if normal file or subdirectory if (DIR_IS_FILE_OR_SUBDIR(dir)) return n; 25c6c: 2b 85 ldd r18, Y+11 ; 0x0b 25c6e: 23 fd sbrc r18, 3 25c70: a7 cf rjmp .-178 ; 0x25bc0 25c72: b5 cf rjmp .-150 ; 0x25bde 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; 25c74: 80 e0 ldi r24, 0x00 ; 0 25c76: b3 cf rjmp .-154 ; 0x25bde 00025c78 : return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 25c78: 4f 92 push r4 25c7a: 5f 92 push r5 25c7c: 6f 92 push r6 25c7e: 7f 92 push r7 25c80: af 92 push r10 25c82: bf 92 push r11 25c84: cf 92 push r12 25c86: df 92 push r13 25c88: ef 92 push r14 25c8a: ff 92 push r15 25c8c: 0f 93 push r16 25c8e: 1f 93 push r17 25c90: cf 93 push r28 25c92: df 93 push r29 25c94: 1f 92 push r1 25c96: cd b7 in r28, 0x3d ; 61 25c98: de b7 in r29, 0x3e ; 62 25c9a: 8c 01 movw r16, r24 25c9c: 7b 01 movw r14, r22 25c9e: 5a 01 movw r10, r20 25ca0: c2 2e mov r12, r18 bool emptyFound = false; bool fileFound = false; uint8_t index; dir_t* p; vol_ = dirFile->vol_; 25ca2: db 01 movw r26, r22 25ca4: 59 96 adiw r26, 0x19 ; 25 25ca6: 8d 91 ld r24, X+ 25ca8: 9c 91 ld r25, X 25caa: f8 01 movw r30, r16 25cac: 92 8f std Z+26, r25 ; 0x1a 25cae: 81 8f std Z+25, r24 ; 0x19 dirFile->rewind(); 25cb0: cb 01 movw r24, r22 25cb2: 0e 94 f7 79 call 0xf3ee ; 0xf3ee } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { bool emptyFound = false; 25cb6: 71 2c mov r7, r1 vol_ = dirFile->vol_; dirFile->rewind(); // search for file while (dirFile->curPosition_ < dirFile->fileSize_) { 25cb8: f7 01 movw r30, r14 25cba: 80 85 ldd r24, Z+8 ; 0x08 25cbc: 91 85 ldd r25, Z+9 ; 0x09 25cbe: a2 85 ldd r26, Z+10 ; 0x0a 25cc0: b3 85 ldd r27, Z+11 ; 0x0b 25cc2: 41 89 ldd r20, Z+17 ; 0x11 25cc4: 52 89 ldd r21, Z+18 ; 0x12 25cc6: 63 89 ldd r22, Z+19 ; 0x13 25cc8: 74 89 ldd r23, Z+20 ; 0x14 25cca: 84 17 cp r24, r20 25ccc: 95 07 cpc r25, r21 25cce: a6 07 cpc r26, r22 25cd0: b7 07 cpc r27, r23 25cd2: 08 f0 brcs .+2 ; 0x25cd6 25cd4: 52 c0 rjmp .+164 ; 0x25d7a index = 0XF & (dirFile->curPosition_ >> 5); 25cd6: 55 e0 ldi r21, 0x05 ; 5 25cd8: b6 95 lsr r27 25cda: a7 95 ror r26 25cdc: 97 95 ror r25 25cde: 87 95 ror r24 25ce0: 5a 95 dec r21 25ce2: d1 f7 brne .-12 ; 0x25cd8 25ce4: f8 2f mov r31, r24 25ce6: ff 70 andi r31, 0x0F ; 15 25ce8: 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; 25cea: d7 01 movw r26, r14 25cec: 13 96 adiw r26, 0x03 ; 3 25cee: 8c 91 ld r24, X 25cf0: 82 30 cpi r24, 0x02 ; 2 25cf2: 10 f4 brcc .+4 ; 0x25cf8 if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; return false; 25cf4: 80 e0 ldi r24, 0x00 ; 0 25cf6: db c0 rjmp .+438 ; 0x25eae * \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; 25cf8: 41 e0 ldi r20, 0x01 ; 1 25cfa: 50 e0 ldi r21, 0x00 ; 0 25cfc: be 01 movw r22, r28 25cfe: 6f 5f subi r22, 0xFF ; 255 25d00: 7f 4f sbci r23, 0xFF ; 255 25d02: c7 01 movw r24, r14 25d04: 0f 94 b8 2c call 0x25970 ; 0x25970 25d08: 01 97 sbiw r24, 0x01 ; 1 25d0a: a1 f7 brne .-24 ; 0x25cf4 // use read to locate and cache block if (read() < 0) goto fail; // advance to next entry curPosition_ += 31; 25d0c: f7 01 movw r30, r14 25d0e: 80 85 ldd r24, Z+8 ; 0x08 25d10: 91 85 ldd r25, Z+9 ; 0x09 25d12: a2 85 ldd r26, Z+10 ; 0x0a 25d14: b3 85 ldd r27, Z+11 ; 0x0b 25d16: 4f 96 adiw r24, 0x1f ; 31 25d18: a1 1d adc r26, r1 25d1a: b1 1d adc r27, r1 25d1c: 80 87 std Z+8, r24 ; 0x08 25d1e: 91 87 std Z+9, r25 ; 0x09 25d20: a2 87 std Z+10, r26 ; 0x0a 25d22: b3 87 std Z+11, r27 ; 0x0b // return pointer to entry return vol_->cache()->dir + i; 25d24: f0 e2 ldi r31, 0x20 ; 32 25d26: df 9e mul r13, r31 25d28: b0 01 movw r22, r0 25d2a: 11 24 eor r1, r1 25d2c: 6a 5b subi r22, 0xBA ; 186 25d2e: 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; 25d30: 61 15 cp r22, r1 25d32: 71 05 cpc r23, r1 25d34: f9 f2 breq .-66 ; 0x25cf4 if (p->name[0] == DIR_NAME_FREE || p->name[0] == DIR_NAME_DELETED) { 25d36: db 01 movw r26, r22 25d38: 8c 91 ld r24, X 25d3a: 88 23 and r24, r24 25d3c: 41 f0 breq .+16 ; 0x25d4e 25d3e: 85 3e cpi r24, 0xE5 ; 229 25d40: 09 f0 breq .+2 ; 0x25d44 25d42: 4c c0 rjmp .+152 ; 0x25ddc // remember first empty slot if (!emptyFound) { 25d44: 77 20 and r7, r7 25d46: 29 f0 breq .+10 ; 0x25d52 return false; } //------------------------------------------------------------------------------ // open with filename in dname bool SdBaseFile::open(SdBaseFile* dirFile, const uint8_t dname[11], uint8_t oflag) { 25d48: 77 24 eor r7, r7 25d4a: 73 94 inc r7 25d4c: b5 cf rjmp .-150 ; 0x25cb8 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) { 25d4e: 71 10 cpse r7, r1 25d50: 0e c0 rjmp .+28 ; 0x25d6e dirBlock_ = dirFile->vol_->cacheBlockNumber(); 25d52: 80 91 3a 0e lds r24, 0x0E3A ; 0x800e3a 25d56: 90 91 3b 0e lds r25, 0x0E3B ; 0x800e3b 25d5a: a0 91 3c 0e lds r26, 0x0E3C ; 0x800e3c 25d5e: b0 91 3d 0e lds r27, 0x0E3D ; 0x800e3d 25d62: f8 01 movw r30, r16 25d64: 84 87 std Z+12, r24 ; 0x0c 25d66: 95 87 std Z+13, r25 ; 0x0d 25d68: a6 87 std Z+14, r26 ; 0x0e 25d6a: b7 87 std Z+15, r27 ; 0x0f dirIndex_ = index; 25d6c: d0 8a std Z+16, r13 ; 0x10 emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; 25d6e: db 01 movw r26, r22 25d70: 8c 91 ld r24, X 25d72: 81 11 cpse r24, r1 25d74: e9 cf rjmp .-46 ; 0x25d48 25d76: 77 24 eor r7, r7 25d78: 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; 25d7a: 8c 2d mov r24, r12 25d7c: 82 74 andi r24, 0x42 ; 66 25d7e: 82 34 cpi r24, 0x42 ; 66 25d80: 09 f0 breq .+2 ; 0x25d84 25d82: b8 cf rjmp .-144 ; 0x25cf4 if (emptyFound) { 25d84: 77 20 and r7, r7 25d86: 09 f4 brne .+2 ; 0x25d8a 25d88: a2 c0 rjmp .+324 ; 0x25ece index = dirIndex_; 25d8a: f8 01 movw r30, r16 25d8c: d0 88 ldd r13, Z+16 ; 0x10 p = cacheDirEntry(SdVolume::CACHE_FOR_WRITE); 25d8e: 61 e0 ldi r22, 0x01 ; 1 25d90: c8 01 movw r24, r16 25d92: 0f 94 26 2c call 0x2584c ; 0x2584c if (!p) goto fail; 25d96: 00 97 sbiw r24, 0x00 ; 0 25d98: 09 f4 brne .+2 ; 0x25d9c 25d9a: ac cf rjmp .-168 ; 0x25cf4 // use first entry in cluster p = dirFile->vol_->cache()->dir; index = 0; } // initialize as empty file memset(p, 0, sizeof(dir_t)); 25d9c: 20 e2 ldi r18, 0x20 ; 32 25d9e: dc 01 movw r26, r24 25da0: 1d 92 st X+, r1 25da2: 2a 95 dec r18 25da4: e9 f7 brne .-6 ; 0x25da0 memcpy(p->name, dname, 11); 25da6: 2b e0 ldi r18, 0x0B ; 11 25da8: f5 01 movw r30, r10 25daa: dc 01 movw r26, r24 25dac: 01 90 ld r0, Z+ 25dae: 0d 92 st X+, r0 25db0: 2a 95 dec r18 25db2: e1 f7 brne .-8 ; 0x25dac if (dateTime_) { // call user date/time function dateTime_(&p->creationDate, &p->creationTime); } else { // use default date/time p->creationDate = FAT_DEFAULT_DATE; 25db4: 21 e2 ldi r18, 0x21 ; 33 25db6: 38 e2 ldi r19, 0x28 ; 40 25db8: fc 01 movw r30, r24 25dba: 31 8b std Z+17, r19 ; 0x11 25dbc: 20 8b std Z+16, r18 ; 0x10 p->creationTime = FAT_DEFAULT_TIME; 25dbe: 40 e0 ldi r20, 0x00 ; 0 25dc0: 58 e0 ldi r21, 0x08 ; 8 25dc2: 57 87 std Z+15, r21 ; 0x0f 25dc4: 46 87 std Z+14, r20 ; 0x0e } p->lastAccessDate = p->creationDate; 25dc6: 33 8b std Z+19, r19 ; 0x13 25dc8: 22 8b std Z+18, r18 ; 0x12 p->lastWriteDate = p->creationDate; 25dca: 31 8f std Z+25, r19 ; 0x19 25dcc: 20 8f std Z+24, r18 ; 0x18 p->lastWriteTime = p->creationTime; 25dce: 57 8b std Z+23, r21 ; 0x17 25dd0: 46 8b std Z+22, r20 ; 0x16 // write entry to SD if (!dirFile->vol_->cacheFlush()) goto fail; 25dd2: 0f 94 1a 27 call 0x24e34 ; 0x24e34 25dd6: 81 11 cpse r24, r1 25dd8: 09 c0 rjmp .+18 ; 0x25dec 25dda: 8c cf rjmp .-232 ; 0x25cf4 dirIndex_ = index; emptyFound = true; } // done if no entries follow if (p->name[0] == DIR_NAME_FREE) break; } else if (!memcmp(dname, p->name, 11)) { 25ddc: 4b e0 ldi r20, 0x0B ; 11 25dde: 50 e0 ldi r21, 0x00 ; 0 25de0: c5 01 movw r24, r10 25de2: 0f 94 9d aa call 0x3553a ; 0x3553a 25de6: 89 2b or r24, r25 25de8: 09 f0 breq .+2 ; 0x25dec 25dea: 66 cf rjmp .-308 ; 0x25cb8 } //------------------------------------------------------------------------------ // 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]; 25dec: f0 e2 ldi r31, 0x20 ; 32 25dee: df 9e mul r13, r31 25df0: d0 01 movw r26, r0 25df2: 11 24 eor r1, r1 25df4: 9d 01 movw r18, r26 25df6: 2a 5b subi r18, 0xBA ; 186 25df8: 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)) { 25dfa: f9 01 movw r30, r18 25dfc: 83 85 ldd r24, Z+11 ; 0x0b 25dfe: 81 71 andi r24, 0x11 ; 17 25e00: 21 f0 breq .+8 ; 0x25e0a if (oflag & (O_WRITE | O_TRUNC)) goto fail; 25e02: 8c 2d mov r24, r12 25e04: 82 71 andi r24, 0x12 ; 18 25e06: 09 f0 breq .+2 ; 0x25e0a 25e08: fc c0 rjmp .+504 ; 0x26002 } //------------------------------------------------------------------------------ // 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]; 25e0a: f8 01 movw r30, r16 25e0c: 81 8d ldd r24, Z+25 ; 0x19 25e0e: 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(); 25e10: 40 91 3a 0e lds r20, 0x0E3A ; 0x800e3a 25e14: 50 91 3b 0e lds r21, 0x0E3B ; 0x800e3b 25e18: 60 91 3c 0e lds r22, 0x0E3C ; 0x800e3c 25e1c: 70 91 3d 0e lds r23, 0x0E3D ; 0x800e3d 25e20: 44 87 std Z+12, r20 ; 0x0c 25e22: 55 87 std Z+13, r21 ; 0x0d 25e24: 66 87 std Z+14, r22 ; 0x0e 25e26: 77 87 std Z+15, r23 ; 0x0f dirIndex_ = dirIndex; 25e28: d0 8a std Z+16, r13 ; 0x10 // copy first cluster number for directory fields firstCluster_ = (uint32_t)p->firstClusterHigh << 16; 25e2a: fd 01 movw r30, r26 25e2c: ea 5b subi r30, 0xBA ; 186 25e2e: f1 4f sbci r31, 0xF1 ; 241 25e30: 44 88 ldd r4, Z+20 ; 0x14 25e32: 55 88 ldd r5, Z+21 ; 0x15 25e34: 71 2c mov r7, r1 25e36: 61 2c mov r6, r1 25e38: 32 01 movw r6, r4 25e3a: 55 24 eor r5, r5 25e3c: 44 24 eor r4, r4 25e3e: d8 01 movw r26, r16 25e40: 55 96 adiw r26, 0x15 ; 21 25e42: 4d 92 st X+, r4 25e44: 5d 92 st X+, r5 25e46: 6d 92 st X+, r6 25e48: 7c 92 st X, r7 25e4a: 58 97 sbiw r26, 0x18 ; 24 firstCluster_ |= p->firstClusterLow; 25e4c: 42 8d ldd r20, Z+26 ; 0x1a 25e4e: 53 8d ldd r21, Z+27 ; 0x1b 25e50: 70 e0 ldi r23, 0x00 ; 0 25e52: 60 e0 ldi r22, 0x00 ; 0 25e54: 44 29 or r20, r4 25e56: 55 29 or r21, r5 25e58: 66 29 or r22, r6 25e5a: 77 29 or r23, r7 25e5c: 55 96 adiw r26, 0x15 ; 21 25e5e: 4d 93 st X+, r20 25e60: 5d 93 st X+, r21 25e62: 6d 93 st X+, r22 25e64: 7c 93 st X, r23 25e66: 58 97 sbiw r26, 0x18 ; 24 25e68: d9 01 movw r26, r18 25e6a: 1b 96 adiw r26, 0x0b ; 11 25e6c: 2c 91 ld r18, X 25e6e: 28 71 andi r18, 0x18 ; 24 // make sure it is a normal file or subdirectory if (DIR_IS_FILE(p)) { 25e70: 09 f0 breq .+2 ; 0x25e74 25e72: b9 c0 rjmp .+370 ; 0x25fe6 fileSize_ = p->fileSize; 25e74: 84 8d ldd r24, Z+28 ; 0x1c 25e76: 95 8d ldd r25, Z+29 ; 0x1d 25e78: a6 8d ldd r26, Z+30 ; 0x1e 25e7a: b7 8d ldd r27, Z+31 ; 0x1f 25e7c: f8 01 movw r30, r16 25e7e: 81 8b std Z+17, r24 ; 0x11 25e80: 92 8b std Z+18, r25 ; 0x12 25e82: a3 8b std Z+19, r26 ; 0x13 25e84: b4 8b std Z+20, r27 ; 0x14 type_ = FAT_FILE_TYPE_NORMAL; 25e86: 81 e0 ldi r24, 0x01 ; 1 25e88: 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; 25e8a: 8c 2d mov r24, r12 25e8c: 8f 70 andi r24, 0x0F ; 15 25e8e: f8 01 movw r30, r16 25e90: 81 83 std Z+1, r24 ; 0x01 // set to start of file curCluster_ = 0; 25e92: 14 82 std Z+4, r1 ; 0x04 25e94: 15 82 std Z+5, r1 ; 0x05 25e96: 16 82 std Z+6, r1 ; 0x06 25e98: 17 82 std Z+7, r1 ; 0x07 curPosition_ = 0; 25e9a: 10 86 std Z+8, r1 ; 0x08 25e9c: 11 86 std Z+9, r1 ; 0x09 25e9e: 12 86 std Z+10, r1 ; 0x0a 25ea0: 13 86 std Z+11, r1 ; 0x0b if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; 25ea2: 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; 25ea4: c4 fe sbrs r12, 4 25ea6: 03 c0 rjmp .+6 ; 0x25eae 25ea8: c8 01 movw r24, r16 25eaa: 0f 94 96 68 call 0x2d12c ; 0x2d12c // open entry in cache return openCachedEntry(index, oflag); fail: return false; } 25eae: 0f 90 pop r0 25eb0: df 91 pop r29 25eb2: cf 91 pop r28 25eb4: 1f 91 pop r17 25eb6: 0f 91 pop r16 25eb8: ff 90 pop r15 25eba: ef 90 pop r14 25ebc: df 90 pop r13 25ebe: cf 90 pop r12 25ec0: bf 90 pop r11 25ec2: af 90 pop r10 25ec4: 7f 90 pop r7 25ec6: 6f 90 pop r6 25ec8: 5f 90 pop r5 25eca: 4f 90 pop r4 25ecc: 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; 25ece: d7 01 movw r26, r14 25ed0: 13 96 adiw r26, 0x03 ; 3 25ed2: 8c 91 ld r24, X 25ed4: 13 97 sbiw r26, 0x03 ; 3 25ed6: 82 30 cpi r24, 0x02 ; 2 25ed8: 09 f4 brne .+2 ; 0x25edc 25eda: 0c cf rjmp .-488 ; 0x25cf4 // 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; 25edc: 51 96 adiw r26, 0x11 ; 17 25ede: 8d 91 ld r24, X+ 25ee0: 9d 91 ld r25, X+ 25ee2: 0d 90 ld r0, X+ 25ee4: bc 91 ld r27, X 25ee6: a0 2d mov r26, r0 25ee8: 80 3e cpi r24, 0xE0 ; 224 25eea: 9f 4f sbci r25, 0xFF ; 255 25eec: af 41 sbci r26, 0x1F ; 31 25eee: b1 05 cpc r27, r1 25ef0: 08 f0 brcs .+2 ; 0x25ef4 25ef2: 00 cf rjmp .-512 ; 0x25cf4 if (!addCluster()) goto fail; 25ef4: c7 01 movw r24, r14 25ef6: 0f 94 2b 2b call 0x25656 ; 0x25656 25efa: 88 23 and r24, r24 25efc: 09 f4 brne .+2 ; 0x25f00 25efe: fa ce rjmp .-524 ; 0x25cf4 if (!vol_->cacheFlush()) goto fail; 25f00: 0f 94 1a 27 call 0x24e34 ; 0x24e34 25f04: 88 23 and r24, r24 25f06: 09 f4 brne .+2 ; 0x25f0a 25f08: f5 ce rjmp .-534 ; 0x25cf4 block = vol_->clusterStartBlock(curCluster_); 25f0a: d7 01 movw r26, r14 25f0c: 59 96 adiw r26, 0x19 ; 25 25f0e: ed 91 ld r30, X+ 25f10: fc 91 ld r31, X 25f12: 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_);} 25f14: 14 96 adiw r26, 0x04 ; 4 25f16: 4d 90 ld r4, X+ 25f18: 5d 90 ld r5, X+ 25f1a: 6d 90 ld r6, X+ 25f1c: 7c 90 ld r7, X 25f1e: 17 97 sbiw r26, 0x07 ; 7 25f20: b2 e0 ldi r27, 0x02 ; 2 25f22: 4b 1a sub r4, r27 25f24: 51 08 sbc r5, r1 25f26: 61 08 sbc r6, r1 25f28: 71 08 sbc r7, r1 25f2a: 85 85 ldd r24, Z+13 ; 0x0d 25f2c: 04 c0 rjmp .+8 ; 0x25f36 25f2e: 44 0c add r4, r4 25f30: 55 1c adc r5, r5 25f32: 66 1c adc r6, r6 25f34: 77 1c adc r7, r7 25f36: 8a 95 dec r24 25f38: d2 f7 brpl .-12 ; 0x25f2e 25f3a: 86 85 ldd r24, Z+14 ; 0x0e 25f3c: 97 85 ldd r25, Z+15 ; 0x0f 25f3e: a0 89 ldd r26, Z+16 ; 0x10 25f40: b1 89 ldd r27, Z+17 ; 0x11 25f42: 48 0e add r4, r24 25f44: 59 1e adc r5, r25 25f46: 6a 1e adc r6, r26 25f48: 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; 25f4a: 81 e0 ldi r24, 0x01 ; 1 25f4c: 80 93 42 0e sts 0x0E42, r24 ; 0x800e42 cacheBlockNumber_ = blockNumber; 25f50: 40 92 3a 0e sts 0x0E3A, r4 ; 0x800e3a 25f54: 50 92 3b 0e sts 0x0E3B, r5 ; 0x800e3b 25f58: 60 92 3c 0e sts 0x0E3C, r6 ; 0x800e3c 25f5c: 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); 25f60: e6 e4 ldi r30, 0x46 ; 70 25f62: fe e0 ldi r31, 0x0E ; 14 25f64: 80 e0 ldi r24, 0x00 ; 0 25f66: 92 e0 ldi r25, 0x02 ; 2 25f68: df 01 movw r26, r30 25f6a: 9c 01 movw r18, r24 25f6c: 1d 92 st X+, r1 25f6e: 21 50 subi r18, 0x01 ; 1 25f70: 30 40 sbci r19, 0x00 ; 0 25f72: e1 f7 brne .-8 ; 0x25f6c // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 25f74: dd 24 eor r13, r13 25f76: d3 94 inc r13 25f78: d7 01 movw r26, r14 25f7a: 59 96 adiw r26, 0x19 ; 25 25f7c: ed 91 ld r30, X+ 25f7e: fc 91 ld r31, X 25f80: 84 81 ldd r24, Z+4 ; 0x04 25f82: d8 16 cp r13, r24 25f84: 98 f4 brcc .+38 ; 0x25fac 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); 25f86: 26 e4 ldi r18, 0x46 ; 70 25f88: 3e e0 ldi r19, 0x0E ; 14 25f8a: b3 01 movw r22, r6 25f8c: a2 01 movw r20, r4 25f8e: 4d 0d add r20, r13 25f90: 51 1d adc r21, r1 25f92: 61 1d adc r22, r1 25f94: 71 1d adc r23, r1 25f96: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 25f9a: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 25f9e: 0f 94 b6 26 call 0x24d6c ; 0x24d6c if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; 25fa2: 88 23 and r24, r24 25fa4: 09 f4 brne .+2 ; 0x25fa8 25fa6: a6 ce rjmp .-692 ; 0x25cf4 // zero first block of cluster memset(vol_->cacheBuffer_.data, 0, 512); // zero rest of cluster for (uint8_t i = 1; i < vol_->blocksPerCluster_; i++) { 25fa8: d3 94 inc r13 25faa: e6 cf rjmp .-52 ; 0x25f78 if (!vol_->writeBlock(block + i, vol_->cacheBuffer_.data)) goto fail; } // Increase directory file size by cluster size fileSize_ += 512UL << vol_->clusterSizeShift_; 25fac: 25 85 ldd r18, Z+13 ; 0x0d 25fae: 80 e0 ldi r24, 0x00 ; 0 25fb0: 92 e0 ldi r25, 0x02 ; 2 25fb2: a0 e0 ldi r26, 0x00 ; 0 25fb4: b0 e0 ldi r27, 0x00 ; 0 25fb6: 04 c0 rjmp .+8 ; 0x25fc0 25fb8: 88 0f add r24, r24 25fba: 99 1f adc r25, r25 25fbc: aa 1f adc r26, r26 25fbe: bb 1f adc r27, r27 25fc0: 2a 95 dec r18 25fc2: d2 f7 brpl .-12 ; 0x25fb8 25fc4: f7 01 movw r30, r14 25fc6: 41 89 ldd r20, Z+17 ; 0x11 25fc8: 52 89 ldd r21, Z+18 ; 0x12 25fca: 63 89 ldd r22, Z+19 ; 0x13 25fcc: 74 89 ldd r23, Z+20 ; 0x14 25fce: 84 0f add r24, r20 25fd0: 95 1f adc r25, r21 25fd2: a6 1f adc r26, r22 25fd4: b7 1f adc r27, r23 25fd6: 81 8b std Z+17, r24 ; 0x11 25fd8: 92 8b std Z+18, r25 ; 0x12 25fda: a3 8b std Z+19, r26 ; 0x13 25fdc: 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; 25fde: 86 e4 ldi r24, 0x46 ; 70 25fe0: 9e e0 ldi r25, 0x0E ; 14 index = 0; 25fe2: d1 2c mov r13, r1 25fe4: db ce rjmp .-586 ; 0x25d9c // 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)) { 25fe6: 20 31 cpi r18, 0x10 ; 16 25fe8: 61 f4 brne .+24 ; 0x26002 if (!vol_->chainSize(firstCluster_, &fileSize_)) goto fail; 25fea: 98 01 movw r18, r16 25fec: 2f 5e subi r18, 0xEF ; 239 25fee: 3f 4f sbci r19, 0xFF ; 255 25ff0: 0f 94 64 29 call 0x252c8 ; 0x252c8 25ff4: 88 23 and r24, r24 25ff6: 29 f0 breq .+10 ; 0x26002 type_ = FAT_FILE_TYPE_SUBDIR; 25ff8: 84 e0 ldi r24, 0x04 ; 4 25ffa: d8 01 movw r26, r16 25ffc: 13 96 adiw r26, 0x03 ; 3 25ffe: 8c 93 st X, r24 26000: 44 cf rjmp .-376 ; 0x25e8a curPosition_ = 0; if ((oflag & O_TRUNC) && !truncate(0)) return false; return oflag & O_AT_END ? seekEnd(0) : true; fail: type_ = FAT_FILE_TYPE_CLOSED; 26002: d8 01 movw r26, r16 26004: 13 96 adiw r26, 0x03 ; 3 26006: 1c 92 st X, r1 26008: 75 ce rjmp .-790 ; 0x25cf4 0002600a : } } #endif //PRUSA_M28 void prusa_statistics(uint8_t _message) { 2600a: cf 93 push r28 const uint8_t _fil_nr = 0; if (!farm_mode) 2600c: 90 91 60 0d lds r25, 0x0D60 ; 0x800d60 26010: 99 23 and r25, r25 26012: 09 f4 brne .+2 ; 0x26016 26014: f6 c0 rjmp .+492 ; 0x26202 26016: c8 2f mov r28, r24 return; switch (_message) { 26018: 87 30 cpi r24, 0x07 ; 7 2601a: 09 f4 brne .+2 ; 0x2601e 2601c: be c0 rjmp .+380 ; 0x2619a 2601e: 08 f0 brcs .+2 ; 0x26022 26020: 46 c0 rjmp .+140 ; 0x260ae 26022: 83 30 cpi r24, 0x03 ; 3 26024: 09 f4 brne .+2 ; 0x26028 26026: ed c0 rjmp .+474 ; 0x26202 26028: 80 f5 brcc .+96 ; 0x2608a 2602a: 81 30 cpi r24, 0x01 ; 1 2602c: 09 f4 brne .+2 ; 0x26030 2602e: 88 c0 rjmp .+272 ; 0x26140 26030: 08 f4 brcc .+2 ; 0x26034 26032: 60 c0 rjmp .+192 ; 0x260f4 26034: 8b e7 ldi r24, 0x7B ; 123 26036: 0e 94 02 7a call 0xf404 ; 0xf404 farm_timer = 1; break; case 2: // heating done SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 2603a: 83 e0 ldi r24, 0x03 ; 3 2603c: 0f 94 42 06 call 0x20c84 ; 0x20c84 prusa_stat_farm_number(); 26040: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 26044: 8d e7 ldi r24, 0x7D ; 125 26046: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2604a: 0e 94 0d 7b call 0xf61a ; 0xf61a SERIAL_ECHOLN('}'); status_number = 3; 2604e: c3 e0 ldi r28, 0x03 ; 3 26050: c0 93 bd 04 sts 0x04BD, r28 ; 0x8004bd <_ZL13status_number.lto_priv.489> farm_timer = 1; 26054: 81 e0 ldi r24, 0x01 ; 1 26056: 80 93 74 02 sts 0x0274, r24 ; 0x800274 if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 2605a: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 2605e: 81 11 cpse r24, r1 26060: 05 c0 rjmp .+10 ; 0x2606c 26062: 80 91 94 03 lds r24, 0x0394 ; 0x800394 26066: 88 23 and r24, r24 26068: 09 f4 brne .+2 ; 0x2606c 2606a: 78 c0 rjmp .+240 ; 0x2615c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2606c: 8b e7 ldi r24, 0x7B ; 123 2606e: 0e 94 02 7a call 0xf404 ; 0xf404 SERIAL_ECHO('{'); prusa_stat_printerstatus(4); 26072: 84 e0 ldi r24, 0x04 ; 4 26074: 0f 94 42 06 call 0x20c84 ; 0x20c84 prusa_stat_farm_number(); 26078: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 status_number = 4; 2607c: 84 e0 ldi r24, 0x04 ; 4 2607e: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.489> SERIAL_ECHO('{'); prusa_stat_printerstatus(3); prusa_stat_farm_number(); status_number = 3; } farm_timer = 1; 26082: 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; 26084: 80 93 74 02 sts 0x0274, r24 ; 0x800274 26088: 1e c0 rjmp .+60 ; 0x260c6 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 2608a: 85 30 cpi r24, 0x05 ; 5 2608c: 09 f4 brne .+2 ; 0x26090 2608e: 71 c0 rjmp .+226 ; 0x26172 // 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:"); 26090: 80 e8 ldi r24, 0x80 ; 128 26092: 9a e8 ldi r25, 0x8A ; 138 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 26094: c6 30 cpi r28, 0x06 ; 6 26096: 08 f4 brcc .+2 ; 0x2609a 26098: 6e c0 rjmp .+220 ; 0x26176 prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 6: // print done SERIAL_ECHOPGM("{[PRN:8]"); 2609a: 89 e6 ldi r24, 0x69 ; 105 2609c: 9a e8 ldi r25, 0x8A ; 138 2609e: 0e 94 15 7b call 0xf62a ; 0xf62a prusa_stat_farm_number(); 260a2: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 status_number = 8; 260a6: 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; 260a8: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.489> 260ac: 74 c0 rjmp .+232 ; 0x26196 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 260ae: 86 31 cpi r24, 0x16 ; 22 260b0: 09 f4 brne .+2 ; 0x260b4 260b2: 9b c0 rjmp .+310 ; 0x261ea 260b4: 70 f4 brcc .+28 ; 0x260d2 260b6: 84 31 cpi r24, 0x14 ; 20 260b8: 09 f4 brne .+2 ; 0x260bc 260ba: 80 c0 rjmp .+256 ; 0x261bc 260bc: 08 f0 brcs .+2 ; 0x260c0 260be: 89 c0 rjmp .+274 ; 0x261d2 260c0: 88 30 cpi r24, 0x08 ; 8 260c2: 09 f4 brne .+2 ; 0x260c6 260c4: 72 c0 rjmp .+228 ; 0x261aa 260c6: 8d e7 ldi r24, 0x7D ; 125 260c8: 0e 94 02 7a call 0xf404 ; 0xf404 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 260cc: cf 91 pop r28 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 260ce: 0c 94 0d 7b jmp 0xf61a ; 0xf61a void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 260d2: 8b 35 cpi r24, 0x5B ; 91 260d4: 09 f4 brne .+2 ; 0x260d8 260d6: 91 c0 rjmp .+290 ; 0x261fa 260d8: 30 f4 brcc .+12 ; 0x260e6 prusa_stat_farm_number(); status_number = 5; break; case 90: // Error - Thermal Runaway prusa_statistics_err('1'); 260da: 81 e3 ldi r24, 0x31 ; 49 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 260dc: ca 35 cpi r28, 0x5A ; 90 260de: 99 f7 brne .-26 ; 0x260c6 break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 260e0: 0f 94 4f 06 call 0x20c9e ; 0x20c9e 260e4: f0 cf rjmp .-32 ; 0x260c6 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 260e6: 8c 35 cpi r24, 0x5C ; 92 260e8: 09 f4 brne .+2 ; 0x260ec 260ea: 89 c0 rjmp .+274 ; 0x261fe break; case 92: // Error - Min temp prusa_statistics_err('3'); break; case 93: // Error - Max temp prusa_statistics_err('4'); 260ec: 84 e3 ldi r24, 0x34 ; 52 void prusa_statistics(uint8_t _message) { const uint8_t _fil_nr = 0; if (!farm_mode) return; switch (_message) { 260ee: cd 35 cpi r28, 0x5D ; 93 260f0: b9 f3 breq .-18 ; 0x260e0 260f2: e9 cf rjmp .-46 ; 0x260c6 case 0: // default message if (busy_state == PAUSED_FOR_USER) { 260f4: 80 91 78 02 lds r24, 0x0278 ; 0x800278 260f8: 84 30 cpi r24, 0x04 ; 4 260fa: 21 f4 brne .+8 ; 0x26104 prusa_statistics_case0(15); 260fc: 8f e0 ldi r24, 0x0F ; 15 } else if (printingIsPaused()) { prusa_statistics_case0(14); 260fe: 0f 94 18 16 call 0x22c30 ; 0x22c30 26102: e1 cf rjmp .-62 ; 0x260c6 switch (_message) { case 0: // default message if (busy_state == PAUSED_FOR_USER) { prusa_statistics_case0(15); } else if (printingIsPaused()) { 26104: 0e 94 86 66 call 0xcd0c ; 0xcd0c 26108: 88 23 and r24, r24 2610a: 11 f0 breq .+4 ; 0x26110 prusa_statistics_case0(14); 2610c: 8e e0 ldi r24, 0x0E ; 14 2610e: f7 cf rjmp .-18 ; 0x260fe } else if (IS_SD_PRINTING || (eFilamentAction != FilamentAction::None)) { 26110: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 26114: 81 11 cpse r24, r1 26116: 04 c0 rjmp .+8 ; 0x26120 26118: 80 91 94 03 lds r24, 0x0394 ; 0x800394 2611c: 88 23 and r24, r24 2611e: 11 f0 breq .+4 ; 0x26124 prusa_statistics_case0(4); 26120: 84 e0 ldi r24, 0x04 ; 4 26122: ed cf rjmp .-38 ; 0x260fe } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 26124: 8b e7 ldi r24, 0x7B ; 123 26126: 0e 94 02 7a call 0xf404 ; 0xf404 } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(1); 2612a: 81 e0 ldi r24, 0x01 ; 1 2612c: 0f 94 42 06 call 0x20c84 ; 0x20c84 prusa_stat_farm_number(); 26130: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 prusa_stat_diameter(); 26134: 0f 94 5e 06 call 0x20cbc ; 0x20cbc status_number = 1; 26138: 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; 2613a: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.489> 2613e: c3 cf rjmp .-122 ; 0x260c6 26140: 8b e7 ldi r24, 0x7B ; 123 26142: 0e 94 02 7a call 0xf404 ; 0xf404 } break; case 1: // 1 heating SERIAL_ECHO('{'); prusa_stat_printerstatus(2); 26146: 82 e0 ldi r24, 0x02 ; 2 26148: 0f 94 42 06 call 0x20c84 ; 0x20c84 prusa_stat_farm_number(); 2614c: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 status_number = 2; 26150: 82 e0 ldi r24, 0x02 ; 2 26152: 80 93 bd 04 sts 0x04BD, r24 ; 0x8004bd <_ZL13status_number.lto_priv.489> farm_timer = 1; 26156: c0 93 74 02 sts 0x0274, r28 ; 0x800274 2615a: b5 cf rjmp .-150 ; 0x260c6 2615c: 8b e7 ldi r24, 0x7B ; 123 2615e: 0e 94 02 7a call 0xf404 ; 0xf404 prusa_stat_farm_number(); status_number = 4; } else { SERIAL_ECHO('{'); prusa_stat_printerstatus(3); 26162: 83 e0 ldi r24, 0x03 ; 3 26164: 0f 94 42 06 call 0x20c84 ; 0x20c84 prusa_stat_farm_number(); 26168: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 status_number = 3; 2616c: c0 93 bd 04 sts 0x04BD, r28 ; 0x8004bd <_ZL13status_number.lto_priv.489> 26170: 88 cf rjmp .-240 ; 0x26082 prusa_stat_printerstatus(status_number); prusa_stat_farm_number(); farm_timer = 2; break; case 5: // print not succesfull SERIAL_ECHOPGM("{[RES:0][FIL:"); 26172: 82 e7 ldi r24, 0x72 ; 114 26174: 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:"); 26176: 0e 94 15 7b call 0xf62a ; 0xf62a 2617a: 60 e0 ldi r22, 0x00 ; 0 2617c: 70 e0 ldi r23, 0x00 ; 0 2617e: cb 01 movw r24, r22 26180: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 26184: 8d e5 ldi r24, 0x5D ; 93 26186: 0e 94 02 7a call 0xf404 ; 0xf404 MYSERIAL.print(int(_fil_nr)); SERIAL_ECHO(']'); prusa_stat_printerstatus(status_number); 2618a: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.489> 2618e: 0f 94 42 06 call 0x20c84 ; 0x20c84 prusa_stat_farm_number(); 26192: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 farm_timer = 2; 26196: 82 e0 ldi r24, 0x02 ; 2 26198: 75 cf rjmp .-278 ; 0x26084 prusa_stat_farm_number(); status_number = 8; farm_timer = 2; break; case 7: // print done - stopped SERIAL_ECHOPGM("{[PRN:9]"); 2619a: 80 e6 ldi r24, 0x60 ; 96 2619c: 9a e8 ldi r25, 0x8A ; 138 2619e: 0e 94 15 7b call 0xf62a ; 0xf62a prusa_stat_farm_number(); 261a2: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 status_number = 9; 261a6: 89 e0 ldi r24, 0x09 ; 9 261a8: 7f cf rjmp .-258 ; 0x260a8 farm_timer = 2; break; case 8: // printer started SERIAL_ECHOPGM("{[PRN:0]"); 261aa: 87 e5 ldi r24, 0x57 ; 87 261ac: 9a e8 ldi r25, 0x8A ; 138 261ae: 0e 94 15 7b call 0xf62a ; 0xf62a prusa_stat_farm_number(); 261b2: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 status_number = 0; 261b6: 10 92 bd 04 sts 0x04BD, r1 ; 0x8004bd <_ZL13status_number.lto_priv.489> 261ba: ed cf rjmp .-38 ; 0x26196 261bc: 8b e7 ldi r24, 0x7B ; 123 261be: 0e 94 02 7a call 0xf404 ; 0xf404 farm_timer = 2; break; case 20: // echo farm no SERIAL_ECHO('{'); prusa_stat_printerstatus(status_number); 261c2: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.489> 261c6: 0f 94 42 06 call 0x20c84 ; 0x20c84 prusa_stat_farm_number(); 261ca: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 farm_timer = 4; 261ce: 84 e0 ldi r24, 0x04 ; 4 261d0: 59 cf rjmp .-334 ; 0x26084 261d2: 8b e7 ldi r24, 0x7B ; 123 261d4: 0e 94 02 7a call 0xf404 ; 0xf404 break; case 21: // temperatures SERIAL_ECHO('{'); prusa_stat_temperatures(); 261d8: 0f 94 05 06 call 0x20c0a ; 0x20c0a prusa_stat_farm_number(); 261dc: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 prusa_stat_printerstatus(status_number); 261e0: 80 91 bd 04 lds r24, 0x04BD ; 0x8004bd <_ZL13status_number.lto_priv.489> 261e4: 0f 94 42 06 call 0x20c84 ; 0x20c84 261e8: 6e cf rjmp .-292 ; 0x260c6 break; case 22: // waiting for filament change SERIAL_ECHOPGM("{[PRN:5]"); 261ea: 8e e4 ldi r24, 0x4E ; 78 261ec: 9a e8 ldi r25, 0x8A ; 138 261ee: 0e 94 15 7b call 0xf62a ; 0xf62a prusa_stat_farm_number(); 261f2: 0f 94 e9 05 call 0x20bd2 ; 0x20bd2 status_number = 5; 261f6: 85 e0 ldi r24, 0x05 ; 5 261f8: a0 cf rjmp .-192 ; 0x2613a case 90: // Error - Thermal Runaway prusa_statistics_err('1'); break; case 91: // Error - Thermal Runaway Preheat prusa_statistics_err('2'); 261fa: 82 e3 ldi r24, 0x32 ; 50 261fc: 71 cf rjmp .-286 ; 0x260e0 break; case 92: // Error - Min temp prusa_statistics_err('3'); 261fe: 83 e3 ldi r24, 0x33 ; 51 26200: 6f cf rjmp .-290 ; 0x260e0 prusa_stat_temperatures(); prusa_stat_farm_number(); break; } SERIAL_ECHOLN('}'); } 26202: cf 91 pop r28 26204: 08 95 ret 00026206 : 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()") { 26206: cf 92 push r12 26208: df 92 push r13 2620a: ef 92 push r14 2620c: ff 92 push r15 2620e: 0f 93 push r16 26210: 1f 93 push r17 26212: cf 93 push r28 26214: df 93 push r29 26216: 00 d0 rcall .+0 ; 0x26218 26218: 00 d0 rcall .+0 ; 0x2621a 2621a: 1f 92 push r1 2621c: 1f 92 push r1 2621e: cd b7 in r28, 0x3d ; 61 26220: de b7 in r29, 0x3e ; 62 static uint8_t lcd_status_update_delay = 0; #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) 26222: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 26226: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 2622a: 00 97 sbiw r24, 0x00 ; 0 2622c: e1 f1 breq .+120 ; 0x262a6 { const int16_t initial_feedmultiply = feedmultiply; 2622e: 20 91 8e 02 lds r18, 0x028E ; 0x80028e 26232: 30 91 8f 02 lds r19, 0x028F ; 0x80028f // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 26236: 24 36 cpi r18, 0x64 ; 100 26238: 31 05 cpc r19, r1 2623a: 4c f4 brge .+18 ; 0x2624e 2623c: ac 01 movw r20, r24 2623e: 42 0f add r20, r18 26240: 53 1f adc r21, r19 26242: 45 36 cpi r20, 0x65 ; 101 26244: 51 05 cpc r21, r1 26246: 6c f4 brge .+26 ; 0x26262 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; 26248: 82 0f add r24, r18 2624a: 93 1f adc r25, r19 2624c: 0c c0 rjmp .+24 ; 0x26266 #ifdef ULTIPANEL_FEEDMULTIPLY if (lcd_encoder) { const int16_t initial_feedmultiply = feedmultiply; // Dead zone at 100% feedrate if ((feedmultiply < 100 && (feedmultiply + lcd_encoder) > 100) || 2624e: 24 36 cpi r18, 0x64 ; 100 26250: 31 05 cpc r19, r1 26252: 09 f4 brne .+2 ; 0x26256 26254: 55 c0 rjmp .+170 ; 0x26300 (feedmultiply > 100 && (feedmultiply + lcd_encoder) < 100)) 26256: ac 01 movw r20, r24 26258: 42 0f add r20, r18 2625a: 53 1f adc r21, r19 2625c: 44 36 cpi r20, 0x64 ; 100 2625e: 51 05 cpc r21, r1 26260: 9c f7 brge .-26 ; 0x26248 { feedmultiply = 100; 26262: 84 e6 ldi r24, 0x64 ; 100 26264: 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; 26266: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 2626a: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e if (initial_feedmultiply != feedmultiply) { 2626e: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 26272: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 26276: 82 17 cp r24, r18 26278: 93 07 cpc r25, r19 2627a: a9 f0 breq .+42 ; 0x262a6 feedmultiply = constrain(feedmultiply, 10, 999); 2627c: 88 3e cpi r24, 0xE8 ; 232 2627e: 53 e0 ldi r21, 0x03 ; 3 26280: 95 07 cpc r25, r21 26282: 14 f0 brlt .+4 ; 0x26288 26284: 87 ee ldi r24, 0xE7 ; 231 26286: 93 e0 ldi r25, 0x03 ; 3 26288: 8a 30 cpi r24, 0x0A ; 10 2628a: 91 05 cpc r25, r1 2628c: 14 f4 brge .+4 ; 0x26292 2628e: 8a e0 ldi r24, 0x0A ; 10 26290: 90 e0 ldi r25, 0x00 ; 0 26292: 90 93 8f 02 sts 0x028F, r25 ; 0x80028f 26296: 80 93 8e 02 sts 0x028E, r24 ; 0x80028e lcd_encoder = 0; // Consume rotation event 2629a: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 2629e: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e refresh_saved_feedrate_multiplier_in_ram(); 262a2: 0e 94 8e 64 call 0xc91c ; 0xc91c } } #endif //ULTIPANEL_FEEDMULTIPLY if (lcd_draw_update) { 262a6: 80 91 59 02 lds r24, 0x0259 ; 0x800259 262aa: 81 11 cpse r24, r1 // Update the status screen immediately lcd_status_update_delay = 0; 262ac: 10 92 0a 06 sts 0x060A, r1 ; 0x80060a } if (lcd_status_update_delay) 262b0: 10 91 0a 06 lds r17, 0x060A ; 0x80060a 262b4: 11 23 and r17, r17 262b6: 91 f1 breq .+100 ; 0x2631c lcd_status_update_delay--; 262b8: 2f ef ldi r18, 0xFF ; 255 262ba: 21 0f add r18, r17 262bc: 20 93 0a 06 sts 0x060A, r18 ; 0x80060a if (lcd_commands_type != LcdCommands::Idle) lcd_commands(); } if (!menu_is_any_block() && lcd_clicked()) { 262c0: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 262c4: 81 11 cpse r24, r1 262c6: 0d c0 rjmp .+26 ; 0x262e2 262c8: 0e 94 c6 73 call 0xe78c ; 0xe78c 262cc: 88 23 and r24, r24 262ce: 49 f0 breq .+18 ; 0x262e2 menu_depth = 0; //redundant, as already done in lcd_return_to_status(), just to be sure 262d0: 10 92 df 03 sts 0x03DF, r1 ; 0x8003df menu_submenu(lcd_main_menu); 262d4: 60 e0 ldi r22, 0x00 ; 0 262d6: 83 ee ldi r24, 0xE3 ; 227 262d8: 96 ec ldi r25, 0xC6 ; 198 262da: 0e 94 2e 63 call 0xc65c ; 0xc65c lcd_refresh(); // to maybe revive the LCD if static electricity killed it. 262de: 0e 94 f0 70 call 0xe1e0 ; 0xe1e0 } } 262e2: 28 96 adiw r28, 0x08 ; 8 262e4: 0f b6 in r0, 0x3f ; 63 262e6: f8 94 cli 262e8: de bf out 0x3e, r29 ; 62 262ea: 0f be out 0x3f, r0 ; 63 262ec: cd bf out 0x3d, r28 ; 61 262ee: df 91 pop r29 262f0: cf 91 pop r28 262f2: 1f 91 pop r17 262f4: 0f 91 pop r16 262f6: ff 90 pop r15 262f8: ef 90 pop r14 262fa: df 90 pop r13 262fc: cf 90 pop r12 262fe: 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) { 26300: 8b 30 cpi r24, 0x0B ; 11 26302: 91 05 cpc r25, r1 26304: 1c f0 brlt .+6 ; 0x2630c feedmultiply += lcd_encoder - ENCODER_FEEDRATE_DEADZONE; 26306: 86 5a subi r24, 0xA6 ; 166 26308: 9f 4f sbci r25, 0xFF ; 255 2630a: ad cf rjmp .-166 ; 0x26266 } else if (feedmultiply == 100 && lcd_encoder < -ENCODER_FEEDRATE_DEADZONE) { 2630c: 86 3f cpi r24, 0xF6 ; 246 2630e: 4f ef ldi r20, 0xFF ; 255 26310: 94 07 cpc r25, r20 26312: 0c f0 brlt .+2 ; 0x26316 26314: ac cf rjmp .-168 ; 0x2626e feedmultiply += lcd_encoder + ENCODER_FEEDRATE_DEADZONE; 26316: 82 59 subi r24, 0x92 ; 146 26318: 9f 4f sbci r25, 0xFF ; 255 2631a: a5 cf rjmp .-182 ; 0x26266 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; 2631c: 6a e0 ldi r22, 0x0A ; 10 2631e: 60 93 0a 06 sts 0x060A, r22 ; 0x80060a ReInitLCD++; 26322: 80 91 09 06 lds r24, 0x0609 ; 0x800609 26326: 8f 5f subi r24, 0xFF ; 255 26328: 80 93 09 06 sts 0x0609, r24 ; 0x800609 if (ReInitLCD == 30) 2632c: 8e 31 cpi r24, 0x1E ; 30 2632e: 09 f0 breq .+2 ; 0x26332 26330: 9f c0 rjmp .+318 ; 0x26470 { ReInitLCD = 0 ; 26332: 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(); 26336: 0e 94 f0 70 call 0xe1e0 ; 0xe1e0 lcd_status_message_idx = 0; // Re-draw message from beginning 2633a: 10 92 64 04 sts 0x0464, r1 ; 0x800464 <_ZL22lcd_status_message_idx.lto_priv.417> //! F - feedrate symbol LCD_STR_FEEDRATE //! t - clock symbol LCD_STR_THERMOMETER //! @endcode void lcdui_print_status_screen(void) { lcd_frame_start(); 2633e: 0e 94 37 6f call 0xde6e ; 0xde6e lcd_home(); //line 0 26342: 0e 94 70 70 call 0xe0e0 ; 0xe0e0 return current_temperature_bed; }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE float degTargetHotend(uint8_t extruder) { return target_temperature[extruder]; 26346: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 2634a: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 2634e: 07 2e mov r0, r23 26350: 00 0c add r0, r0 26352: 88 0b sbc r24, r24 26354: 99 0b sbc r25, r25 26356: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__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)); 2635a: 20 e0 ldi r18, 0x00 ; 0 2635c: 30 e0 ldi r19, 0x00 ; 0 2635e: 40 e0 ldi r20, 0x00 ; 0 26360: 5f e3 ldi r21, 0x3F ; 63 26362: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 26366: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 2636a: 6b 01 movw r12, r22 2636c: 20 e0 ldi r18, 0x00 ; 0 2636e: 30 e0 ldi r19, 0x00 ; 0 26370: 40 e0 ldi r20, 0x00 ; 0 26372: 5f e3 ldi r21, 0x3F ; 63 26374: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 26378: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2637c: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 26380: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 26384: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 26388: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 2638c: a6 01 movw r20, r12 2638e: 82 e8 ldi r24, 0x82 ; 130 26390: 0f 94 34 0a call 0x21468 ; 0x21468 lcd_space(3); //3 spaces 26394: 83 e0 ldi r24, 0x03 ; 3 26396: 0e 94 79 6f call 0xdef2 ; 0xdef2 } // Print Z-coordinate (8 chars total) void lcdui_print_Z_coord(void) { if (custom_message_type == CustomMsg::MeshBedLeveling) 2639a: 80 91 5d 06 lds r24, 0x065D ; 0x80065d 2639e: 81 30 cpi r24, 0x01 ; 1 263a0: 09 f0 breq .+2 ; 0x263a4 263a2: 6e c0 rjmp .+220 ; 0x26480 lcd_puts_P(_N("Z --- ")); 263a4: 8e e0 ldi r24, 0x0E ; 14 263a6: 9b e6 ldi r25, 0x6B ; 107 263a8: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_space(3); //3 spaces //Print Z-coordinate (8 chars total) lcdui_print_Z_coord(); lcd_set_cursor(0, 1); //line 1 263ac: 61 e0 ldi r22, 0x01 ; 1 263ae: 80 e0 ldi r24, 0x00 ; 0 263b0: 0e 94 ab 6f call 0xdf56 ; 0xdf56 }; FORCE_INLINE float degTargetBed() { return target_temperature_bed; 263b4: 60 91 59 12 lds r22, 0x1259 ; 0x801259 263b8: 70 91 5a 12 lds r23, 0x125A ; 0x80125a 263bc: 07 2e mov r0, r23 263be: 00 0c add r0, r0 263c0: 88 0b sbc r24, r24 263c2: 99 0b sbc r25, r25 263c4: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> //Print the Bed temperature (9 chars total) lcdui_print_temp(LCD_STR_BEDTEMP[0], (int)(degBed() + 0.5), (int)(degTargetBed() + 0.5)); 263c8: 20 e0 ldi r18, 0x00 ; 0 263ca: 30 e0 ldi r19, 0x00 ; 0 263cc: 40 e0 ldi r20, 0x00 ; 0 263ce: 5f e3 ldi r21, 0x3F ; 63 263d0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 263d4: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 263d8: 6b 01 movw r12, r22 263da: 20 e0 ldi r18, 0x00 ; 0 263dc: 30 e0 ldi r19, 0x00 ; 0 263de: 40 e0 ldi r20, 0x00 ; 0 263e0: 5f e3 ldi r21, 0x3F ; 63 263e2: 60 91 bc 03 lds r22, 0x03BC ; 0x8003bc 263e6: 70 91 bd 03 lds r23, 0x03BD ; 0x8003bd 263ea: 80 91 be 03 lds r24, 0x03BE ; 0x8003be 263ee: 90 91 bf 03 lds r25, 0x03BF ; 0x8003bf 263f2: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 263f6: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 263fa: a6 01 movw r20, r12 263fc: 80 e8 ldi r24, 0x80 ; 128 263fe: 0f 94 34 0a call 0x21468 ; 0x21468 lcd_space(3); //3 spaces 26402: 83 e0 ldi r24, 0x03 ; 3 26404: 0e 94 79 6f call 0xdef2 ; 0xdef2 #endif // PLANNER_DIAGNOSTICS // Print feedrate (8 chars total) void lcdui_print_feedrate(void) { int chars = lcd_printf_P(_N(LCD_STR_FEEDRATE "%3d%%"), feedmultiply); 26408: 80 91 8f 02 lds r24, 0x028F ; 0x80028f 2640c: 8f 93 push r24 2640e: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 26412: 8f 93 push r24 26414: 87 e1 ldi r24, 0x17 ; 23 26416: 9b e6 ldi r25, 0x6B ; 107 26418: 9f 93 push r25 2641a: 8f 93 push r24 2641c: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 lcd_space(8 - chars); 26420: 98 e0 ldi r25, 0x08 ; 8 26422: 98 1b sub r25, r24 26424: 89 2f mov r24, r25 26426: 0e 94 79 6f call 0xdef2 ; 0xdef2 #else // PLANNER_DIAGNOSTICS //Print Feedrate (8 chars) lcdui_print_feedrate(); #endif // PLANNER_DIAGNOSTICS lcd_set_cursor(0, 2); //line 2 2642a: 62 e0 ldi r22, 0x02 ; 2 2642c: 80 e0 ldi r24, 0x00 ; 0 2642e: 0e 94 ab 6f call 0xdf56 ; 0xdf56 } // 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(" ")); 26432: 0f 90 pop r0 26434: 0f 90 pop r0 26436: 0f 90 pop r0 26438: 0f 90 pop r0 2643a: 80 91 42 12 lds r24, 0x1242 ; 0x801242 2643e: e0 90 d7 13 lds r14, 0x13D7 ; 0x8013d7 26442: 81 11 cpse r24, r1 26444: 3e c0 rjmp .+124 ; 0x264c2 26446: 2a e2 ldi r18, 0x2A ; 42 26448: c2 2e mov r12, r18 2644a: 2b e6 ldi r18, 0x6B ; 107 2644c: d2 2e mov r13, r18 2644e: e1 10 cpse r14, r1 26450: 3c c0 rjmp .+120 ; 0x264ca 26452: 8e e2 ldi r24, 0x2E ; 46 26454: c8 2e mov r12, r24 26456: 8b e6 ldi r24, 0x6B ; 107 26458: d8 2e mov r13, r24 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 2645a: 0e 94 e2 66 call 0xcdc4 ; 0xcdc4 2645e: f8 2e mov r15, r24 26460: 88 23 and r24, r24 26462: d9 f1 breq .+118 ; 0x264da 26464: 80 91 6f 02 lds r24, 0x026F ; 0x80026f 26468: 8f 3f cpi r24, 0xFF ; 255 2646a: 89 f5 brne .+98 ; 0x264ce 2646c: f1 2c mov r15, r1 2646e: 35 c0 rjmp .+106 ; 0x264da ReInitLCD = 0 ; lcdui_refresh(); } else { if ((ReInitLCD % 10) == 0) 26470: 0f 94 3c a5 call 0x34a78 ; 0x34a78 <__divmodqi4> 26474: 91 11 cpse r25, r1 26476: 63 cf rjmp .-314 ; 0x2633e lcd_begin(1); } void lcd_refresh_noclear(void) { lcd_begin(0); 26478: 80 e0 ldi r24, 0x00 ; 0 2647a: 0e 94 af 70 call 0xe15e ; 0xe15e 2647e: 5d cf rjmp .-326 ; 0x2633a 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]?' ':'?'); 26480: 80 91 3b 06 lds r24, 0x063B ; 0x80063b 26484: 88 23 and r24, r24 26486: d9 f0 breq .+54 ; 0x264be 26488: 80 e2 ldi r24, 0x20 ; 32 2648a: 1f 92 push r1 2648c: 8f 93 push r24 2648e: 80 91 6c 12 lds r24, 0x126C ; 0x80126c 26492: 8f 93 push r24 26494: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 26498: 8f 93 push r24 2649a: 80 91 6a 12 lds r24, 0x126A ; 0x80126a 2649e: 8f 93 push r24 264a0: 80 91 69 12 lds r24, 0x1269 ; 0x801269 264a4: 8f 93 push r24 264a6: 85 e0 ldi r24, 0x05 ; 5 264a8: 9b e6 ldi r25, 0x6B ; 107 264aa: 9f 93 push r25 264ac: 8f 93 push r24 264ae: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 264b2: 0f b6 in r0, 0x3f ; 63 264b4: f8 94 cli 264b6: de bf out 0x3e, r29 ; 62 264b8: 0f be out 0x3f, r0 ; 63 264ba: cd bf out 0x3d, r28 ; 61 264bc: 77 cf rjmp .-274 ; 0x263ac 264be: 8f e3 ldi r24, 0x3F ; 63 264c0: e4 cf rjmp .-56 ; 0x2648a } // 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(" ")); 264c2: 92 e3 ldi r25, 0x32 ; 50 264c4: c9 2e mov r12, r25 264c6: 9b e6 ldi r25, 0x6B ; 107 264c8: d9 2e mov r13, r25 bool num = IS_SD_PRINTING || (printer_active() && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT)); 264ca: ee 20 and r14, r14 264cc: 31 f2 breq .-116 ; 0x2645a if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 264ce: 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)); 264d2: ff 24 eor r15, r15 264d4: f3 94 inc r15 if (!num || heating_status != HeatingStatus::NO_HEATING) // either not printing or heating 264d6: 88 23 and r24, r24 264d8: 99 f1 breq .+102 ; 0x26540 { const int8_t sheetNR = eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)); 264da: 81 ea ldi r24, 0xA1 ; 161 264dc: 9d e0 ldi r25, 0x0D ; 13 264de: 0f 94 81 a4 call 0x34902 ; 0x34902 264e2: 08 2f mov r16, r24 const int8_t nextSheet = eeprom_next_initialized_sheet(sheetNR); 264e4: 0e 94 e7 78 call 0xf1ce ; 0xf1ce if ((nextSheet >= 0) && (sheetNR != nextSheet)) 264e8: 87 fd sbrc r24, 7 264ea: 2a c0 rjmp .+84 ; 0x26540 264ec: 08 17 cp r16, r24 264ee: 41 f1 breq .+80 ; 0x26540 { char sheet[8]; eeprom_read_block(sheet, EEPROM_Sheets_base->s[sheetNR].name, 7); 264f0: 9b e0 ldi r25, 0x0B ; 11 264f2: 09 02 muls r16, r25 264f4: b0 01 movw r22, r0 264f6: 11 24 eor r1, r1 264f8: 67 5b subi r22, 0xB7 ; 183 264fa: 72 4f sbci r23, 0xF2 ; 242 264fc: 47 e0 ldi r20, 0x07 ; 7 264fe: 50 e0 ldi r21, 0x00 ; 0 26500: 8e 01 movw r16, r28 26502: 0f 5f subi r16, 0xFF ; 255 26504: 1f 4f sbci r17, 0xFF ; 255 26506: c8 01 movw r24, r16 26508: 0f 94 71 a4 call 0x348e2 ; 0x348e2 sheet[7] = '\0'; 2650c: 18 86 std Y+8, r1 ; 0x08 lcd_printf_P(PSTR("%-7s"),sheet); 2650e: 1f 93 push r17 26510: 0f 93 push r16 26512: 8a e8 ldi r24, 0x8A ; 138 26514: 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()); 26516: 9f 93 push r25 26518: 8f 93 push r24 2651a: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 2651e: 0f 90 pop r0 26520: 0f 90 pop r0 26522: 0f 90 pop r0 26524: 0f 90 pop r0 lcd_set_cursor(0, 2); //line 2 //Print SD status (7 chars) lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { 26526: 80 91 01 13 lds r24, 0x1301 ; 0x801301 2652a: 81 30 cpi r24, 0x01 ; 1 2652c: 09 f0 breq .+2 ; 0x26530 2652e: 5a c0 rjmp .+180 ; 0x265e4 // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); 26530: 0f 94 7f 05 call 0x20afe ; 0x20afe 26534: 95 e0 ldi r25, 0x05 ; 5 26536: 98 1b sub r25, r24 26538: 89 2f mov r24, r25 } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 2653a: 0e 94 79 6f call 0xdef2 ; 0xdef2 2653e: 5f c0 rjmp .+190 ; 0x265fe lcd_printf_P(PSTR("%-7s"),sheet); return; //do not also print the percentage } } if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) 26540: e1 10 cpse r14, r1 26542: 04 c0 rjmp .+8 ; 0x2654c 26544: 80 91 8c 03 lds r24, 0x038C ; 0x80038c <_ZL9M79_timer.lto_priv.419> 26548: 81 11 cpse r24, r1 2654a: 42 c0 rjmp .+132 ; 0x265d0 // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space lcd_print(hostName); // Two characters } else { lcd_printf_P(PSTR("%3S"), src); 2654c: df 92 push r13 2654e: cf 92 push r12 26550: 86 e8 ldi r24, 0x86 ; 134 26552: 98 e9 ldi r25, 0x98 ; 152 26554: 9f 93 push r25 26556: 8f 93 push r24 26558: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 2655c: 0f 90 pop r0 2655e: 0f 90 pop r0 26560: 0f 90 pop r0 26562: 0f 90 pop r0 else if (print_percent_done_silent <= 100) { percent_done = print_percent_done_silent; } #else if (print_percent_done_normal <= 100) 26564: 80 91 6f 02 lds r24, 0x026F ; 0x80026f 26568: 85 36 cpi r24, 0x65 ; 101 2656a: d0 f1 brcs .+116 ; 0x265e0 2656c: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 26570: 88 23 and r24, r24 26572: 19 f1 breq .+70 ; 0x265ba 26574: 80 91 e4 16 lds r24, 0x16E4 ; 0x8016e4 26578: 90 91 e5 16 lds r25, 0x16E5 ; 0x8016e5 2657c: a0 91 e6 16 lds r26, 0x16E6 ; 0x8016e6 26580: b0 91 e7 16 lds r27, 0x16E7 ; 0x8016e7 26584: 00 97 sbiw r24, 0x00 ; 0 26586: a1 05 cpc r26, r1 26588: b1 05 cpc r27, r1 2658a: b9 f0 breq .+46 ; 0x265ba 2658c: bc 01 movw r22, r24 2658e: cd 01 movw r24, r26 26590: 6d 59 subi r22, 0x9D ; 157 26592: 7f 4f sbci r23, 0xFF ; 255 26594: 8f 4f sbci r24, 0xFF ; 255 26596: 9f 4f sbci r25, 0xFF ; 255 26598: 24 e6 ldi r18, 0x64 ; 100 2659a: 30 e0 ldi r19, 0x00 ; 0 2659c: 40 e0 ldi r20, 0x00 ; 0 2659e: 50 e0 ldi r21, 0x00 ; 0 265a0: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 265a4: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 265a8: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 265ac: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 265b0: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 265b4: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 265b8: 12 2f mov r17, r18 } lcd_printf_P(num ? _N("%3d%%"):_N("---%%"), calc_percent_done()); 265ba: 21 2f mov r18, r17 265bc: 30 e0 ldi r19, 0x00 ; 0 265be: 84 e2 ldi r24, 0x24 ; 36 265c0: 9b e6 ldi r25, 0x6B ; 107 265c2: f1 10 cpse r15, r1 265c4: 02 c0 rjmp .+4 ; 0x265ca 265c6: 8e e1 ldi r24, 0x1E ; 30 265c8: 9b e6 ldi r25, 0x6B ; 107 265ca: 3f 93 push r19 265cc: 2f 93 push r18 265ce: a3 cf rjmp .-186 ; 0x26516 if (!IS_SD_PRINTING && M79_timer_get_status() && GetHostStatusScreenName()) { // Overwrite the name char * hostName = GetHostStatusScreenName(); lcd_space(1); // Blank space 265d0: 81 e0 ldi r24, 0x01 ; 1 265d2: 0e 94 79 6f call 0xdef2 ; 0xdef2 lcd_print(hostName); // Two characters 265d6: 85 e0 ldi r24, 0x05 ; 5 265d8: 96 e0 ldi r25, 0x06 ; 6 265da: 0e 94 b0 73 call 0xe760 ; 0xe760 265de: c2 cf rjmp .-124 ; 0x26564 265e0: 18 2f mov r17, r24 265e2: eb cf rjmp .-42 ; 0x265ba lcdui_print_percent_done(); if (MMU2::mmu2.Enabled()) { // Print extruder status (5 chars) lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { 265e4: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 265e8: 88 23 and r24, r24 265ea: 09 f4 brne .+2 ; 0x265ee 265ec: a5 c0 rjmp .+330 ; 0x26738 } // Print farm number (5 chars total) static void lcdui_print_farm(void) { lcd_printf_P(_N(" FRM ")); 265ee: 86 e3 ldi r24, 0x36 ; 54 265f0: 9b e6 ldi r25, 0x6B ; 107 265f2: 9f 93 push r25 265f4: 8f 93 push r24 265f6: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 265fa: 0f 90 pop r0 265fc: 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()) { 265fe: 0e 94 e2 66 call 0xcdc4 ; 0xcdc4 26602: 88 23 and r24, r24 26604: 09 f4 brne .+2 ; 0x26608 26606: ac c0 rjmp .+344 ; 0x26760 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) 26608: c0 90 72 02 lds r12, 0x0272 ; 0x800272 2660c: 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) 26610: e0 90 70 02 lds r14, 0x0270 ; 0x800270 26614: f0 90 71 02 lds r15, 0x0271 ; 0x800271 #ifdef TMC2130 } #endif //TMC2130 //#ifdef CLOCK_INTERVAL_TIME if (clock_interval == CLOCK_INTERVAL_TIME*2) 26618: 80 91 08 06 lds r24, 0x0608 ; 0x800608 2661c: 8a 30 cpi r24, 0x0A ; 10 2661e: 11 f4 brne .+4 ; 0x26624 clock_interval = 0; 26620: 10 92 08 06 sts 0x0608, r1 ; 0x800608 clock_interval++; 26624: 80 91 08 06 lds r24, 0x0608 ; 0x800608 26628: 8f 5f subi r24, 0xFF ; 255 2662a: 80 93 08 06 sts 0x0608, r24 ; 0x800608 if (print_tc != PRINT_TIME_REMAINING_INIT && clock_interval > CLOCK_INTERVAL_TIME) { 2662e: 2f ef ldi r18, 0xFF ; 255 26630: e2 16 cp r14, r18 26632: f2 06 cpc r15, r18 26634: 21 f0 breq .+8 ; 0x2663e 26636: 97 01 movw r18, r14 print_t = print_tc; suff = 'C'; 26638: 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) { 2663a: 86 30 cpi r24, 0x06 ; 6 2663c: 70 f4 brcc .+28 ; 0x2665a print_t = print_tc; suff = 'C'; } else //#endif //CLOCK_INTERVAL_TIME if (print_tr != PRINT_TIME_REMAINING_INIT) { 2663e: 3f ef ldi r19, 0xFF ; 255 26640: c3 16 cp r12, r19 26642: d3 06 cpc r13, r19 26644: 09 f0 breq .+2 ; 0x26648 26646: 7a c0 rjmp .+244 ; 0x2673c print_t = print_tr; suff = 'R'; } else print_t = print_job_timer.duration() / 60; 26648: 0f 94 06 15 call 0x22a0c ; 0x22a0c 2664c: 2c e3 ldi r18, 0x3C ; 60 2664e: 30 e0 ldi r19, 0x00 ; 0 26650: 40 e0 ldi r20, 0x00 ; 0 26652: 50 e0 ldi r21, 0x00 ; 0 26654: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__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 = ' '; 26658: 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)) { 2665a: 40 91 8e 02 lds r20, 0x028E ; 0x80028e 2665e: 50 91 8f 02 lds r21, 0x028F ; 0x80028f 26662: 44 36 cpi r20, 0x64 ; 100 26664: 51 05 cpc r21, r1 26666: 09 f4 brne .+2 ; 0x2666a 26668: 6c c0 rjmp .+216 ; 0x26742 2666a: c2 16 cp r12, r18 2666c: d3 06 cpc r13, r19 2666e: 21 f0 breq .+8 ; 0x26678 26670: e2 16 cp r14, r18 26672: f3 06 cpc r15, r19 26674: 09 f0 breq .+2 ; 0x26678 26676: 65 c0 rjmp .+202 ; 0x26742 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); 26678: a4 e6 ldi r26, 0x64 ; 100 2667a: b0 e0 ldi r27, 0x00 ; 0 2667c: 0f 94 21 a5 call 0x34a42 ; 0x34a42 <__umulhisi3> 26680: 9a 01 movw r18, r20 26682: 55 0f add r21, r21 26684: 44 0b sbc r20, r20 26686: 55 0b sbc r21, r21 26688: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> suff = 'R'; } else print_t = print_job_timer.duration() / 60; if (feedmultiply != 100 && (print_t == print_tr || print_t == print_tc)) { suff_doubt = '?'; 2668c: 4f e3 ldi r20, 0x3F ; 63 2668e: e4 2e mov r14, r20 26690: 04 2e mov r0, r20 26692: 00 0c add r0, r0 26694: ff 08 sbc r15, r15 26696: e1 2f mov r30, r17 26698: 01 2e mov r0, r17 2669a: 00 0c add r0, r0 2669c: ff 0b sbc r31, r31 2669e: c9 01 movw r24, r18 266a0: 6c e3 ldi r22, 0x3C ; 60 266a2: 70 e0 ldi r23, 0x00 ; 0 266a4: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__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 266a8: 20 37 cpi r18, 0x70 ; 112 266aa: 37 41 sbci r19, 0x17 ; 23 266ac: 08 f0 brcs .+2 ; 0x266b0 266ae: 4b c0 rjmp .+150 ; 0x26746 chars = lcd_printf_P(_N(LCD_STR_CLOCK "%02u:%02u%c%c"), print_t / 60, print_t % 60, suff, suff_doubt); 266b0: ff 92 push r15 266b2: 4f 93 push r20 266b4: ff 93 push r31 266b6: 1f 93 push r17 266b8: 9f 93 push r25 266ba: 8f 93 push r24 266bc: 7f 93 push r23 266be: 6f 93 push r22 266c0: 80 e5 ldi r24, 0x50 ; 80 266c2: 9b e6 ldi r25, 0x6B ; 107 266c4: 9f 93 push r25 266c6: 8f 93 push r24 266c8: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 else //time>=100h chars = lcd_printf_P(_N(LCD_STR_CLOCK "%3uh %c%c"), print_t / 60, suff, suff_doubt); 266cc: 0f b6 in r0, 0x3f ; 63 266ce: f8 94 cli 266d0: de bf out 0x3e, r29 ; 62 266d2: 0f be out 0x3f, r0 ; 63 266d4: 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); 266d6: 98 e0 ldi r25, 0x08 ; 8 266d8: 98 1b sub r25, r24 266da: 89 2f mov r24, r25 266dc: 0e 94 79 6f call 0xdef2 ; 0xdef2 #else //Print time (8chars) lcdui_print_time(); #endif //CMD_DIAGNOSTICS lcd_set_cursor(0, 3); //line 3 266e0: 63 e0 ldi r22, 0x03 ; 3 266e2: 80 e0 ldi r24, 0x00 ; 0 266e4: 0e 94 ab 6f call 0xdf56 ; 0xdf56 #ifndef DEBUG_DISABLE_LCD_STATUS_LINE lcdui_print_status_line(); 266e8: 0f 94 64 0c call 0x218c8 ; 0x218c8 void prusa_statistics_update_from_status_screen() { if (farm_mode) { 266ec: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 266f0: 88 23 and r24, r24 266f2: b1 f0 breq .+44 ; 0x26720 farm_timer--; 266f4: 80 91 74 02 lds r24, 0x0274 ; 0x800274 266f8: 81 50 subi r24, 0x01 ; 1 if (farm_timer < 1) { 266fa: d9 f1 breq .+118 ; 0x26772 SERIAL_ECHOLN('}'); } void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; 266fc: 80 93 74 02 sts 0x0274, r24 ; 0x800274 if (farm_timer < 1) { farm_timer = 10; prusa_statistics(0); } switch (farm_timer) { 26700: 80 91 74 02 lds r24, 0x0274 ; 0x800274 26704: 85 30 cpi r24, 0x05 ; 5 26706: e1 f1 breq .+120 ; 0x26780 26708: 88 30 cpi r24, 0x08 ; 8 2670a: 51 f4 brne .+20 ; 0x26720 case 8: prusa_statistics(21); 2670c: 85 e1 ldi r24, 0x15 ; 21 2670e: 0f 94 05 30 call 0x2600a ; 0x2600a if(eFilamentAction != FilamentAction::None) 26712: 80 91 94 03 lds r24, 0x0394 ; 0x800394 26716: 88 23 and r24, r24 26718: 19 f0 breq .+6 ; 0x26720 prusa_statistics(22); 2671a: 86 e1 ldi r24, 0x16 ; 22 break; case 5: if (IS_SD_PRINTING) prusa_statistics(20); 2671c: 0f 94 05 30 call 0x2600a ; 0x2600a lcdui_print_status_screen(); prusa_statistics_update_from_status_screen(); if (lcd_commands_type != LcdCommands::Idle) 26720: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 26724: 88 23 and r24, r24 26726: 09 f4 brne .+2 ; 0x2672a 26728: cb cd rjmp .-1130 ; 0x262c0 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) { 2672a: 80 91 42 0d lds r24, 0x0D42 ; 0x800d42 2672e: 81 11 cpse r24, r1 26730: c7 cd rjmp .-1138 ; 0x262c0 26732: 0e 94 c6 f3 call 0x1e78c ; 0x1e78c 26736: c4 cd rjmp .-1144 ; 0x262c0 lcd_space(5 - lcdui_print_extruder()); } else if (farm_mode) { // Print farm number (5 chars) lcdui_print_farm(); } else { lcd_space(5); // 5 spaces 26738: 85 e0 ldi r24, 0x05 ; 5 2673a: ff ce rjmp .-514 ; 0x2653a 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) { 2673c: 96 01 movw r18, r12 print_t = print_tr; suff = 'R'; 2673e: 12 e5 ldi r17, 0x52 ; 82 26740: 8c cf rjmp .-232 ; 0x2665a 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 = ' '; 26742: 40 e2 ldi r20, 0x20 ; 32 26744: a4 cf rjmp .-184 ; 0x2668e } 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); 26746: ff 92 push r15 26748: 4f 93 push r20 2674a: ff 93 push r31 2674c: 1f 93 push r17 2674e: 7f 93 push r23 26750: 6f 93 push r22 26752: 85 e4 ldi r24, 0x45 ; 69 26754: 9b e6 ldi r25, 0x6B ; 107 26756: 9f 93 push r25 26758: 8f 93 push r24 2675a: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 2675e: b6 cf rjmp .-148 ; 0x266cc } 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 "--:-- ")); 26760: 8c e3 ldi r24, 0x3C ; 60 26762: 9b e6 ldi r25, 0x6B ; 107 26764: 9f 93 push r25 26766: 8f 93 push r24 26768: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 2676c: 0f 90 pop r0 2676e: 0f 90 pop r0 26770: b2 cf rjmp .-156 ; 0x266d6 void prusa_statistics_update_from_status_screen() { if (farm_mode) { farm_timer--; if (farm_timer < 1) { farm_timer = 10; 26772: 8a e0 ldi r24, 0x0A ; 10 26774: 80 93 74 02 sts 0x0274, r24 ; 0x800274 prusa_statistics(0); 26778: 80 e0 ldi r24, 0x00 ; 0 2677a: 0f 94 05 30 call 0x2600a ; 0x2600a 2677e: c0 cf rjmp .-128 ; 0x26700 prusa_statistics(21); if(eFilamentAction != FilamentAction::None) prusa_statistics(22); break; case 5: if (IS_SD_PRINTING) 26780: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 26784: 88 23 and r24, r24 26786: 61 f2 breq .-104 ; 0x26720 prusa_statistics(20); 26788: 84 e1 ldi r24, 0x14 ; 20 2678a: c8 cf rjmp .-112 ; 0x2671c 0002678c : } } static void temp_runaway_stop(bool isPreheat, bool isBed) { 2678c: cf 93 push r28 2678e: df 93 push r29 if(IsStopped() == false) { 26790: 90 91 3b 12 lds r25, 0x123B ; 0x80123b 26794: 91 11 cpse r25, r1 26796: 21 c0 rjmp .+66 ; 0x267da 26798: c6 2f mov r28, r22 2679a: d8 2f mov r29, r24 if (isPreheat) { 2679c: 88 23 and r24, r24 2679e: 09 f1 breq .+66 ; 0x267e2 lcd_setalertstatuspgm(isBed? PSTR("BED PREHEAT ERROR") : PSTR("PREHEAT ERROR"), LCD_STATUS_CRITICAL); 267a0: 8b ee ldi r24, 0xEB ; 235 267a2: 97 e9 ldi r25, 0x97 ; 151 267a4: 66 23 and r22, r22 267a6: 11 f0 breq .+4 ; 0x267ac 267a8: 89 ef ldi r24, 0xF9 ; 249 267aa: 97 e9 ldi r25, 0x97 ; 151 267ac: 63 e0 ldi r22, 0x03 ; 3 267ae: 0e 94 14 d8 call 0x1b028 ; 0x1b028 SERIAL_ERROR_START; 267b2: 87 ec ldi r24, 0xC7 ; 199 267b4: 92 ea ldi r25, 0xA2 ; 162 267b6: 0e 94 15 7b call 0xf62a ; 0xf62a if (isBed) { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); 267ba: 88 ec ldi r24, 0xC8 ; 200 267bc: 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) { 267be: c1 11 cpse r28, r1 267c0: 02 c0 rjmp .+4 ; 0x267c6 SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HEATBED)"); } else { SERIAL_ERRORLNPGM(" THERMAL RUNAWAY (PREHEAT HOTEND)"); 267c2: 86 ea ldi r24, 0xA6 ; 166 267c4: 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"); 267c6: 0e 94 0e 7d call 0xfa1c ; 0xfa1c } } prusa_statistics(0); 267ca: 80 e0 ldi r24, 0x00 ; 0 267cc: 0f 94 05 30 call 0x2600a ; 0x2600a prusa_statistics(isPreheat? 91 : 90); 267d0: 8a e5 ldi r24, 0x5A ; 90 267d2: d1 11 cpse r29, r1 267d4: 8b e5 ldi r24, 0x5B ; 91 267d6: 0f 94 05 30 call 0x2600a ; 0x2600a } ThermalStop(); } 267da: df 91 pop r29 267dc: cf 91 pop r28 } } prusa_statistics(0); prusa_statistics(isPreheat? 91 : 90); } ThermalStop(); 267de: 0d 94 ed 66 jmp 0x2cdda ; 0x2cdda 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); 267e2: 82 e8 ldi r24, 0x82 ; 130 267e4: 97 e9 ldi r25, 0x97 ; 151 267e6: 66 23 and r22, r22 267e8: 11 f0 breq .+4 ; 0x267ee 267ea: 82 e9 ldi r24, 0x92 ; 146 267ec: 97 e9 ldi r25, 0x97 ; 151 267ee: 63 e0 ldi r22, 0x03 ; 3 267f0: 0e 94 14 d8 call 0x1b028 ; 0x1b028 SERIAL_ERROR_START; 267f4: 87 ec ldi r24, 0xC7 ; 199 267f6: 92 ea ldi r25, 0xA2 ; 162 267f8: 0e 94 15 7b call 0xf62a ; 0xf62a if (isBed) { SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); 267fc: 89 e6 ldi r24, 0x69 ; 105 267fe: 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) { 26800: c1 11 cpse r28, r1 26802: e1 cf rjmp .-62 ; 0x267c6 SERIAL_ERRORLNPGM(" HEATBED THERMAL RUNAWAY"); } else { SERIAL_ERRORLNPGM(" HOTEND THERMAL RUNAWAY"); 26804: 81 e5 ldi r24, 0x51 ; 81 26806: 97 e9 ldi r25, 0x97 ; 151 26808: de cf rjmp .-68 ; 0x267c6 0002680a : #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) { 2680a: 2f 92 push r2 2680c: 3f 92 push r3 2680e: 4f 92 push r4 26810: 5f 92 push r5 26812: 6f 92 push r6 26814: 7f 92 push r7 26816: 8f 92 push r8 26818: 9f 92 push r9 2681a: af 92 push r10 2681c: bf 92 push r11 2681e: cf 92 push r12 26820: df 92 push r13 26822: ef 92 push r14 26824: ff 92 push r15 26826: 0f 93 push r16 26828: 1f 93 push r17 2682a: cf 93 push r28 2682c: df 93 push r29 2682e: cd b7 in r28, 0x3d ; 61 26830: de b7 in r29, 0x3e ; 62 26832: e0 97 sbiw r28, 0x30 ; 48 26834: 0f b6 in r0, 0x3f ; 63 26836: f8 94 cli 26838: de bf out 0x3e, r29 ; 62 2683a: 0f be out 0x3f, r0 ; 63 2683c: cd bf out 0x3d, r28 ; 61 2683e: 6a 87 std Y+10, r22 ; 0x0a 26840: 7b 87 std Y+11, r23 ; 0x0b 26842: 8c 87 std Y+12, r24 ; 0x0c 26844: 9d 87 std Y+13, r25 ; 0x0d 26846: 1a 01 movw r2, r20 26848: 3a a7 std Y+42, r19 ; 0x2a 2684a: 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(); 2684c: 0f 94 9e 0e call 0x21d3c ; 0x21d3c pid_tuning_finished = false; 26850: 10 92 41 02 sts 0x0241, r1 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.424> // 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; 26854: 29 a5 ldd r18, Y+41 ; 0x29 26856: 3a a5 ldd r19, Y+42 ; 0x2a 26858: 30 93 01 06 sts 0x0601, r19 ; 0x800601 2685c: 20 93 00 06 sts 0x0600, r18 ; 0x800600 float input = 0.0; pid_cycle=0; 26860: 10 92 03 06 sts 0x0603, r1 ; 0x800603 26864: 10 92 02 06 sts 0x0602, r1 ; 0x800602 bool heating = true; unsigned long temp_millis = _millis(); 26868: 0f 94 89 0b call 0x21712 ; 0x21712 2686c: 6e 83 std Y+6, r22 ; 0x06 2686e: 7f 83 std Y+7, r23 ; 0x07 26870: 88 87 std Y+8, r24 ; 0x08 26872: 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 26874: 37 fe sbrs r3, 7 26876: ff c0 rjmp .+510 ; 0x26a76 26878: 3d e2 ldi r19, 0x2D ; 45 2687a: 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(); 2687c: 0f 94 89 0b call 0x21712 ; 0x21712 26880: 6c a3 std Y+36, r22 ; 0x24 26882: 7d a3 std Y+37, r23 ; 0x25 26884: 8e a3 std Y+38, r24 ; 0x26 26886: 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."); 26888: 8c eb ldi r24, 0xBC ; 188 2688a: 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) 2688c: 12 14 cp r1, r2 2688e: 13 04 cpc r1, r3 26890: 0c f4 brge .+2 ; 0x26894 26892: 8a c2 rjmp .+1300 ; 0x26da8 pid_tuning_finished = true; pid_cycle = 0; return; } SERIAL_ECHOLNPGM("PID Autotune start"); 26894: 89 ea ldi r24, 0xA9 ; 169 26896: 95 e9 ldi r25, 0x95 ; 149 26898: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 2689c: 6a 85 ldd r22, Y+10 ; 0x0a 2689e: 7b 85 ldd r23, Y+11 ; 0x0b 268a0: 8c 85 ldd r24, Y+12 ; 0x0c 268a2: 9d 85 ldd r25, Y+13 ; 0x0d 268a4: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> if (extruder<0) { soft_pwm_bed = (MAX_BED_POWER)/2; 268a8: 2f e7 ldi r18, 0x7F ; 127 return; } SERIAL_ECHOLNPGM("PID Autotune start"); if (extruder<0) 268aa: 21 14 cp r2, r1 268ac: 31 04 cpc r3, r1 268ae: 09 f4 brne .+2 ; 0x268b2 268b0: e5 c0 rjmp .+458 ; 0x26a7c { soft_pwm_bed = (MAX_BED_POWER)/2; 268b2: 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 268b6: 70 93 5a 12 sts 0x125A, r23 ; 0x80125a 268ba: 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 268be: 8e 81 ldd r24, Y+6 ; 0x06 268c0: 9f 81 ldd r25, Y+7 ; 0x07 268c2: a8 85 ldd r26, Y+8 ; 0x08 268c4: b9 85 ldd r27, Y+9 ; 0x09 268c6: 8e 87 std Y+14, r24 ; 0x0e 268c8: 9f 87 std Y+15, r25 ; 0x0f 268ca: a8 8b std Y+16, r26 ; 0x10 268cc: b9 8b std Y+17, r27 ; 0x11 268ce: 88 a3 std Y+32, r24 ; 0x20 268d0: 99 a3 std Y+33, r25 ; 0x21 268d2: aa a3 std Y+34, r26 ; 0x22 268d4: bb a3 std Y+35, r27 ; 0x23 268d6: 1a 8a std Y+18, r1 ; 0x12 268d8: 90 e4 ldi r25, 0x40 ; 64 268da: 9b 8b std Y+19, r25 ; 0x13 268dc: ac e1 ldi r26, 0x1C ; 28 268de: ac 8b std Y+20, r26 ; 0x14 268e0: b6 e4 ldi r27, 0x46 ; 70 268e2: bd 8b std Y+21, r27 ; 0x15 268e4: 1e 8a std Y+22, r1 ; 0x16 268e6: 1f 8a std Y+23, r1 ; 0x17 268e8: 18 8e std Y+24, r1 ; 0x18 268ea: 19 8e std Y+25, r1 ; 0x19 268ec: 6f e7 ldi r22, 0x7F ; 127 268ee: c6 2e mov r12, r22 268f0: d1 2c mov r13, r1 268f2: e1 2c mov r14, r1 268f4: f1 2c mov r15, r1 268f6: 00 e0 ldi r16, 0x00 ; 0 268f8: 10 e0 ldi r17, 0x00 ; 0 268fa: 18 aa std Y+48, r1 ; 0x30 268fc: 1f a6 std Y+47, r1 ; 0x2f 268fe: 1d 82 std Y+5, r1 ; 0x05 26900: 2f e7 ldi r18, 0x7F ; 127 26902: 30 e0 ldi r19, 0x00 ; 0 26904: 40 e0 ldi r20, 0x00 ; 0 26906: 50 e0 ldi r21, 0x00 ; 0 26908: 29 83 std Y+1, r18 ; 0x01 2690a: 3a 83 std Y+2, r19 ; 0x02 2690c: 4b 83 std Y+3, r20 ; 0x03 2690e: 5c 83 std Y+4, r21 ; 0x04 26910: 1b 8e std Y+27, r1 ; 0x1b 26912: 1c 8e std Y+28, r1 ; 0x1c 26914: 1d 8e std Y+29, r1 ; 0x1d 26916: 1e 8e std Y+30, r1 ; 0x1e 26918: 31 e0 ldi r19, 0x01 ; 1 2691a: 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(); 2691c: a8 95 wdr #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready 2691e: 40 91 d5 05 lds r20, 0x05D5 ; 0x8005d5 26922: 48 a7 std Y+40, r20 ; 0x28 26924: 44 23 and r20, r20 26926: 09 f4 brne .+2 ; 0x2692a 26928: 2c c2 rjmp .+1112 ; 0x26d82 updateTemperatures(); 2692a: 0e 94 ef ff call 0x1ffde ; 0x1ffde input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 2692e: 21 14 cp r2, r1 26930: 31 04 cpc r3, r1 26932: 09 f0 breq .+2 ; 0x26936 26934: aa c0 rjmp .+340 ; 0x26a8a 26936: 00 91 5a 0d lds r16, 0x0D5A ; 0x800d5a 2693a: 10 91 5b 0d lds r17, 0x0D5B ; 0x800d5b 2693e: 50 91 5c 0d lds r21, 0x0D5C ; 0x800d5c 26942: 58 ab std Y+48, r21 ; 0x30 26944: 80 91 5d 0d lds r24, 0x0D5D ; 0x800d5d 26948: 8f a7 std Y+47, r24 ; 0x2f max=max(max,input); 2694a: 2e 89 ldd r18, Y+22 ; 0x16 2694c: 3f 89 ldd r19, Y+23 ; 0x17 2694e: 48 8d ldd r20, Y+24 ; 0x18 26950: 59 8d ldd r21, Y+25 ; 0x19 26952: b8 01 movw r22, r16 26954: 88 a9 ldd r24, Y+48 ; 0x30 26956: 9f a5 ldd r25, Y+47 ; 0x2f 26958: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2695c: 87 fd sbrc r24, 7 2695e: 06 c0 rjmp .+12 ; 0x2696c 26960: 0e 8b std Y+22, r16 ; 0x16 26962: 1f 8b std Y+23, r17 ; 0x17 26964: b8 a9 ldd r27, Y+48 ; 0x30 26966: b8 8f std Y+24, r27 ; 0x18 26968: 2f a5 ldd r18, Y+47 ; 0x2f 2696a: 29 8f std Y+25, r18 ; 0x19 min=min(min,input); 2696c: 2a 89 ldd r18, Y+18 ; 0x12 2696e: 3b 89 ldd r19, Y+19 ; 0x13 26970: 4c 89 ldd r20, Y+20 ; 0x14 26972: 5d 89 ldd r21, Y+21 ; 0x15 26974: b8 01 movw r22, r16 26976: 88 a9 ldd r24, Y+48 ; 0x30 26978: 9f a5 ldd r25, Y+47 ; 0x2f 2697a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2697e: 18 16 cp r1, r24 26980: 34 f0 brlt .+12 ; 0x2698e 26982: 0a 8b std Y+18, r16 ; 0x12 26984: 1b 8b std Y+19, r17 ; 0x13 26986: 38 a9 ldd r19, Y+48 ; 0x30 26988: 3c 8b std Y+20, r19 ; 0x14 2698a: 4f a5 ldd r20, Y+47 ; 0x2f 2698c: 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) { 2698e: 0f 94 89 0b call 0x21712 ; 0x21712 26992: 2c a1 ldd r18, Y+36 ; 0x24 26994: 3d a1 ldd r19, Y+37 ; 0x25 26996: 4e a1 ldd r20, Y+38 ; 0x26 26998: 5f a1 ldd r21, Y+39 ; 0x27 2699a: 62 1b sub r22, r18 2699c: 73 0b sbc r23, r19 2699e: 84 0b sbc r24, r20 269a0: 95 0b sbc r25, r21 269a2: 65 3c cpi r22, 0xC5 ; 197 269a4: 79 40 sbci r23, 0x09 ; 9 269a6: 81 05 cpc r24, r1 269a8: 91 05 cpc r25, r1 269aa: 40 f0 brcs .+16 ; 0x269bc checkExtruderAutoFans(); 269ac: 0e 94 4c 78 call 0xf098 ; 0xf098 extruder_autofan_last_check = _millis(); 269b0: 0f 94 89 0b call 0x21712 ; 0x21712 269b4: 6c a3 std Y+36, r22 ; 0x24 269b6: 7d a3 std Y+37, r23 ; 0x25 269b8: 8e a3 std Y+38, r24 ; 0x26 269ba: 9f a3 std Y+39, r25 ; 0x27 } #endif if(heating == true && input > temp) { 269bc: 4a 8d ldd r20, Y+26 ; 0x1a 269be: 44 23 and r20, r20 269c0: 09 f4 brne .+2 ; 0x269c4 269c2: 4c c0 rjmp .+152 ; 0x26a5c 269c4: 2a 85 ldd r18, Y+10 ; 0x0a 269c6: 3b 85 ldd r19, Y+11 ; 0x0b 269c8: 4c 85 ldd r20, Y+12 ; 0x0c 269ca: 5d 85 ldd r21, Y+13 ; 0x0d 269cc: b8 01 movw r22, r16 269ce: 88 a9 ldd r24, Y+48 ; 0x30 269d0: 9f a5 ldd r25, Y+47 ; 0x2f 269d2: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 269d6: 18 16 cp r1, r24 269d8: 0c f0 brlt .+2 ; 0x269dc 269da: d3 c1 rjmp .+934 ; 0x26d82 if(_millis() - t2 > 5000) { 269dc: 0f 94 89 0b call 0x21712 ; 0x21712 269e0: 2e 85 ldd r18, Y+14 ; 0x0e 269e2: 3f 85 ldd r19, Y+15 ; 0x0f 269e4: 48 89 ldd r20, Y+16 ; 0x10 269e6: 59 89 ldd r21, Y+17 ; 0x11 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: 08 f4 brcc .+2 ; 0x269fc 269fa: c3 c1 rjmp .+902 ; 0x26d82 269fc: d7 01 movw r26, r14 269fe: c6 01 movw r24, r12 26a00: 29 81 ldd r18, Y+1 ; 0x01 26a02: 3a 81 ldd r19, Y+2 ; 0x02 26a04: 4b 81 ldd r20, Y+3 ; 0x03 26a06: 5c 81 ldd r21, Y+4 ; 0x04 26a08: 82 1b sub r24, r18 26a0a: 93 0b sbc r25, r19 26a0c: a4 0b sbc r26, r20 26a0e: b5 0b sbc r27, r21 26a10: b5 95 asr r27 26a12: a7 95 ror r26 26a14: 97 95 ror r25 26a16: 87 95 ror r24 heating=false; if (extruder<0) { 26a18: 21 14 cp r2, r1 26a1a: 31 04 cpc r3, r1 26a1c: 09 f4 brne .+2 ; 0x26a20 26a1e: 40 c0 rjmp .+128 ; 0x26aa0 soft_pwm_bed = (bias - d) >> 1; 26a20: 80 93 ee 05 sts 0x05EE, r24 ; 0x8005ee } else soft_pwm[extruder] = (bias - d) >> 1; t1=_millis(); 26a24: 0f 94 89 0b call 0x21712 ; 0x21712 26a28: 6e 83 std Y+6, r22 ; 0x06 26a2a: 7f 83 std Y+7, r23 ; 0x07 26a2c: 88 87 std Y+8, r24 ; 0x08 26a2e: 99 87 std Y+9, r25 ; 0x09 t_high=t1 - t2; 26a30: dc 01 movw r26, r24 26a32: cb 01 movw r24, r22 26a34: 2e 85 ldd r18, Y+14 ; 0x0e 26a36: 3f 85 ldd r19, Y+15 ; 0x0f 26a38: 48 89 ldd r20, Y+16 ; 0x10 26a3a: 59 89 ldd r21, Y+17 ; 0x11 26a3c: 82 1b sub r24, r18 26a3e: 93 0b sbc r25, r19 26a40: a4 0b sbc r26, r20 26a42: b5 0b sbc r27, r21 26a44: 8b 8f std Y+27, r24 ; 0x1b 26a46: 9c 8f std Y+28, r25 ; 0x1c 26a48: ad 8f std Y+29, r26 ; 0x1d 26a4a: be 8f std Y+30, r27 ; 0x1e max=temp; 26a4c: 3a 85 ldd r19, Y+10 ; 0x0a 26a4e: 3e 8b std Y+22, r19 ; 0x16 26a50: 4b 85 ldd r20, Y+11 ; 0x0b 26a52: 4f 8b std Y+23, r20 ; 0x17 26a54: 5c 85 ldd r21, Y+12 ; 0x0c 26a56: 58 8f std Y+24, r21 ; 0x18 26a58: 8d 85 ldd r24, Y+13 ; 0x0d 26a5a: 89 8f std Y+25, r24 ; 0x19 } } if(heating == false && input < temp) { 26a5c: 2a 85 ldd r18, Y+10 ; 0x0a 26a5e: 3b 85 ldd r19, Y+11 ; 0x0b 26a60: 4c 85 ldd r20, Y+12 ; 0x0c 26a62: 5d 85 ldd r21, Y+13 ; 0x0d 26a64: b8 01 movw r22, r16 26a66: 88 a9 ldd r24, Y+48 ; 0x30 26a68: 9f a5 ldd r25, Y+47 ; 0x2f 26a6a: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 26a6e: 87 fd sbrc r24, 7 26a70: 1a c0 rjmp .+52 ; 0x26aa6 if(_millis() - t1 > 5000) { 26a72: 1a 8e std Y+26, r1 ; 0x1a 26a74: 86 c1 rjmp .+780 ; 0x26d82 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 26a76: 4a e0 ldi r20, 0x0A ; 10 26a78: 4f 8f std Y+31, r20 ; 0x1f 26a7a: 00 cf rjmp .-512 ; 0x2687c 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; 26a7c: 20 93 f5 05 sts 0x05F5, r18 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.501> bias = d = (PID_MAX)/2; target_temperature[extruder] = (int)temp; // to display the requested target extruder temperature properly on the main screen 26a80: 70 93 5e 12 sts 0x125E, r23 ; 0x80125e 26a84: 60 93 5d 12 sts 0x125D, r22 ; 0x80125d 26a88: 1a cf rjmp .-460 ; 0x268be wdt_reset(); #endif //WATCHDOG if(temp_meas_ready == true) { // temp sample ready updateTemperatures(); input = (extruder<0)?current_temperature_bed:current_temperature[extruder]; 26a8a: 00 91 bc 03 lds r16, 0x03BC ; 0x8003bc 26a8e: 10 91 bd 03 lds r17, 0x03BD ; 0x8003bd 26a92: 90 91 be 03 lds r25, 0x03BE ; 0x8003be 26a96: 98 ab std Y+48, r25 ; 0x30 26a98: a0 91 bf 03 lds r26, 0x03BF ; 0x8003bf 26a9c: af a7 std Y+47, r26 ; 0x2f 26a9e: 55 cf rjmp .-342 ; 0x2694a heating=false; if (extruder<0) { soft_pwm_bed = (bias - d) >> 1; } else soft_pwm[extruder] = (bias - d) >> 1; 26aa0: 80 93 f5 05 sts 0x05F5, r24 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.501> 26aa4: bf cf rjmp .-130 ; 0x26a24 t_high=t1 - t2; max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { 26aa6: 0f 94 89 0b call 0x21712 ; 0x21712 26aaa: 2e 81 ldd r18, Y+6 ; 0x06 26aac: 3f 81 ldd r19, Y+7 ; 0x07 26aae: 48 85 ldd r20, Y+8 ; 0x08 26ab0: 59 85 ldd r21, Y+9 ; 0x09 26ab2: 62 1b sub r22, r18 26ab4: 73 0b sbc r23, r19 26ab6: 84 0b sbc r24, r20 26ab8: 95 0b sbc r25, r21 26aba: 69 38 cpi r22, 0x89 ; 137 26abc: 73 41 sbci r23, 0x13 ; 19 26abe: 81 05 cpc r24, r1 26ac0: 91 05 cpc r25, r1 26ac2: b8 f2 brcs .-82 ; 0x26a72 heating=true; t2=_millis(); 26ac4: 0f 94 89 0b call 0x21712 ; 0x21712 26ac8: 6e 87 std Y+14, r22 ; 0x0e 26aca: 7f 87 std Y+15, r23 ; 0x0f 26acc: 88 8b std Y+16, r24 ; 0x10 26ace: 99 8b std Y+17, r25 ; 0x11 t_low=t2 - t1; if(pid_cycle > 0) { 26ad0: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26ad4: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26ad8: 18 16 cp r1, r24 26ada: 19 06 cpc r1, r25 26adc: 0c f0 brlt .+2 ; 0x26ae0 26ade: 2c c1 rjmp .+600 ; 0x26d38 } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; t2=_millis(); t_low=t2 - t1; 26ae0: 8e 85 ldd r24, Y+14 ; 0x0e 26ae2: 9f 85 ldd r25, Y+15 ; 0x0f 26ae4: a8 89 ldd r26, Y+16 ; 0x10 26ae6: b9 89 ldd r27, Y+17 ; 0x11 26ae8: 2e 81 ldd r18, Y+6 ; 0x06 26aea: 3f 81 ldd r19, Y+7 ; 0x07 26aec: 48 85 ldd r20, Y+8 ; 0x08 26aee: 59 85 ldd r21, Y+9 ; 0x09 26af0: 82 1b sub r24, r18 26af2: 93 0b sbc r25, r19 26af4: a4 0b sbc r26, r20 26af6: b5 0b sbc r27, r21 if(pid_cycle > 0) { bias += (d*(t_high - t_low))/(t_low + t_high); 26af8: 4b 8c ldd r4, Y+27 ; 0x1b 26afa: 5c 8c ldd r5, Y+28 ; 0x1c 26afc: 6d 8c ldd r6, Y+29 ; 0x1d 26afe: 7e 8c ldd r7, Y+30 ; 0x1e 26b00: 48 0e add r4, r24 26b02: 59 1e adc r5, r25 26b04: 6a 1e adc r6, r26 26b06: 7b 1e adc r7, r27 26b08: 2b 8d ldd r18, Y+27 ; 0x1b 26b0a: 3c 8d ldd r19, Y+28 ; 0x1c 26b0c: 4d 8d ldd r20, Y+29 ; 0x1d 26b0e: 5e 8d ldd r21, Y+30 ; 0x1e 26b10: 28 1b sub r18, r24 26b12: 39 0b sbc r19, r25 26b14: 4a 0b sbc r20, r26 26b16: 5b 0b sbc r21, r27 26b18: 69 81 ldd r22, Y+1 ; 0x01 26b1a: 7a 81 ldd r23, Y+2 ; 0x02 26b1c: 8b 81 ldd r24, Y+3 ; 0x03 26b1e: 9c 81 ldd r25, Y+4 ; 0x04 26b20: 0f 94 e4 a4 call 0x349c8 ; 0x349c8 <__mulsi3> 26b24: a3 01 movw r20, r6 26b26: 92 01 movw r18, r4 26b28: 0f 94 72 a5 call 0x34ae4 ; 0x34ae4 <__divmodsi4> 26b2c: da 01 movw r26, r20 26b2e: c9 01 movw r24, r18 26b30: 8c 0d add r24, r12 26b32: 9d 1d adc r25, r13 26b34: ae 1d adc r26, r14 26b36: bf 1d adc r27, r15 bias = constrain(bias, 20 ,(extruder<0?(MAX_BED_POWER):(PID_MAX))-20); 26b38: 84 31 cpi r24, 0x14 ; 20 26b3a: 91 05 cpc r25, r1 26b3c: a1 05 cpc r26, r1 26b3e: b1 05 cpc r27, r1 26b40: 0c f4 brge .+2 ; 0x26b44 26b42: 3c c1 rjmp .+632 ; 0x26dbc 26b44: 6c 01 movw r12, r24 26b46: 7d 01 movw r14, r26 26b48: 3c ee ldi r19, 0xEC ; 236 26b4a: c3 16 cp r12, r19 26b4c: d1 04 cpc r13, r1 26b4e: e1 04 cpc r14, r1 26b50: f1 04 cpc r15, r1 26b52: 2c f0 brlt .+10 ; 0x26b5e 26b54: 4b ee ldi r20, 0xEB ; 235 26b56: c4 2e mov r12, r20 26b58: d1 2c mov r13, r1 26b5a: e1 2c mov r14, r1 26b5c: 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; 26b5e: 80 38 cpi r24, 0x80 ; 128 26b60: 91 05 cpc r25, r1 26b62: a1 05 cpc r26, r1 26b64: b1 05 cpc r27, r1 26b66: 0c f4 brge .+2 ; 0x26b6a 26b68: 37 c1 rjmp .+622 ; 0x26dd8 26b6a: 8e ef ldi r24, 0xFE ; 254 26b6c: 90 e0 ldi r25, 0x00 ; 0 26b6e: a0 e0 ldi r26, 0x00 ; 0 26b70: b0 e0 ldi r27, 0x00 ; 0 26b72: 8c 19 sub r24, r12 26b74: 9d 09 sbc r25, r13 26b76: ae 09 sbc r26, r14 26b78: bf 09 sbc r27, r15 26b7a: 89 83 std Y+1, r24 ; 0x01 26b7c: 9a 83 std Y+2, r25 ; 0x02 26b7e: ab 83 std Y+3, r26 ; 0x03 26b80: bc 83 std Y+4, r27 ; 0x04 else d = bias; SERIAL_PROTOCOLPGM(" bias: "); SERIAL_PROTOCOL(bias); 26b82: 81 ea ldi r24, 0xA1 ; 161 26b84: 95 e9 ldi r25, 0x95 ; 149 26b86: 0e 94 15 7b call 0xf62a ; 0xf62a 26b8a: c7 01 movw r24, r14 26b8c: b6 01 movw r22, r12 26b8e: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOLPGM(" d: "); SERIAL_PROTOCOL(d); 26b92: 8c e9 ldi r24, 0x9C ; 156 26b94: 95 e9 ldi r25, 0x95 ; 149 26b96: 0e 94 15 7b call 0xf62a ; 0xf62a 26b9a: 69 81 ldd r22, Y+1 ; 0x01 26b9c: 7a 81 ldd r23, Y+2 ; 0x02 26b9e: 8b 81 ldd r24, Y+3 ; 0x03 26ba0: 9c 81 ldd r25, Y+4 ; 0x04 26ba2: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOLPGM(" min: "); SERIAL_PROTOCOL(min); 26ba6: 85 e9 ldi r24, 0x95 ; 149 26ba8: 95 e9 ldi r25, 0x95 ; 149 26baa: 0e 94 15 7b call 0xf62a ; 0xf62a else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 26bae: 42 e0 ldi r20, 0x02 ; 2 26bb0: 6a 89 ldd r22, Y+18 ; 0x12 26bb2: 7b 89 ldd r23, Y+19 ; 0x13 26bb4: 8c 89 ldd r24, Y+20 ; 0x14 26bb6: 9d 89 ldd r25, Y+21 ; 0x15 26bb8: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOLPGM(" max: "); SERIAL_PROTOCOLLN(max); 26bbc: 8e e8 ldi r24, 0x8E ; 142 26bbe: 95 e9 ldi r25, 0x95 ; 149 26bc0: 0e 94 15 7b call 0xf62a ; 0xf62a 26bc4: 6e 89 ldd r22, Y+22 ; 0x16 26bc6: 7f 89 ldd r23, Y+23 ; 0x17 26bc8: 88 8d ldd r24, Y+24 ; 0x18 26bca: 99 8d ldd r25, Y+25 ; 0x19 26bcc: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 if(pid_cycle > 2) { 26bd0: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26bd4: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26bd8: 03 97 sbiw r24, 0x03 ; 3 26bda: 0c f4 brge .+2 ; 0x26bde 26bdc: ad c0 rjmp .+346 ; 0x26d38 Ku = (4.0*d)/(3.14159*(max-min)/2.0); 26bde: 69 81 ldd r22, Y+1 ; 0x01 26be0: 7a 81 ldd r23, Y+2 ; 0x02 26be2: 8b 81 ldd r24, Y+3 ; 0x03 26be4: 9c 81 ldd r25, Y+4 ; 0x04 26be6: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 26bea: 20 e0 ldi r18, 0x00 ; 0 26bec: 30 e0 ldi r19, 0x00 ; 0 26bee: 40 e8 ldi r20, 0x80 ; 128 26bf0: 50 e4 ldi r21, 0x40 ; 64 26bf2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 26bf6: 4b 01 movw r8, r22 26bf8: 5c 01 movw r10, r24 26bfa: 2a 89 ldd r18, Y+18 ; 0x12 26bfc: 3b 89 ldd r19, Y+19 ; 0x13 26bfe: 4c 89 ldd r20, Y+20 ; 0x14 26c00: 5d 89 ldd r21, Y+21 ; 0x15 26c02: 6e 89 ldd r22, Y+22 ; 0x16 26c04: 7f 89 ldd r23, Y+23 ; 0x17 26c06: 88 8d ldd r24, Y+24 ; 0x18 26c08: 99 8d ldd r25, Y+25 ; 0x19 26c0a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 26c0e: 20 ed ldi r18, 0xD0 ; 208 26c10: 3f e0 ldi r19, 0x0F ; 15 26c12: 49 e4 ldi r20, 0x49 ; 73 26c14: 50 e4 ldi r21, 0x40 ; 64 26c16: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 26c1a: 20 e0 ldi r18, 0x00 ; 0 26c1c: 30 e0 ldi r19, 0x00 ; 0 26c1e: 40 e0 ldi r20, 0x00 ; 0 26c20: 5f e3 ldi r21, 0x3F ; 63 26c22: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 26c26: 9b 01 movw r18, r22 26c28: ac 01 movw r20, r24 26c2a: c5 01 movw r24, r10 26c2c: b4 01 movw r22, r8 26c2e: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 26c32: 4b 01 movw r8, r22 26c34: 5c 01 movw r10, r24 Tu = ((float)(t_low + t_high)/1000.0); 26c36: c3 01 movw r24, r6 26c38: b2 01 movw r22, r4 26c3a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 26c3e: 20 e0 ldi r18, 0x00 ; 0 26c40: 30 e0 ldi r19, 0x00 ; 0 26c42: 4a e7 ldi r20, 0x7A ; 122 26c44: 54 e4 ldi r21, 0x44 ; 68 26c46: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 26c4a: 2b 01 movw r4, r22 26c4c: 3c 01 movw r6, r24 SERIAL_PROTOCOLPGM(" Ku: "); SERIAL_PROTOCOL(Ku); 26c4e: 88 e8 ldi r24, 0x88 ; 136 26c50: 95 e9 ldi r25, 0x95 ; 149 26c52: 0e 94 15 7b call 0xf62a ; 0xf62a 26c56: 42 e0 ldi r20, 0x02 ; 2 26c58: c5 01 movw r24, r10 26c5a: b4 01 movw r22, r8 26c5c: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOLPGM(" Tu: "); SERIAL_PROTOCOLLN(Tu); 26c60: 82 e8 ldi r24, 0x82 ; 130 26c62: 95 e9 ldi r25, 0x95 ; 149 26c64: 0e 94 15 7b call 0xf62a ; 0xf62a 26c68: c3 01 movw r24, r6 26c6a: b2 01 movw r22, r4 26c6c: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 _Kp = 0.6*Ku; 26c70: 2a e9 ldi r18, 0x9A ; 154 26c72: 39 e9 ldi r19, 0x99 ; 153 26c74: 49 e1 ldi r20, 0x19 ; 25 26c76: 5f e3 ldi r21, 0x3F ; 63 26c78: c5 01 movw r24, r10 26c7a: b4 01 movw r22, r8 26c7c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 26c80: 4b 01 movw r8, r22 26c82: 5c 01 movw r10, r24 26c84: 80 92 da 03 sts 0x03DA, r8 ; 0x8003da <_Kp> 26c88: 90 92 db 03 sts 0x03DB, r9 ; 0x8003db <_Kp+0x1> 26c8c: a0 92 dc 03 sts 0x03DC, r10 ; 0x8003dc <_Kp+0x2> 26c90: b0 92 dd 03 sts 0x03DD, r11 ; 0x8003dd <_Kp+0x3> _Ki = 2*_Kp/Tu; 26c94: ac 01 movw r20, r24 26c96: 9b 01 movw r18, r22 26c98: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 26c9c: a3 01 movw r20, r6 26c9e: 92 01 movw r18, r4 26ca0: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 26ca4: 60 93 d6 03 sts 0x03D6, r22 ; 0x8003d6 <_Ki> 26ca8: 70 93 d7 03 sts 0x03D7, r23 ; 0x8003d7 <_Ki+0x1> 26cac: 80 93 d8 03 sts 0x03D8, r24 ; 0x8003d8 <_Ki+0x2> 26cb0: 90 93 d9 03 sts 0x03D9, r25 ; 0x8003d9 <_Ki+0x3> _Kd = _Kp*Tu/8; 26cb4: a3 01 movw r20, r6 26cb6: 92 01 movw r18, r4 26cb8: c5 01 movw r24, r10 26cba: b4 01 movw r22, r8 26cbc: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 26cc0: 20 e0 ldi r18, 0x00 ; 0 26cc2: 30 e0 ldi r19, 0x00 ; 0 26cc4: 40 e0 ldi r20, 0x00 ; 0 26cc6: 5e e3 ldi r21, 0x3E ; 62 26cc8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 26ccc: 60 93 d2 03 sts 0x03D2, r22 ; 0x8003d2 <_Kd> 26cd0: 70 93 d3 03 sts 0x03D3, r23 ; 0x8003d3 <_Kd+0x1> 26cd4: 80 93 d4 03 sts 0x03D4, r24 ; 0x8003d4 <_Kd+0x2> 26cd8: 90 93 d5 03 sts 0x03D5, r25 ; 0x8003d5 <_Kd+0x3> SERIAL_PROTOCOLLNPGM(" Classic PID "); 26cdc: 84 e7 ldi r24, 0x74 ; 116 26cde: 95 e9 ldi r25, 0x95 ; 149 26ce0: 0e 94 0e 7d call 0xfa1c ; 0xfa1c SERIAL_PROTOCOLPGM(" Kp: "); SERIAL_PROTOCOLLN(_Kp); 26ce4: 8e e6 ldi r24, 0x6E ; 110 26ce6: 95 e9 ldi r25, 0x95 ; 149 26ce8: 0e 94 15 7b call 0xf62a ; 0xf62a 26cec: 60 91 da 03 lds r22, 0x03DA ; 0x8003da <_Kp> 26cf0: 70 91 db 03 lds r23, 0x03DB ; 0x8003db <_Kp+0x1> 26cf4: 80 91 dc 03 lds r24, 0x03DC ; 0x8003dc <_Kp+0x2> 26cf8: 90 91 dd 03 lds r25, 0x03DD ; 0x8003dd <_Kp+0x3> 26cfc: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); 26d00: 88 e6 ldi r24, 0x68 ; 104 26d02: 95 e9 ldi r25, 0x95 ; 149 26d04: 0e 94 15 7b call 0xf62a ; 0xf62a 26d08: 60 91 d6 03 lds r22, 0x03D6 ; 0x8003d6 <_Ki> 26d0c: 70 91 d7 03 lds r23, 0x03D7 ; 0x8003d7 <_Ki+0x1> 26d10: 80 91 d8 03 lds r24, 0x03D8 ; 0x8003d8 <_Ki+0x2> 26d14: 90 91 d9 03 lds r25, 0x03D9 ; 0x8003d9 <_Ki+0x3> 26d18: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); 26d1c: 82 e6 ldi r24, 0x62 ; 98 26d1e: 95 e9 ldi r25, 0x95 ; 149 26d20: 0e 94 15 7b call 0xf62a ; 0xf62a 26d24: 60 91 d2 03 lds r22, 0x03D2 ; 0x8003d2 <_Kd> 26d28: 70 91 d3 03 lds r23, 0x03D3 ; 0x8003d3 <_Kd+0x1> 26d2c: 80 91 d4 03 lds r24, 0x03D4 ; 0x8003d4 <_Kd+0x2> 26d30: 90 91 d5 03 lds r25, 0x03D5 ; 0x8003d5 <_Kd+0x3> 26d34: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 26d38: 89 81 ldd r24, Y+1 ; 0x01 26d3a: 9a 81 ldd r25, Y+2 ; 0x02 26d3c: ab 81 ldd r26, Y+3 ; 0x03 26d3e: bc 81 ldd r27, Y+4 ; 0x04 26d40: 8c 0d add r24, r12 26d42: 9d 1d adc r25, r13 26d44: ae 1d adc r26, r14 26d46: bf 1d adc r27, r15 26d48: b5 95 asr r27 26d4a: a7 95 ror r26 26d4c: 97 95 ror r25 26d4e: 87 95 ror r24 SERIAL_PROTOCOLPGM(" Ki: "); SERIAL_PROTOCOLLN(_Ki); SERIAL_PROTOCOLPGM(" Kd: "); SERIAL_PROTOCOLLN(_Kd); */ } } if (extruder<0) 26d50: 21 14 cp r2, r1 26d52: 31 04 cpc r3, r1 26d54: 09 f4 brne .+2 ; 0x26d58 26d56: 45 c0 rjmp .+138 ; 0x26de2 { soft_pwm_bed = (bias + d) >> 1; 26d58: 80 93 ee 05 sts 0x05EE, r24 ; 0x8005ee } else soft_pwm[extruder] = (bias + d) >> 1; pid_cycle++; 26d5c: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26d60: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26d64: 01 96 adiw r24, 0x01 ; 1 26d66: 90 93 03 06 sts 0x0603, r25 ; 0x800603 26d6a: 80 93 02 06 sts 0x0602, r24 ; 0x800602 min=temp; 26d6e: 3a 85 ldd r19, Y+10 ; 0x0a 26d70: 3a 8b std Y+18, r19 ; 0x12 26d72: 4b 85 ldd r20, Y+11 ; 0x0b 26d74: 4b 8b std Y+19, r20 ; 0x13 26d76: 5c 85 ldd r21, Y+12 ; 0x0c 26d78: 5c 8b std Y+20, r21 ; 0x14 26d7a: 8d 85 ldd r24, Y+13 ; 0x0d 26d7c: 8d 8b std Y+21, r24 ; 0x15 max=temp; } } if(heating == false && input < temp) { if(_millis() - t1 > 5000) { heating=true; 26d7e: 98 a5 ldd r25, Y+40 ; 0x28 26d80: 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)) { 26d82: 20 e0 ldi r18, 0x00 ; 0 26d84: 30 e0 ldi r19, 0x00 ; 0 26d86: 40 ea ldi r20, 0xA0 ; 160 26d88: 51 e4 ldi r21, 0x41 ; 65 26d8a: 6a 85 ldd r22, Y+10 ; 0x0a 26d8c: 7b 85 ldd r23, Y+11 ; 0x0b 26d8e: 8c 85 ldd r24, Y+12 ; 0x0c 26d90: 9d 85 ldd r25, Y+13 ; 0x0d 26d92: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 26d96: 98 01 movw r18, r16 26d98: 48 a9 ldd r20, Y+48 ; 0x30 26d9a: 5f a5 ldd r21, Y+47 ; 0x2f 26d9c: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 26da0: 87 ff sbrs r24, 7 26da2: 22 c0 rjmp .+68 ; 0x26de8 SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); 26da4: 88 e3 ldi r24, 0x38 ; 56 26da6: 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"); 26da8: 0e 94 0e 7d call 0xfa1c ; 0xfa1c pid_tuning_finished = true; 26dac: 81 e0 ldi r24, 0x01 ; 1 26dae: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.424> pid_cycle = 0; 26db2: 10 92 03 06 sts 0x0603, r1 ; 0x800603 26db6: 10 92 02 06 sts 0x0602, r1 ; 0x800602 26dba: 98 c0 rjmp .+304 ; 0x26eec 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); 26dbc: 34 e1 ldi r19, 0x14 ; 20 26dbe: c3 2e mov r12, r19 26dc0: d1 2c mov r13, r1 26dc2: e1 2c mov r14, r1 26dc4: f1 2c mov r15, r1 26dc6: 24 e1 ldi r18, 0x14 ; 20 26dc8: 30 e0 ldi r19, 0x00 ; 0 26dca: 40 e0 ldi r20, 0x00 ; 0 26dcc: 50 e0 ldi r21, 0x00 ; 0 26dce: 29 83 std Y+1, r18 ; 0x01 26dd0: 3a 83 std Y+2, r19 ; 0x02 26dd2: 4b 83 std Y+3, r20 ; 0x03 26dd4: 5c 83 std Y+4, r21 ; 0x04 26dd6: d5 ce rjmp .-598 ; 0x26b82 26dd8: c9 82 std Y+1, r12 ; 0x01 26dda: da 82 std Y+2, r13 ; 0x02 26ddc: eb 82 std Y+3, r14 ; 0x03 26dde: fc 82 std Y+4, r15 ; 0x04 26de0: d0 ce rjmp .-608 ; 0x26b82 if (extruder<0) { soft_pwm_bed = (bias + d) >> 1; } else soft_pwm[extruder] = (bias + d) >> 1; 26de2: 80 93 f5 05 sts 0x05F5, r24 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.501> 26de6: ba cf rjmp .-140 ; 0x26d5c SERIAL_PROTOCOLLNPGM("PID Autotune failed! Temperature too high"); pid_tuning_finished = true; pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { 26de8: 0f 94 89 0b call 0x21712 ; 0x21712 26dec: 28 a1 ldd r18, Y+32 ; 0x20 26dee: 39 a1 ldd r19, Y+33 ; 0x21 26df0: 4a a1 ldd r20, Y+34 ; 0x22 26df2: 5b a1 ldd r21, Y+35 ; 0x23 26df4: 62 1b sub r22, r18 26df6: 73 0b sbc r23, r19 26df8: 84 0b sbc r24, r20 26dfa: 95 0b sbc r25, r21 26dfc: 61 3d cpi r22, 0xD1 ; 209 26dfe: 77 40 sbci r23, 0x07 ; 7 26e00: 81 05 cpc r24, r1 26e02: 91 05 cpc r25, r1 26e04: 58 f1 brcs .+86 ; 0x26e5c int p; if (extruder<0){ p=soft_pwm_bed; 26e06: a0 90 ee 05 lds r10, 0x05EE ; 0x8005ee 26e0a: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("B:"); 26e0c: 85 e3 ldi r24, 0x35 ; 53 26e0e: 95 e9 ldi r25, 0x95 ; 149 pid_cycle = 0; return; } if(_millis() - temp_millis > 2000) { int p; if (extruder<0){ 26e10: 21 14 cp r2, r1 26e12: 31 04 cpc r3, r1 26e14: 29 f4 brne .+10 ; 0x26e20 p=soft_pwm_bed; SERIAL_PROTOCOLPGM("B:"); }else{ p=soft_pwm[extruder]; 26e16: a0 90 f5 05 lds r10, 0x05F5 ; 0x8005f5 <_ZL8soft_pwm.lto_priv.501> 26e1a: b1 2c mov r11, r1 SERIAL_PROTOCOLPGM("T:"); 26e1c: 82 e3 ldi r24, 0x32 ; 50 26e1e: 95 e9 ldi r25, 0x95 ; 149 26e20: 0e 94 15 7b call 0xf62a ; 0xf62a 26e24: 42 e0 ldi r20, 0x02 ; 2 26e26: b8 01 movw r22, r16 26e28: 88 a9 ldd r24, Y+48 ; 0x30 26e2a: 9f a5 ldd r25, Y+47 ; 0x2f 26e2c: 0e 94 97 7a call 0xf52e ; 0xf52e } SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); 26e30: 8e e2 ldi r24, 0x2E ; 46 26e32: 95 e9 ldi r25, 0x95 ; 149 26e34: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_PROTOCOLLN(p); 26e38: c5 01 movw r24, r10 26e3a: 0f 94 5d 65 call 0x2caba ; 0x2caba if (safety_check_cycles == 0) { //save ambient temp 26e3e: 4d 81 ldd r20, Y+5 ; 0x05 26e40: 44 23 and r20, r20 26e42: 09 f4 brne .+2 ; 0x26e46 26e44: 6c c0 rjmp .+216 ; 0x26f1e temp_ambient = input; //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; } else if (safety_check_cycles < safety_check_cycles_count) { //delay 26e46: 5f 8d ldd r21, Y+31 ; 0x1f 26e48: 45 17 cp r20, r21 26e4a: 70 f5 brcc .+92 ; 0x26ea8 safety_check_cycles++; 26e4c: 4f 5f subi r20, 0xFF ; 255 26e4e: 4d 83 std Y+5, r20 ; 0x05 temp_runaway_stop(false, (extruder<0)); pid_tuning_finished = true; return; } } temp_millis = _millis(); 26e50: 0f 94 89 0b call 0x21712 ; 0x21712 26e54: 68 a3 std Y+32, r22 ; 0x20 26e56: 79 a3 std Y+33, r23 ; 0x21 26e58: 8a a3 std Y+34, r24 ; 0x22 26e5a: 9b a3 std Y+35, r25 ; 0x23 } if(((_millis() - t1) + (_millis() - t2)) > (10L*60L*1000L*2L)) { 26e5c: 0f 94 89 0b call 0x21712 ; 0x21712 26e60: 4b 01 movw r8, r22 26e62: 5c 01 movw r10, r24 26e64: 0f 94 89 0b call 0x21712 ; 0x21712 26e68: 4e 80 ldd r4, Y+6 ; 0x06 26e6a: 5f 80 ldd r5, Y+7 ; 0x07 26e6c: 68 84 ldd r6, Y+8 ; 0x08 26e6e: 79 84 ldd r7, Y+9 ; 0x09 26e70: 2e 85 ldd r18, Y+14 ; 0x0e 26e72: 3f 85 ldd r19, Y+15 ; 0x0f 26e74: 48 89 ldd r20, Y+16 ; 0x10 26e76: 59 89 ldd r21, Y+17 ; 0x11 26e78: 42 0e add r4, r18 26e7a: 53 1e adc r5, r19 26e7c: 64 1e adc r6, r20 26e7e: 75 1e adc r7, r21 26e80: 84 18 sub r8, r4 26e82: 95 08 sbc r9, r5 26e84: a6 08 sbc r10, r6 26e86: b7 08 sbc r11, r7 26e88: 86 0e add r8, r22 26e8a: 97 1e adc r9, r23 26e8c: a8 1e adc r10, r24 26e8e: b9 1e adc r11, r25 26e90: 31 e8 ldi r19, 0x81 ; 129 26e92: 83 16 cp r8, r19 26e94: 3f e4 ldi r19, 0x4F ; 79 26e96: 93 06 cpc r9, r19 26e98: 32 e1 ldi r19, 0x12 ; 18 26e9a: a3 06 cpc r10, r19 26e9c: b1 04 cpc r11, r1 26e9e: 08 f4 brcc .+2 ; 0x26ea2 26ea0: 47 c0 rjmp .+142 ; 0x26f30 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); 26ea2: 81 e1 ldi r24, 0x11 ; 17 26ea4: 95 e9 ldi r25, 0x95 ; 149 26ea6: 80 cf rjmp .-256 ; 0x26da8 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 26ea8: 8d 81 ldd r24, Y+5 ; 0x05 26eaa: 9f 8d ldd r25, Y+31 ; 0x1f 26eac: 89 13 cpse r24, r25 26eae: d0 cf rjmp .-96 ; 0x26e50 safety_check_cycles++; 26eb0: 8f 5f subi r24, 0xFF ; 255 26eb2: 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) { 26eb4: 2b a5 ldd r18, Y+43 ; 0x2b 26eb6: 3c a5 ldd r19, Y+44 ; 0x2c 26eb8: 4d a5 ldd r20, Y+45 ; 0x2d 26eba: 5e a5 ldd r21, Y+46 ; 0x2e 26ebc: b8 01 movw r22, r16 26ebe: 88 a9 ldd r24, Y+48 ; 0x30 26ec0: 9f a5 ldd r25, Y+47 ; 0x2f 26ec2: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 26ec6: 9f 77 andi r25, 0x7F ; 127 26ec8: 20 e0 ldi r18, 0x00 ; 0 26eca: 30 e0 ldi r19, 0x00 ; 0 26ecc: 40 ea ldi r20, 0xA0 ; 160 26ece: 50 e4 ldi r21, 0x40 ; 64 26ed0: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 26ed4: 87 ff sbrs r24, 7 26ed6: bc cf rjmp .-136 ; 0x26e50 temp_runaway_stop(false, (extruder<0)); 26ed8: 63 2d mov r22, r3 26eda: 66 1f adc r22, r22 26edc: 66 27 eor r22, r22 26ede: 66 1f adc r22, r22 26ee0: 80 e0 ldi r24, 0x00 ; 0 26ee2: 0f 94 c6 33 call 0x2678c ; 0x2678c pid_tuning_finished = true; 26ee6: 81 e0 ldi r24, 0x01 ; 1 26ee8: 80 93 41 02 sts 0x0241, r24 ; 0x800241 <_ZL19pid_tuning_finished.lto_priv.424> pid_cycle = 0; return; } lcd_update(0); } } 26eec: e0 96 adiw r28, 0x30 ; 48 26eee: 0f b6 in r0, 0x3f ; 63 26ef0: f8 94 cli 26ef2: de bf out 0x3e, r29 ; 62 26ef4: 0f be out 0x3f, r0 ; 63 26ef6: cd bf out 0x3d, r28 ; 61 26ef8: df 91 pop r29 26efa: cf 91 pop r28 26efc: 1f 91 pop r17 26efe: 0f 91 pop r16 26f00: ff 90 pop r15 26f02: ef 90 pop r14 26f04: df 90 pop r13 26f06: cf 90 pop r12 26f08: bf 90 pop r11 26f0a: af 90 pop r10 26f0c: 9f 90 pop r9 26f0e: 8f 90 pop r8 26f10: 7f 90 pop r7 26f12: 6f 90 pop r6 26f14: 5f 90 pop r5 26f16: 4f 90 pop r4 26f18: 3f 90 pop r3 26f1a: 2f 90 pop r2 26f1c: 08 95 ret SERIAL_PROTOCOL(input); SERIAL_PROTOCOLPGM(" @:"); SERIAL_PROTOCOLLN(p); if (safety_check_cycles == 0) { //save ambient temp temp_ambient = input; 26f1e: 0b a7 std Y+43, r16 ; 0x2b 26f20: 1c a7 std Y+44, r17 ; 0x2c 26f22: a8 a9 ldd r26, Y+48 ; 0x30 26f24: ad a7 std Y+45, r26 ; 0x2d 26f26: bf a5 ldd r27, Y+47 ; 0x2f 26f28: be a7 std Y+46, r27 ; 0x2e //SERIAL_ECHOPGM("Ambient T: "); //MYSERIAL.println(temp_ambient); safety_check_cycles++; 26f2a: 21 e0 ldi r18, 0x01 ; 1 26f2c: 2d 83 std Y+5, r18 ; 0x05 26f2e: 90 cf rjmp .-224 ; 0x26e50 SERIAL_PROTOCOLLNPGM("PID Autotune failed! timeout"); pid_tuning_finished = true; pid_cycle = 0; return; } if(pid_cycle > ncycles) { 26f30: 80 91 02 06 lds r24, 0x0602 ; 0x800602 26f34: 90 91 03 06 lds r25, 0x0603 ; 0x800603 26f38: 49 a5 ldd r20, Y+41 ; 0x29 26f3a: 5a a5 ldd r21, Y+42 ; 0x2a 26f3c: 48 17 cp r20, r24 26f3e: 59 07 cpc r21, r25 26f40: 1c f4 brge .+6 ; 0x26f48 SERIAL_PROTOCOLLNPGM("PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h"); 26f42: 85 eb ldi r24, 0xB5 ; 181 26f44: 94 e9 ldi r25, 0x94 ; 148 26f46: 30 cf rjmp .-416 ; 0x26da8 pid_tuning_finished = true; pid_cycle = 0; return; } lcd_update(0); 26f48: 80 e0 ldi r24, 0x00 ; 0 26f4a: 0e 94 4a 6f call 0xde94 ; 0xde94 26f4e: e6 cc rjmp .-1588 ; 0x2691c 00026f50 : } void handle_temp_error(); void manage_heater() { 26f50: cf 92 push r12 26f52: df 92 push r13 26f54: ef 92 push r14 26f56: ff 92 push r15 26f58: 0f 93 push r16 26f5a: 1f 93 push r17 26f5c: cf 93 push r28 26f5e: df 93 push r29 26f60: 1f 92 push r1 26f62: 1f 92 push r1 26f64: cd b7 in r28, 0x3d ; 61 26f66: de b7 in r29, 0x3e ; 62 #ifdef WATCHDOG wdt_reset(); 26f68: 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) 26f6a: 80 91 d5 05 lds r24, 0x05D5 ; 0x8005d5 26f6e: 88 23 and r24, r24 26f70: 09 f4 brne .+2 ; 0x26f74 26f72: 29 c2 rjmp .+1106 ; 0x273c6 return; // syncronize temperatures with isr updateTemperatures(); 26f74: 0e 94 ef ff call 0x1ffde ; 0x1ffde if(thermal_model::warning_state.warning) thermal_model::handle_warning(); #endif // handle temperature errors if(temp_error_state.v) 26f78: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 26f7c: 88 23 and r24, r24 26f7e: 89 f1 breq .+98 ; 0x26fe2 #endif void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { 26f80: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 26f84: 82 95 swap r24 26f86: 86 95 lsr r24 26f88: 87 70 andi r24, 0x07 ; 7 26f8a: 81 30 cpi r24, 0x01 ; 1 26f8c: 01 f1 breq .+64 ; 0x26fce 26f8e: 08 f4 brcc .+2 ; 0x26f92 26f90: be c1 rjmp .+892 ; 0x2730e 26f92: 84 30 cpi r24, 0x04 ; 4 26f94: 30 f5 brcc .+76 ; 0x26fe2 #endif } break; case TempErrorType::preheat: case TempErrorType::runaway: switch((TempErrorSource)temp_error_state.source) { 26f96: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 26f9a: 86 95 lsr r24 26f9c: 86 95 lsr r24 26f9e: 83 70 andi r24, 0x03 ; 3 26fa0: 82 30 cpi r24, 0x02 ; 2 26fa2: f8 f4 brcc .+62 ; 0x26fe2 case TempErrorSource::hotend: case TempErrorSource::bed: temp_runaway_stop( ((TempErrorType)temp_error_state.type == TempErrorType::preheat), ((TempErrorSource)temp_error_state.source == TempErrorSource::bed)); 26fa4: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 26fa8: 86 95 lsr r24 26faa: 86 95 lsr r24 26fac: 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), 26fae: 90 91 cc 03 lds r25, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 26fb2: 92 95 swap r25 26fb4: 96 95 lsr r25 26fb6: 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( 26fb8: 61 e0 ldi r22, 0x01 ; 1 26fba: 81 30 cpi r24, 0x01 ; 1 26fbc: 09 f0 breq .+2 ; 0x26fc0 26fbe: 60 e0 ldi r22, 0x00 ; 0 26fc0: 81 e0 ldi r24, 0x01 ; 1 26fc2: 92 30 cpi r25, 0x02 ; 2 26fc4: 09 f0 breq .+2 ; 0x26fc8 26fc6: 80 e0 ldi r24, 0x00 ; 0 26fc8: 0f 94 c6 33 call 0x2678c ; 0x2678c 26fcc: 0a c0 rjmp .+20 ; 0x26fe2 void handle_temp_error() { // relay to the original handler switch((TempErrorType)temp_error_state.type) { case TempErrorType::min: switch((TempErrorSource)temp_error_state.source) { 26fce: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 26fd2: 86 95 lsr r24 26fd4: 86 95 lsr r24 26fd6: 83 70 andi r24, 0x03 ; 3 26fd8: 09 f4 brne .+2 ; 0x26fdc 26fda: 4b c1 rjmp .+662 ; 0x27272 26fdc: 81 30 cpi r24, 0x01 ; 1 26fde: 09 f4 brne .+2 ; 0x26fe2 26fe0: 79 c1 rjmp .+754 ; 0x272d4 #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)) { 26fe2: 0f 94 89 0b call 0x21712 ; 0x21712 26fe6: 00 91 07 17 lds r16, 0x1707 ; 0x801707 26fea: 10 91 08 17 lds r17, 0x1708 ; 0x801708 26fee: 20 91 09 17 lds r18, 0x1709 ; 0x801709 26ff2: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 26ff6: 60 1b sub r22, r16 26ff8: 71 0b sbc r23, r17 26ffa: 82 0b sbc r24, r18 26ffc: 93 0b sbc r25, r19 26ffe: 69 38 cpi r22, 0x89 ; 137 27000: 73 41 sbci r23, 0x13 ; 19 27002: 81 05 cpc r24, r1 27004: 91 05 cpc r25, r1 27006: d0 f0 brcs .+52 ; 0x2703c 27008: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 2700c: 81 11 cpse r24, r1 2700e: 16 c0 rjmp .+44 ; 0x2703c extruder_autofan_last_check = _millis(); 27010: 0f 94 89 0b call 0x21712 ; 0x21712 27014: 60 93 07 17 sts 0x1707, r22 ; 0x801707 27018: 70 93 08 17 sts 0x1708, r23 ; 0x801708 2701c: 80 93 09 17 sts 0x1709, r24 ; 0x801709 27020: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a fanSpeedBckp = fanSpeedSoftPwm; 27024: 80 91 1d 06 lds r24, 0x061D ; 0x80061d 27028: 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 2702c: 8b 34 cpi r24, 0x4B ; 75 2702e: 18 f0 brcs .+6 ; 0x27036 // printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = 255; 27030: 8f ef ldi r24, 0xFF ; 255 27032: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d } fan_measuring = true; 27036: 81 e0 ldi r24, 0x01 ; 1 27038: 80 93 b6 03 sts 0x03B6, r24 ; 0x8003b6 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { 2703c: 0f 94 89 0b call 0x21712 ; 0x21712 27040: 00 91 07 17 lds r16, 0x1707 ; 0x801707 27044: 10 91 08 17 lds r17, 0x1708 ; 0x801708 27048: 20 91 09 17 lds r18, 0x1709 ; 0x801709 2704c: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 27050: 60 1b sub r22, r16 27052: 71 0b sbc r23, r17 27054: 82 0b sbc r24, r18 27056: 93 0b sbc r25, r19 27058: 65 36 cpi r22, 0x65 ; 101 2705a: 71 05 cpc r23, r1 2705c: 81 05 cpc r24, r1 2705e: 91 05 cpc r25, r1 27060: 08 f4 brcc .+2 ; 0x27064 27062: a5 c1 rjmp .+842 ; 0x273ae 27064: 80 91 b6 03 lds r24, 0x03B6 ; 0x8003b6 27068: 88 23 and r24, r24 2706a: 09 f4 brne .+2 ; 0x2706e 2706c: a0 c1 rjmp .+832 ; 0x273ae #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))); 2706e: 60 91 b5 05 lds r22, 0x05B5 ; 0x8005b5 27072: 70 91 b6 05 lds r23, 0x05B6 ; 0x8005b6 27076: 07 2e mov r0, r23 27078: 00 0c add r0, r0 2707a: 88 0b sbc r24, r24 2707c: 99 0b sbc r25, r25 2707e: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 27082: 6b 01 movw r12, r22 27084: 7c 01 movw r14, r24 27086: 0f 94 89 0b call 0x21712 ; 0x21712 2708a: 00 91 07 17 lds r16, 0x1707 ; 0x801707 2708e: 10 91 08 17 lds r17, 0x1708 ; 0x801708 27092: 20 91 09 17 lds r18, 0x1709 ; 0x801709 27096: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 2709a: 60 1b sub r22, r16 2709c: 71 0b sbc r23, r17 2709e: 82 0b sbc r24, r18 270a0: 93 0b sbc r25, r19 270a2: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 270a6: 9b 01 movw r18, r22 270a8: ac 01 movw r20, r24 270aa: 60 e0 ldi r22, 0x00 ; 0 270ac: 70 e0 ldi r23, 0x00 ; 0 270ae: 8a e7 ldi r24, 0x7A ; 122 270b0: 93 e4 ldi r25, 0x43 ; 67 270b2: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 270b6: a7 01 movw r20, r14 270b8: 96 01 movw r18, r12 270ba: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 270be: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 270c2: 70 93 b8 03 sts 0x03B8, r23 ; 0x8003b8 270c6: 60 93 b7 03 sts 0x03B7, r22 ; 0x8003b7 fan_speed[1] = (fan_edge_counter[1] * (float(250) / (_millis() - extruder_autofan_last_check))); 270ca: 60 91 b7 05 lds r22, 0x05B7 ; 0x8005b7 270ce: 70 91 b8 05 lds r23, 0x05B8 ; 0x8005b8 270d2: 07 2e mov r0, r23 270d4: 00 0c add r0, r0 270d6: 88 0b sbc r24, r24 270d8: 99 0b sbc r25, r25 270da: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 270de: 6b 01 movw r12, r22 270e0: 7c 01 movw r14, r24 270e2: 0f 94 89 0b call 0x21712 ; 0x21712 270e6: 00 91 07 17 lds r16, 0x1707 ; 0x801707 270ea: 10 91 08 17 lds r17, 0x1708 ; 0x801708 270ee: 20 91 09 17 lds r18, 0x1709 ; 0x801709 270f2: 30 91 0a 17 lds r19, 0x170A ; 0x80170a 270f6: 60 1b sub r22, r16 270f8: 71 0b sbc r23, r17 270fa: 82 0b sbc r24, r18 270fc: 93 0b sbc r25, r19 270fe: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 27102: 9b 01 movw r18, r22 27104: ac 01 movw r20, r24 27106: 60 e0 ldi r22, 0x00 ; 0 27108: 70 e0 ldi r23, 0x00 ; 0 2710a: 8a e7 ldi r24, 0x7A ; 122 2710c: 93 e4 ldi r25, 0x43 ; 67 2710e: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 27112: a7 01 movw r20, r14 27114: 96 01 movw r18, r12 27116: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2711a: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 2711e: 70 93 ba 03 sts 0x03BA, r23 ; 0x8003ba 27122: 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; 27126: 10 92 b6 05 sts 0x05B6, r1 ; 0x8005b6 2712a: 10 92 b5 05 sts 0x05B5, r1 ; 0x8005b5 fan_edge_counter[1] = 0; 2712e: 10 92 b8 05 sts 0x05B8, r1 ; 0x8005b8 27132: 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) 27136: 83 e0 ldi r24, 0x03 ; 3 27138: 8a 83 std Y+2, r24 ; 0x02 max_fan_errors[0] = 2; // 10 seconds (Hotend fan) 2713a: 82 e0 ldi r24, 0x02 ; 2 2713c: 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) 2713e: 80 91 40 02 lds r24, 0x0240 ; 0x800240 27142: 88 23 and r24, r24 27144: 51 f0 breq .+20 ; 0x2715a fans_check_enabled = (eeprom_read_byte((uint8_t*)EEPROM_FAN_CHECK_ENABLED) > 0); 27146: 87 e8 ldi r24, 0x87 ; 135 27148: 9f e0 ldi r25, 0x0F ; 15 2714a: 0f 94 81 a4 call 0x34902 ; 0x34902 2714e: 91 e0 ldi r25, 0x01 ; 1 27150: 81 11 cpse r24, r1 27152: 01 c0 rjmp .+2 ; 0x27156 27154: 90 e0 ldi r25, 0x00 ; 0 27156: 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]++;} 2715a: 80 91 b7 03 lds r24, 0x03B7 ; 0x8003b7 2715e: 90 91 b8 03 lds r25, 0x03B8 ; 0x8003b8 27162: 44 97 sbiw r24, 0x14 ; 20 27164: 0c f0 brlt .+2 ; 0x27168 27166: f2 c0 rjmp .+484 ; 0x2734c 27168: 20 e0 ldi r18, 0x00 ; 0 2716a: 30 e0 ldi r19, 0x00 ; 0 2716c: 48 e4 ldi r20, 0x48 ; 72 2716e: 52 e4 ldi r21, 0x42 ; 66 27170: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 27174: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 27178: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2717c: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 27180: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 27184: 18 16 cp r1, r24 27186: 0c f0 brlt .+2 ; 0x2718a 27188: e1 c0 rjmp .+450 ; 0x2734c 2718a: 80 91 80 05 lds r24, 0x0580 ; 0x800580 2718e: 8f 5f subi r24, 0xFF ; 255 27190: 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){ 27194: 80 91 80 05 lds r24, 0x0580 ; 0x800580 27198: 81 11 cpse r24, r1 2719a: 0b c0 rjmp .+22 ; 0x271b2 2719c: 80 91 81 05 lds r24, 0x0581 ; 0x800581 271a0: 81 11 cpse r24, r1 271a2: 07 c0 rjmp .+14 ; 0x271b2 271a4: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 271a8: 82 30 cpi r24, 0x02 ; 2 271aa: 19 f4 brne .+6 ; 0x271b2 // we may even send some info to the LCD from here fan_check_error = EFCE_FIXED; 271ac: 81 e0 ldi r24, 0x01 ; 1 271ae: 80 93 ce 03 sts 0x03CE, r24 ; 0x8003ce } if ((fan_check_error == EFCE_FIXED) && !printer_active()){ 271b2: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 271b6: 81 30 cpi r24, 0x01 ; 1 271b8: 61 f4 brne .+24 ; 0x271d2 271ba: 0e 94 e2 66 call 0xcdc4 ; 0xcdc4 271be: 81 11 cpse r24, r1 271c0: 08 c0 rjmp .+16 ; 0x271d2 fan_check_error = EFCE_OK; //if the issue is fixed while the printer is doing nothing, reenable processing immediately. 271c2: 10 92 ce 03 sts 0x03CE, r1 ; 0x8003ce lcd_setalertstatus_(message, severity, true); } void lcd_reset_alert_level() { lcd_status_message_level = 0; 271c6: 10 92 c0 03 sts 0x03C0, r1 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> 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 271ca: 8a e8 ldi r24, 0x8A ; 138 271cc: 9c e6 ldi r25, 0x6C ; 108 271ce: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 } if (fans_check_enabled && (fan_check_error != EFCE_REPORTED)) 271d2: 80 91 40 02 lds r24, 0x0240 ; 0x800240 271d6: 88 23 and r24, r24 271d8: 09 f4 brne .+2 ; 0x271dc 271da: d9 c0 rjmp .+434 ; 0x2738e 271dc: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 271e0: 82 30 cpi r24, 0x02 ; 2 271e2: 09 f4 brne .+2 ; 0x271e6 271e4: d4 c0 rjmp .+424 ; 0x2738e 271e6: 80 e8 ldi r24, 0x80 ; 128 271e8: e8 2e mov r14, r24 271ea: 85 e0 ldi r24, 0x05 ; 5 271ec: f8 2e mov r15, r24 271ee: ce 01 movw r24, r28 271f0: 01 96 adiw r24, 0x01 ; 1 271f2: 6c 01 movw r12, r24 { for (uint8_t fan = 0; fan < 2; fan++) 271f4: 10 e0 ldi r17, 0x00 ; 0 } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; fan_check_error = EFCE_REPORTED; 271f6: 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]) 271f8: f7 01 movw r30, r14 271fa: 91 91 ld r25, Z+ 271fc: 7f 01 movw r14, r30 271fe: f6 01 movw r30, r12 27200: 81 91 ld r24, Z+ 27202: 6f 01 movw r12, r30 27204: 89 17 cp r24, r25 27206: 80 f5 brcc .+96 ; 0x27268 { fan_speed_errors[fan] = 0; 27208: f7 01 movw r30, r14 2720a: 31 97 sbiw r30, 0x01 ; 1 2720c: 10 82 st Z, r1 LCD_ALERTMESSAGERPGM(lcdMsg); } } void fanSpeedError(unsigned char _fan) { if (fan_check_error == EFCE_REPORTED) return; 2720e: 80 91 ce 03 lds r24, 0x03CE ; 0x8003ce 27212: 82 30 cpi r24, 0x02 ; 2 27214: 49 f1 breq .+82 ; 0x27268 fan_check_error = EFCE_REPORTED; 27216: 00 93 ce 03 sts 0x03CE, r16 ; 0x8003ce if (printJobOngoing()) { 2721a: 0e 94 91 66 call 0xcd22 ; 0xcd22 2721e: 88 23 and r24, r24 27220: 09 f4 brne .+2 ; 0x27224 27222: 9a c0 rjmp .+308 ; 0x27358 // A print is ongoing, pause the print normally if(!printingIsPaused()) { 27224: 0e 94 86 66 call 0xcd0c ; 0xcd0c 27228: 81 11 cpse r24, r1 2722a: 07 c0 rjmp .+14 ; 0x2723a if (usb_timer.running()) 2722c: 80 91 42 12 lds r24, 0x1242 ; 0x801242 27230: 88 23 and r24, r24 27232: 09 f4 brne .+2 ; 0x27236 27234: 8e c0 rjmp .+284 ; 0x27352 lcd_pause_usb_print(); 27236: 0f 94 6a 05 call 0x20ad4 ; 0x20ad4 else { // Nothing is going on, but still turn off heaters and report the error setTargetHotend(0); heating_status = HeatingStatus::NO_HEATING; } switch (_fan) { 2723a: 11 30 cpi r17, 0x01 ; 1 2723c: 09 f4 brne .+2 ; 0x27240 2723e: 93 c0 rjmp .+294 ; 0x27366 //! 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); 27240: 86 ee ldi r24, 0xE6 ; 230 27242: 95 e9 ldi r25, 0x95 ; 149 27244: 0e 94 0e 7d call 0xfa1c ; 0xfa1c if (get_message_level() == 0) { 27248: 80 91 c0 03 lds r24, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> 2724c: 81 11 cpse r24, r1 2724e: 0c c0 rjmp .+24 ; 0x27268 Sound_MakeCustom(200,0,true); 27250: 41 e0 ldi r20, 0x01 ; 1 27252: 70 e0 ldi r23, 0x00 ; 0 27254: 60 e0 ldi r22, 0x00 ; 0 27256: 88 ec ldi r24, 0xC8 ; 200 27258: 90 e0 ldi r25, 0x00 ; 0 2725a: 0f 94 4a 25 call 0x24a94 ; 0x24a94 LCD_ALERTMESSAGERPGM(lcdMsg); 2725e: 62 e0 ldi r22, 0x02 ; 2 27260: 8a ec ldi r24, 0xCA ; 202 27262: 98 e6 ldi r25, 0x68 ; 104 27264: 0e 94 14 d8 call 0x1b028 ; 0x1b028 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++) 27268: 11 30 cpi r17, 0x01 ; 1 2726a: 09 f4 brne .+2 ; 0x2726e 2726c: 90 c0 rjmp .+288 ; 0x2738e 2726e: 11 e0 ldi r17, 0x01 ; 1 27270: c3 cf rjmp .-122 ; 0x271f8 case TempErrorSource::hotend: if(temp_error_state.assert) { 27272: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 27276: 81 ff sbrs r24, 1 27278: 12 c0 rjmp .+36 ; 0x2729e min_temp_error(temp_error_state.index); 2727a: 60 91 cc 03 lds r22, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 2727e: 62 95 swap r22 27280: 61 70 andi r22, 0x01 ; 1 #endif } static void min_temp_error(uint8_t e) { static const char err[] PROGMEM = "MINTEMP"; if(IsStopped() == false) { 27282: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 27286: 81 11 cpse r24, r1 27288: 07 c0 rjmp .+14 ; 0x27298 temp_error_messagepgm(err, e); 2728a: 81 e4 ldi r24, 0x41 ; 65 2728c: 96 e9 ldi r25, 0x96 ; 150 2728e: 0f 94 ee 0d call 0x21bdc ; 0x21bdc prusa_statistics(92); 27292: 8c e5 ldi r24, 0x5C ; 92 27294: 0f 94 05 30 call 0x2600a ; 0x2600a } ThermalStop(); 27298: 0f 94 ed 66 call 0x2cdda ; 0x2cdda 2729c: a2 ce rjmp .-700 ; 0x26fe2 // 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); 2729e: 60 91 0d 04 lds r22, 0x040D ; 0x80040d <_ZL8minttemp.lto_priv.425> 272a2: 70 91 0e 04 lds r23, 0x040E ; 0x80040e <_ZL8minttemp.lto_priv.425+0x1> 272a6: 6b 5f subi r22, 0xFB ; 251 272a8: 7f 4f sbci r23, 0xFF ; 255 272aa: 07 2e mov r0, r23 272ac: 00 0c add r0, r0 272ae: 88 0b sbc r24, r24 272b0: 99 0b sbc r25, r25 272b2: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 272b6: 8b 01 movw r16, r22 272b8: 9c 01 movw r18, r24 272ba: 40 91 5a 0d lds r20, 0x0D5A ; 0x800d5a 272be: 50 91 5b 0d lds r21, 0x0D5B ; 0x800d5b 272c2: 60 91 5c 0d lds r22, 0x0D5C ; 0x800d5c 272c6: 70 91 5d 0d lds r23, 0x0D5D ; 0x800d5d 272ca: 8a e6 ldi r24, 0x6A ; 106 272cc: 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); 272ce: 0f 94 b0 05 call 0x20b60 ; 0x20b60 272d2: 87 ce rjmp .-754 ; 0x26fe2 // 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) { 272d4: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 272d8: 81 ff sbrs r24, 1 272da: 0a c0 rjmp .+20 ; 0x272f0 ThermalStop(); } static void bed_min_temp_error(void) { static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { 272dc: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 272e0: 81 11 cpse r24, r1 272e2: da cf rjmp .-76 ; 0x27298 temp_error_messagepgm(err); 272e4: 61 e0 ldi r22, 0x01 ; 1 272e6: 85 e3 ldi r24, 0x35 ; 53 272e8: 96 e9 ldi r25, 0x96 ; 150 ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { temp_error_messagepgm(PSTR("MAXTEMP BED")); 272ea: 0f 94 ee 0d call 0x21bdc ; 0x21bdc 272ee: d4 cf rjmp .-88 ; 0x27298 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); 272f0: 40 91 bc 03 lds r20, 0x03BC ; 0x8003bc 272f4: 50 91 bd 03 lds r21, 0x03BD ; 0x8003bd 272f8: 60 91 be 03 lds r22, 0x03BE ; 0x8003be 272fc: 70 91 bf 03 lds r23, 0x03BF ; 0x8003bf 27300: 00 e0 ldi r16, 0x00 ; 0 27302: 10 e0 ldi r17, 0x00 ; 0 27304: 2c e0 ldi r18, 0x0C ; 12 27306: 32 e4 ldi r19, 0x42 ; 66 27308: 86 e6 ldi r24, 0x66 ; 102 2730a: 92 e0 ldi r25, 0x02 ; 2 2730c: e0 cf rjmp .-64 ; 0x272ce break; #endif } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { 2730e: 80 91 cc 03 lds r24, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 27312: 86 95 lsr r24 27314: 86 95 lsr r24 27316: 83 70 andi r24, 0x03 ; 3 27318: 59 f0 breq .+22 ; 0x27330 2731a: 81 30 cpi r24, 0x01 ; 1 2731c: 09 f0 breq .+2 ; 0x27320 2731e: 61 ce rjmp .-830 ; 0x26fe2 } ThermalStop(); } static void bed_max_temp_error(void) { if(IsStopped() == false) { 27320: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 27324: 81 11 cpse r24, r1 27326: b8 cf rjmp .-144 ; 0x27298 temp_error_messagepgm(PSTR("MAXTEMP BED")); 27328: 61 e0 ldi r22, 0x01 ; 1 2732a: 81 e5 ldi r24, 0x51 ; 81 2732c: 96 e9 ldi r25, 0x96 ; 150 2732e: dd cf rjmp .-70 ; 0x272ea } break; case TempErrorType::max: switch((TempErrorSource)temp_error_state.source) { case TempErrorSource::hotend: max_temp_error(temp_error_state.index); 27330: 60 91 cc 03 lds r22, 0x03CC ; 0x8003cc <_ZL16temp_error_state.lto_priv.423> 27334: 62 95 swap r22 27336: 61 70 andi r22, 0x01 ; 1 SERIAL_ERRORLNPGM(" triggered!"); } static void max_temp_error(uint8_t e) { if(IsStopped() == false) { 27338: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2733c: 81 11 cpse r24, r1 2733e: ac cf rjmp .-168 ; 0x27298 temp_error_messagepgm(PSTR("MAXTEMP"), e); 27340: 89 e4 ldi r24, 0x49 ; 73 27342: 96 e9 ldi r25, 0x96 ; 150 27344: 0f 94 ee 0d call 0x21bdc ; 0x21bdc prusa_statistics(93); 27348: 8d e5 ldi r24, 0x5D ; 93 2734a: a4 cf rjmp .-184 ; 0x27294 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; 2734c: 10 92 80 05 sts 0x0580, r1 ; 0x800580 27350: 21 cf rjmp .-446 ; 0x27194 // A print is ongoing, pause the print normally if(!printingIsPaused()) { if (usb_timer.running()) lcd_pause_usb_print(); else lcd_pause_print(); 27352: 0f 94 95 0b call 0x2172a ; 0x2172a 27356: 71 cf rjmp .-286 ; 0x2723a }; // Doesn't save FLASH when FORCE_INLINE removed. FORCE_INLINE void setTargetHotend(const float &celsius) { target_temperature[0] = celsius; 27358: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 2735c: 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; 27360: 10 92 cb 03 sts 0x03CB, r1 ; 0x8003cb 27364: 6a cf rjmp .-300 ; 0x2723a //! 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); 27366: 8e e0 ldi r24, 0x0E ; 14 27368: 96 e9 ldi r25, 0x96 ; 150 2736a: 0e 94 0e 7d call 0xfa1c ; 0xfa1c if (get_message_level() == 0) { 2736e: 80 91 c0 03 lds r24, 0x03C0 ; 0x8003c0 <_ZL24lcd_status_message_level.lto_priv.420> 27372: 81 11 cpse r24, r1 27374: 0c c0 rjmp .+24 ; 0x2738e Sound_MakeCustom(200,0,true); 27376: 41 e0 ldi r20, 0x01 ; 1 27378: 70 e0 ldi r23, 0x00 ; 0 2737a: 60 e0 ldi r22, 0x00 ; 0 2737c: 88 ec ldi r24, 0xC8 ; 200 2737e: 90 e0 ldi r25, 0x00 ; 0 27380: 0f 94 4a 25 call 0x24a94 ; 0x24a94 LCD_ALERTMESSAGERPGM(lcdMsg); 27384: 62 e0 ldi r22, 0x02 ; 2 27386: 87 ee ldi r24, 0xE7 ; 231 27388: 9a e6 ldi r25, 0x6A ; 106 2738a: 0e 94 14 d8 call 0x1b028 ; 0x1b028 } if ((_millis() - extruder_autofan_last_check > FAN_CHECK_DURATION) && (fan_measuring)) { countFanSpeed(); checkFanSpeed(); //printf_P(PSTR("fanSpeedSoftPwm 1: %d\n"), fanSpeedSoftPwm); fanSpeedSoftPwm = fanSpeedBckp; 2738e: 80 91 65 02 lds r24, 0x0265 ; 0x800265 27392: 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(); 27396: 0f 94 89 0b call 0x21712 ; 0x21712 2739a: 60 93 07 17 sts 0x1707, r22 ; 0x801707 2739e: 70 93 08 17 sts 0x1708, r23 ; 0x801708 273a2: 80 93 09 17 sts 0x1709, r24 ; 0x801709 273a6: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a fan_measuring = false; 273aa: 10 92 b6 03 sts 0x03B6, r1 ; 0x8003b6 checkFans(); #ifdef THERMAL_MODEL_DEBUG thermal_model::log_usr(); #endif } 273ae: 0f 90 pop r0 273b0: 0f 90 pop r0 273b2: df 91 pop r29 273b4: cf 91 pop r28 273b6: 1f 91 pop r17 273b8: 0f 91 pop r16 273ba: ff 90 pop r15 273bc: ef 90 pop r14 273be: df 90 pop r13 273c0: cf 90 pop r12 } #endif //FANCHECK checkExtruderAutoFans(); 273c2: 0c 94 4c 78 jmp 0xf098 ; 0xf098 273c6: 0f 90 pop r0 273c8: 0f 90 pop r0 273ca: df 91 pop r29 273cc: cf 91 pop r28 273ce: 1f 91 pop r17 273d0: 0f 91 pop r16 273d2: ff 90 pop r15 273d4: ef 90 pop r14 273d6: df 90 pop r13 273d8: cf 90 pop r12 273da: 08 95 ret 000273dc : } #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; } 273dc: 20 91 38 12 lds r18, 0x1238 ; 0x801238 273e0: 30 91 39 12 lds r19, 0x1239 ; 0x801239 273e4: bc 01 movw r22, r24 273e6: c9 01 movw r24, r18 273e8: 82 5b subi r24, 0xB2 ; 178 273ea: 9f 4e sbci r25, 0xEF ; 239 273ec: 0f 94 88 a2 call 0x34510 ; 0x34510 273f0: 9c 01 movw r18, r24 273f2: 90 93 bc 04 sts 0x04BC, r25 ; 0x8004bc 273f6: 80 93 bb 04 sts 0x04BB, r24 ; 0x8004bb 273fa: 81 e0 ldi r24, 0x01 ; 1 273fc: 23 2b or r18, r19 273fe: 09 f4 brne .+2 ; 0x27402 27400: 80 e0 ldi r24, 0x00 ; 0 27402: 08 95 ret 00027404 : } } uint16_t planner_calc_sd_length() { uint8_t _block_buffer_head = block_buffer_head; 27404: 60 91 3e 0d lds r22, 0x0D3E ; 0x800d3e uint8_t _block_buffer_tail = block_buffer_tail; 27408: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f uint16_t sdlen = 0; 2740c: 30 e0 ldi r19, 0x00 ; 0 2740e: 20 e0 ldi r18, 0x00 ; 0 while (_block_buffer_head != _block_buffer_tail) { sdlen += block_buffer[_block_buffer_tail].sdlen; 27410: 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) 27412: 96 17 cp r25, r22 27414: 61 f0 breq .+24 ; 0x2742e { sdlen += block_buffer[_block_buffer_tail].sdlen; 27416: 89 9f mul r24, r25 27418: f0 01 movw r30, r0 2741a: 11 24 eor r1, r1 2741c: e6 53 subi r30, 0x36 ; 54 2741e: f9 4f sbci r31, 0xF9 ; 249 27420: 40 81 ld r20, Z 27422: 51 81 ldd r21, Z+1 ; 0x01 27424: 24 0f add r18, r20 27426: 35 1f adc r19, r21 _block_buffer_tail = (_block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 27428: 9f 5f subi r25, 0xFF ; 255 2742a: 9f 70 andi r25, 0x0F ; 15 2742c: f2 cf rjmp .-28 ; 0x27412 } return sdlen; } 2742e: c9 01 movw r24, r18 27430: 08 95 ret 00027432 : } #endif /* PLANNER_DIAGNOSTICS */ void planner_add_sd_length(uint16_t sdlen) { if (block_buffer_head != block_buffer_tail) { 27432: 30 91 3e 0d lds r19, 0x0D3E ; 0x800d3e 27436: 20 91 3f 0d lds r18, 0x0D3F ; 0x800d3f 2743a: 32 17 cp r19, r18 2743c: 91 f0 breq .+36 ; 0x27462 // 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; 2743e: 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) 27442: e1 11 cpse r30, r1 27444: 01 c0 rjmp .+2 ; 0x27448 block_index = BLOCK_BUFFER_SIZE; 27446: e0 e1 ldi r30, 0x10 ; 16 -- block_index; 27448: 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; 2744a: 2e e6 ldi r18, 0x6E ; 110 2744c: e2 9f mul r30, r18 2744e: f0 01 movw r30, r0 27450: 11 24 eor r1, r1 27452: e6 53 subi r30, 0x36 ; 54 27454: f9 4f sbci r31, 0xF9 ; 249 27456: 20 81 ld r18, Z 27458: 31 81 ldd r19, Z+1 ; 0x01 2745a: 82 0f add r24, r18 2745c: 93 1f adc r25, r19 2745e: 91 83 std Z+1, r25 ; 0x01 27460: 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. } } 27462: 08 95 ret 00027464 : } #endif //PREVENT_DANGEROUS_EXTRUDE // Calculate the steps/s^2 acceleration rates, based on the mm/s^s void reset_acceleration_rates() { 27464: cf 92 push r12 27466: df 92 push r13 27468: ef 92 push r14 2746a: ff 92 push r15 2746c: 0f 93 push r16 2746e: 1f 93 push r17 27470: cf 93 push r28 27472: df 93 push r29 27474: 0b e6 ldi r16, 0x6B ; 107 27476: 1d e0 ldi r17, 0x0D ; 13 27478: cb ea ldi r28, 0xAB ; 171 2747a: d4 e0 ldi r29, 0x04 ; 4 2747c: 8b eb ldi r24, 0xBB ; 187 2747e: c8 2e mov r12, r24 27480: 84 e0 ldi r24, 0x04 ; 4 27482: d8 2e mov r13, r24 27484: 78 01 movw r14, r16 27486: 0c 5f subi r16, 0xFC ; 252 27488: 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]; 2748a: f7 01 movw r30, r14 2748c: 60 a1 ldd r22, Z+32 ; 0x20 2748e: 71 a1 ldd r23, Z+33 ; 0x21 27490: 82 a1 ldd r24, Z+34 ; 0x22 27492: 93 a1 ldd r25, Z+35 ; 0x23 27494: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 27498: f7 01 movw r30, r14 2749a: 20 81 ld r18, Z 2749c: 31 81 ldd r19, Z+1 ; 0x01 2749e: 42 81 ldd r20, Z+2 ; 0x02 274a0: 53 81 ldd r21, Z+3 ; 0x03 274a2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 274a6: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 274aa: 69 93 st Y+, r22 274ac: 79 93 st Y+, r23 274ae: 89 93 st Y+, r24 274b0: 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++) 274b2: cc 16 cp r12, r28 274b4: dd 06 cpc r13, r29 274b6: 31 f7 brne .-52 ; 0x27484 max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * cs.axis_steps_per_mm[i]; } 274b8: df 91 pop r29 274ba: cf 91 pop r28 274bc: 1f 91 pop r17 274be: 0f 91 pop r16 274c0: ff 90 pop r15 274c2: ef 90 pop r14 274c4: df 90 pop r13 274c6: cf 90 pop r12 274c8: 08 95 ret 000274ca : } void plan_set_e_position(const float &e) { #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 274ca: fc 01 movw r30, r24 274cc: 40 81 ld r20, Z 274ce: 51 81 ldd r21, Z+1 ; 0x01 274d0: 62 81 ldd r22, Z+2 ; 0x02 274d2: 73 81 ldd r23, Z+3 ; 0x03 274d4: 40 93 42 04 sts 0x0442, r20 ; 0x800442 274d8: 50 93 43 04 sts 0x0443, r21 ; 0x800443 274dc: 60 93 44 04 sts 0x0444, r22 ; 0x800444 274e0: 70 93 45 04 sts 0x0445, r23 ; 0x800445 #endif position[E_AXIS] = lround(e*cs.axis_steps_per_mm[E_AXIS]); 274e4: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 274e8: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 274ec: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 274f0: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 274f4: 60 81 ld r22, Z 274f6: 71 81 ldd r23, Z+1 ; 0x01 274f8: 82 81 ldd r24, Z+2 ; 0x02 274fa: 93 81 ldd r25, Z+3 ; 0x03 274fc: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 27500: 0f 94 e6 a8 call 0x351cc ; 0x351cc 27504: ec e3 ldi r30, 0x3C ; 60 27506: f6 e0 ldi r31, 0x06 ; 6 27508: 64 87 std Z+12, r22 ; 0x0c 2750a: 75 87 std Z+13, r23 ; 0x0d 2750c: 86 87 std Z+14, r24 ; 0x0e 2750e: 97 87 std Z+15, r25 ; 0x0f CRITICAL_SECTION_END; } void st_set_e_position(const long &e) { CRITICAL_SECTION_START; 27510: 8f b7 in r24, 0x3f ; 63 27512: f8 94 cli count_position[E_AXIS] = e; 27514: 44 85 ldd r20, Z+12 ; 0x0c 27516: 55 85 ldd r21, Z+13 ; 0x0d 27518: 66 85 ldd r22, Z+14 ; 0x0e 2751a: 77 85 ldd r23, Z+15 ; 0x0f 2751c: 40 93 58 06 sts 0x0658, r20 ; 0x800658 27520: 50 93 59 06 sts 0x0659, r21 ; 0x800659 27524: 60 93 5a 06 sts 0x065A, r22 ; 0x80065a 27528: 70 93 5b 06 sts 0x065B, r23 ; 0x80065b CRITICAL_SECTION_END; 2752c: 8f bf out 0x3f, r24 ; 63 st_set_e_position(position[E_AXIS]); } 2752e: 08 95 ret 00027530 : // 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; 27530: fc 01 movw r30, r24 27532: 40 81 ld r20, Z 27534: 51 81 ldd r21, Z+1 ; 0x01 27536: 62 81 ldd r22, Z+2 ; 0x02 27538: 73 81 ldd r23, Z+3 ; 0x03 2753a: 40 93 3e 04 sts 0x043E, r20 ; 0x80043e 2753e: 50 93 3f 04 sts 0x043F, r21 ; 0x80043f 27542: 60 93 40 04 sts 0x0440, r22 ; 0x800440 27546: 70 93 41 04 sts 0x0441, r23 ; 0x800441 #endif position[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 2754a: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 2754e: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 27552: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 27556: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 2755a: 60 81 ld r22, Z 2755c: 71 81 ldd r23, Z+1 ; 0x01 2755e: 82 81 ldd r24, Z+2 ; 0x02 27560: 93 81 ldd r25, Z+3 ; 0x03 27562: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 27566: 0f 94 e6 a8 call 0x351cc ; 0x351cc 2756a: 60 93 44 06 sts 0x0644, r22 ; 0x800644 2756e: 70 93 45 06 sts 0x0645, r23 ; 0x800645 27572: 80 93 46 06 sts 0x0646, r24 ; 0x800646 27576: 90 93 47 06 sts 0x0647, r25 ; 0x800647 st_set_position(position); 2757a: 0d 94 06 7a jmp 0x2f40c ; 0x2f40c 0002757e : // 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) { 2757e: 2f 92 push r2 27580: 3f 92 push r3 27582: 4f 92 push r4 27584: 5f 92 push r5 27586: 6f 92 push r6 27588: 7f 92 push r7 2758a: 8f 92 push r8 2758c: 9f 92 push r9 2758e: af 92 push r10 27590: bf 92 push r11 27592: cf 92 push r12 27594: df 92 push r13 27596: ef 92 push r14 27598: ff 92 push r15 2759a: 0f 93 push r16 2759c: 1f 93 push r17 2759e: cf 93 push r28 275a0: df 93 push r29 275a2: cd b7 in r28, 0x3d ; 61 275a4: de b7 in r29, 0x3e ; 62 275a6: c4 58 subi r28, 0x84 ; 132 275a8: d1 09 sbc r29, r1 275aa: 0f b6 in r0, 0x3f ; 63 275ac: f8 94 cli 275ae: de bf out 0x3e, r29 ; 62 275b0: 0f be out 0x3f, r0 ; 63 275b2: cd bf out 0x3d, r28 ; 61 275b4: 69 a3 std Y+33, r22 ; 0x21 275b6: 7a a3 std Y+34, r23 ; 0x22 275b8: 8b a3 std Y+35, r24 ; 0x23 275ba: 9c a3 std Y+36, r25 ; 0x24 275bc: 2d a3 std Y+37, r18 ; 0x25 275be: 3e a3 std Y+38, r19 ; 0x26 275c0: 4f a3 std Y+39, r20 ; 0x27 275c2: 58 a7 std Y+40, r21 ; 0x28 275c4: a7 96 adiw r28, 0x27 ; 39 275c6: ec ae std Y+60, r14 ; 0x3c 275c8: fd ae std Y+61, r15 ; 0x3d 275ca: 0e af std Y+62, r16 ; 0x3e 275cc: 1f af std Y+63, r17 ; 0x3f 275ce: a7 97 sbiw r28, 0x27 ; 39 275d0: a9 96 adiw r28, 0x29 ; 41 275d2: df ae std Y+63, r13 ; 0x3f 275d4: ce ae std Y+62, r12 ; 0x3e 275d6: a9 97 sbiw r28, 0x29 ; 41 275d8: 89 ae std Y+57, r8 ; 0x39 275da: 99 aa std Y+49, r9 ; 0x31 275dc: ad ae std Y+61, r10 ; 0x3d 275de: bd aa std Y+53, r11 ; 0x35 275e0: c6 56 subi r28, 0x66 ; 102 275e2: df 4f sbci r29, 0xFF ; 255 275e4: 08 81 ld r16, Y 275e6: 19 81 ldd r17, Y+1 ; 0x01 275e8: ca 59 subi r28, 0x9A ; 154 275ea: 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); 275ec: 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) 275f0: 8f 5f subi r24, 0xFF ; 255 275f2: a0 96 adiw r28, 0x20 ; 32 275f4: 8f af std Y+63, r24 ; 0x3f 275f6: a0 97 sbiw r28, 0x20 ; 32 275f8: 80 31 cpi r24, 0x10 ; 16 275fa: 19 f4 brne .+6 ; 0x27602 block_index = 0; 275fc: a0 96 adiw r28, 0x20 ; 32 275fe: 1f ae std Y+63, r1 ; 0x3f 27600: 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) { 27602: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 27606: a0 96 adiw r28, 0x20 ; 32 27608: 2f ad ldd r18, Y+63 ; 0x3f 2760a: a0 97 sbiw r28, 0x20 ; 32 2760c: 82 13 cpse r24, r18 2760e: 0f c0 rjmp .+30 ; 0x2762e do { manage_heater(); 27610: 0f 94 a8 37 call 0x26f50 ; 0x26f50 // Vojtech: Don't disable motors inside the planner! manage_inactivity(false); 27614: 80 e0 ldi r24, 0x00 ; 0 27616: 0e 94 ad 8a call 0x1155a ; 0x1155a lcd_update(0); 2761a: 80 e0 ldi r24, 0x00 ; 0 2761c: 0e 94 4a 6f call 0xde94 ; 0xde94 } while (block_buffer_tail == next_buffer_head); 27620: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 27624: a0 96 adiw r28, 0x20 ; 32 27626: 3f ad ldd r19, Y+63 ; 0x3f 27628: a0 97 sbiw r28, 0x20 ; 32 2762a: 83 17 cp r24, r19 2762c: 89 f3 breq .-30 ; 0x27610 } #ifdef PLANNER_DIAGNOSTICS planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ if(planner_aborted) { 2762e: 40 91 42 0d lds r20, 0x0D42 ; 0x800d42 27632: a1 96 adiw r28, 0x21 ; 33 27634: 4f af std Y+63, r20 ; 0x3f 27636: a1 97 sbiw r28, 0x21 ; 33 27638: 44 23 and r20, r20 2763a: 11 f1 breq .+68 ; 0x27680 // avoid planning the block early if aborted SERIAL_ECHO_START; 2763c: 84 ee ldi r24, 0xE4 ; 228 2763e: 92 ea ldi r25, 0xA2 ; 162 27640: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNRPGM(_n("Move aborted")); 27644: 8a ed ldi r24, 0xDA ; 218 27646: 9a e6 ldi r25, 0x6A ; 106 27648: 0e 94 0e 7d call 0xfa1c ; 0xfa1c // 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(); } 2764c: cc 57 subi r28, 0x7C ; 124 2764e: df 4f sbci r29, 0xFF ; 255 27650: 0f b6 in r0, 0x3f ; 63 27652: f8 94 cli 27654: de bf out 0x3e, r29 ; 62 27656: 0f be out 0x3f, r0 ; 63 27658: cd bf out 0x3d, r28 ; 61 2765a: df 91 pop r29 2765c: cf 91 pop r28 2765e: 1f 91 pop r17 27660: 0f 91 pop r16 27662: ff 90 pop r15 27664: ef 90 pop r14 27666: df 90 pop r13 27668: cf 90 pop r12 2766a: bf 90 pop r11 2766c: af 90 pop r10 2766e: 9f 90 pop r9 27670: 8f 90 pop r8 27672: 7f 90 pop r7 27674: 6f 90 pop r6 27676: 5f 90 pop r5 27678: 4f 90 pop r4 2767a: 3f 90 pop r3 2767c: 2f 90 pop r2 2767e: 08 95 ret SERIAL_ECHOLNRPGM(_n("Move aborted")); return; } // Prepare to set up new block block_t *block = &block_buffer[block_buffer_head]; 27680: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 27684: 29 2e mov r2, r25 27686: 31 2c mov r3, r1 27688: 8e e6 ldi r24, 0x6E ; 110 2768a: 98 9f mul r25, r24 2768c: d0 01 movw r26, r0 2768e: 11 24 eor r1, r1 27690: a3 96 adiw r28, 0x23 ; 35 27692: bf af std Y+63, r27 ; 0x3f 27694: ae af std Y+62, r26 ; 0x3e 27696: 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; 27698: cd 01 movw r24, r26 2769a: 82 5a subi r24, 0xA2 ; 162 2769c: 99 4f sbci r25, 0xF9 ; 249 2769e: fc 01 movw r30, r24 276a0: e9 5b subi r30, 0xB9 ; 185 276a2: ff 4f sbci r31, 0xFF ; 255 276a4: 10 82 st Z, r1 // Set sdlen for calculating sd position block->sdlen = 0; 276a6: 84 59 subi r24, 0x94 ; 148 276a8: 9f 4f sbci r25, 0xFF ; 255 276aa: fc 01 movw r30, r24 276ac: 11 82 std Z+1, r1 ; 0x01 276ae: 10 82 st Z, r1 // Save original start position of the move if (gcode_start_position) 276b0: 01 15 cp r16, r1 276b2: 11 05 cpc r17, r1 276b4: 11 f4 brne .+4 ; 0x276ba 276b6: 0d 94 ac 45 jmp 0x28b58 ; 0x28b58 memcpy(block->gcode_start_position, gcode_start_position, sizeof(block_t::gcode_start_position)); 276ba: 80 e1 ldi r24, 0x10 ; 16 276bc: f8 01 movw r30, r16 276be: aa 54 subi r26, 0x4A ; 74 276c0: b9 4f sbci r27, 0xF9 ; 249 else memcpy(block->gcode_start_position, current_position, sizeof(block_t::gcode_start_position)); 276c2: 01 90 ld r0, Z+ 276c4: 0d 92 st X+, r0 276c6: 8a 95 dec r24 276c8: e1 f7 brne .-8 ; 0x276c2 // Save the index of this segment (when a single G0/1/2/3 command plans multiple segments) block->segment_idx = segment_idx; 276ca: 8e e6 ldi r24, 0x6E ; 110 276cc: 82 9d mul r24, r2 276ce: 80 01 movw r16, r0 276d0: 83 9d mul r24, r3 276d2: 10 0d add r17, r0 276d4: 11 24 eor r1, r1 276d6: 02 5a subi r16, 0xA2 ; 162 276d8: 19 4f sbci r17, 0xF9 ; 249 276da: f8 01 movw r30, r16 276dc: e8 59 subi r30, 0x98 ; 152 276de: ff 4f sbci r31, 0xFF ; 255 276e0: c4 56 subi r28, 0x64 ; 100 276e2: df 4f sbci r29, 0xFF ; 255 276e4: 88 81 ld r24, Y 276e6: 99 81 ldd r25, Y+1 ; 0x01 276e8: cc 59 subi r28, 0x9C ; 156 276ea: d0 40 sbci r29, 0x00 ; 0 276ec: 91 83 std Z+1, r25 ; 0x01 276ee: 80 83 st Z, r24 // Save the global feedrate at scheduling time block->gcode_feedrate = feedrate; 276f0: 06 59 subi r16, 0x96 ; 150 276f2: 1f 4f sbci r17, 0xFF ; 255 276f4: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 276f8: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 276fc: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 27700: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 27704: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 27708: d8 01 movw r26, r16 2770a: 6d 93 st X+, r22 2770c: 7c 93 st X, r23 // Reset the starting E position when requested if (plan_reset_next_e_queue) 2770e: 80 91 21 04 lds r24, 0x0421 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.441> 27712: 88 23 and r24, r24 27714: a9 f0 breq .+42 ; 0x27740 { position[E_AXIS] = 0; 27716: 10 92 48 06 sts 0x0648, r1 ; 0x800648 2771a: 10 92 49 06 sts 0x0649, r1 ; 0x800649 2771e: 10 92 4a 06 sts 0x064A, r1 ; 0x80064a 27722: 10 92 4b 06 sts 0x064B, r1 ; 0x80064b #ifdef LIN_ADVANCE position_float[E_AXIS] = 0; 27726: 10 92 42 04 sts 0x0442, r1 ; 0x800442 2772a: 10 92 43 04 sts 0x0443, r1 ; 0x800443 2772e: 10 92 44 04 sts 0x0444, r1 ; 0x800444 27732: 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; 27736: 10 92 21 04 sts 0x0421, r1 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.441> plan_reset_next_e_sched = true; 2773a: 81 e0 ldi r24, 0x01 ; 1 2773c: 80 93 20 04 sts 0x0420, r24 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.442> } // Apply the machine correction matrix. world2machine(x, y); 27740: be 01 movw r22, r28 27742: 6b 5d subi r22, 0xDB ; 219 27744: 7f 4f sbci r23, 0xFF ; 255 27746: ce 01 movw r24, r28 27748: 81 96 adiw r24, 0x21 ; 33 2774a: 0e 94 c7 68 call 0xd18e ; 0xd18e // 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]); 2774e: c9 a0 ldd r12, Y+33 ; 0x21 27750: da a0 ldd r13, Y+34 ; 0x22 27752: eb a0 ldd r14, Y+35 ; 0x23 27754: fc a0 ldd r15, Y+36 ; 0x24 27756: 20 91 6b 0d lds r18, 0x0D6B ; 0x800d6b 2775a: 30 91 6c 0d lds r19, 0x0D6C ; 0x800d6c 2775e: 40 91 6d 0d lds r20, 0x0D6D ; 0x800d6d 27762: 50 91 6e 0d lds r21, 0x0D6E ; 0x800d6e 27766: c7 01 movw r24, r14 27768: b6 01 movw r22, r12 2776a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2776e: 0f 94 e6 a8 call 0x351cc ; 0x351cc 27772: c3 58 subi r28, 0x83 ; 131 27774: df 4f sbci r29, 0xFF ; 255 27776: 68 83 st Y, r22 27778: 79 83 std Y+1, r23 ; 0x01 2777a: 8a 83 std Y+2, r24 ; 0x02 2777c: 9b 83 std Y+3, r25 ; 0x03 2777e: cd 57 subi r28, 0x7D ; 125 27780: d0 40 sbci r29, 0x00 ; 0 target[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 27782: 8d a0 ldd r8, Y+37 ; 0x25 27784: 9e a0 ldd r9, Y+38 ; 0x26 27786: af a0 ldd r10, Y+39 ; 0x27 27788: b8 a4 ldd r11, Y+40 ; 0x28 2778a: 20 91 6f 0d lds r18, 0x0D6F ; 0x800d6f 2778e: 30 91 70 0d lds r19, 0x0D70 ; 0x800d70 27792: 40 91 71 0d lds r20, 0x0D71 ; 0x800d71 27796: 50 91 72 0d lds r21, 0x0D72 ; 0x800d72 2779a: c5 01 movw r24, r10 2779c: b4 01 movw r22, r8 2779e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 277a2: 0f 94 e6 a8 call 0x351cc ; 0x351cc 277a6: cf 57 subi r28, 0x7F ; 127 277a8: df 4f sbci r29, 0xFF ; 255 277aa: 68 83 st Y, r22 277ac: 79 83 std Y+1, r23 ; 0x01 277ae: 8a 83 std Y+2, r24 ; 0x02 277b0: 9b 83 std Y+3, r25 ; 0x03 277b2: c1 58 subi r28, 0x81 ; 129 277b4: d0 40 sbci r29, 0x00 ; 0 #ifdef MESH_BED_LEVELING if (mbl.active){ 277b6: 80 91 09 13 lds r24, 0x1309 ; 0x801309 277ba: 88 23 and r24, r24 277bc: 11 f4 brne .+4 ; 0x277c2 277be: 0d 94 b3 45 jmp 0x28b66 ; 0x28b66 target[Z_AXIS] = lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]); 277c2: a5 01 movw r20, r10 277c4: 94 01 movw r18, r8 277c6: c7 01 movw r24, r14 277c8: b6 01 movw r22, r12 277ca: 0f 94 19 92 call 0x32432 ; 0x32432 277ce: a7 96 adiw r28, 0x27 ; 39 277d0: 2c ad ldd r18, Y+60 ; 0x3c 277d2: 3d ad ldd r19, Y+61 ; 0x3d 277d4: 4e ad ldd r20, Y+62 ; 0x3e 277d6: 5f ad ldd r21, Y+63 ; 0x3f 277d8: a7 97 sbiw r28, 0x27 ; 39 277da: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 277de: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 277e2: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 277e6: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 277ea: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 }else{ target[Z_AXIS] = lround(z*cs.axis_steps_per_mm[Z_AXIS]); 277ee: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 277f2: 0f 94 e6 a8 call 0x351cc ; 0x351cc 277f6: e5 96 adiw r28, 0x35 ; 53 277f8: 6c af std Y+60, r22 ; 0x3c 277fa: 7d af std Y+61, r23 ; 0x3d 277fc: 8e af std Y+62, r24 ; 0x3e 277fe: 9f af std Y+63, r25 ; 0x3f 27800: 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]); 27802: a9 96 adiw r28, 0x29 ; 41 27804: ee ad ldd r30, Y+62 ; 0x3e 27806: ff ad ldd r31, Y+63 ; 0x3f 27808: a9 97 sbiw r28, 0x29 ; 41 2780a: 80 80 ld r8, Z 2780c: 91 80 ldd r9, Z+1 ; 0x01 2780e: a2 80 ldd r10, Z+2 ; 0x02 27810: b3 80 ldd r11, Z+3 ; 0x03 27812: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 27816: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 2781a: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 2781e: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 27822: c5 01 movw r24, r10 27824: b4 01 movw r22, r8 27826: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2782a: 0f 94 e6 a8 call 0x351cc ; 0x351cc 2782e: ad 96 adiw r28, 0x2d ; 45 27830: 6c af std Y+60, r22 ; 0x3c 27832: 7d af std Y+61, r23 ; 0x3d 27834: 8e af std Y+62, r24 ; 0x3e 27836: 9f af std Y+63, r25 ; 0x3f 27838: 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]; 2783a: 80 91 48 06 lds r24, 0x0648 ; 0x800648 2783e: 90 91 49 06 lds r25, 0x0649 ; 0x800649 27842: a0 91 4a 06 lds r26, 0x064A ; 0x80064a 27846: b0 91 4b 06 lds r27, 0x064B ; 0x80064b 2784a: ad 96 adiw r28, 0x2d ; 45 2784c: 4c ac ldd r4, Y+60 ; 0x3c 2784e: 5d ac ldd r5, Y+61 ; 0x3d 27850: 6e ac ldd r6, Y+62 ; 0x3e 27852: 7f ac ldd r7, Y+63 ; 0x3f 27854: ad 97 sbiw r28, 0x2d ; 45 27856: 48 1a sub r4, r24 27858: 59 0a sbc r5, r25 2785a: 6a 0a sbc r6, r26 2785c: 7b 0a sbc r7, r27 int32_t dx = target[X_AXIS] - position[X_AXIS]; 2785e: 80 91 3c 06 lds r24, 0x063C ; 0x80063c 27862: 90 91 3d 06 lds r25, 0x063D ; 0x80063d 27866: a0 91 3e 06 lds r26, 0x063E ; 0x80063e 2786a: b0 91 3f 06 lds r27, 0x063F ; 0x80063f 2786e: c3 58 subi r28, 0x83 ; 131 27870: df 4f sbci r29, 0xFF ; 255 27872: c8 80 ld r12, Y 27874: d9 80 ldd r13, Y+1 ; 0x01 27876: ea 80 ldd r14, Y+2 ; 0x02 27878: fb 80 ldd r15, Y+3 ; 0x03 2787a: cd 57 subi r28, 0x7D ; 125 2787c: d0 40 sbci r29, 0x00 ; 0 2787e: c8 1a sub r12, r24 27880: d9 0a sbc r13, r25 27882: ea 0a sbc r14, r26 27884: fb 0a sbc r15, r27 int32_t dy = target[Y_AXIS] - position[Y_AXIS]; 27886: 80 91 40 06 lds r24, 0x0640 ; 0x800640 2788a: 90 91 41 06 lds r25, 0x0641 ; 0x800641 2788e: a0 91 42 06 lds r26, 0x0642 ; 0x800642 27892: b0 91 43 06 lds r27, 0x0643 ; 0x800643 27896: cf 57 subi r28, 0x7F ; 127 27898: df 4f sbci r29, 0xFF ; 255 2789a: 28 81 ld r18, Y 2789c: 39 81 ldd r19, Y+1 ; 0x01 2789e: 4a 81 ldd r20, Y+2 ; 0x02 278a0: 5b 81 ldd r21, Y+3 ; 0x03 278a2: c1 58 subi r28, 0x81 ; 129 278a4: d0 40 sbci r29, 0x00 ; 0 278a6: 28 1b sub r18, r24 278a8: 39 0b sbc r19, r25 278aa: 4a 0b sbc r20, r26 278ac: 5b 0b sbc r21, r27 278ae: 29 a7 std Y+41, r18 ; 0x29 278b0: 3a a7 std Y+42, r19 ; 0x2a 278b2: 4b a7 std Y+43, r20 ; 0x2b 278b4: 5c a7 std Y+44, r21 ; 0x2c int32_t dz = target[Z_AXIS] - position[Z_AXIS]; 278b6: 80 91 44 06 lds r24, 0x0644 ; 0x800644 278ba: 90 91 45 06 lds r25, 0x0645 ; 0x800645 278be: a0 91 46 06 lds r26, 0x0646 ; 0x800646 278c2: b0 91 47 06 lds r27, 0x0647 ; 0x800647 278c6: e5 96 adiw r28, 0x35 ; 53 278c8: 2c ad ldd r18, Y+60 ; 0x3c 278ca: 3d ad ldd r19, Y+61 ; 0x3d 278cc: 4e ad ldd r20, Y+62 ; 0x3e 278ce: 5f ad ldd r21, Y+63 ; 0x3f 278d0: e5 97 sbiw r28, 0x35 ; 53 278d2: 28 1b sub r18, r24 278d4: 39 0b sbc r19, r25 278d6: 4a 0b sbc r20, r26 278d8: 5b 0b sbc r21, r27 278da: 2d a7 std Y+45, r18 ; 0x2d 278dc: 3e a7 std Y+46, r19 ; 0x2e 278de: 4f a7 std Y+47, r20 ; 0x2f 278e0: 58 ab std Y+48, r21 ; 0x30 #ifdef PREVENT_DANGEROUS_EXTRUDE if(de) 278e2: 41 14 cp r4, r1 278e4: 51 04 cpc r5, r1 278e6: 61 04 cpc r6, r1 278e8: 71 04 cpc r7, r1 278ea: 09 f4 brne .+2 ; 0x278ee 278ec: 80 c0 rjmp .+256 ; 0x279ee { if((int)degHotend(active_extruder) 278f2: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 278f6: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 278fa: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 278fe: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 27902: 20 91 57 02 lds r18, 0x0257 ; 0x800257 27906: 30 91 58 02 lds r19, 0x0258 ; 0x800258 2790a: 62 17 cp r22, r18 2790c: 73 07 cpc r23, r19 2790e: 0c f5 brge .+66 ; 0x27952 { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 27910: ad 96 adiw r28, 0x2d ; 45 27912: 8c ad ldd r24, Y+60 ; 0x3c 27914: 9d ad ldd r25, Y+61 ; 0x3d 27916: ae ad ldd r26, Y+62 ; 0x3e 27918: bf ad ldd r27, Y+63 ; 0x3f 2791a: ad 97 sbiw r28, 0x2d ; 45 2791c: 80 93 48 06 sts 0x0648, r24 ; 0x800648 27920: 90 93 49 06 sts 0x0649, r25 ; 0x800649 27924: a0 93 4a 06 sts 0x064A, r26 ; 0x80064a 27928: b0 93 4b 06 sts 0x064B, r27 ; 0x80064b #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 2792c: 80 92 42 04 sts 0x0442, r8 ; 0x800442 27930: 90 92 43 04 sts 0x0443, r9 ; 0x800443 27934: a0 92 44 04 sts 0x0444, r10 ; 0x800444 27938: b0 92 45 04 sts 0x0445, r11 ; 0x800445 #endif de = 0; // no difference SERIAL_ECHO_START; 2793c: 84 ee ldi r24, 0xE4 ; 228 2793e: 92 ea ldi r25, 0xA2 ; 162 27940: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNRPGM(_n(" cold extrusion prevented"));////MSG_ERR_COLD_EXTRUDE_STOP 27944: 80 ec ldi r24, 0xC0 ; 192 27946: 9a e6 ldi r25, 0x6A ; 106 27948: 0e 94 0e 7d call 0xfa1c ; 0xfa1c { 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 2794c: 41 2c mov r4, r1 2794e: 51 2c mov r5, r1 27950: 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) 27952: c3 01 movw r24, r6 27954: b2 01 movw r22, r4 27956: 77 fe sbrs r7, 7 27958: 07 c0 rjmp .+14 ; 0x27968 2795a: 66 27 eor r22, r22 2795c: 77 27 eor r23, r23 2795e: cb 01 movw r24, r22 27960: 64 19 sub r22, r4 27962: 75 09 sbc r23, r5 27964: 86 09 sbc r24, r6 27966: 97 09 sbc r25, r7 27968: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2796c: 4b 01 movw r8, r22 2796e: 5c 01 movw r10, r24 27970: 20 e0 ldi r18, 0x00 ; 0 27972: 30 e0 ldi r19, 0x00 ; 0 27974: 48 ee ldi r20, 0xE8 ; 232 27976: 53 e4 ldi r21, 0x43 ; 67 27978: 60 91 77 0d lds r22, 0x0D77 ; 0x800d77 2797c: 70 91 78 0d lds r23, 0x0D78 ; 0x800d78 27980: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 27984: 90 91 7a 0d lds r25, 0x0D7A ; 0x800d7a 27988: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2798c: 9b 01 movw r18, r22 2798e: ac 01 movw r20, r24 27990: c5 01 movw r24, r10 27992: b4 01 movw r22, r8 27994: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 27998: 18 16 cp r1, r24 2799a: 4c f5 brge .+82 ; 0x279ee { position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part 2799c: ad 96 adiw r28, 0x2d ; 45 2799e: 2c ad ldd r18, Y+60 ; 0x3c 279a0: 3d ad ldd r19, Y+61 ; 0x3d 279a2: 4e ad ldd r20, Y+62 ; 0x3e 279a4: 5f ad ldd r21, Y+63 ; 0x3f 279a6: ad 97 sbiw r28, 0x2d ; 45 279a8: 20 93 48 06 sts 0x0648, r18 ; 0x800648 279ac: 30 93 49 06 sts 0x0649, r19 ; 0x800649 279b0: 40 93 4a 06 sts 0x064A, r20 ; 0x80064a 279b4: 50 93 4b 06 sts 0x064B, r21 ; 0x80064b #ifdef LIN_ADVANCE position_float[E_AXIS] = e; 279b8: a9 96 adiw r28, 0x29 ; 41 279ba: ee ad ldd r30, Y+62 ; 0x3e 279bc: ff ad ldd r31, Y+63 ; 0x3f 279be: a9 97 sbiw r28, 0x29 ; 41 279c0: 80 81 ld r24, Z 279c2: 91 81 ldd r25, Z+1 ; 0x01 279c4: a2 81 ldd r26, Z+2 ; 0x02 279c6: b3 81 ldd r27, Z+3 ; 0x03 279c8: 80 93 42 04 sts 0x0442, r24 ; 0x800442 279cc: 90 93 43 04 sts 0x0443, r25 ; 0x800443 279d0: a0 93 44 04 sts 0x0444, r26 ; 0x800444 279d4: b0 93 45 04 sts 0x0445, r27 ; 0x800445 #endif de = 0; // no difference SERIAL_ECHO_START; 279d8: 84 ee ldi r24, 0xE4 ; 228 279da: 92 ea ldi r25, 0xA2 ; 162 279dc: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNRPGM(_n(" too long extrusion prevented"));////MSG_ERR_LONG_EXTRUDE_STOP 279e0: 82 ea ldi r24, 0xA2 ; 162 279e2: 9a e6 ldi r25, 0x6A ; 106 279e4: 0e 94 0e 7d call 0xfa1c ; 0xfa1c { 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 279e8: 41 2c mov r4, r1 279ea: 51 2c mov r5, r1 279ec: 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); 279ee: 8e e6 ldi r24, 0x6E ; 110 279f0: 82 9d mul r24, r2 279f2: f0 01 movw r30, r0 279f4: 83 9d mul r24, r3 279f6: f0 0d add r31, r0 279f8: 11 24 eor r1, r1 279fa: e2 5a subi r30, 0xA2 ; 162 279fc: f9 4f sbci r31, 0xF9 ; 249 279fe: d7 01 movw r26, r14 27a00: c6 01 movw r24, r12 27a02: f7 fe sbrs r15, 7 27a04: 07 c0 rjmp .+14 ; 0x27a14 27a06: 88 27 eor r24, r24 27a08: 99 27 eor r25, r25 27a0a: dc 01 movw r26, r24 27a0c: 8c 19 sub r24, r12 27a0e: 9d 09 sbc r25, r13 27a10: ae 09 sbc r26, r14 27a12: bf 09 sbc r27, r15 27a14: 80 83 st Z, r24 27a16: 91 83 std Z+1, r25 ; 0x01 27a18: a2 83 std Z+2, r26 ; 0x02 27a1a: b3 83 std Z+3, r27 ; 0x03 block->steps[Y_AXIS].wide = labs(dy); 27a1c: 8e e6 ldi r24, 0x6E ; 110 27a1e: 82 9d mul r24, r2 27a20: f0 01 movw r30, r0 27a22: 83 9d mul r24, r3 27a24: f0 0d add r31, r0 27a26: 11 24 eor r1, r1 27a28: e2 5a subi r30, 0xA2 ; 162 27a2a: f9 4f sbci r31, 0xF9 ; 249 27a2c: 89 a5 ldd r24, Y+41 ; 0x29 27a2e: 9a a5 ldd r25, Y+42 ; 0x2a 27a30: ab a5 ldd r26, Y+43 ; 0x2b 27a32: bc a5 ldd r27, Y+44 ; 0x2c 27a34: b7 ff sbrs r27, 7 27a36: 07 c0 rjmp .+14 ; 0x27a46 27a38: b0 95 com r27 27a3a: a0 95 com r26 27a3c: 90 95 com r25 27a3e: 81 95 neg r24 27a40: 9f 4f sbci r25, 0xFF ; 255 27a42: af 4f sbci r26, 0xFF ; 255 27a44: bf 4f sbci r27, 0xFF ; 255 27a46: 84 83 std Z+4, r24 ; 0x04 27a48: 95 83 std Z+5, r25 ; 0x05 27a4a: a6 83 std Z+6, r26 ; 0x06 27a4c: 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); 27a4e: 8e e6 ldi r24, 0x6E ; 110 27a50: 82 9d mul r24, r2 27a52: f0 01 movw r30, r0 27a54: 83 9d mul r24, r3 27a56: f0 0d add r31, r0 27a58: 11 24 eor r1, r1 27a5a: e2 5a subi r30, 0xA2 ; 162 27a5c: f9 4f sbci r31, 0xF9 ; 249 27a5e: 8d a5 ldd r24, Y+45 ; 0x2d 27a60: 9e a5 ldd r25, Y+46 ; 0x2e 27a62: af a5 ldd r26, Y+47 ; 0x2f 27a64: b8 a9 ldd r27, Y+48 ; 0x30 27a66: b7 ff sbrs r27, 7 27a68: 07 c0 rjmp .+14 ; 0x27a78 27a6a: b0 95 com r27 27a6c: a0 95 com r26 27a6e: 90 95 com r25 27a70: 81 95 neg r24 27a72: 9f 4f sbci r25, 0xFF ; 255 27a74: af 4f sbci r26, 0xFF ; 255 27a76: bf 4f sbci r27, 0xFF ; 255 27a78: 80 87 std Z+8, r24 ; 0x08 27a7a: 91 87 std Z+9, r25 ; 0x09 27a7c: a2 87 std Z+10, r26 ; 0x0a 27a7e: b3 87 std Z+11, r27 ; 0x0b block->steps[E_AXIS].wide = labs(de); 27a80: b3 01 movw r22, r6 27a82: a2 01 movw r20, r4 27a84: 77 fe sbrs r7, 7 27a86: 07 c0 rjmp .+14 ; 0x27a96 27a88: 44 27 eor r20, r20 27a8a: 55 27 eor r21, r21 27a8c: ba 01 movw r22, r20 27a8e: 44 19 sub r20, r4 27a90: 55 09 sbc r21, r5 27a92: 66 09 sbc r22, r6 27a94: 77 09 sbc r23, r7 27a96: 8e e6 ldi r24, 0x6E ; 110 27a98: 82 9d mul r24, r2 27a9a: f0 01 movw r30, r0 27a9c: 83 9d mul r24, r3 27a9e: f0 0d add r31, r0 27aa0: 11 24 eor r1, r1 27aa2: e2 5a subi r30, 0xA2 ; 162 27aa4: f9 4f sbci r31, 0xF9 ; 249 27aa6: 44 87 std Z+12, r20 ; 0x0c 27aa8: 55 87 std Z+13, r21 ; 0x0d 27aaa: 66 87 std Z+14, r22 ; 0x0e 27aac: 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))); 27aae: 00 81 ld r16, Z 27ab0: 11 81 ldd r17, Z+1 ; 0x01 27ab2: 22 81 ldd r18, Z+2 ; 0x02 27ab4: 33 81 ldd r19, Z+3 ; 0x03 27ab6: 84 81 ldd r24, Z+4 ; 0x04 27ab8: 95 81 ldd r25, Z+5 ; 0x05 27aba: a6 81 ldd r26, Z+6 ; 0x06 27abc: b7 81 ldd r27, Z+7 ; 0x07 27abe: 80 17 cp r24, r16 27ac0: 91 07 cpc r25, r17 27ac2: a2 07 cpc r26, r18 27ac4: b3 07 cpc r27, r19 27ac6: 14 f4 brge .+4 ; 0x27acc 27ac8: d9 01 movw r26, r18 27aca: c8 01 movw r24, r16 27acc: ee e6 ldi r30, 0x6E ; 110 27ace: be 2e mov r11, r30 27ad0: b2 9c mul r11, r2 27ad2: f0 01 movw r30, r0 27ad4: b3 9c mul r11, r3 27ad6: f0 0d add r31, r0 27ad8: 11 24 eor r1, r1 27ada: e2 5a subi r30, 0xA2 ; 162 27adc: f9 4f sbci r31, 0xF9 ; 249 27ade: 80 84 ldd r8, Z+8 ; 0x08 27ae0: 91 84 ldd r9, Z+9 ; 0x09 27ae2: a2 84 ldd r10, Z+10 ; 0x0a 27ae4: b3 84 ldd r11, Z+11 ; 0x0b 27ae6: 88 15 cp r24, r8 27ae8: 99 05 cpc r25, r9 27aea: aa 05 cpc r26, r10 27aec: bb 05 cpc r27, r11 27aee: 14 f4 brge .+4 ; 0x27af4 27af0: d5 01 movw r26, r10 27af2: c4 01 movw r24, r8 27af4: 84 17 cp r24, r20 27af6: 95 07 cpc r25, r21 27af8: a6 07 cpc r26, r22 27afa: b7 07 cpc r27, r23 27afc: 14 f4 brge .+4 ; 0x27b02 27afe: db 01 movw r26, r22 27b00: ca 01 movw r24, r20 27b02: 4e e6 ldi r20, 0x6E ; 110 27b04: 42 9d mul r20, r2 27b06: f0 01 movw r30, r0 27b08: 43 9d mul r20, r3 27b0a: f0 0d add r31, r0 27b0c: 11 24 eor r1, r1 27b0e: e2 5a subi r30, 0xA2 ; 162 27b10: f9 4f sbci r31, 0xF9 ; 249 27b12: 80 8b std Z+16, r24 ; 0x10 27b14: 91 8b std Z+17, r25 ; 0x11 27b16: a2 8b std Z+18, r26 ; 0x12 27b18: b3 8b std Z+19, r27 ; 0x13 // Bail if this is a zero-length block if (block->step_event_count.wide <= dropsegments) 27b1a: 06 97 sbiw r24, 0x06 ; 6 27b1c: a1 05 cpc r26, r1 27b1e: b1 05 cpc r27, r1 27b20: 0c f4 brge .+2 ; 0x27b24 27b22: 94 cd rjmp .-1240 ; 0x2764c planner_update_queue_min_counter(); #endif /* PLANNER_DIAGNOSTICS */ return; } block->fan_speed = fanSpeed; 27b24: 80 91 55 12 lds r24, 0x1255 ; 0x801255 27b28: df 01 movw r26, r30 27b2a: aa 5b subi r26, 0xBA ; 186 27b2c: bf 4f sbci r27, 0xFF ; 255 27b2e: 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); 27b30: f7 fe sbrs r15, 7 27b32: 02 c0 rjmp .+4 ; 0x27b38 27b34: 0d 94 c3 45 jmp 0x28b86 ; 0x28b86 } block->fan_speed = fanSpeed; // Compute direction bits for this block block->direction_bits = 0; 27b38: 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); 27b3a: 89 a5 ldd r24, Y+41 ; 0x29 27b3c: 9a a5 ldd r25, Y+42 ; 0x2a 27b3e: ab a5 ldd r26, Y+43 ; 0x2b 27b40: bc a5 ldd r27, Y+44 ; 0x2c 27b42: b7 ff sbrs r27, 7 27b44: 0b c0 rjmp .+22 ; 0x27b5c 27b46: 8e e6 ldi r24, 0x6E ; 110 27b48: 82 9d mul r24, r2 27b4a: f0 01 movw r30, r0 27b4c: 83 9d mul r24, r3 27b4e: f0 0d add r31, r0 27b50: 11 24 eor r1, r1 27b52: e2 5a subi r30, 0xA2 ; 162 27b54: f9 4f sbci r31, 0xF9 ; 249 27b56: 80 8d ldd r24, Z+24 ; 0x18 27b58: 82 60 ori r24, 0x02 ; 2 27b5a: 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); 27b5c: 8d a5 ldd r24, Y+45 ; 0x2d 27b5e: 9e a5 ldd r25, Y+46 ; 0x2e 27b60: af a5 ldd r26, Y+47 ; 0x2f 27b62: b8 a9 ldd r27, Y+48 ; 0x30 27b64: b7 ff sbrs r27, 7 27b66: 0b c0 rjmp .+22 ; 0x27b7e 27b68: 8e e6 ldi r24, 0x6E ; 110 27b6a: 82 9d mul r24, r2 27b6c: f0 01 movw r30, r0 27b6e: 83 9d mul r24, r3 27b70: f0 0d add r31, r0 27b72: 11 24 eor r1, r1 27b74: e2 5a subi r30, 0xA2 ; 162 27b76: f9 4f sbci r31, 0xF9 ; 249 27b78: 80 8d ldd r24, Z+24 ; 0x18 27b7a: 84 60 ori r24, 0x04 ; 4 27b7c: 80 8f std Z+24, r24 ; 0x18 if (de < 0) block->direction_bits |= _BV(E_AXIS); 27b7e: 77 fe sbrs r7, 7 27b80: 0b c0 rjmp .+22 ; 0x27b98 27b82: 8e e6 ldi r24, 0x6E ; 110 27b84: 82 9d mul r24, r2 27b86: f0 01 movw r30, r0 27b88: 83 9d mul r24, r3 27b8a: f0 0d add r31, r0 27b8c: 11 24 eor r1, r1 27b8e: e2 5a subi r30, 0xA2 ; 162 27b90: f9 4f sbci r31, 0xF9 ; 249 27b92: 80 8d ldd r24, Z+24 ; 0x18 27b94: 88 60 ori r24, 0x08 ; 8 27b96: 80 8f std Z+24, r24 ; 0x18 { enable_x(); enable_y(); } #else if(block->steps[X_AXIS].wide != 0) enable_x(); 27b98: 01 2b or r16, r17 27b9a: 02 2b or r16, r18 27b9c: 03 2b or r16, r19 27b9e: 09 f0 breq .+2 ; 0x27ba2 27ba0: 17 98 cbi 0x02, 7 ; 2 if(block->steps[Y_AXIS].wide != 0) enable_y(); 27ba2: 8e e6 ldi r24, 0x6E ; 110 27ba4: 82 9d mul r24, r2 27ba6: f0 01 movw r30, r0 27ba8: 83 9d mul r24, r3 27baa: f0 0d add r31, r0 27bac: 11 24 eor r1, r1 27bae: e2 5a subi r30, 0xA2 ; 162 27bb0: f9 4f sbci r31, 0xF9 ; 249 27bb2: 84 81 ldd r24, Z+4 ; 0x04 27bb4: 95 81 ldd r25, Z+5 ; 0x05 27bb6: a6 81 ldd r26, Z+6 ; 0x06 27bb8: b7 81 ldd r27, Z+7 ; 0x07 27bba: 89 2b or r24, r25 27bbc: 8a 2b or r24, r26 27bbe: 8b 2b or r24, r27 27bc0: 09 f0 breq .+2 ; 0x27bc4 27bc2: 16 98 cbi 0x02, 6 ; 2 #endif if(block->steps[Z_AXIS].wide != 0) enable_z(); 27bc4: 8e e6 ldi r24, 0x6E ; 110 27bc6: 82 9d mul r24, r2 27bc8: f0 01 movw r30, r0 27bca: 83 9d mul r24, r3 27bcc: f0 0d add r31, r0 27bce: 11 24 eor r1, r1 27bd0: e2 5a subi r30, 0xA2 ; 162 27bd2: f9 4f sbci r31, 0xF9 ; 249 27bd4: 80 85 ldd r24, Z+8 ; 0x08 27bd6: 91 85 ldd r25, Z+9 ; 0x09 27bd8: a2 85 ldd r26, Z+10 ; 0x0a 27bda: b3 85 ldd r27, Z+11 ; 0x0b 27bdc: 89 2b or r24, r25 27bde: 8a 2b or r24, r26 27be0: 8b 2b or r24, r27 27be2: 09 f0 breq .+2 ; 0x27be6 27be4: 15 98 cbi 0x02, 5 ; 2 if(block->steps[E_AXIS].wide != 0) enable_e0(); 27be6: 8e e6 ldi r24, 0x6E ; 110 27be8: 82 9d mul r24, r2 27bea: f0 01 movw r30, r0 27bec: 83 9d mul r24, r3 27bee: f0 0d add r31, r0 27bf0: 11 24 eor r1, r1 27bf2: e2 5a subi r30, 0xA2 ; 162 27bf4: f9 4f sbci r31, 0xF9 ; 249 27bf6: 84 85 ldd r24, Z+12 ; 0x0c 27bf8: 95 85 ldd r25, Z+13 ; 0x0d 27bfa: a6 85 ldd r26, Z+14 ; 0x0e 27bfc: b7 85 ldd r27, Z+15 ; 0x0f 27bfe: 89 2b or r24, r25 27c00: 8a 2b or r24, r26 27c02: 8b 2b or r24, r27 27c04: 09 f0 breq .+2 ; 0x27c08 27c06: 14 98 cbi 0x02, 4 ; 2 if (block->steps[E_AXIS].wide == 0) 27c08: 8e e6 ldi r24, 0x6E ; 110 27c0a: 82 9d mul r24, r2 27c0c: f0 01 movw r30, r0 27c0e: 83 9d mul r24, r3 27c10: f0 0d add r31, r0 27c12: 11 24 eor r1, r1 27c14: e2 5a subi r30, 0xA2 ; 162 27c16: f9 4f sbci r31, 0xF9 ; 249 27c18: 24 85 ldd r18, Z+12 ; 0x0c 27c1a: 35 85 ldd r19, Z+13 ; 0x0d 27c1c: 46 85 ldd r20, Z+14 ; 0x0e 27c1e: 57 85 ldd r21, Z+15 ; 0x0f 27c20: 2a 96 adiw r28, 0x0a ; 10 27c22: 2c af std Y+60, r18 ; 0x3c 27c24: 3d af std Y+61, r19 ; 0x3d 27c26: 4e af std Y+62, r20 ; 0x3e 27c28: 5f af std Y+63, r21 ; 0x3f 27c2a: 2a 97 sbiw r28, 0x0a ; 10 27c2c: 23 2b or r18, r19 27c2e: 24 2b or r18, r20 27c30: 25 2b or r18, r21 27c32: 09 f0 breq .+2 ; 0x27c36 27c34: ac c7 rjmp .+3928 ; 0x28b8e { if(feed_rate 27c3a: b0 90 a8 0d lds r11, 0x0DA8 ; 0x800da8 27c3e: 00 91 a9 0d lds r16, 0x0DA9 ; 0x800da9 27c42: 10 91 aa 0d lds r17, 0x0DAA ; 0x800daa } else { if(feed_rate 27c56: 18 16 cp r1, r24 27c58: 24 f4 brge .+8 ; 0x27c62 27c5a: a9 ae std Y+57, r10 ; 0x39 27c5c: b9 aa std Y+49, r11 ; 0x31 27c5e: 0d af std Y+61, r16 ; 0x3d 27c60: 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]; 27c62: c7 01 movw r24, r14 27c64: b6 01 movw r22, r12 27c66: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 27c6a: 20 91 6b 0d lds r18, 0x0D6B ; 0x800d6b 27c6e: 30 91 6c 0d lds r19, 0x0D6C ; 0x800d6c 27c72: 40 91 6d 0d lds r20, 0x0D6D ; 0x800d6d 27c76: 50 91 6e 0d lds r21, 0x0D6E ; 0x800d6e 27c7a: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 27c7e: 4b 01 movw r8, r22 27c80: 5c 01 movw r10, r24 27c82: 89 82 std Y+1, r8 ; 0x01 27c84: 9a 82 std Y+2, r9 ; 0x02 27c86: ab 82 std Y+3, r10 ; 0x03 27c88: bc 82 std Y+4, r11 ; 0x04 delta_mm[Y_AXIS] = dy / cs.axis_steps_per_mm[Y_AXIS]; 27c8a: 69 a5 ldd r22, Y+41 ; 0x29 27c8c: 7a a5 ldd r23, Y+42 ; 0x2a 27c8e: 8b a5 ldd r24, Y+43 ; 0x2b 27c90: 9c a5 ldd r25, Y+44 ; 0x2c 27c92: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 27c96: 20 91 6f 0d lds r18, 0x0D6F ; 0x800d6f 27c9a: 30 91 70 0d lds r19, 0x0D70 ; 0x800d70 27c9e: 40 91 71 0d lds r20, 0x0D71 ; 0x800d71 27ca2: 50 91 72 0d lds r21, 0x0D72 ; 0x800d72 27ca6: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 27caa: 6b 01 movw r12, r22 27cac: 7c 01 movw r14, r24 27cae: cd 82 std Y+5, r12 ; 0x05 27cb0: de 82 std Y+6, r13 ; 0x06 27cb2: ef 82 std Y+7, r14 ; 0x07 27cb4: 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]; 27cb6: 6d a5 ldd r22, Y+45 ; 0x2d 27cb8: 7e a5 ldd r23, Y+46 ; 0x2e 27cba: 8f a5 ldd r24, Y+47 ; 0x2f 27cbc: 98 a9 ldd r25, Y+48 ; 0x30 27cbe: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 27cc2: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 27cc6: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 27cca: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 27cce: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 27cd2: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 27cd6: 22 96 adiw r28, 0x02 ; 2 27cd8: 6c af std Y+60, r22 ; 0x3c 27cda: 7d af std Y+61, r23 ; 0x3d 27cdc: 8e af std Y+62, r24 ; 0x3e 27cde: 9f af std Y+63, r25 ; 0x3f 27ce0: 22 97 sbiw r28, 0x02 ; 2 27ce2: 69 87 std Y+9, r22 ; 0x09 27ce4: 7a 87 std Y+10, r23 ; 0x0a 27ce6: 8b 87 std Y+11, r24 ; 0x0b 27ce8: 9c 87 std Y+12, r25 ; 0x0c delta_mm[E_AXIS] = de / cs.axis_steps_per_mm[E_AXIS]; 27cea: c3 01 movw r24, r6 27cec: b2 01 movw r22, r4 27cee: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 27cf2: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 27cf6: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 27cfa: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 27cfe: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 27d02: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 27d06: 26 96 adiw r28, 0x06 ; 6 27d08: 6c af std Y+60, r22 ; 0x3c 27d0a: 7d af std Y+61, r23 ; 0x3d 27d0c: 8e af std Y+62, r24 ; 0x3e 27d0e: 9f af std Y+63, r25 ; 0x3f 27d10: 26 97 sbiw r28, 0x06 ; 6 27d12: 6d 87 std Y+13, r22 ; 0x0d 27d14: 7e 87 std Y+14, r23 ; 0x0e 27d16: 8f 87 std Y+15, r24 ; 0x0f 27d18: 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 ) 27d1a: 8e e6 ldi r24, 0x6E ; 110 27d1c: 82 9d mul r24, r2 27d1e: f0 01 movw r30, r0 27d20: 83 9d mul r24, r3 27d22: f0 0d add r31, r0 27d24: 11 24 eor r1, r1 27d26: e2 5a subi r30, 0xA2 ; 162 27d28: f9 4f sbci r31, 0xF9 ; 249 27d2a: 80 81 ld r24, Z 27d2c: 91 81 ldd r25, Z+1 ; 0x01 27d2e: a2 81 ldd r26, Z+2 ; 0x02 27d30: b3 81 ldd r27, Z+3 ; 0x03 27d32: 2e 96 adiw r28, 0x0e ; 14 27d34: 8c af std Y+60, r24 ; 0x3c 27d36: 9d af std Y+61, r25 ; 0x3d 27d38: ae af std Y+62, r26 ; 0x3e 27d3a: bf af std Y+63, r27 ; 0x3f 27d3c: 2e 97 sbiw r28, 0x0e ; 14 27d3e: 06 97 sbiw r24, 0x06 ; 6 27d40: a1 05 cpc r26, r1 27d42: b1 05 cpc r27, r1 27d44: 0c f0 brlt .+2 ; 0x27d48 27d46: 2c c7 rjmp .+3672 ; 0x28ba0 27d48: 84 81 ldd r24, Z+4 ; 0x04 27d4a: 95 81 ldd r25, Z+5 ; 0x05 27d4c: a6 81 ldd r26, Z+6 ; 0x06 27d4e: b7 81 ldd r27, Z+7 ; 0x07 27d50: 06 97 sbiw r24, 0x06 ; 6 27d52: a1 05 cpc r26, r1 27d54: b1 05 cpc r27, r1 27d56: 0c f0 brlt .+2 ; 0x27d5a 27d58: 23 c7 rjmp .+3654 ; 0x28ba0 27d5a: 80 85 ldd r24, Z+8 ; 0x08 27d5c: 91 85 ldd r25, Z+9 ; 0x09 27d5e: a2 85 ldd r26, Z+10 ; 0x0a 27d60: b3 85 ldd r27, Z+11 ; 0x0b 27d62: 06 97 sbiw r24, 0x06 ; 6 27d64: a1 05 cpc r26, r1 27d66: b1 05 cpc r27, r1 27d68: 0c f0 brlt .+2 ; 0x27d6c 27d6a: 1a c7 rjmp .+3636 ; 0x28ba0 { block->millimeters = fabs(delta_mm[E_AXIS]); 27d6c: 26 96 adiw r28, 0x06 ; 6 27d6e: 8c ad ldd r24, Y+60 ; 0x3c 27d70: 9d ad ldd r25, Y+61 ; 0x3d 27d72: ae ad ldd r26, Y+62 ; 0x3e 27d74: bf ad ldd r27, Y+63 ; 0x3f 27d76: 26 97 sbiw r28, 0x06 ; 6 27d78: bf 77 andi r27, 0x7F ; 127 27d7a: 85 a7 std Z+45, r24 ; 0x2d 27d7c: 96 a7 std Z+46, r25 ; 0x2e 27d7e: a7 a7 std Z+47, r26 ; 0x2f 27d80: 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 27d82: 8e e6 ldi r24, 0x6E ; 110 27d84: 82 9d mul r24, r2 27d86: f0 01 movw r30, r0 27d88: 83 9d mul r24, r3 27d8a: f0 0d add r31, r0 27d8c: 11 24 eor r1, r1 27d8e: e2 5a subi r30, 0xA2 ; 162 27d90: f9 4f sbci r31, 0xF9 ; 249 27d92: 45 a4 ldd r4, Z+45 ; 0x2d 27d94: 56 a4 ldd r5, Z+46 ; 0x2e 27d96: 67 a4 ldd r6, Z+47 ; 0x2f 27d98: 70 a8 ldd r7, Z+48 ; 0x30 27d9a: a3 01 movw r20, r6 27d9c: 92 01 movw r18, r4 27d9e: 60 e0 ldi r22, 0x00 ; 0 27da0: 70 e0 ldi r23, 0x00 ; 0 27da2: 80 e8 ldi r24, 0x80 ; 128 27da4: 9f e3 ldi r25, 0x3F ; 63 27da6: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> // Calculate speed in mm/second for each axis. No divide by zero due to previous checks. float inverse_second = feed_rate * inverse_millimeters; 27daa: 29 ad ldd r18, Y+57 ; 0x39 27dac: 39 a9 ldd r19, Y+49 ; 0x31 27dae: 4d ad ldd r20, Y+61 ; 0x3d 27db0: 5d a9 ldd r21, Y+53 ; 0x35 27db2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 27db6: 6b 01 movw r12, r22 27db8: 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); 27dba: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 27dbe: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 27dc2: 89 1b sub r24, r25 27dc4: 8f 70 andi r24, 0x0F ; 15 27dc6: 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)) { 27dc8: 82 50 subi r24, 0x02 ; 2 27dca: 86 30 cpi r24, 0x06 ; 6 27dcc: 08 f0 brcs .+2 ; 0x27dd0 27dce: 40 c0 rjmp .+128 ; 0x27e50 // segment time in micro seconds unsigned long segment_time = lround(1000000.0/inverse_second); 27dd0: a7 01 movw r20, r14 27dd2: 96 01 movw r18, r12 27dd4: 60 e0 ldi r22, 0x00 ; 0 27dd6: 74 e2 ldi r23, 0x24 ; 36 27dd8: 84 e7 ldi r24, 0x74 ; 116 27dda: 99 e4 ldi r25, 0x49 ; 73 27ddc: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 27de0: 0f 94 e6 a8 call 0x351cc ; 0x351cc 27de4: 4b 01 movw r8, r22 27de6: 5c 01 movw r10, r24 if (segment_time < cs.min_segment_time_us) 27de8: 80 91 ab 0d lds r24, 0x0DAB ; 0x800dab 27dec: 90 91 ac 0d lds r25, 0x0DAC ; 0x800dac 27df0: a0 91 ad 0d lds r26, 0x0DAD ; 0x800dad 27df4: b0 91 ae 0d lds r27, 0x0DAE ; 0x800dae 27df8: 88 16 cp r8, r24 27dfa: 99 06 cpc r9, r25 27dfc: aa 06 cpc r10, r26 27dfe: bb 06 cpc r11, r27 27e00: 38 f5 brcc .+78 ; 0x27e50 // 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)); 27e02: bc 01 movw r22, r24 27e04: cd 01 movw r24, r26 27e06: 68 19 sub r22, r8 27e08: 79 09 sbc r23, r9 27e0a: 8a 09 sbc r24, r10 27e0c: 9b 09 sbc r25, r11 27e0e: 66 0f add r22, r22 27e10: 77 1f adc r23, r23 27e12: 88 1f adc r24, r24 27e14: 99 1f adc r25, r25 27e16: ad ad ldd r26, Y+61 ; 0x3d 27e18: 2a 2f mov r18, r26 27e1a: 30 e0 ldi r19, 0x00 ; 0 27e1c: 50 e0 ldi r21, 0x00 ; 0 27e1e: 40 e0 ldi r20, 0x00 ; 0 27e20: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 27e24: ca 01 movw r24, r20 27e26: b9 01 movw r22, r18 27e28: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 27e2c: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 27e30: 68 0d add r22, r8 27e32: 79 1d adc r23, r9 27e34: 8a 1d adc r24, r10 27e36: 9b 1d adc r25, r11 27e38: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 27e3c: 9b 01 movw r18, r22 27e3e: ac 01 movw r20, r24 27e40: 60 e0 ldi r22, 0x00 ; 0 27e42: 74 e2 ldi r23, 0x24 ; 36 27e44: 84 e7 ldi r24, 0x74 ; 116 27e46: 99 e4 ldi r25, 0x49 ; 73 27e48: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 27e4c: 6b 01 movw r12, r22 27e4e: 7c 01 movw r14, r24 } #endif // SLOWDOWN block->nominal_speed = block->millimeters * inverse_second; // (mm/sec) Always > 0 27e50: a3 01 movw r20, r6 27e52: 92 01 movw r18, r4 27e54: c7 01 movw r24, r14 27e56: b6 01 movw r22, r12 27e58: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 27e5c: 6d ab std Y+53, r22 ; 0x35 27e5e: 7e ab std Y+54, r23 ; 0x36 27e60: 8f ab std Y+55, r24 ; 0x37 27e62: 98 af std Y+56, r25 ; 0x38 27e64: 8e e6 ldi r24, 0x6E ; 110 27e66: 82 9d mul r24, r2 27e68: 80 01 movw r16, r0 27e6a: 83 9d mul r24, r3 27e6c: 10 0d add r17, r0 27e6e: 11 24 eor r1, r1 27e70: 02 5a subi r16, 0xA2 ; 162 27e72: 19 4f sbci r17, 0xF9 ; 249 27e74: 2d a9 ldd r18, Y+53 ; 0x35 27e76: 3e a9 ldd r19, Y+54 ; 0x36 27e78: 4f a9 ldd r20, Y+55 ; 0x37 27e7a: 58 ad ldd r21, Y+56 ; 0x38 27e7c: d8 01 movw r26, r16 27e7e: 91 96 adiw r26, 0x21 ; 33 27e80: 2d 93 st X+, r18 27e82: 3d 93 st X+, r19 27e84: 4d 93 st X+, r20 27e86: 5c 93 st X, r21 27e88: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate = ceil(block->step_event_count.wide * inverse_second); // (step/sec) Always > 0 27e8a: 50 96 adiw r26, 0x10 ; 16 27e8c: 6d 91 ld r22, X+ 27e8e: 7d 91 ld r23, X+ 27e90: 8d 91 ld r24, X+ 27e92: 9c 91 ld r25, X 27e94: 53 97 sbiw r26, 0x13 ; 19 27e96: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 27e9a: 69 af std Y+57, r22 ; 0x39 27e9c: 7a af std Y+58, r23 ; 0x3a 27e9e: 8b af std Y+59, r24 ; 0x3b 27ea0: 9c af std Y+60, r25 ; 0x3c 27ea2: 9b 01 movw r18, r22 27ea4: ac 01 movw r20, r24 27ea6: c7 01 movw r24, r14 27ea8: b6 01 movw r22, r12 27eaa: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 27eae: 0f 94 87 a6 call 0x34d0e ; 0x34d0e 27eb2: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 27eb6: 62 96 adiw r28, 0x12 ; 18 27eb8: 6c af std Y+60, r22 ; 0x3c 27eba: 7d af std Y+61, r23 ; 0x3d 27ebc: 8e af std Y+62, r24 ; 0x3e 27ebe: 9f af std Y+63, r25 ; 0x3f 27ec0: 62 97 sbiw r28, 0x12 ; 18 27ec2: f8 01 movw r30, r16 27ec4: 66 ab std Z+54, r22 ; 0x36 27ec6: 77 ab std Z+55, r23 ; 0x37 27ec8: 80 af std Z+56, r24 ; 0x38 27eca: 91 af std Z+57, r25 ; 0x39 27ecc: 9e 01 movw r18, r28 27ece: 2f 5f subi r18, 0xFF ; 255 27ed0: 3f 4f sbci r19, 0xFF ; 255 27ed2: 3a ab std Y+50, r19 ; 0x32 27ed4: 29 ab std Y+49, r18 ; 0x31 27ed6: ae 01 movw r20, r28 27ed8: 4f 5e subi r20, 0xEF ; 239 27eda: 5f 4f sbci r21, 0xFF ; 255 27edc: 6e 96 adiw r28, 0x1e ; 30 27ede: 5f af std Y+63, r21 ; 0x3f 27ee0: 4e af std Y+62, r20 ; 0x3e 27ee2: 6e 97 sbiw r28, 0x1e ; 30 27ee4: 8b e7 ldi r24, 0x7B ; 123 27ee6: 9d e0 ldi r25, 0x0D ; 13 27ee8: 68 96 adiw r28, 0x18 ; 24 27eea: 9f af std Y+63, r25 ; 0x3f 27eec: 8e af std Y+62, r24 ; 0x3e 27eee: 68 97 sbiw r28, 0x18 ; 24 27ef0: 6c 96 adiw r28, 0x1c ; 28 27ef2: 5f af std Y+63, r21 ; 0x3f 27ef4: 4e af std Y+62, r20 ; 0x3e 27ef6: 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 27ef8: 19 a6 std Y+41, r1 ; 0x29 27efa: 1d a6 std Y+45, r1 ; 0x2d 27efc: 00 e8 ldi r16, 0x80 ; 128 27efe: 1f e3 ldi r17, 0x3F ; 63 for(int i=0; i < 4; i++) { current_speed[i] = delta_mm[i] * inverse_second; 27f00: a9 a9 ldd r26, Y+49 ; 0x31 27f02: ba a9 ldd r27, Y+50 ; 0x32 27f04: 2d 91 ld r18, X+ 27f06: 3d 91 ld r19, X+ 27f08: 4d 91 ld r20, X+ 27f0a: 5d 91 ld r21, X+ 27f0c: ba ab std Y+50, r27 ; 0x32 27f0e: a9 ab std Y+49, r26 ; 0x31 27f10: c7 01 movw r24, r14 27f12: b6 01 movw r22, r12 27f14: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 27f18: 6c 96 adiw r28, 0x1c ; 28 27f1a: ee ad ldd r30, Y+62 ; 0x3e 27f1c: ff ad ldd r31, Y+63 ; 0x3f 27f1e: 6c 97 sbiw r28, 0x1c ; 28 27f20: 61 93 st Z+, r22 27f22: 71 93 st Z+, r23 27f24: 81 93 st Z+, r24 27f26: 91 93 st Z+, r25 27f28: 6c 96 adiw r28, 0x1c ; 28 27f2a: ff af std Y+63, r31 ; 0x3f 27f2c: ee af std Y+62, r30 ; 0x3e 27f2e: 6c 97 sbiw r28, 0x1c ; 28 if(fabs(current_speed[i]) > max_feedrate[i]) 27f30: 4b 01 movw r8, r22 27f32: 5c 01 movw r10, r24 27f34: e8 94 clt 27f36: b7 f8 bld r11, 7 27f38: 68 96 adiw r28, 0x18 ; 24 27f3a: ae ad ldd r26, Y+62 ; 0x3e 27f3c: bf ad ldd r27, Y+63 ; 0x3f 27f3e: 68 97 sbiw r28, 0x18 ; 24 27f40: 2d 91 ld r18, X+ 27f42: 3d 91 ld r19, X+ 27f44: 4d 91 ld r20, X+ 27f46: 5d 91 ld r21, X+ 27f48: 68 96 adiw r28, 0x18 ; 24 27f4a: bf af std Y+63, r27 ; 0x3f 27f4c: ae af std Y+62, r26 ; 0x3e 27f4e: 68 97 sbiw r28, 0x18 ; 24 27f50: 66 96 adiw r28, 0x16 ; 22 27f52: 2c af std Y+60, r18 ; 0x3c 27f54: 3d af std Y+61, r19 ; 0x3d 27f56: 4e af std Y+62, r20 ; 0x3e 27f58: 5f af std Y+63, r21 ; 0x3f 27f5a: 66 97 sbiw r28, 0x16 ; 22 27f5c: c5 01 movw r24, r10 27f5e: b4 01 movw r22, r8 27f60: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 27f64: 18 16 cp r1, r24 27f66: b4 f4 brge .+44 ; 0x27f94 { speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); 27f68: a5 01 movw r20, r10 27f6a: 94 01 movw r18, r8 27f6c: 66 96 adiw r28, 0x16 ; 22 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: 66 97 sbiw r28, 0x16 ; 22 27f78: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 27f7c: 4b 01 movw r8, r22 27f7e: 5c 01 movw r10, r24 27f80: 29 a5 ldd r18, Y+41 ; 0x29 27f82: 3d a5 ldd r19, Y+45 ; 0x2d 27f84: a8 01 movw r20, r16 27f86: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 27f8a: 18 16 cp r1, r24 27f8c: 1c f0 brlt .+6 ; 0x27f94 27f8e: 89 a6 std Y+41, r8 ; 0x29 27f90: 9d a6 std Y+45, r9 ; 0x2d 27f92: 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++) 27f94: 6e 96 adiw r28, 0x1e ; 30 27f96: ee ad ldd r30, Y+62 ; 0x3e 27f98: ff ad ldd r31, Y+63 ; 0x3f 27f9a: 6e 97 sbiw r28, 0x1e ; 30 27f9c: 29 a9 ldd r18, Y+49 ; 0x31 27f9e: 3a a9 ldd r19, Y+50 ; 0x32 27fa0: e2 17 cp r30, r18 27fa2: f3 07 cpc r31, r19 27fa4: 09 f0 breq .+2 ; 0x27fa8 27fa6: ac cf rjmp .-168 ; 0x27f00 speed_factor = min(speed_factor, max_feedrate[i] / fabs(current_speed[i])); } } // Correct the speed if( speed_factor < 1.0) 27fa8: 20 e0 ldi r18, 0x00 ; 0 27faa: 30 e0 ldi r19, 0x00 ; 0 27fac: 40 e8 ldi r20, 0x80 ; 128 27fae: 5f e3 ldi r21, 0x3F ; 63 27fb0: 69 a5 ldd r22, Y+41 ; 0x29 27fb2: 7d a5 ldd r23, Y+45 ; 0x2d 27fb4: c8 01 movw r24, r16 27fb6: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 27fba: 87 ff sbrs r24, 7 27fbc: 50 c0 rjmp .+160 ; 0x2805e 27fbe: 6e 96 adiw r28, 0x1e ; 30 27fc0: ae ac ldd r10, Y+62 ; 0x3e 27fc2: bf ac ldd r11, Y+63 ; 0x3f 27fc4: 6e 97 sbiw r28, 0x1e ; 30 27fc6: 30 e1 ldi r19, 0x10 ; 16 27fc8: a3 0e add r10, r19 27fca: b1 1c adc r11, r1 27fcc: 6e 96 adiw r28, 0x1e ; 30 27fce: ce ac ldd r12, Y+62 ; 0x3e 27fd0: df ac ldd r13, Y+63 ; 0x3f 27fd2: 6e 97 sbiw r28, 0x1e ; 30 { for(unsigned char i=0; i < 4; i++) { current_speed[i] *= speed_factor; 27fd4: d6 01 movw r26, r12 27fd6: 6d 91 ld r22, X+ 27fd8: 7d 91 ld r23, X+ 27fda: 8d 91 ld r24, X+ 27fdc: 9d 91 ld r25, X+ 27fde: 6d 01 movw r12, r26 27fe0: 7d 01 movw r14, r26 27fe2: b4 e0 ldi r27, 0x04 ; 4 27fe4: eb 1a sub r14, r27 27fe6: f1 08 sbc r15, r1 27fe8: 29 a5 ldd r18, Y+41 ; 0x29 27fea: 3d a5 ldd r19, Y+45 ; 0x2d 27fec: a8 01 movw r20, r16 27fee: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 27ff2: f7 01 movw r30, r14 27ff4: 60 83 st Z, r22 27ff6: 71 83 std Z+1, r23 ; 0x01 27ff8: 82 83 std Z+2, r24 ; 0x02 27ffa: 93 83 std Z+3, r25 ; 0x03 } // Correct the speed if( speed_factor < 1.0) { for(unsigned char i=0; i < 4; i++) 27ffc: ac 14 cp r10, r12 27ffe: bd 04 cpc r11, r13 28000: 49 f7 brne .-46 ; 0x27fd4 { current_speed[i] *= speed_factor; } block->nominal_speed *= speed_factor; 28002: 2e e6 ldi r18, 0x6E ; 110 28004: 22 9d mul r18, r2 28006: c0 01 movw r24, r0 28008: 23 9d mul r18, r3 2800a: 90 0d add r25, r0 2800c: 11 24 eor r1, r1 2800e: 9c 01 movw r18, r24 28010: 22 5a subi r18, 0xA2 ; 162 28012: 39 4f sbci r19, 0xF9 ; 249 28014: 79 01 movw r14, r18 28016: 29 a5 ldd r18, Y+41 ; 0x29 28018: 3d a5 ldd r19, Y+45 ; 0x2d 2801a: a8 01 movw r20, r16 2801c: 6d a9 ldd r22, Y+53 ; 0x35 2801e: 7e a9 ldd r23, Y+54 ; 0x36 28020: 8f a9 ldd r24, Y+55 ; 0x37 28022: 98 ad ldd r25, Y+56 ; 0x38 28024: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28028: d7 01 movw r26, r14 2802a: 91 96 adiw r26, 0x21 ; 33 2802c: 6d 93 st X+, r22 2802e: 7d 93 st X+, r23 28030: 8d 93 st X+, r24 28032: 9c 93 st X, r25 28034: 94 97 sbiw r26, 0x24 ; 36 block->nominal_rate *= speed_factor; 28036: 62 96 adiw r28, 0x12 ; 18 28038: 6c ad ldd r22, Y+60 ; 0x3c 2803a: 7d ad ldd r23, Y+61 ; 0x3d 2803c: 8e ad ldd r24, Y+62 ; 0x3e 2803e: 9f ad ldd r25, Y+63 ; 0x3f 28040: 62 97 sbiw r28, 0x12 ; 18 28042: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 28046: 29 a5 ldd r18, Y+41 ; 0x29 28048: 3d a5 ldd r19, Y+45 ; 0x2d 2804a: a8 01 movw r20, r16 2804c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28050: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 28054: f7 01 movw r30, r14 28056: 66 ab std Z+54, r22 ; 0x36 28058: 77 ab std Z+55, r23 ; 0x37 2805a: 80 af std Z+56, r24 ; 0x38 2805c: 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; 2805e: a3 01 movw r20, r6 28060: 92 01 movw r18, r4 28062: 69 ad ldd r22, Y+57 ; 0x39 28064: 7a ad ldd r23, Y+58 ; 0x3a 28066: 8b ad ldd r24, Y+59 ; 0x3b 28068: 9c ad ldd r25, Y+60 ; 0x3c 2806a: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 2806e: 69 a7 std Y+41, r22 ; 0x29 28070: 7a a7 std Y+42, r23 ; 0x2a 28072: 8b a7 std Y+43, r24 ; 0x2b 28074: 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) 28076: 2e 96 adiw r28, 0x0e ; 14 28078: 2c ad ldd r18, Y+60 ; 0x3c 2807a: 3d ad ldd r19, Y+61 ; 0x3d 2807c: 4e ad ldd r20, Y+62 ; 0x3e 2807e: 5f ad ldd r21, Y+63 ; 0x3f 28080: 2e 97 sbiw r28, 0x0e ; 14 28082: 23 2b or r18, r19 28084: 24 2b or r18, r20 28086: 25 2b or r18, r21 28088: 09 f0 breq .+2 ; 0x2808c 2808a: b9 c5 rjmp .+2930 ; 0x28bfe 2808c: 8e e6 ldi r24, 0x6E ; 110 2808e: 82 9d mul r24, r2 28090: 80 01 movw r16, r0 28092: 83 9d mul r24, r3 28094: 10 0d add r17, r0 28096: 11 24 eor r1, r1 28098: 02 5a subi r16, 0xA2 ; 162 2809a: 19 4f sbci r17, 0xF9 ; 249 2809c: f8 01 movw r30, r16 2809e: 84 81 ldd r24, Z+4 ; 0x04 280a0: 95 81 ldd r25, Z+5 ; 0x05 280a2: a6 81 ldd r26, Z+6 ; 0x06 280a4: b7 81 ldd r27, Z+7 ; 0x07 280a6: 89 2b or r24, r25 280a8: 8a 2b or r24, r26 280aa: 8b 2b or r24, r27 280ac: 09 f0 breq .+2 ; 0x280b0 280ae: a7 c5 rjmp .+2894 ; 0x28bfe 280b0: 80 85 ldd r24, Z+8 ; 0x08 280b2: 91 85 ldd r25, Z+9 ; 0x09 280b4: a2 85 ldd r26, Z+10 ; 0x0a 280b6: b3 85 ldd r27, Z+11 ; 0x0b 280b8: 89 2b or r24, r25 280ba: 8a 2b or r24, r26 280bc: 8b 2b or r24, r27 280be: 09 f0 breq .+2 ; 0x280c2 280c0: 9e c5 rjmp .+2876 ; 0x28bfe { accel = ceil(cs.retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2 280c2: 20 91 9f 0d lds r18, 0x0D9F ; 0x800d9f 280c6: 30 91 a0 0d lds r19, 0x0DA0 ; 0x800da0 280ca: 40 91 a1 0d lds r20, 0x0DA1 ; 0x800da1 280ce: 50 91 a2 0d lds r21, 0x0DA2 ; 0x800da2 280d2: 69 a5 ldd r22, Y+41 ; 0x29 280d4: 7a a5 ldd r23, Y+42 ; 0x2a 280d6: 8b a5 ldd r24, Y+43 ; 0x2b 280d8: 9c a5 ldd r25, Y+44 ; 0x2c 280da: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 280de: 0f 94 87 a6 call 0x34d0e ; 0x34d0e 280e2: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 280e6: 2b 01 movw r4, r22 280e8: 3c 01 movw r6, r24 #ifdef LIN_ADVANCE block->use_advance_lead = false; 280ea: f8 01 movw r30, r16 280ec: e4 5b subi r30, 0xB4 ; 180 280ee: ff 4f sbci r31, 0xFF ; 255 280f0: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 280f2: 6a 96 adiw r28, 0x1a ; 26 280f4: 1c ae std Y+60, r1 ; 0x3c 280f6: 1d ae std Y+61, r1 ; 0x3d 280f8: 1e ae std Y+62, r1 ; 0x3e 280fa: 1f ae std Y+63, r1 ; 0x3f 280fc: 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; 280fe: 8e e6 ldi r24, 0x6E ; 110 28100: 82 9d mul r24, r2 28102: 80 01 movw r16, r0 28104: 83 9d mul r24, r3 28106: 10 0d add r17, r0 28108: 11 24 eor r1, r1 2810a: 02 5a subi r16, 0xA2 ; 162 2810c: 19 4f sbci r17, 0xF9 ; 249 2810e: f8 01 movw r30, r16 28110: ee 5b subi r30, 0xBE ; 190 28112: ff 4f sbci r31, 0xFF ; 255 28114: 40 82 st Z, r4 28116: 51 82 std Z+1, r5 ; 0x01 28118: 62 82 std Z+2, r6 ; 0x02 2811a: 73 82 std Z+3, r7 ; 0x03 block->acceleration = accel / steps_per_mm; 2811c: c3 01 movw r24, r6 2811e: b2 01 movw r22, r4 28120: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 28124: 6b 01 movw r12, r22 28126: 7c 01 movw r14, r24 28128: 29 a5 ldd r18, Y+41 ; 0x29 2812a: 3a a5 ldd r19, Y+42 ; 0x2a 2812c: 4b a5 ldd r20, Y+43 ; 0x2b 2812e: 5c a5 ldd r21, Y+44 ; 0x2c 28130: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 28134: e1 96 adiw r28, 0x31 ; 49 28136: 6c af std Y+60, r22 ; 0x3c 28138: 7d af std Y+61, r23 ; 0x3d 2813a: 8e af std Y+62, r24 ; 0x3e 2813c: 9f af std Y+63, r25 ; 0x3f 2813e: e1 97 sbiw r28, 0x31 ; 49 28140: f8 01 movw r30, r16 28142: 61 ab std Z+49, r22 ; 0x31 28144: 72 ab std Z+50, r23 ; 0x32 28146: 83 ab std Z+51, r24 ; 0x33 28148: 94 ab std Z+52, r25 ; 0x34 block->acceleration_rate = (uint32_t)(accel * (float(1UL << 24) / ((F_CPU) / 8.0f))); 2814a: 2d eb ldi r18, 0xBD ; 189 2814c: 37 e3 ldi r19, 0x37 ; 55 2814e: 46 e0 ldi r20, 0x06 ; 6 28150: 51 e4 ldi r21, 0x41 ; 65 28152: c7 01 movw r24, r14 28154: b6 01 movw r22, r12 28156: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2815a: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 2815e: d8 01 movw r26, r16 28160: 54 96 adiw r26, 0x14 ; 20 28162: 6d 93 st X+, r22 28164: 7d 93 st X+, r23 28166: 8d 93 st X+, r24 28168: 9c 93 st X, r25 2816a: 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; 2816c: 91 96 adiw r26, 0x21 ; 33 2816e: bc 91 ld r27, X 28170: 27 96 adiw r28, 0x07 ; 7 28172: bf af std Y+63, r27 ; 0x3f 28174: 27 97 sbiw r28, 0x07 ; 7 28176: f8 01 movw r30, r16 28178: f2 a1 ldd r31, Z+34 ; 0x22 2817a: 2b 96 adiw r28, 0x0b ; 11 2817c: ff af std Y+63, r31 ; 0x3f 2817e: 2b 97 sbiw r28, 0x0b ; 11 28180: d8 01 movw r26, r16 28182: 93 96 adiw r26, 0x23 ; 35 28184: bc 91 ld r27, X 28186: 2f 96 adiw r28, 0x0f ; 15 28188: bf af std Y+63, r27 ; 0x3f 2818a: 2f 97 sbiw r28, 0x0f ; 15 2818c: f8 01 movw r30, r16 2818e: f4 a1 ldd r31, Z+36 ; 0x24 28190: 63 96 adiw r28, 0x13 ; 19 28192: ff af std Y+63, r31 ; 0x3f 28194: 63 97 sbiw r28, 0x13 ; 19 28196: 2f ea ldi r18, 0xAF ; 175 28198: 3d e0 ldi r19, 0x0D ; 13 2819a: ed 96 adiw r28, 0x3d ; 61 2819c: 3f af std Y+63, r19 ; 0x3f 2819e: 2e af std Y+62, r18 ; 0x3e 281a0: ed 97 sbiw r28, 0x3d ; 61 281a2: 6e 96 adiw r28, 0x1e ; 30 281a4: 4e ac ldd r4, Y+62 ; 0x3e 281a6: 5f ac ldd r5, Y+63 ; 0x3f 281a8: 6e 97 sbiw r28, 0x1e ; 30 281aa: 30 e1 ldi r19, 0x10 ; 16 281ac: 43 0e add r4, r19 281ae: 51 1c adc r5, r1 281b0: 0f ea ldi r16, 0xAF ; 175 281b2: 1d e0 ldi r17, 0x0D ; 13 281b4: 6e 96 adiw r28, 0x1e ; 30 281b6: 6e ac ldd r6, Y+62 ; 0x3e 281b8: 7f ac ldd r7, Y+63 ; 0x3f 281ba: 6e 97 sbiw r28, 0x1e ; 30 281bc: 27 96 adiw r28, 0x07 ; 7 281be: 4f ad ldd r20, Y+63 ; 0x3f 281c0: 27 97 sbiw r28, 0x07 ; 7 281c2: 49 a7 std Y+41, r20 ; 0x29 281c4: 2b 96 adiw r28, 0x0b ; 11 281c6: 5f ad ldd r21, Y+63 ; 0x3f 281c8: 2b 97 sbiw r28, 0x0b ; 11 281ca: 5d a7 std Y+45, r21 ; 0x2d 281cc: b9 af std Y+57, r27 ; 0x39 281ce: f9 ab std Y+49, r31 ; 0x31 bool limited = false; 281d0: 1d aa std Y+53, r1 ; 0x35 for (uint8_t axis = 0; axis < 4; ++ axis) { float jerk = fabs(current_speed[axis]); 281d2: d3 01 movw r26, r6 281d4: 8d 90 ld r8, X+ 281d6: 9d 90 ld r9, X+ 281d8: ad 90 ld r10, X+ 281da: bd 90 ld r11, X+ 281dc: 3d 01 movw r6, r26 281de: e8 94 clt 281e0: b7 f8 bld r11, 7 if (jerk > cs.max_jerk[axis]) { 281e2: f8 01 movw r30, r16 281e4: c1 90 ld r12, Z+ 281e6: d1 90 ld r13, Z+ 281e8: e1 90 ld r14, Z+ 281ea: f1 90 ld r15, Z+ 281ec: 8f 01 movw r16, r30 281ee: a5 01 movw r20, r10 281f0: 94 01 movw r18, r8 281f2: c7 01 movw r24, r14 281f4: b6 01 movw r22, r12 281f6: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 281fa: 87 ff sbrs r24, 7 281fc: 3a c0 rjmp .+116 ; 0x28272 // The actual jerk is lower, if it has been limited by the XY jerk. if (limited) { 281fe: fd a9 ldd r31, Y+53 ; 0x35 28200: ff 23 and r31, r31 28202: 09 f4 brne .+2 ; 0x28206 28204: 7e c6 rjmp .+3324 ; 0x28f02 // 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; 28206: 29 a5 ldd r18, Y+41 ; 0x29 28208: 3d a5 ldd r19, Y+45 ; 0x2d 2820a: 49 ad ldd r20, Y+57 ; 0x39 2820c: 59 a9 ldd r21, Y+49 ; 0x31 2820e: c5 01 movw r24, r10 28210: b4 01 movw r22, r8 28212: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28216: 4b 01 movw r8, r22 28218: 5c 01 movw r10, r24 float mjerk = cs.max_jerk[axis] * block->nominal_speed; 2821a: a7 01 movw r20, r14 2821c: 96 01 movw r18, r12 2821e: 27 96 adiw r28, 0x07 ; 7 28220: 6f ad ldd r22, Y+63 ; 0x3f 28222: 27 97 sbiw r28, 0x07 ; 7 28224: 2b 96 adiw r28, 0x0b ; 11 28226: 7f ad ldd r23, Y+63 ; 0x3f 28228: 2b 97 sbiw r28, 0x0b ; 11 2822a: 2f 96 adiw r28, 0x0f ; 15 2822c: 8f ad ldd r24, Y+63 ; 0x3f 2822e: 2f 97 sbiw r28, 0x0f ; 15 28230: 63 96 adiw r28, 0x13 ; 19 28232: 9f ad ldd r25, Y+63 ; 0x3f 28234: 63 97 sbiw r28, 0x13 ; 19 28236: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2823a: 6b 01 movw r12, r22 2823c: 7c 01 movw r14, r24 if (jerk > mjerk) { 2823e: ac 01 movw r20, r24 28240: 9b 01 movw r18, r22 28242: c5 01 movw r24, r10 28244: b4 01 movw r22, r8 28246: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2824a: 18 16 cp r1, r24 2824c: 94 f4 brge .+36 ; 0x28272 safe_speed *= mjerk / jerk; 2824e: a5 01 movw r20, r10 28250: 94 01 movw r18, r8 28252: c7 01 movw r24, r14 28254: b6 01 movw r22, r12 28256: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 2825a: 9b 01 movw r18, r22 2825c: ac 01 movw r20, r24 2825e: 69 a5 ldd r22, Y+41 ; 0x29 28260: 7d a5 ldd r23, Y+45 ; 0x2d 28262: 89 ad ldd r24, Y+57 ; 0x39 28264: 99 a9 ldd r25, Y+49 ; 0x31 28266: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2826a: 69 a7 std Y+41, r22 ; 0x29 2826c: 7d a7 std Y+45, r23 ; 0x2d 2826e: 89 af std Y+57, r24 ; 0x39 28270: 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) { 28272: 46 14 cp r4, r6 28274: 57 04 cpc r5, r7 28276: 09 f0 breq .+2 ; 0x2827a 28278: ac cf rjmp .-168 ; 0x281d2 } } } // Reset the block flag. block->flag = 0; 2827a: 8e e6 ldi r24, 0x6E ; 110 2827c: 82 9d mul r24, r2 2827e: f0 01 movw r30, r0 28280: 83 9d mul r24, r3 28282: f0 0d add r31, r0 28284: 11 24 eor r1, r1 28286: e2 5a subi r30, 0xA2 ; 162 28288: f9 4f sbci r31, 0xF9 ; 249 2828a: 15 aa std Z+53, r1 ; 0x35 if (plan_reset_next_e_sched) 2828c: 80 91 20 04 lds r24, 0x0420 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.442> 28290: 88 23 and r24, r24 28292: 21 f0 breq .+8 ; 0x2829c { // finally propagate a pending reset block->flag |= BLOCK_FLAG_E_RESET; 28294: 80 e1 ldi r24, 0x10 ; 16 28296: 85 ab std Z+53, r24 ; 0x35 plan_reset_next_e_sched = false; 28298: 10 92 20 04 sts 0x0420, r1 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.442> 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) { 2829c: 3d ad ldd r19, Y+61 ; 0x3d 2829e: 32 30 cpi r19, 0x02 ; 2 282a0: 08 f4 brcc .+2 ; 0x282a4 282a2: 8f c6 rjmp .+3358 ; 0x28fc2 282a4: 40 91 22 04 lds r20, 0x0422 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.443> 282a8: 6b 96 adiw r28, 0x1b ; 27 282aa: 4f af std Y+63, r20 ; 0x3f 282ac: 6b 97 sbiw r28, 0x1b ; 27 282ae: 50 91 23 04 lds r21, 0x0423 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.443+0x1> 282b2: 6f 96 adiw r28, 0x1f ; 31 282b4: 5f af std Y+63, r21 ; 0x3f 282b6: 6f 97 sbiw r28, 0x1f ; 31 282b8: 00 91 24 04 lds r16, 0x0424 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.443+0x2> 282bc: 10 91 25 04 lds r17, 0x0425 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.443+0x3> 282c0: 27 e1 ldi r18, 0x17 ; 23 282c2: 37 eb ldi r19, 0xB7 ; 183 282c4: 41 ed ldi r20, 0xD1 ; 209 282c6: 58 e3 ldi r21, 0x38 ; 56 282c8: 6b 96 adiw r28, 0x1b ; 27 282ca: 6f ad ldd r22, Y+63 ; 0x3f 282cc: 6b 97 sbiw r28, 0x1b ; 27 282ce: 6f 96 adiw r28, 0x1f ; 31 282d0: 7f ad ldd r23, Y+63 ; 0x3f 282d2: 6f 97 sbiw r28, 0x1f ; 31 282d4: c8 01 movw r24, r16 282d6: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 282da: 18 16 cp r1, r24 282dc: 0c f0 brlt .+2 ; 0x282e0 282de: 71 c6 rjmp .+3298 ; 0x28fc2 // 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); 282e0: 6b 96 adiw r28, 0x1b ; 27 282e2: 2f ad ldd r18, Y+63 ; 0x3f 282e4: 6b 97 sbiw r28, 0x1b ; 27 282e6: 6f 96 adiw r28, 0x1f ; 31 282e8: 3f ad ldd r19, Y+63 ; 0x3f 282ea: 6f 97 sbiw r28, 0x1f ; 31 282ec: a8 01 movw r20, r16 282ee: 27 96 adiw r28, 0x07 ; 7 282f0: 6f ad ldd r22, Y+63 ; 0x3f 282f2: 27 97 sbiw r28, 0x07 ; 7 282f4: 2b 96 adiw r28, 0x0b ; 11 282f6: 7f ad ldd r23, Y+63 ; 0x3f 282f8: 2b 97 sbiw r28, 0x0b ; 11 282fa: 2f 96 adiw r28, 0x0f ; 15 282fc: 8f ad ldd r24, Y+63 ; 0x3f 282fe: 2f 97 sbiw r28, 0x0f ; 15 28300: 63 96 adiw r28, 0x13 ; 19 28302: 9f ad ldd r25, Y+63 ; 0x3f 28304: 63 97 sbiw r28, 0x13 ; 19 28306: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2830a: 87 ff sbrs r24, 7 2830c: 01 c6 rjmp .+3074 ; 0x28f10 2830e: 6b 96 adiw r28, 0x1b ; 27 28310: 2f ad ldd r18, Y+63 ; 0x3f 28312: 6b 97 sbiw r28, 0x1b ; 27 28314: 6f 96 adiw r28, 0x1f ; 31 28316: 3f ad ldd r19, Y+63 ; 0x3f 28318: 6f 97 sbiw r28, 0x1f ; 31 2831a: a8 01 movw r20, r16 2831c: 27 96 adiw r28, 0x07 ; 7 2831e: 6f ad ldd r22, Y+63 ; 0x3f 28320: 27 97 sbiw r28, 0x07 ; 7 28322: 2b 96 adiw r28, 0x0b ; 11 28324: 7f ad ldd r23, Y+63 ; 0x3f 28326: 2b 97 sbiw r28, 0x0b ; 11 28328: 2f 96 adiw r28, 0x0f ; 15 2832a: 8f ad ldd r24, Y+63 ; 0x3f 2832c: 2f 97 sbiw r28, 0x0f ; 15 2832e: 63 96 adiw r28, 0x13 ; 19 28330: 9f ad ldd r25, Y+63 ; 0x3f 28332: 63 97 sbiw r28, 0x13 ; 19 28334: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 28338: eb 96 adiw r28, 0x3b ; 59 2833a: 6c af std Y+60, r22 ; 0x3c 2833c: 7d af std Y+61, r23 ; 0x3d 2833e: 8e af std Y+62, r24 ; 0x3e 28340: 9f af std Y+63, r25 ; 0x3f 28342: 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; 28344: 27 96 adiw r28, 0x07 ; 7 28346: 8f ad ldd r24, Y+63 ; 0x3f 28348: 27 97 sbiw r28, 0x07 ; 7 2834a: 8d af std Y+61, r24 ; 0x3d 2834c: 2b 96 adiw r28, 0x0b ; 11 2834e: 9f ad ldd r25, Y+63 ; 0x3f 28350: 2b 97 sbiw r28, 0x0b ; 11 28352: 9d ab std Y+53, r25 ; 0x35 28354: 2f 96 adiw r28, 0x0f ; 15 28356: af ad ldd r26, Y+63 ; 0x3f 28358: 2f 97 sbiw r28, 0x0f ; 15 2835a: ae af std Y+62, r26 ; 0x3e 2835c: 63 96 adiw r28, 0x13 ; 19 2835e: bf ad ldd r27, Y+63 ; 0x3f 28360: 63 97 sbiw r28, 0x13 ; 19 28362: 23 96 adiw r28, 0x03 ; 3 28364: bf af std Y+63, r27 ; 0x3f 28366: 23 97 sbiw r28, 0x03 ; 3 28368: 26 e2 ldi r18, 0x26 ; 38 2836a: 34 e0 ldi r19, 0x04 ; 4 2836c: e7 96 adiw r28, 0x37 ; 55 2836e: 3f af std Y+63, r19 ; 0x3f 28370: 2e af std Y+62, r18 ; 0x3e 28372: e7 97 sbiw r28, 0x37 ; 55 // Factor to multiply the previous / current nominal velocities to get componentwise limited velocities. float v_factor = 1.f; 28374: 41 2c mov r4, r1 28376: 51 2c mov r5, r1 28378: 30 e8 ldi r19, 0x80 ; 128 2837a: 63 2e mov r6, r19 2837c: 3f e3 ldi r19, 0x3F ; 63 2837e: 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]; 28380: e7 96 adiw r28, 0x37 ; 55 28382: ae ad ldd r26, Y+62 ; 0x3e 28384: bf ad ldd r27, Y+63 ; 0x3f 28386: e7 97 sbiw r28, 0x37 ; 55 28388: 8d 90 ld r8, X+ 2838a: 9d 90 ld r9, X+ 2838c: ad 90 ld r10, X+ 2838e: bd 90 ld r11, X+ 28390: e7 96 adiw r28, 0x37 ; 55 28392: bf af std Y+63, r27 ; 0x3f 28394: ae af std Y+62, r26 ; 0x3e 28396: e7 97 sbiw r28, 0x37 ; 55 float v_entry = current_speed [axis]; 28398: 6e 96 adiw r28, 0x1e ; 30 2839a: ee ad ldd r30, Y+62 ; 0x3e 2839c: ff ad ldd r31, Y+63 ; 0x3f 2839e: 6e 97 sbiw r28, 0x1e ; 30 283a0: c1 90 ld r12, Z+ 283a2: d1 90 ld r13, Z+ 283a4: e1 90 ld r14, Z+ 283a6: f1 90 ld r15, Z+ 283a8: 6e 96 adiw r28, 0x1e ; 30 283aa: ff af std Y+63, r31 ; 0x3f 283ac: ee af std Y+62, r30 ; 0x3e 283ae: 6e 97 sbiw r28, 0x1e ; 30 if (prev_speed_larger) 283b0: 6b 96 adiw r28, 0x1b ; 27 283b2: 2f ad ldd r18, Y+63 ; 0x3f 283b4: 6b 97 sbiw r28, 0x1b ; 27 283b6: 6f 96 adiw r28, 0x1f ; 31 283b8: 3f ad ldd r19, Y+63 ; 0x3f 283ba: 6f 97 sbiw r28, 0x1f ; 31 283bc: a8 01 movw r20, r16 283be: 27 96 adiw r28, 0x07 ; 7 283c0: 6f ad ldd r22, Y+63 ; 0x3f 283c2: 27 97 sbiw r28, 0x07 ; 7 283c4: 2b 96 adiw r28, 0x0b ; 11 283c6: 7f ad ldd r23, Y+63 ; 0x3f 283c8: 2b 97 sbiw r28, 0x0b ; 11 283ca: 2f 96 adiw r28, 0x0f ; 15 283cc: 8f ad ldd r24, Y+63 ; 0x3f 283ce: 2f 97 sbiw r28, 0x0f ; 15 283d0: 63 96 adiw r28, 0x13 ; 19 283d2: 9f ad ldd r25, Y+63 ; 0x3f 283d4: 63 97 sbiw r28, 0x13 ; 19 283d6: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 283da: 87 ff sbrs r24, 7 283dc: 0c c0 rjmp .+24 ; 0x283f6 v_exit *= smaller_speed_factor; 283de: eb 96 adiw r28, 0x3b ; 59 283e0: 2c ad ldd r18, Y+60 ; 0x3c 283e2: 3d ad ldd r19, Y+61 ; 0x3d 283e4: 4e ad ldd r20, Y+62 ; 0x3e 283e6: 5f ad ldd r21, Y+63 ; 0x3f 283e8: eb 97 sbiw r28, 0x3b ; 59 283ea: c5 01 movw r24, r10 283ec: b4 01 movw r22, r8 283ee: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 283f2: 4b 01 movw r8, r22 283f4: 5c 01 movw r10, r24 if (limited) { 283f6: a1 96 adiw r28, 0x21 ; 33 283f8: ff ad ldd r31, Y+63 ; 0x3f 283fa: a1 97 sbiw r28, 0x21 ; 33 283fc: ff 23 and r31, r31 283fe: 81 f0 breq .+32 ; 0x28420 v_exit *= v_factor; 28400: a3 01 movw r20, r6 28402: 92 01 movw r18, r4 28404: c5 01 movw r24, r10 28406: b4 01 movw r22, r8 28408: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2840c: 4b 01 movw r8, r22 2840e: 5c 01 movw r10, r24 v_entry *= v_factor; 28410: a3 01 movw r20, r6 28412: 92 01 movw r18, r4 28414: c7 01 movw r24, r14 28416: b6 01 movw r22, r12 28418: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2841c: 6b 01 movw r12, r22 2841e: 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) ? 28420: a7 01 movw r20, r14 28422: 96 01 movw r18, r12 28424: c5 01 movw r24, r10 28426: b4 01 movw r22, r8 28428: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> ((v_entry > 0.f || v_exit < 0.f) ? 2842c: 20 e0 ldi r18, 0x00 ; 0 2842e: 30 e0 ldi r19, 0x00 ; 0 28430: 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) ? 28432: 18 16 cp r1, r24 28434: 0c f0 brlt .+2 ; 0x28438 28436: a3 c5 rjmp .+2886 ; 0x28f7e ((v_entry > 0.f || v_exit < 0.f) ? 28438: c7 01 movw r24, r14 2843a: b6 01 movw r22, r12 2843c: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 28440: 18 16 cp r1, r24 28442: 4c f0 brlt .+18 ; 0x28456 28444: 20 e0 ldi r18, 0x00 ; 0 28446: 30 e0 ldi r19, 0x00 ; 0 28448: a9 01 movw r20, r18 2844a: c5 01 movw r24, r10 2844c: b4 01 movw r22, r8 2844e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 28452: 87 ff sbrs r24, 7 28454: 85 c5 rjmp .+2826 ; 0x28f60 28456: a7 01 movw r20, r14 28458: 96 01 movw r18, r12 2845a: c5 01 movw r24, r10 2845c: 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) ? 2845e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 28462: 6b 01 movw r12, r22 28464: 7c 01 movw r14, r24 // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); if (jerk > cs.max_jerk[axis]) { 28466: ed 96 adiw r28, 0x3d ; 61 28468: ae ad ldd r26, Y+62 ; 0x3e 2846a: bf ad ldd r27, Y+63 ; 0x3f 2846c: ed 97 sbiw r28, 0x3d ; 61 2846e: 8d 90 ld r8, X+ 28470: 9d 90 ld r9, X+ 28472: ad 90 ld r10, X+ 28474: bd 90 ld r11, X+ 28476: ed 96 adiw r28, 0x3d ; 61 28478: bf af std Y+63, r27 ; 0x3f 2847a: ae af std Y+62, r26 ; 0x3e 2847c: ed 97 sbiw r28, 0x3d ; 61 2847e: a5 01 movw r20, r10 28480: 94 01 movw r18, r8 28482: c7 01 movw r24, r14 28484: b6 01 movw r22, r12 28486: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2848a: 18 16 cp r1, r24 2848c: 94 f4 brge .+36 ; 0x284b2 v_factor *= cs.max_jerk[axis] / jerk; 2848e: a7 01 movw r20, r14 28490: 96 01 movw r18, r12 28492: c5 01 movw r24, r10 28494: b4 01 movw r22, r8 28496: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 2849a: 9b 01 movw r18, r22 2849c: ac 01 movw r20, r24 2849e: c3 01 movw r24, r6 284a0: b2 01 movw r22, r4 284a2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 284a6: 2b 01 movw r4, r22 284a8: 3c 01 movw r6, r24 limited = true; 284aa: b1 e0 ldi r27, 0x01 ; 1 284ac: a1 96 adiw r28, 0x21 ; 33 284ae: bf af std Y+63, r27 ; 0x3f 284b0: 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) { 284b2: e6 e3 ldi r30, 0x36 ; 54 284b4: f4 e0 ldi r31, 0x04 ; 4 284b6: e7 96 adiw r28, 0x37 ; 55 284b8: 2e ad ldd r18, Y+62 ; 0x3e 284ba: 3f ad ldd r19, Y+63 ; 0x3f 284bc: e7 97 sbiw r28, 0x37 ; 55 284be: e2 17 cp r30, r18 284c0: f3 07 cpc r31, r19 284c2: 09 f0 breq .+2 ; 0x284c6 284c4: 5d cf rjmp .-326 ; 0x28380 if (jerk > cs.max_jerk[axis]) { v_factor *= cs.max_jerk[axis] / jerk; limited = true; } } if (limited) 284c6: a1 96 adiw r28, 0x21 ; 33 284c8: 3f ad ldd r19, Y+63 ; 0x3f 284ca: a1 97 sbiw r28, 0x21 ; 33 284cc: 33 23 and r19, r19 284ce: 81 f0 breq .+32 ; 0x284f0 vmax_junction *= v_factor; 284d0: a3 01 movw r20, r6 284d2: 92 01 movw r18, r4 284d4: 6d ad ldd r22, Y+61 ; 0x3d 284d6: 7d a9 ldd r23, Y+53 ; 0x35 284d8: 8e ad ldd r24, Y+62 ; 0x3e 284da: 23 96 adiw r28, 0x03 ; 3 284dc: 9f ad ldd r25, Y+63 ; 0x3f 284de: 23 97 sbiw r28, 0x03 ; 3 284e0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 284e4: 6d af std Y+61, r22 ; 0x3d 284e6: 7d ab std Y+53, r23 ; 0x35 284e8: 8e af std Y+62, r24 ; 0x3e 284ea: 23 96 adiw r28, 0x03 ; 3 284ec: 9f af std Y+63, r25 ; 0x3f 284ee: 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; 284f0: 24 ea ldi r18, 0xA4 ; 164 284f2: 30 e7 ldi r19, 0x70 ; 112 284f4: 4d e7 ldi r20, 0x7D ; 125 284f6: 5f e3 ldi r21, 0x3F ; 63 284f8: 6d ad ldd r22, Y+61 ; 0x3d 284fa: 7d a9 ldd r23, Y+53 ; 0x35 284fc: 8e ad ldd r24, Y+62 ; 0x3e 284fe: 23 96 adiw r28, 0x03 ; 3 28500: 9f ad ldd r25, Y+63 ; 0x3f 28502: 23 97 sbiw r28, 0x03 ; 3 28504: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28508: 6b 01 movw r12, r22 2850a: 7c 01 movw r14, r24 if (previous_safe_speed > vmax_junction_threshold && safe_speed > vmax_junction_threshold) { 2850c: ac 01 movw r20, r24 2850e: 9b 01 movw r18, r22 28510: 60 91 a3 04 lds r22, 0x04A3 ; 0x8004a3 28514: 70 91 a4 04 lds r23, 0x04A4 ; 0x8004a4 28518: 80 91 a5 04 lds r24, 0x04A5 ; 0x8004a5 2851c: 90 91 a6 04 lds r25, 0x04A6 ; 0x8004a6 28520: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 28524: 18 16 cp r1, r24 28526: fc f4 brge .+62 ; 0x28566 28528: 29 a5 ldd r18, Y+41 ; 0x29 2852a: 3d a5 ldd r19, Y+45 ; 0x2d 2852c: 49 ad ldd r20, Y+57 ; 0x39 2852e: 59 a9 ldd r21, Y+49 ; 0x31 28530: c7 01 movw r24, r14 28532: b6 01 movw r22, r12 28534: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 28538: 87 ff sbrs r24, 7 2853a: 15 c0 rjmp .+42 ; 0x28566 // 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; 2853c: 8e e6 ldi r24, 0x6E ; 110 2853e: 82 9d mul r24, r2 28540: f0 01 movw r30, r0 28542: 83 9d mul r24, r3 28544: f0 0d add r31, r0 28546: 11 24 eor r1, r1 28548: e2 5a subi r30, 0xA2 ; 162 2854a: f9 4f sbci r31, 0xF9 ; 249 2854c: 85 a9 ldd r24, Z+53 ; 0x35 2854e: 84 60 ori r24, 0x04 ; 4 28550: 85 ab std Z+53, r24 ; 0x35 28552: 49 a5 ldd r20, Y+41 ; 0x29 28554: 4d af std Y+61, r20 ; 0x3d 28556: 5d a5 ldd r21, Y+45 ; 0x2d 28558: 5d ab std Y+53, r21 ; 0x35 2855a: 89 ad ldd r24, Y+57 ; 0x39 2855c: 8e af std Y+62, r24 ; 0x3e 2855e: 99 a9 ldd r25, Y+49 ; 0x31 28560: 23 96 adiw r28, 0x03 ; 3 28562: 9f af std Y+63, r25 ; 0x3f 28564: 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; 28566: 8e e6 ldi r24, 0x6E ; 110 28568: 82 9d mul r24, r2 2856a: 80 01 movw r16, r0 2856c: 83 9d mul r24, r3 2856e: 10 0d add r17, r0 28570: 11 24 eor r1, r1 28572: 02 5a subi r16, 0xA2 ; 162 28574: 19 4f sbci r17, 0xF9 ; 249 28576: 8d ad ldd r24, Y+61 ; 0x3d 28578: 9d a9 ldd r25, Y+53 ; 0x35 2857a: ae ad ldd r26, Y+62 ; 0x3e 2857c: 23 96 adiw r28, 0x03 ; 3 2857e: bf ad ldd r27, Y+63 ; 0x3f 28580: 23 97 sbiw r28, 0x03 ; 3 28582: f8 01 movw r30, r16 28584: 81 a7 std Z+41, r24 ; 0x29 28586: 92 a7 std Z+42, r25 ; 0x2a 28588: a3 a7 std Z+43, r26 ; 0x2b 2858a: 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); 2858c: 29 a5 ldd r18, Y+41 ; 0x29 2858e: 3d a5 ldd r19, Y+45 ; 0x2d 28590: 49 ad ldd r20, Y+57 ; 0x39 28592: 59 a9 ldd r21, Y+49 ; 0x31 28594: 69 a5 ldd r22, Y+41 ; 0x29 28596: 7d a5 ldd r23, Y+45 ; 0x2d 28598: 89 ad ldd r24, Y+57 ; 0x39 2859a: 99 a9 ldd r25, Y+49 ; 0x31 2859c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 285a0: 6b 01 movw r12, r22 285a2: 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); 285a4: e1 96 adiw r28, 0x31 ; 49 285a6: 6c ad ldd r22, Y+60 ; 0x3c 285a8: 7d ad ldd r23, Y+61 ; 0x3d 285aa: 8e ad ldd r24, Y+62 ; 0x3e 285ac: 9f ad ldd r25, Y+63 ; 0x3f 285ae: e1 97 sbiw r28, 0x31 ; 49 285b0: 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); 285b2: 9b 01 movw r18, r22 285b4: ac 01 movw r20, r24 285b6: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 285ba: d8 01 movw r26, r16 285bc: 9d 96 adiw r26, 0x2d ; 45 285be: 2d 91 ld r18, X+ 285c0: 3d 91 ld r19, X+ 285c2: 4d 91 ld r20, X+ 285c4: 5c 91 ld r21, X 285c6: d0 97 sbiw r26, 0x30 ; 48 285c8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 285cc: 9b 01 movw r18, r22 285ce: ac 01 movw r20, r24 285d0: c7 01 movw r24, r14 285d2: b6 01 movw r22, r12 285d4: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 285d8: 0f 94 77 a9 call 0x352ee ; 0x352ee 285dc: d6 2e mov r13, r22 285de: e7 2e mov r14, r23 285e0: 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); 285e2: 2d ad ldd r18, Y+61 ; 0x3d 285e4: 3d a9 ldd r19, Y+53 ; 0x35 285e6: 4e ad ldd r20, Y+62 ; 0x3e 285e8: 23 96 adiw r28, 0x03 ; 3 285ea: 5f ad ldd r21, Y+63 ; 0x3f 285ec: 23 97 sbiw r28, 0x03 ; 3 285ee: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 285f2: 18 16 cp r1, r24 285f4: 34 f0 brlt .+12 ; 0x28602 285f6: dd ae std Y+61, r13 ; 0x3d 285f8: ed aa std Y+53, r14 ; 0x35 285fa: 0e af std Y+62, r16 ; 0x3e 285fc: 23 96 adiw r28, 0x03 ; 3 285fe: 1f af std Y+63, r17 ; 0x3f 28600: 23 97 sbiw r28, 0x03 ; 3 28602: 8e e6 ldi r24, 0x6E ; 110 28604: 82 9d mul r24, r2 28606: f0 01 movw r30, r0 28608: 83 9d mul r24, r3 2860a: f0 0d add r31, r0 2860c: 11 24 eor r1, r1 2860e: e2 5a subi r30, 0xA2 ; 162 28610: f9 4f sbci r31, 0xF9 ; 249 28612: 8d ad ldd r24, Y+61 ; 0x3d 28614: 9d a9 ldd r25, Y+53 ; 0x35 28616: ae ad ldd r26, Y+62 ; 0x3e 28618: 23 96 adiw r28, 0x03 ; 3 2861a: bf ad ldd r27, Y+63 ; 0x3f 2861c: 23 97 sbiw r28, 0x03 ; 3 2861e: 85 a3 std Z+37, r24 ; 0x25 28620: 96 a3 std Z+38, r25 ; 0x26 28622: a7 a3 std Z+39, r26 ; 0x27 28624: 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; 28626: f5 a8 ldd r15, Z+53 ; 0x35 28628: 2d 2d mov r18, r13 2862a: 3e 2d mov r19, r14 2862c: a8 01 movw r20, r16 2862e: 27 96 adiw r28, 0x07 ; 7 28630: 6f ad ldd r22, Y+63 ; 0x3f 28632: 27 97 sbiw r28, 0x07 ; 7 28634: 2b 96 adiw r28, 0x0b ; 11 28636: 7f ad ldd r23, Y+63 ; 0x3f 28638: 2b 97 sbiw r28, 0x0b ; 11 2863a: 2f 96 adiw r28, 0x0f ; 15 2863c: 8f ad ldd r24, Y+63 ; 0x3f 2863e: 2f 97 sbiw r28, 0x0f ; 15 28640: 63 96 adiw r28, 0x13 ; 19 28642: 9f ad ldd r25, Y+63 ; 0x3f 28644: 63 97 sbiw r28, 0x13 ; 19 28646: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2864a: 18 16 cp r1, r24 2864c: 0c f4 brge .+2 ; 0x28650 2864e: cf c4 rjmp .+2462 ; 0x28fee 28650: 83 e0 ldi r24, 0x03 ; 3 28652: 9e e6 ldi r25, 0x6E ; 110 28654: 92 9d mul r25, r2 28656: 80 01 movw r16, r0 28658: 93 9d mul r25, r3 2865a: 10 0d add r17, r0 2865c: 11 24 eor r1, r1 2865e: 02 5a subi r16, 0xA2 ; 162 28660: 19 4f sbci r17, 0xF9 ; 249 28662: f8 2a or r15, r24 28664: f8 01 movw r30, r16 28666: 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[] 28668: 80 e1 ldi r24, 0x10 ; 16 2866a: fe 01 movw r30, r28 2866c: 71 96 adiw r30, 0x11 ; 17 2866e: a6 e2 ldi r26, 0x26 ; 38 28670: b4 e0 ldi r27, 0x04 ; 4 28672: 01 90 ld r0, Z+ 28674: 0d 92 st X+, r0 28676: 8a 95 dec r24 28678: e1 f7 brne .-8 ; 0x28672 previous_nominal_speed = block->nominal_speed; 2867a: 27 96 adiw r28, 0x07 ; 7 2867c: 8f ad ldd r24, Y+63 ; 0x3f 2867e: 27 97 sbiw r28, 0x07 ; 7 28680: 2b 96 adiw r28, 0x0b ; 11 28682: 9f ad ldd r25, Y+63 ; 0x3f 28684: 2b 97 sbiw r28, 0x0b ; 11 28686: 2f 96 adiw r28, 0x0f ; 15 28688: af ad ldd r26, Y+63 ; 0x3f 2868a: 2f 97 sbiw r28, 0x0f ; 15 2868c: 63 96 adiw r28, 0x13 ; 19 2868e: bf ad ldd r27, Y+63 ; 0x3f 28690: 63 97 sbiw r28, 0x13 ; 19 28692: 80 93 22 04 sts 0x0422, r24 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.443> 28696: 90 93 23 04 sts 0x0423, r25 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.443+0x1> 2869a: a0 93 24 04 sts 0x0424, r26 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.443+0x2> 2869e: b0 93 25 04 sts 0x0425, r27 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.443+0x3> previous_safe_speed = safe_speed; 286a2: 89 a5 ldd r24, Y+41 ; 0x29 286a4: 9d a5 ldd r25, Y+45 ; 0x2d 286a6: a9 ad ldd r26, Y+57 ; 0x39 286a8: b9 a9 ldd r27, Y+49 ; 0x31 286aa: 80 93 a3 04 sts 0x04A3, r24 ; 0x8004a3 286ae: 90 93 a4 04 sts 0x04A4, r25 ; 0x8004a4 286b2: a0 93 a5 04 sts 0x04A5, r26 ; 0x8004a5 286b6: 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; 286ba: d8 01 movw r26, r16 286bc: d6 96 adiw r26, 0x36 ; 54 286be: 6d 91 ld r22, X+ 286c0: 7d 91 ld r23, X+ 286c2: 8d 91 ld r24, X+ 286c4: 9c 91 ld r25, X 286c6: d9 97 sbiw r26, 0x39 ; 57 286c8: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 286cc: 27 96 adiw r28, 0x07 ; 7 286ce: 2f ad ldd r18, Y+63 ; 0x3f 286d0: 27 97 sbiw r28, 0x07 ; 7 286d2: 2b 96 adiw r28, 0x0b ; 11 286d4: 3f ad ldd r19, Y+63 ; 0x3f 286d6: 2b 97 sbiw r28, 0x0b ; 11 286d8: 2f 96 adiw r28, 0x0f ; 15 286da: 4f ad ldd r20, Y+63 ; 0x3f 286dc: 2f 97 sbiw r28, 0x0f ; 15 286de: 63 96 adiw r28, 0x13 ; 19 286e0: 5f ad ldd r21, Y+63 ; 0x3f 286e2: 63 97 sbiw r28, 0x13 ; 19 286e4: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 286e8: 2b 01 movw r4, r22 286ea: 3c 01 movw r6, r24 286ec: f8 01 movw r30, r16 286ee: e8 5b subi r30, 0xB8 ; 184 286f0: ff 4f sbci r31, 0xFF ; 255 286f2: 40 82 st Z, r4 286f4: 51 82 std Z+1, r5 ; 0x01 286f6: 62 82 std Z+2, r6 ; 0x02 286f8: 73 82 std Z+3, r7 ; 0x03 #ifdef LIN_ADVANCE if (block->use_advance_lead) { 286fa: 34 96 adiw r30, 0x04 ; 4 286fc: 80 81 ld r24, Z 286fe: 88 23 and r24, r24 28700: 09 f4 brne .+2 ; 0x28704 28702: 89 c0 rjmp .+274 ; 0x28816 // 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)) 28704: 20 91 a7 04 lds r18, 0x04A7 ; 0x8004a7 28708: 30 91 a8 04 lds r19, 0x04A8 ; 0x8004a8 2870c: 40 91 a9 04 lds r20, 0x04A9 ; 0x8004a9 28710: 50 91 aa 04 lds r21, 0x04AA ; 0x8004aa 28714: 6a 96 adiw r28, 0x1a ; 26 28716: 6c ad ldd r22, Y+60 ; 0x3c 28718: 7d ad ldd r23, Y+61 ; 0x3d 2871a: 8e ad ldd r24, Y+62 ; 0x3e 2871c: 9f ad ldd r25, Y+63 ; 0x3f 2871e: 6a 97 sbiw r28, 0x1a ; 26 28720: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28724: 4b 01 movw r8, r22 28726: 5c 01 movw r10, r24 28728: c0 90 77 0d lds r12, 0x0D77 ; 0x800d77 2872c: d0 90 78 0d lds r13, 0x0D78 ; 0x800d78 28730: e0 90 79 0d lds r14, 0x0D79 ; 0x800d79 28734: f0 90 7a 0d lds r15, 0x0D7A ; 0x800d7a block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 28738: 0c 5a subi r16, 0xAC ; 172 2873a: 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)) 2873c: a7 01 movw r20, r14 2873e: 96 01 movw r18, r12 28740: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> block->adv_comp = adv_comp / block->speed_factor; // step/(step/min) 28744: a3 01 movw r20, r6 28746: 92 01 movw r18, r4 28748: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 2874c: f8 01 movw r30, r16 2874e: 60 83 st Z, r22 28750: 71 83 std Z+1, r23 ; 0x01 28752: 82 83 std Z+2, r24 ; 0x02 28754: 93 83 std Z+3, r25 ; 0x03 float advance_speed; if (e_D_ratio > 0) 28756: 20 e0 ldi r18, 0x00 ; 0 28758: 30 e0 ldi r19, 0x00 ; 0 2875a: a9 01 movw r20, r18 2875c: 6a 96 adiw r28, 0x1a ; 26 2875e: 6c ad ldd r22, Y+60 ; 0x3c 28760: 7d ad ldd r23, Y+61 ; 0x3d 28762: 8e ad ldd r24, Y+62 ; 0x3e 28764: 9f ad ldd r25, Y+63 ; 0x3f 28766: 6a 97 sbiw r28, 0x1a ; 26 28768: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2876c: 18 16 cp r1, r24 2876e: 0c f0 brlt .+2 ; 0x28772 28770: 40 c4 rjmp .+2176 ; 0x28ff2 advance_speed = (extruder_advance_K * e_D_ratio * block->acceleration * cs.axis_steps_per_mm[E_AXIS]); 28772: a5 01 movw r20, r10 28774: 94 01 movw r18, r8 28776: e1 96 adiw r28, 0x31 ; 49 28778: 6c ad ldd r22, Y+60 ; 0x3c 2877a: 7d ad ldd r23, Y+61 ; 0x3d 2877c: 8e ad ldd r24, Y+62 ; 0x3e 2877e: 9f ad ldd r25, Y+63 ; 0x3f 28780: e1 97 sbiw r28, 0x31 ; 49 28782: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28786: a7 01 movw r20, r14 28788: 96 01 movw r18, r12 else advance_speed = cs.max_jerk[E_AXIS] * cs.axis_steps_per_mm[E_AXIS]; 2878a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2878e: 6b 01 movw r12, r22 28790: 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; 28792: 20 e0 ldi r18, 0x00 ; 0 28794: 30 e4 ldi r19, 0x40 ; 64 28796: 4c e1 ldi r20, 0x1C ; 28 28798: 57 e4 ldi r21, 0x47 ; 71 2879a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2879e: 18 16 cp r1, r24 287a0: 3c f4 brge .+14 ; 0x287b0 287a2: c1 2c mov r12, r1 287a4: 20 e4 ldi r18, 0x40 ; 64 287a6: d2 2e mov r13, r18 287a8: 2c e1 ldi r18, 0x1C ; 28 287aa: e2 2e mov r14, r18 287ac: 27 e4 ldi r18, 0x47 ; 71 287ae: f2 2e mov r15, r18 float advance_rate = (F_CPU / 8.0) / advance_speed; 287b0: a7 01 movw r20, r14 287b2: 96 01 movw r18, r12 287b4: 60 e0 ldi r22, 0x00 ; 0 287b6: 74 e2 ldi r23, 0x24 ; 36 287b8: 84 ef ldi r24, 0xF4 ; 244 287ba: 99 e4 ldi r25, 0x49 ; 73 287bc: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 287c0: 4b 01 movw r8, r22 287c2: 5c 01 movw r10, r24 if (advance_speed > 20000) { 287c4: 20 e0 ldi r18, 0x00 ; 0 287c6: 30 e4 ldi r19, 0x40 ; 64 287c8: 4c e9 ldi r20, 0x9C ; 156 287ca: 56 e4 ldi r21, 0x46 ; 70 287cc: c7 01 movw r24, r14 287ce: b6 01 movw r22, r12 287d0: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 287d4: 18 16 cp r1, r24 287d6: 0c f0 brlt .+2 ; 0x287da 287d8: 17 c4 rjmp .+2094 ; 0x29008 block->advance_rate = advance_rate * 4; 287da: 8e e6 ldi r24, 0x6E ; 110 287dc: 82 9d mul r24, r2 287de: 80 01 movw r16, r0 287e0: 83 9d mul r24, r3 287e2: 10 0d add r17, r0 287e4: 11 24 eor r1, r1 287e6: 02 5a subi r16, 0xA2 ; 162 287e8: 19 4f sbci r17, 0xF9 ; 249 287ea: 78 01 movw r14, r16 287ec: fd e4 ldi r31, 0x4D ; 77 287ee: ef 0e add r14, r31 287f0: f1 1c adc r15, r1 287f2: 20 e0 ldi r18, 0x00 ; 0 287f4: 30 e0 ldi r19, 0x00 ; 0 287f6: 40 e8 ldi r20, 0x80 ; 128 287f8: 50 e4 ldi r21, 0x40 ; 64 287fa: c5 01 movw r24, r10 287fc: b4 01 movw r22, r8 287fe: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28802: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 28806: d7 01 movw r26, r14 28808: 6d 93 st X+, r22 2880a: 7c 93 st X, r23 block->advance_step_loops = 4; 2880c: f8 01 movw r30, r16 2880e: ed 5a subi r30, 0xAD ; 173 28810: ff 4f sbci r31, 0xFF ; 255 28812: 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; 28814: 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); 28816: 09 a5 ldd r16, Y+41 ; 0x29 28818: 1d a5 ldd r17, Y+45 ; 0x2d 2881a: 29 ad ldd r18, Y+57 ; 0x39 2881c: 39 a9 ldd r19, Y+49 ; 0x31 2881e: 4d ad ldd r20, Y+61 ; 0x3d 28820: 5d a9 ldd r21, Y+53 ; 0x35 28822: 6e ad ldd r22, Y+62 ; 0x3e 28824: 23 96 adiw r28, 0x03 ; 3 28826: 7f ad ldd r23, Y+63 ; 0x3f 28828: 23 97 sbiw r28, 0x03 ; 3 2882a: a3 96 adiw r28, 0x23 ; 35 2882c: 8e ad ldd r24, Y+62 ; 0x3e 2882e: 9f ad ldd r25, Y+63 ; 0x3f 28830: a3 97 sbiw r28, 0x23 ; 35 28832: 82 5a subi r24, 0xA2 ; 162 28834: 99 4f sbci r25, 0xF9 ; 249 28836: 0f 94 6f 06 call 0x20cde ; 0x20cde if (block->step_event_count.wide <= 32767) 2883a: 8e e6 ldi r24, 0x6E ; 110 2883c: 82 9d mul r24, r2 2883e: f0 01 movw r30, r0 28840: 83 9d mul r24, r3 28842: f0 0d add r31, r0 28844: 11 24 eor r1, r1 28846: e2 5a subi r30, 0xA2 ; 162 28848: f9 4f sbci r31, 0xF9 ; 249 2884a: 80 89 ldd r24, Z+16 ; 0x10 2884c: 91 89 ldd r25, Z+17 ; 0x11 2884e: a2 89 ldd r26, Z+18 ; 0x12 28850: b3 89 ldd r27, Z+19 ; 0x13 28852: 81 15 cp r24, r1 28854: 90 48 sbci r25, 0x80 ; 128 28856: a1 05 cpc r26, r1 28858: b1 05 cpc r27, r1 2885a: 18 f4 brcc .+6 ; 0x28862 block->flag |= BLOCK_FLAG_DDA_LOWRES; 2885c: 85 a9 ldd r24, Z+53 ; 0x35 2885e: 88 60 ori r24, 0x08 ; 8 28860: 85 ab std Z+53, r24 ; 0x35 ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { 28862: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 28864: 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; 28866: 90 91 42 0d lds r25, 0x0D42 ; 0x800d42 2886a: 91 11 cpse r25, r1 2886c: 93 c4 rjmp .+2342 ; 0x29194 block_buffer_head = next_buffer_head; 2886e: a0 96 adiw r28, 0x20 ; 32 28870: 3f ad ldd r19, Y+63 ; 0x3f 28872: a0 97 sbiw r28, 0x20 ; 32 28874: 30 93 3e 0d sts 0x0D3E, r19 ; 0x800d3e (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 28878: 8f bf out 0x3f, r24 ; 63 } // Update position memcpy(position, target, sizeof(target)); // position[] = target[] 2887a: c3 58 subi r28, 0x83 ; 131 2887c: df 4f sbci r29, 0xFF ; 255 2887e: 88 81 ld r24, Y 28880: 99 81 ldd r25, Y+1 ; 0x01 28882: aa 81 ldd r26, Y+2 ; 0x02 28884: bb 81 ldd r27, Y+3 ; 0x03 28886: cd 57 subi r28, 0x7D ; 125 28888: d0 40 sbci r29, 0x00 ; 0 2888a: 80 93 3c 06 sts 0x063C, r24 ; 0x80063c 2888e: 90 93 3d 06 sts 0x063D, r25 ; 0x80063d 28892: a0 93 3e 06 sts 0x063E, r26 ; 0x80063e 28896: b0 93 3f 06 sts 0x063F, r27 ; 0x80063f 2889a: cf 57 subi r28, 0x7F ; 127 2889c: df 4f sbci r29, 0xFF ; 255 2889e: 28 81 ld r18, Y 288a0: 39 81 ldd r19, Y+1 ; 0x01 288a2: 4a 81 ldd r20, Y+2 ; 0x02 288a4: 5b 81 ldd r21, Y+3 ; 0x03 288a6: c1 58 subi r28, 0x81 ; 129 288a8: d0 40 sbci r29, 0x00 ; 0 288aa: 20 93 40 06 sts 0x0640, r18 ; 0x800640 288ae: 30 93 41 06 sts 0x0641, r19 ; 0x800641 288b2: 40 93 42 06 sts 0x0642, r20 ; 0x800642 288b6: 50 93 43 06 sts 0x0643, r21 ; 0x800643 288ba: e5 96 adiw r28, 0x35 ; 53 288bc: 8c ad ldd r24, Y+60 ; 0x3c 288be: 9d ad ldd r25, Y+61 ; 0x3d 288c0: ae ad ldd r26, Y+62 ; 0x3e 288c2: bf ad ldd r27, Y+63 ; 0x3f 288c4: e5 97 sbiw r28, 0x35 ; 53 288c6: 80 93 44 06 sts 0x0644, r24 ; 0x800644 288ca: 90 93 45 06 sts 0x0645, r25 ; 0x800645 288ce: a0 93 46 06 sts 0x0646, r26 ; 0x800646 288d2: b0 93 47 06 sts 0x0647, r27 ; 0x800647 288d6: ad 96 adiw r28, 0x2d ; 45 288d8: 2c ad ldd r18, Y+60 ; 0x3c 288da: 3d ad ldd r19, Y+61 ; 0x3d 288dc: 4e ad ldd r20, Y+62 ; 0x3e 288de: 5f ad ldd r21, Y+63 ; 0x3f 288e0: ad 97 sbiw r28, 0x2d ; 45 288e2: 20 93 48 06 sts 0x0648, r18 ; 0x800648 288e6: 30 93 49 06 sts 0x0649, r19 ; 0x800649 288ea: 40 93 4a 06 sts 0x064A, r20 ; 0x80064a 288ee: 50 93 4b 06 sts 0x064B, r21 ; 0x80064b #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 288f2: 89 a1 ldd r24, Y+33 ; 0x21 288f4: 9a a1 ldd r25, Y+34 ; 0x22 288f6: ab a1 ldd r26, Y+35 ; 0x23 288f8: bc a1 ldd r27, Y+36 ; 0x24 288fa: 80 93 36 04 sts 0x0436, r24 ; 0x800436 288fe: 90 93 37 04 sts 0x0437, r25 ; 0x800437 28902: a0 93 38 04 sts 0x0438, r26 ; 0x800438 28906: b0 93 39 04 sts 0x0439, r27 ; 0x800439 position_float[Y_AXIS] = y; 2890a: 8d a1 ldd r24, Y+37 ; 0x25 2890c: 9e a1 ldd r25, Y+38 ; 0x26 2890e: af a1 ldd r26, Y+39 ; 0x27 28910: b8 a5 ldd r27, Y+40 ; 0x28 28912: 80 93 3a 04 sts 0x043A, r24 ; 0x80043a 28916: 90 93 3b 04 sts 0x043B, r25 ; 0x80043b 2891a: a0 93 3c 04 sts 0x043C, r26 ; 0x80043c 2891e: b0 93 3d 04 sts 0x043D, r27 ; 0x80043d position_float[Z_AXIS] = z; 28922: a7 96 adiw r28, 0x27 ; 39 28924: 8c ad ldd r24, Y+60 ; 0x3c 28926: 9d ad ldd r25, Y+61 ; 0x3d 28928: ae ad ldd r26, Y+62 ; 0x3e 2892a: bf ad ldd r27, Y+63 ; 0x3f 2892c: a7 97 sbiw r28, 0x27 ; 39 2892e: 80 93 3e 04 sts 0x043E, r24 ; 0x80043e 28932: 90 93 3f 04 sts 0x043F, r25 ; 0x80043f 28936: a0 93 40 04 sts 0x0440, r26 ; 0x800440 2893a: b0 93 41 04 sts 0x0441, r27 ; 0x800441 position_float[E_AXIS] = e; 2893e: a9 96 adiw r28, 0x29 ; 41 28940: ee ad ldd r30, Y+62 ; 0x3e 28942: ff ad ldd r31, Y+63 ; 0x3f 28944: a9 97 sbiw r28, 0x29 ; 41 28946: 80 81 ld r24, Z 28948: 91 81 ldd r25, Z+1 ; 0x01 2894a: a2 81 ldd r26, Z+2 ; 0x02 2894c: b3 81 ldd r27, Z+3 ; 0x03 2894e: 80 93 42 04 sts 0x0442, r24 ; 0x800442 28952: 90 93 43 04 sts 0x0443, r25 ; 0x800443 28956: a0 93 44 04 sts 0x0444, r26 ; 0x800444 2895a: 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; 2895e: 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); 28962: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 28966: 8f 19 sub r24, r15 28968: 8f 70 andi r24, 0x0F ; 15 if (n_blocks >= 3) { 2896a: 83 30 cpi r24, 0x03 ; 3 2896c: 40 f1 brcs .+80 ; 0x289be // Initialize the last tripple of blocks. block_index = prev_block_index(block_buffer_head); 2896e: 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) 28972: 11 11 cpse r17, r1 28974: 01 c0 rjmp .+2 ; 0x28978 block_index = BLOCK_BUFFER_SIZE; 28976: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 28978: 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; 2897a: fe e6 ldi r31, 0x6E ; 110 2897c: 1f 9f mul r17, r31 2897e: c0 01 movw r24, r0 28980: 11 24 eor r1, r1 28982: 9c 01 movw r18, r24 28984: 22 5a subi r18, 0xA2 ; 162 28986: 39 4f sbci r19, 0xF9 ; 249 28988: 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) 2898a: 11 11 cpse r17, r1 2898c: 01 c0 rjmp .+2 ; 0x28990 block_index = BLOCK_BUFFER_SIZE; 2898e: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 28990: 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)); 28992: 3e e6 ldi r19, 0x6E ; 110 28994: 13 9f mul r17, r19 28996: c0 01 movw r24, r0 28998: 11 24 eor r1, r1 2899a: ac 01 movw r20, r24 2899c: 42 5a subi r20, 0xA2 ; 162 2899e: 59 4f sbci r21, 0xF9 ; 249 289a0: 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)); 289a2: 9e e6 ldi r25, 0x6E ; 110 289a4: 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) { 289a6: f1 16 cp r15, r17 289a8: 69 f0 breq .+26 ; 0x289c4 if (current->flag & BLOCK_FLAG_START_FROM_FULL_HALT) { 289aa: d6 01 movw r26, r12 289ac: d5 96 adiw r26, 0x35 ; 53 289ae: 0c 91 ld r16, X 289b0: 02 ff sbrs r16, 2 289b2: 7e c3 rjmp .+1788 ; 0x290b0 // 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); 289b4: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 289b8: 81 1b sub r24, r17 289ba: 8f 70 andi r24, 0x0F ; 15 289bc: f1 2e mov r15, r17 } // SERIAL_ECHOLNPGM("planner_recalculate - 2"); // Forward pass and recalculate the trapezoids. if (n_blocks >= 2) { 289be: 82 30 cpi r24, 0x02 ; 2 289c0: 08 f4 brcc .+2 ; 0x289c4 289c2: a3 c0 rjmp .+326 ; 0x28b0a // 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; 289c4: 3e e6 ldi r19, 0x6E ; 110 289c6: f3 9e mul r15, r19 289c8: c0 01 movw r24, r0 289ca: 11 24 eor r1, r1 289cc: ac 01 movw r20, r24 289ce: 42 5a subi r20, 0xA2 ; 162 289d0: 59 4f sbci r21, 0xF9 ; 249 289d2: 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) 289d4: f3 94 inc r15 289d6: 50 e1 ldi r21, 0x10 ; 16 289d8: f5 12 cpse r15, r21 289da: 01 c0 rjmp .+2 ; 0x289de block_index = 0; 289dc: 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)); 289de: ae e6 ldi r26, 0x6E ; 110 289e0: fa 9e mul r15, r26 289e2: c0 01 movw r24, r0 289e4: 11 24 eor r1, r1 289e6: fc 01 movw r30, r24 289e8: e2 5a subi r30, 0xA2 ; 162 289ea: f9 4f sbci r31, 0xF9 ; 249 289ec: 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)); 289ee: 8e e6 ldi r24, 0x6E ; 110 289f0: 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) { 289f2: d5 01 movw r26, r10 289f4: d5 96 adiw r26, 0x35 ; 53 289f6: 8c 91 ld r24, X 289f8: d5 97 sbiw r26, 0x35 ; 53 289fa: 81 fd sbrc r24, 1 289fc: 5a c0 rjmp .+180 ; 0x28ab2 289fe: 95 96 adiw r26, 0x25 ; 37 28a00: 4d 90 ld r4, X+ 28a02: 5d 90 ld r5, X+ 28a04: 6d 90 ld r6, X+ 28a06: 7c 90 ld r7, X 28a08: 98 97 sbiw r26, 0x28 ; 40 28a0a: f6 01 movw r30, r12 28a0c: 95 a0 ldd r9, Z+37 ; 0x25 28a0e: e6 a0 ldd r14, Z+38 ; 0x26 28a10: 07 a1 ldd r16, Z+39 ; 0x27 28a12: 10 a5 ldd r17, Z+40 ; 0x28 28a14: 29 2d mov r18, r9 28a16: 3e 2d mov r19, r14 28a18: a8 01 movw r20, r16 28a1a: c3 01 movw r24, r6 28a1c: b2 01 movw r22, r4 28a1e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 28a22: 87 ff sbrs r24, 7 28a24: 46 c0 rjmp .+140 ; 0x28ab2 // 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); 28a26: a3 01 movw r20, r6 28a28: 92 01 movw r18, r4 28a2a: c3 01 movw r24, r6 28a2c: b2 01 movw r22, r4 28a2e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28a32: 2b 01 movw r4, r22 28a34: 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)); 28a36: d5 01 movw r26, r10 28a38: d1 96 adiw r26, 0x31 ; 49 28a3a: 6d 91 ld r22, X+ 28a3c: 7d 91 ld r23, X+ 28a3e: 8d 91 ld r24, X+ 28a40: 9c 91 ld r25, X 28a42: d4 97 sbiw r26, 0x34 ; 52 28a44: 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); 28a46: 9b 01 movw r18, r22 28a48: ac 01 movw r20, r24 28a4a: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 28a4e: f5 01 movw r30, r10 28a50: 25 a5 ldd r18, Z+45 ; 0x2d 28a52: 36 a5 ldd r19, Z+46 ; 0x2e 28a54: 47 a5 ldd r20, Z+47 ; 0x2f 28a56: 50 a9 ldd r21, Z+48 ; 0x30 28a58: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28a5c: 9b 01 movw r18, r22 28a5e: ac 01 movw r20, r24 28a60: c3 01 movw r24, r6 28a62: b2 01 movw r22, r4 28a64: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 28a68: 0f 94 77 a9 call 0x352ee ; 0x352ee 28a6c: 2b 01 movw r4, r22 28a6e: 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)); 28a70: 9b 01 movw r18, r22 28a72: ac 01 movw r20, r24 28a74: 69 2d mov r22, r9 28a76: 7e 2d mov r23, r14 28a78: c8 01 movw r24, r16 28a7a: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 28a7e: 87 ff sbrs r24, 7 28a80: 03 c0 rjmp .+6 ; 0x28a88 28a82: 49 2c mov r4, r9 28a84: 5e 2c mov r5, r14 28a86: 38 01 movw r6, r16 // Check for junction speed change if (current->entry_speed != entry_speed) { 28a88: 92 01 movw r18, r4 28a8a: a3 01 movw r20, r6 28a8c: 69 2d mov r22, r9 28a8e: 7e 2d mov r23, r14 28a90: c8 01 movw r24, r16 28a92: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 28a96: 88 23 and r24, r24 28a98: 61 f0 breq .+24 ; 0x28ab2 28a9a: d6 01 movw r26, r12 28a9c: d5 96 adiw r26, 0x35 ; 53 28a9e: 2c 91 ld r18, X current->entry_speed = entry_speed; 28aa0: c2 01 movw r24, r4 28aa2: d3 01 movw r26, r6 28aa4: f6 01 movw r30, r12 28aa6: 85 a3 std Z+37, r24 ; 0x25 28aa8: 96 a3 std Z+38, r25 ; 0x26 28aaa: a7 a3 std Z+39, r26 ; 0x27 28aac: b0 a7 std Z+40, r27 ; 0x28 current->flag |= BLOCK_FLAG_RECALCULATE; 28aae: 21 60 ori r18, 0x01 ; 1 28ab0: 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) { 28ab2: d5 01 movw r26, r10 28ab4: d5 96 adiw r26, 0x35 ; 53 28ab6: 8c 91 ld r24, X 28ab8: d5 97 sbiw r26, 0x35 ; 53 28aba: f6 01 movw r30, r12 28abc: 95 a9 ldd r25, Z+53 ; 0x35 28abe: 89 2b or r24, r25 28ac0: 80 ff sbrs r24, 0 28ac2: 14 c0 rjmp .+40 ; 0x28aec // NOTE: Entry and exit factors always > 0 by all previous logic operations. calculate_trapezoid_for_block(prev, prev->entry_speed, current->entry_speed); 28ac4: 05 a1 ldd r16, Z+37 ; 0x25 28ac6: 16 a1 ldd r17, Z+38 ; 0x26 28ac8: 27 a1 ldd r18, Z+39 ; 0x27 28aca: 30 a5 ldd r19, Z+40 ; 0x28 28acc: 95 96 adiw r26, 0x25 ; 37 28ace: 4d 91 ld r20, X+ 28ad0: 5d 91 ld r21, X+ 28ad2: 6d 91 ld r22, X+ 28ad4: 7c 91 ld r23, X 28ad6: 98 97 sbiw r26, 0x28 ; 40 28ad8: c5 01 movw r24, r10 28ada: 0f 94 6f 06 call 0x20cde ; 0x20cde // Reset current only to ensure next trapezoid is computed. prev->flag &= ~BLOCK_FLAG_RECALCULATE; 28ade: d5 01 movw r26, r10 28ae0: d5 96 adiw r26, 0x35 ; 53 28ae2: 8c 91 ld r24, X 28ae4: d5 97 sbiw r26, 0x35 ; 53 28ae6: 8e 7f andi r24, 0xFE ; 254 28ae8: d5 96 adiw r26, 0x35 ; 53 28aea: 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) 28aec: f3 94 inc r15 28aee: b0 e1 ldi r27, 0x10 ; 16 28af0: fb 12 cpse r15, r27 28af2: 01 c0 rjmp .+2 ; 0x28af6 block_index = 0; 28af4: 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)); 28af6: f8 9c mul r15, r8 28af8: c0 01 movw r24, r0 28afa: 11 24 eor r1, r1 28afc: 82 5a subi r24, 0xA2 ; 162 28afe: 99 4f sbci r25, 0xF9 ; 249 } while (block_index != block_buffer_head); 28b00: 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; 28b04: 56 01 movw r10, r12 current = block_buffer + (block_index = next_block_index(block_index)); } while (block_index != block_buffer_head); 28b06: f2 12 cpse r15, r18 28b08: 43 c3 rjmp .+1670 ; 0x29190 } // 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); 28b0a: 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) 28b0e: 81 11 cpse r24, r1 28b10: 01 c0 rjmp .+2 ; 0x28b14 block_index = BLOCK_BUFFER_SIZE; 28b12: 80 e1 ldi r24, 0x10 ; 16 -- block_index; 28b14: 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); 28b16: ee e6 ldi r30, 0x6E ; 110 28b18: 8e 9f mul r24, r30 28b1a: c0 01 movw r24, r0 28b1c: 11 24 eor r1, r1 28b1e: 9c 01 movw r18, r24 28b20: 22 5a subi r18, 0xA2 ; 162 28b22: 39 4f sbci r19, 0xF9 ; 249 28b24: 79 01 movw r14, r18 calculate_trapezoid_for_block(current, current->entry_speed, safe_final_speed); 28b26: d9 01 movw r26, r18 28b28: 95 96 adiw r26, 0x25 ; 37 28b2a: 4d 91 ld r20, X+ 28b2c: 5d 91 ld r21, X+ 28b2e: 6d 91 ld r22, X+ 28b30: 7c 91 ld r23, X 28b32: 98 97 sbiw r26, 0x28 ; 40 28b34: 09 a5 ldd r16, Y+41 ; 0x29 28b36: 1d a5 ldd r17, Y+45 ; 0x2d 28b38: 29 ad ldd r18, Y+57 ; 0x39 28b3a: 39 a9 ldd r19, Y+49 ; 0x31 28b3c: c7 01 movw r24, r14 28b3e: 0f 94 6f 06 call 0x20cde ; 0x20cde current->flag &= ~BLOCK_FLAG_RECALCULATE; 28b42: f7 01 movw r30, r14 28b44: 85 a9 ldd r24, Z+53 ; 0x35 28b46: 8e 7f andi r24, 0xFE ; 254 28b48: 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(); 28b4a: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 28b4e: 82 60 ori r24, 0x02 ; 2 28b50: 80 93 6f 00 sts 0x006F, r24 ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 28b54: 0d 94 26 3b jmp 0x2764c ; 0x2764c // 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)); 28b58: aa 54 subi r26, 0x4A ; 74 28b5a: b9 4f sbci r27, 0xF9 ; 249 28b5c: 80 e1 ldi r24, 0x10 ; 16 28b5e: e1 e6 ldi r30, 0x61 ; 97 28b60: f2 e1 ldi r31, 0x12 ; 18 28b62: 0d 94 61 3b jmp 0x276c2 ; 0x276c2 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]); 28b66: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 28b6a: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 28b6e: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 28b72: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 28b76: a7 96 adiw r28, 0x27 ; 39 28b78: 6c ad ldd r22, Y+60 ; 0x3c 28b7a: 7d ad ldd r23, Y+61 ; 0x3d 28b7c: 8e ad ldd r24, Y+62 ; 0x3e 28b7e: 9f ad ldd r25, Y+63 ; 0x3f 28b80: a7 97 sbiw r28, 0x27 ; 39 28b82: 0d 94 f7 3b jmp 0x277ee ; 0x277ee 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); 28b86: 81 e0 ldi r24, 0x01 ; 1 28b88: 80 8f std Z+24, r24 ; 0x18 28b8a: 0d 94 9d 3d jmp 0x27b3a ; 0x27b3a { if(feed_rate 28b92: b0 90 a4 0d lds r11, 0x0DA4 ; 0x800da4 28b96: 00 91 a5 0d lds r16, 0x0DA5 ; 0x800da5 28b9a: 10 91 a6 0d lds r17, 0x0DA6 ; 0x800da6 28b9e: 53 c8 rjmp .-3930 ; 0x27c46 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])); 28ba0: c5 01 movw r24, r10 28ba2: b4 01 movw r22, r8 28ba4: 0f 94 4a 9f call 0x33e94 ; 0x33e94 28ba8: 4b 01 movw r8, r22 28baa: 5c 01 movw r10, r24 28bac: c7 01 movw r24, r14 28bae: b6 01 movw r22, r12 28bb0: 0f 94 4a 9f call 0x33e94 ; 0x33e94 28bb4: 9b 01 movw r18, r22 28bb6: ac 01 movw r20, r24 28bb8: c5 01 movw r24, r10 28bba: b4 01 movw r22, r8 28bbc: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 28bc0: 6b 01 movw r12, r22 28bc2: 7c 01 movw r14, r24 28bc4: 22 96 adiw r28, 0x02 ; 2 28bc6: 6c ad ldd r22, Y+60 ; 0x3c 28bc8: 7d ad ldd r23, Y+61 ; 0x3d 28bca: 8e ad ldd r24, Y+62 ; 0x3e 28bcc: 9f ad ldd r25, Y+63 ; 0x3f 28bce: 22 97 sbiw r28, 0x02 ; 2 28bd0: 0f 94 4a 9f call 0x33e94 ; 0x33e94 28bd4: 9b 01 movw r18, r22 28bd6: ac 01 movw r20, r24 28bd8: c7 01 movw r24, r14 28bda: b6 01 movw r22, r12 28bdc: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 28be0: 0f 94 77 a9 call 0x352ee ; 0x352ee 28be4: 2e e6 ldi r18, 0x6E ; 110 28be6: 22 9d mul r18, r2 28be8: f0 01 movw r30, r0 28bea: 23 9d mul r18, r3 28bec: f0 0d add r31, r0 28bee: 11 24 eor r1, r1 28bf0: e2 5a subi r30, 0xA2 ; 162 28bf2: f9 4f sbci r31, 0xF9 ; 249 28bf4: 65 a7 std Z+45, r22 ; 0x2d 28bf6: 76 a7 std Z+46, r23 ; 0x2e 28bf8: 87 a7 std Z+47, r24 ; 0x2f 28bfa: 90 ab std Z+48, r25 ; 0x30 28bfc: c2 c8 rjmp .-3708 ; 0x27d82 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 28bfe: 2a 96 adiw r28, 0x0a ; 10 28c00: 2c ad ldd r18, Y+60 ; 0x3c 28c02: 3d ad ldd r19, Y+61 ; 0x3d 28c04: 4e ad ldd r20, Y+62 ; 0x3e 28c06: 5f ad ldd r21, Y+63 ; 0x3f 28c08: 2a 97 sbiw r28, 0x0a ; 10 28c0a: 23 2b or r18, r19 28c0c: 24 2b or r18, r20 28c0e: 25 2b or r18, r21 28c10: 09 f4 brne .+2 ; 0x28c14 28c12: 0e c1 rjmp .+540 ; 0x28e30 28c14: 60 91 9b 0d lds r22, 0x0D9B ; 0x800d9b 28c18: 70 91 9c 0d lds r23, 0x0D9C ; 0x800d9c 28c1c: 80 91 9d 0d lds r24, 0x0D9D ; 0x800d9d 28c20: 90 91 9e 0d lds r25, 0x0D9E ; 0x800d9e 28c24: 29 a5 ldd r18, Y+41 ; 0x29 28c26: 3a a5 ldd r19, Y+42 ; 0x2a 28c28: 4b a5 ldd r20, Y+43 ; 0x2b 28c2a: 5c a5 ldd r21, Y+44 ; 0x2c 28c2c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28c30: 0f 94 87 a6 call 0x34d0e ; 0x34d0e 28c34: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 28c38: 2b 01 movw r4, r22 28c3a: 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 28c3c: 80 91 a7 04 lds r24, 0x04A7 ; 0x8004a7 28c40: 90 91 a8 04 lds r25, 0x04A8 ; 0x8004a8 28c44: a0 91 a9 04 lds r26, 0x04A9 ; 0x8004a9 28c48: b0 91 aa 04 lds r27, 0x04AA ; 0x8004aa 28c4c: 8d a7 std Y+45, r24 ; 0x2d 28c4e: 9e a7 std Y+46, r25 ; 0x2e 28c50: af a7 std Y+47, r26 ; 0x2f 28c52: b8 ab std Y+48, r27 ; 0x30 && delta_mm[E_AXIS] >= 0 && fabs(delta_mm[Z_AXIS]) < 0.5; 28c54: 20 e0 ldi r18, 0x00 ; 0 28c56: 30 e0 ldi r19, 0x00 ; 0 28c58: a9 01 movw r20, r18 28c5a: bc 01 movw r22, r24 28c5c: cd 01 movw r24, r26 28c5e: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 28c62: 18 16 cp r1, r24 28c64: 0c f0 brlt .+2 ; 0x28c68 28c66: ed c0 rjmp .+474 ; 0x28e42 * 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 28c68: 20 e0 ldi r18, 0x00 ; 0 28c6a: 30 e0 ldi r19, 0x00 ; 0 28c6c: a9 01 movw r20, r18 28c6e: 26 96 adiw r28, 0x06 ; 6 28c70: 6c ad ldd r22, Y+60 ; 0x3c 28c72: 7d ad ldd r23, Y+61 ; 0x3d 28c74: 8e ad ldd r24, Y+62 ; 0x3e 28c76: 9f ad ldd r25, Y+63 ; 0x3f 28c78: 26 97 sbiw r28, 0x06 ; 6 28c7a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 28c7e: 87 fd sbrc r24, 7 28c80: e0 c0 rjmp .+448 ; 0x28e42 && fabs(delta_mm[Z_AXIS]) < 0.5; 28c82: 22 96 adiw r28, 0x02 ; 2 28c84: 6c ad ldd r22, Y+60 ; 0x3c 28c86: 7d ad ldd r23, Y+61 ; 0x3d 28c88: 8e ad ldd r24, Y+62 ; 0x3e 28c8a: 9f ad ldd r25, Y+63 ; 0x3f 28c8c: 22 97 sbiw r28, 0x02 ; 2 28c8e: 9f 77 andi r25, 0x7F ; 127 28c90: 20 e0 ldi r18, 0x00 ; 0 28c92: 30 e0 ldi r19, 0x00 ; 0 28c94: 40 e0 ldi r20, 0x00 ; 0 28c96: 5f e3 ldi r21, 0x3F ; 63 28c98: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 28c9c: 87 ff sbrs r24, 7 28c9e: d1 c0 rjmp .+418 ; 0x28e42 * * 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 28ca0: 8e e6 ldi r24, 0x6E ; 110 28ca2: 82 9d mul r24, r2 28ca4: 80 01 movw r16, r0 28ca6: 83 9d mul r24, r3 28ca8: 10 0d add r17, r0 28caa: 11 24 eor r1, r1 28cac: 06 55 subi r16, 0x56 ; 86 28cae: 19 4f sbci r17, 0xF9 ; 249 28cb0: 81 e0 ldi r24, 0x01 ; 1 28cb2: d8 01 movw r26, r16 28cb4: 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]) 28cb6: 20 91 36 04 lds r18, 0x0436 ; 0x800436 28cba: 30 91 37 04 lds r19, 0x0437 ; 0x800437 28cbe: 40 91 38 04 lds r20, 0x0438 ; 0x800438 28cc2: 50 91 39 04 lds r21, 0x0439 ; 0x800439 28cc6: 69 a1 ldd r22, Y+33 ; 0x21 28cc8: 7a a1 ldd r23, Y+34 ; 0x22 28cca: 8b a1 ldd r24, Y+35 ; 0x23 28ccc: 9c a1 ldd r25, Y+36 ; 0x24 28cce: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 28cd2: 69 ab std Y+49, r22 ; 0x31 28cd4: 7a ab std Y+50, r23 ; 0x32 28cd6: 8b ab std Y+51, r24 ; 0x33 28cd8: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 28cda: 20 91 3a 04 lds r18, 0x043A ; 0x80043a 28cde: 30 91 3b 04 lds r19, 0x043B ; 0x80043b 28ce2: 40 91 3c 04 lds r20, 0x043C ; 0x80043c 28ce6: 50 91 3d 04 lds r21, 0x043D ; 0x80043d 28cea: 6d a1 ldd r22, Y+37 ; 0x25 28cec: 7e a1 ldd r23, Y+38 ; 0x26 28cee: 8f a1 ldd r24, Y+39 ; 0x27 28cf0: 98 a5 ldd r25, Y+40 ; 0x28 28cf2: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 28cf6: 4b 01 movw r8, r22 28cf8: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 28cfa: 20 91 3e 04 lds r18, 0x043E ; 0x80043e 28cfe: 30 91 3f 04 lds r19, 0x043F ; 0x80043f 28d02: 40 91 40 04 lds r20, 0x0440 ; 0x800440 28d06: 50 91 41 04 lds r21, 0x0441 ; 0x800441 28d0a: a7 96 adiw r28, 0x27 ; 39 28d0c: 6c ad ldd r22, Y+60 ; 0x3c 28d0e: 7d ad ldd r23, Y+61 ; 0x3d 28d10: 8e ad ldd r24, Y+62 ; 0x3e 28d12: 9f ad ldd r25, Y+63 ; 0x3f 28d14: a7 97 sbiw r28, 0x27 ; 39 28d16: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 28d1a: 6b 01 movw r12, r22 28d1c: 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]) 28d1e: 29 a9 ldd r18, Y+49 ; 0x31 28d20: 3a a9 ldd r19, Y+50 ; 0x32 28d22: 4b a9 ldd r20, Y+51 ; 0x33 28d24: 5c a9 ldd r21, Y+52 ; 0x34 28d26: ca 01 movw r24, r20 28d28: b9 01 movw r22, r18 28d2a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28d2e: 69 ab std Y+49, r22 ; 0x31 28d30: 7a ab std Y+50, r23 ; 0x32 28d32: 8b ab std Y+51, r24 ; 0x33 28d34: 9c ab std Y+52, r25 ; 0x34 + sq(y - position_float[Y_AXIS]) 28d36: a5 01 movw r20, r10 28d38: 94 01 movw r18, r8 28d3a: c5 01 movw r24, r10 28d3c: b4 01 movw r22, r8 28d3e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28d42: 9b 01 movw r18, r22 28d44: ac 01 movw r20, r24 28d46: 69 a9 ldd r22, Y+49 ; 0x31 28d48: 7a a9 ldd r23, Y+50 ; 0x32 28d4a: 8b a9 ldd r24, Y+51 ; 0x33 28d4c: 9c a9 ldd r25, Y+52 ; 0x34 28d4e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 28d52: 4b 01 movw r8, r22 28d54: 5c 01 movw r10, r24 + sq(z - position_float[Z_AXIS])); 28d56: a7 01 movw r20, r14 28d58: 96 01 movw r18, r12 28d5a: c7 01 movw r24, r14 28d5c: b6 01 movw r22, r12 28d5e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28d62: 9b 01 movw r18, r22 28d64: ac 01 movw r20, r24 28d66: c5 01 movw r24, r10 28d68: b4 01 movw r22, r8 28d6a: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__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]) 28d6e: 0f 94 77 a9 call 0x352ee ; 0x352ee 28d72: 6b 01 movw r12, r22 28d74: 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]); 28d76: 20 91 42 04 lds r18, 0x0442 ; 0x800442 28d7a: 30 91 43 04 lds r19, 0x0443 ; 0x800443 28d7e: 40 91 44 04 lds r20, 0x0444 ; 0x800444 28d82: 50 91 45 04 lds r21, 0x0445 ; 0x800445 28d86: a9 96 adiw r28, 0x29 ; 41 28d88: ee ad ldd r30, Y+62 ; 0x3e 28d8a: ff ad ldd r31, Y+63 ; 0x3f 28d8c: a9 97 sbiw r28, 0x29 ; 41 28d8e: 60 81 ld r22, Z 28d90: 71 81 ldd r23, Z+1 ; 0x01 28d92: 82 81 ldd r24, Z+2 ; 0x02 28d94: 93 81 ldd r25, Z+3 ; 0x03 28d96: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__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; 28d9a: a7 01 movw r20, r14 28d9c: 96 01 movw r18, r12 28d9e: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 28da2: 6a 96 adiw r28, 0x1a ; 26 28da4: 6c af std Y+60, r22 ; 0x3c 28da6: 7d af std Y+61, r23 ; 0x3d 28da8: 8e af std Y+62, r24 ; 0x3e 28daa: 9f af std Y+63, r25 ; 0x3f 28dac: 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) 28dae: 20 e0 ldi r18, 0x00 ; 0 28db0: 30 e0 ldi r19, 0x00 ; 0 28db2: 40 e4 ldi r20, 0x40 ; 64 28db4: 50 e4 ldi r21, 0x40 ; 64 28db6: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 28dba: 18 16 cp r1, r24 28dbc: 0c f4 brge .+2 ; 0x28dc0 28dbe: 9e c0 rjmp .+316 ; 0x28efc block->use_advance_lead = false; else if (e_D_ratio > 0) { 28dc0: 20 e0 ldi r18, 0x00 ; 0 28dc2: 30 e0 ldi r19, 0x00 ; 0 28dc4: a9 01 movw r20, r18 28dc6: 6a 96 adiw r28, 0x1a ; 26 28dc8: 6c ad ldd r22, Y+60 ; 0x3c 28dca: 7d ad ldd r23, Y+61 ; 0x3d 28dcc: 8e ad ldd r24, Y+62 ; 0x3e 28dce: 9f ad ldd r25, Y+63 ; 0x3f 28dd0: 6a 97 sbiw r28, 0x1a ; 26 28dd2: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 28dd6: 18 16 cp r1, r24 28dd8: 0c f0 brlt .+2 ; 0x28ddc 28dda: 42 c0 rjmp .+132 ; 0x28e60 const uint32_t max_accel_steps_per_s2 = ceil(cs.max_jerk[E_AXIS] / (extruder_advance_K * e_D_ratio) * steps_per_mm); 28ddc: 6a 96 adiw r28, 0x1a ; 26 28dde: 2c ad ldd r18, Y+60 ; 0x3c 28de0: 3d ad ldd r19, Y+61 ; 0x3d 28de2: 4e ad ldd r20, Y+62 ; 0x3e 28de4: 5f ad ldd r21, Y+63 ; 0x3f 28de6: 6a 97 sbiw r28, 0x1a ; 26 28de8: 6d a5 ldd r22, Y+45 ; 0x2d 28dea: 7e a5 ldd r23, Y+46 ; 0x2e 28dec: 8f a5 ldd r24, Y+47 ; 0x2f 28dee: 98 a9 ldd r25, Y+48 ; 0x30 28df0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28df4: 9b 01 movw r18, r22 28df6: ac 01 movw r20, r24 28df8: 60 91 bb 0d lds r22, 0x0DBB ; 0x800dbb 28dfc: 70 91 bc 0d lds r23, 0x0DBC ; 0x800dbc 28e00: 80 91 bd 0d lds r24, 0x0DBD ; 0x800dbd 28e04: 90 91 be 0d lds r25, 0x0DBE ; 0x800dbe 28e08: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 28e0c: 29 a5 ldd r18, Y+41 ; 0x29 28e0e: 3a a5 ldd r19, Y+42 ; 0x2a 28e10: 4b a5 ldd r20, Y+43 ; 0x2b 28e12: 5c a5 ldd r21, Y+44 ; 0x2c 28e14: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28e18: 0f 94 87 a6 call 0x34d0e ; 0x34d0e 28e1c: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 28e20: 64 15 cp r22, r4 28e22: 75 05 cpc r23, r5 28e24: 86 05 cpc r24, r6 28e26: 97 05 cpc r25, r7 28e28: d8 f4 brcc .+54 ; 0x28e60 28e2a: 2b 01 movw r4, r22 28e2c: 3c 01 movw r6, r24 28e2e: 18 c0 rjmp .+48 ; 0x28e60 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 28e30: 60 91 27 0e lds r22, 0x0E27 ; 0x800e27 28e34: 70 91 28 0e lds r23, 0x0E28 ; 0x800e28 28e38: 80 91 29 0e lds r24, 0x0E29 ; 0x800e29 28e3c: 90 91 2a 0e lds r25, 0x0E2A ; 0x800e2a 28e40: f1 ce rjmp .-542 ; 0x28c24 * * 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 28e42: 8e e6 ldi r24, 0x6E ; 110 28e44: 82 9d mul r24, r2 28e46: f0 01 movw r30, r0 28e48: 83 9d mul r24, r3 28e4a: f0 0d add r31, r0 28e4c: 11 24 eor r1, r1 28e4e: e6 55 subi r30, 0x56 ; 86 28e50: f9 4f sbci r31, 0xF9 ; 249 28e52: 10 82 st Z, r1 block->nominal_speed *= speed_factor; block->nominal_rate *= speed_factor; } #ifdef LIN_ADVANCE float e_D_ratio = 0; 28e54: 6a 96 adiw r28, 0x1a ; 26 28e56: 1c ae std Y+60, r1 ; 0x3c 28e58: 1d ae std Y+61, r1 ; 0x3d 28e5a: 1e ae std Y+62, r1 ; 0x3e 28e5c: 1f ae std Y+63, r1 ; 0x3f 28e5e: 6a 97 sbiw r28, 0x1a ; 26 28e60: 10 e0 ldi r17, 0x00 ; 0 28e62: 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) 28e64: a3 96 adiw r28, 0x23 ; 35 28e66: ee ad ldd r30, Y+62 ; 0x3e 28e68: ff ad ldd r31, Y+63 ; 0x3f 28e6a: a3 97 sbiw r28, 0x23 ; 35 28e6c: e0 0f add r30, r16 28e6e: f1 1f adc r31, r17 28e70: e2 5a subi r30, 0xA2 ; 162 28e72: f9 4f sbci r31, 0xF9 ; 249 28e74: c0 80 ld r12, Z 28e76: d1 80 ldd r13, Z+1 ; 0x01 28e78: e2 80 ldd r14, Z+2 ; 0x02 28e7a: f3 80 ldd r15, Z+3 ; 0x03 28e7c: c1 14 cp r12, r1 28e7e: d1 04 cpc r13, r1 28e80: e1 04 cpc r14, r1 28e82: f1 04 cpc r15, r1 28e84: a1 f1 breq .+104 ; 0x28eee 28e86: f8 01 movw r30, r16 28e88: e5 55 subi r30, 0x55 ; 85 28e8a: fb 4f sbci r31, 0xFB ; 251 28e8c: 60 81 ld r22, Z 28e8e: 71 81 ldd r23, Z+1 ; 0x01 28e90: 82 81 ldd r24, Z+2 ; 0x02 28e92: 93 81 ldd r25, Z+3 ; 0x03 28e94: 64 15 cp r22, r4 28e96: 75 05 cpc r23, r5 28e98: 86 05 cpc r24, r6 28e9a: 97 05 cpc r25, r7 28e9c: 40 f5 brcc .+80 ; 0x28eee { const float max_possible = float(max_acceleration_steps_per_s2[axis]) * float(block->step_event_count.wide) / float(block->steps[axis].wide); 28e9e: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 28ea2: 29 ad ldd r18, Y+57 ; 0x39 28ea4: 3a ad ldd r19, Y+58 ; 0x3a 28ea6: 4b ad ldd r20, Y+59 ; 0x3b 28ea8: 5c ad ldd r21, Y+60 ; 0x3c 28eaa: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 28eae: 4b 01 movw r8, r22 28eb0: 5c 01 movw r10, r24 28eb2: c7 01 movw r24, r14 28eb4: b6 01 movw r22, r12 28eb6: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 28eba: 9b 01 movw r18, r22 28ebc: ac 01 movw r20, r24 28ebe: c5 01 movw r24, r10 28ec0: b4 01 movw r22, r8 28ec2: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 28ec6: 6b 01 movw r12, r22 28ec8: 7c 01 movw r14, r24 if (max_possible < accel) accel = max_possible; 28eca: c3 01 movw r24, r6 28ecc: b2 01 movw r22, r4 28ece: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 28ed2: 9b 01 movw r18, r22 28ed4: ac 01 movw r20, r24 28ed6: c7 01 movw r24, r14 28ed8: b6 01 movw r22, r12 28eda: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 28ede: 87 ff sbrs r24, 7 28ee0: 06 c0 rjmp .+12 ; 0x28eee 28ee2: c7 01 movw r24, r14 28ee4: b6 01 movw r22, r12 28ee6: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 28eea: 2b 01 movw r4, r22 28eec: 3c 01 movw r6, r24 28eee: 0c 5f subi r16, 0xFC ; 252 28ef0: 1f 4f sbci r17, 0xFF ; 255 } } #endif // Limit acceleration per axis for (uint8_t axis = 0; axis < NUM_AXIS; axis++) 28ef2: 00 31 cpi r16, 0x10 ; 16 28ef4: 11 05 cpc r17, r1 28ef6: 09 f0 breq .+2 ; 0x28efa 28ef8: b5 cf rjmp .-150 ; 0x28e64 28efa: 01 c9 rjmp .-3582 ; 0x280fe // 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; 28efc: d8 01 movw r26, r16 28efe: 1c 92 st X, r1 28f00: af cf rjmp .-162 ; 0x28e60 if (jerk > mjerk) { safe_speed *= mjerk / jerk; limited = true; } } else { safe_speed = cs.max_jerk[axis]; 28f02: c9 a6 std Y+41, r12 ; 0x29 28f04: dd a6 std Y+45, r13 ; 0x2d 28f06: e9 ae std Y+57, r14 ; 0x39 28f08: f9 aa std Y+49, r15 ; 0x31 limited = true; 28f0a: 21 e0 ldi r18, 0x01 ; 1 28f0c: 2d ab std Y+53, r18 ; 0x35 28f0e: b1 c9 rjmp .-3230 ; 0x28272 // 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); 28f10: 27 96 adiw r28, 0x07 ; 7 28f12: 2f ad ldd r18, Y+63 ; 0x3f 28f14: 27 97 sbiw r28, 0x07 ; 7 28f16: 2b 96 adiw r28, 0x0b ; 11 28f18: 3f ad ldd r19, Y+63 ; 0x3f 28f1a: 2b 97 sbiw r28, 0x0b ; 11 28f1c: 2f 96 adiw r28, 0x0f ; 15 28f1e: 4f ad ldd r20, Y+63 ; 0x3f 28f20: 2f 97 sbiw r28, 0x0f ; 15 28f22: 63 96 adiw r28, 0x13 ; 19 28f24: 5f ad ldd r21, Y+63 ; 0x3f 28f26: 63 97 sbiw r28, 0x13 ; 19 28f28: 6b 96 adiw r28, 0x1b ; 27 28f2a: 6f ad ldd r22, Y+63 ; 0x3f 28f2c: 6b 97 sbiw r28, 0x1b ; 27 28f2e: 6f 96 adiw r28, 0x1f ; 31 28f30: 7f ad ldd r23, Y+63 ; 0x3f 28f32: 6f 97 sbiw r28, 0x1f ; 31 28f34: c8 01 movw r24, r16 28f36: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 28f3a: eb 96 adiw r28, 0x3b ; 59 28f3c: 6c af std Y+60, r22 ; 0x3c 28f3e: 7d af std Y+61, r23 ; 0x3d 28f40: 8e af std Y+62, r24 ; 0x3e 28f42: 9f af std Y+63, r25 ; 0x3f 28f44: 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; 28f46: 6b 96 adiw r28, 0x1b ; 27 28f48: ef ad ldd r30, Y+63 ; 0x3f 28f4a: 6b 97 sbiw r28, 0x1b ; 27 28f4c: ed af std Y+61, r30 ; 0x3d 28f4e: 6f 96 adiw r28, 0x1f ; 31 28f50: ff ad ldd r31, Y+63 ; 0x3f 28f52: 6f 97 sbiw r28, 0x1f ; 31 28f54: fd ab std Y+53, r31 ; 0x35 28f56: 0e af std Y+62, r16 ; 0x3e 28f58: 23 96 adiw r28, 0x03 ; 3 28f5a: 1f af std Y+63, r17 ; 0x3f 28f5c: 23 97 sbiw r28, 0x03 ; 3 28f5e: 04 ca rjmp .-3064 ; 0x28368 (v_exit > v_entry) ? ((v_entry > 0.f || v_exit < 0.f) ? // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : 28f60: f7 fa bst r15, 7 28f62: f0 94 com r15 28f64: f7 f8 bld r15, 7 28f66: f0 94 com r15 28f68: a5 01 movw r20, r10 28f6a: 94 01 movw r18, r8 28f6c: c7 01 movw r24, r14 28f6e: b6 01 movw r22, r12 28f70: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 28f74: 87 ff sbrs r24, 7 28f76: 77 ca rjmp .-2834 ; 0x28466 // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 28f78: 75 01 movw r14, r10 28f7a: 64 01 movw r12, r8 28f7c: 74 ca rjmp .-2840 ; 0x28466 // coasting (v_exit - v_entry) : // axis reversal max(v_exit, - v_entry)) : // v_exit <= v_entry ((v_entry < 0.f || v_exit > 0.f) ? 28f7e: c7 01 movw r24, r14 28f80: b6 01 movw r22, r12 28f82: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 28f86: 87 fd sbrc r24, 7 28f88: 09 c0 rjmp .+18 ; 0x28f9c 28f8a: 20 e0 ldi r18, 0x00 ; 0 28f8c: 30 e0 ldi r19, 0x00 ; 0 28f8e: a9 01 movw r20, r18 28f90: c5 01 movw r24, r10 28f92: b4 01 movw r22, r8 28f94: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 28f98: 18 16 cp r1, r24 28f9a: 2c f4 brge .+10 ; 0x28fa6 28f9c: a5 01 movw r20, r10 28f9e: 94 01 movw r18, r8 28fa0: c7 01 movw r24, r14 28fa2: b6 01 movw r22, r12 28fa4: 5c ca rjmp .-2888 ; 0x2845e // coasting (v_entry - v_exit) : // axis reversal max(- v_exit, v_entry)); 28fa6: b7 fa bst r11, 7 28fa8: b0 94 com r11 28faa: b7 f8 bld r11, 7 28fac: b0 94 com r11 28fae: a7 01 movw r20, r14 28fb0: 96 01 movw r18, r12 28fb2: c5 01 movw r24, r10 28fb4: b4 01 movw r22, r8 28fb6: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 28fba: 18 16 cp r1, r24 28fbc: 0c f0 brlt .+2 ; 0x28fc0 28fbe: 53 ca rjmp .-2906 ; 0x28466 28fc0: db cf rjmp .-74 ; 0x28f78 // 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; 28fc2: 8e e6 ldi r24, 0x6E ; 110 28fc4: 82 9d mul r24, r2 28fc6: f0 01 movw r30, r0 28fc8: 83 9d mul r24, r3 28fca: f0 0d add r31, r0 28fcc: 11 24 eor r1, r1 28fce: e2 5a subi r30, 0xA2 ; 162 28fd0: f9 4f sbci r31, 0xF9 ; 249 28fd2: 85 a9 ldd r24, Z+53 ; 0x35 28fd4: 84 60 ori r24, 0x04 ; 4 28fd6: 85 ab std Z+53, r24 ; 0x35 28fd8: a9 a5 ldd r26, Y+41 ; 0x29 28fda: ad af std Y+61, r26 ; 0x3d 28fdc: bd a5 ldd r27, Y+45 ; 0x2d 28fde: bd ab std Y+53, r27 ; 0x35 28fe0: e9 ad ldd r30, Y+57 ; 0x39 28fe2: ee af std Y+62, r30 ; 0x3e 28fe4: f9 a9 ldd r31, Y+49 ; 0x31 28fe6: 23 96 adiw r28, 0x03 ; 3 28fe8: ff af std Y+63, r31 ; 0x3f 28fea: 23 97 sbiw r28, 0x03 ; 3 28fec: bc ca rjmp .-2696 ; 0x28566 // 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; 28fee: 81 e0 ldi r24, 0x01 ; 1 28ff0: 30 cb rjmp .-2464 ; 0x28652 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]; 28ff2: 20 91 bb 0d lds r18, 0x0DBB ; 0x800dbb 28ff6: 30 91 bc 0d lds r19, 0x0DBC ; 0x800dbc 28ffa: 40 91 bd 0d lds r20, 0x0DBD ; 0x800dbd 28ffe: 50 91 be 0d lds r21, 0x0DBE ; 0x800dbe 29002: c7 01 movw r24, r14 29004: b6 01 movw r22, r12 29006: c1 cb rjmp .-2174 ; 0x2878a 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) { 29008: 20 e0 ldi r18, 0x00 ; 0 2900a: 30 e4 ldi r19, 0x40 ; 64 2900c: 4c e1 ldi r20, 0x1C ; 28 2900e: 56 e4 ldi r21, 0x46 ; 70 29010: c7 01 movw r24, r14 29012: b6 01 movw r22, r12 29014: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 29018: 18 16 cp r1, r24 2901a: d4 f4 brge .+52 ; 0x29050 block->advance_rate = advance_rate * 2; 2901c: 8e e6 ldi r24, 0x6E ; 110 2901e: 82 9d mul r24, r2 29020: 80 01 movw r16, r0 29022: 83 9d mul r24, r3 29024: 10 0d add r17, r0 29026: 11 24 eor r1, r1 29028: 02 5a subi r16, 0xA2 ; 162 2902a: 19 4f sbci r17, 0xF9 ; 249 2902c: 78 01 movw r14, r16 2902e: bd e4 ldi r27, 0x4D ; 77 29030: eb 0e add r14, r27 29032: f1 1c adc r15, r1 29034: a5 01 movw r20, r10 29036: 94 01 movw r18, r8 29038: c5 01 movw r24, r10 2903a: b4 01 movw r22, r8 2903c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 29040: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 29044: f7 01 movw r30, r14 29046: 71 83 std Z+1, r23 ; 0x01 29048: 60 83 st Z, r22 block->advance_step_loops = 2; 2904a: 36 96 adiw r30, 0x06 ; 6 2904c: 82 e0 ldi r24, 0x02 ; 2 2904e: e2 cb rjmp .-2108 ; 0x28814 } else { // never overflow the internal accumulator with very low rates if (advance_rate < UINT16_MAX) 29050: 20 e0 ldi r18, 0x00 ; 0 29052: 3f ef ldi r19, 0xFF ; 255 29054: 4f e7 ldi r20, 0x7F ; 127 29056: 57 e4 ldi r21, 0x47 ; 71 29058: c5 01 movw r24, r10 2905a: b4 01 movw r22, r8 2905c: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 29060: 87 ff sbrs r24, 7 29062: 19 c0 rjmp .+50 ; 0x29096 block->advance_rate = advance_rate; 29064: 8e e6 ldi r24, 0x6E ; 110 29066: 82 9d mul r24, r2 29068: 80 01 movw r16, r0 2906a: 83 9d mul r24, r3 2906c: 10 0d add r17, r0 2906e: 11 24 eor r1, r1 29070: 05 55 subi r16, 0x55 ; 85 29072: 19 4f sbci r17, 0xF9 ; 249 29074: c5 01 movw r24, r10 29076: b4 01 movw r22, r8 29078: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 2907c: d8 01 movw r26, r16 2907e: 6d 93 st X+, r22 29080: 7c 93 st X, r23 else block->advance_rate = UINT16_MAX; block->advance_step_loops = 1; 29082: 8e e6 ldi r24, 0x6E ; 110 29084: 82 9d mul r24, r2 29086: f0 01 movw r30, r0 29088: 83 9d mul r24, r3 2908a: f0 0d add r31, r0 2908c: 11 24 eor r1, r1 2908e: ef 54 subi r30, 0x4F ; 79 29090: f9 4f sbci r31, 0xF9 ; 249 29092: 81 e0 ldi r24, 0x01 ; 1 29094: bf cb rjmp .-2178 ; 0x28814 { // 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; 29096: 8e e6 ldi r24, 0x6E ; 110 29098: 82 9d mul r24, r2 2909a: f0 01 movw r30, r0 2909c: 83 9d mul r24, r3 2909e: f0 0d add r31, r0 290a0: 11 24 eor r1, r1 290a2: e5 55 subi r30, 0x55 ; 85 290a4: f9 4f sbci r31, 0xF9 ; 249 290a6: 8f ef ldi r24, 0xFF ; 255 290a8: 9f ef ldi r25, 0xFF ; 255 290aa: 91 83 std Z+1, r25 ; 0x01 290ac: 80 83 st Z, r24 290ae: e9 cf rjmp .-46 ; 0x29082 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) { 290b0: f6 01 movw r30, r12 290b2: 71 a4 ldd r7, Z+41 ; 0x29 290b4: 82 a4 ldd r8, Z+42 ; 0x2a 290b6: 93 a4 ldd r9, Z+43 ; 0x2b 290b8: e4 a4 ldd r14, Z+44 ; 0x2c 290ba: 27 2d mov r18, r7 290bc: 38 2d mov r19, r8 290be: 49 2d mov r20, r9 290c0: 5e 2d mov r21, r14 290c2: 65 a1 ldd r22, Z+37 ; 0x25 290c4: 76 a1 ldd r23, Z+38 ; 0x26 290c6: 87 a1 ldd r24, Z+39 ; 0x27 290c8: 90 a5 ldd r25, Z+40 ; 0x28 290ca: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 290ce: 88 23 and r24, r24 290d0: 09 f4 brne .+2 ; 0x290d4 290d2: 51 c0 rjmp .+162 ; 0x29176 // 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) ? 290d4: 01 fd sbrc r16, 1 290d6: 44 c0 rjmp .+136 ; 0x29160 290d8: d5 01 movw r26, r10 290da: 95 96 adiw r26, 0x25 ; 37 290dc: 2d 90 ld r2, X+ 290de: 3d 90 ld r3, X+ 290e0: 4d 90 ld r4, X+ 290e2: 5c 90 ld r5, X 290e4: 98 97 sbiw r26, 0x28 ; 40 290e6: a2 01 movw r20, r4 290e8: 91 01 movw r18, r2 290ea: 67 2d mov r22, r7 290ec: 78 2d mov r23, r8 290ee: 89 2d mov r24, r9 290f0: 9e 2d mov r25, r14 290f2: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 290f6: 18 16 cp r1, r24 290f8: 9c f5 brge .+102 ; 0x29160 // 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); 290fa: a2 01 movw r20, r4 290fc: 91 01 movw r18, r2 290fe: c2 01 movw r24, r4 29100: b1 01 movw r22, r2 29102: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 29106: 1b 01 movw r2, r22 29108: 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)); 2910a: f6 01 movw r30, r12 2910c: 61 a9 ldd r22, Z+49 ; 0x31 2910e: 72 a9 ldd r23, Z+50 ; 0x32 29110: 83 a9 ldd r24, Z+51 ; 0x33 29112: 94 a9 ldd r25, Z+52 ; 0x34 29114: 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); 29116: 9b 01 movw r18, r22 29118: ac 01 movw r20, r24 2911a: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2911e: d6 01 movw r26, r12 29120: 9d 96 adiw r26, 0x2d ; 45 29122: 2d 91 ld r18, X+ 29124: 3d 91 ld r19, X+ 29126: 4d 91 ld r20, X+ 29128: 5c 91 ld r21, X 2912a: d0 97 sbiw r26, 0x30 ; 48 2912c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 29130: 9b 01 movw r18, r22 29132: ac 01 movw r20, r24 29134: c2 01 movw r24, r4 29136: b1 01 movw r22, r2 29138: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2913c: 0f 94 77 a9 call 0x352ee ; 0x352ee 29140: 2b 01 movw r4, r22 29142: 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)); 29144: 9b 01 movw r18, r22 29146: ac 01 movw r20, r24 29148: 67 2d mov r22, r7 2914a: 78 2d mov r23, r8 2914c: 89 2d mov r24, r9 2914e: 9e 2d mov r25, r14 29150: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 29154: 87 fd sbrc r24, 7 29156: 04 c0 rjmp .+8 ; 0x29160 29158: 74 2c mov r7, r4 2915a: 85 2c mov r8, r5 2915c: 9a 2c mov r9, r10 2915e: 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) ? 29160: 87 2d mov r24, r7 29162: 98 2d mov r25, r8 29164: a9 2d mov r26, r9 29166: be 2d mov r27, r14 29168: f6 01 movw r30, r12 2916a: 85 a3 std Z+37, r24 ; 0x25 2916c: 96 a3 std Z+38, r25 ; 0x26 2916e: a7 a3 std Z+39, r26 ; 0x27 29170: 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; 29172: 01 60 ori r16, 0x01 ; 1 29174: 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) 29176: 11 11 cpse r17, r1 29178: 01 c0 rjmp .+2 ; 0x2917c block_index = BLOCK_BUFFER_SIZE; 2917a: 10 e1 ldi r17, 0x10 ; 16 -- block_index; 2917c: 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)); 2917e: 16 9d mul r17, r6 29180: c0 01 movw r24, r0 29182: 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; 29184: 56 01 movw r10, r12 current = block_buffer + (block_index = prev_block_index(block_index)); 29186: 9c 01 movw r18, r24 29188: 22 5a subi r18, 0xA2 ; 162 2918a: 39 4f sbci r19, 0xF9 ; 249 2918c: 69 01 movw r12, r18 2918e: 0b cc rjmp .-2026 ; 0x289a6 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)); 29190: 6c 01 movw r12, r24 29192: 2f cc rjmp .-1954 ; 0x289f2 29194: 8f bf out 0x3f, r24 ; 63 __asm__ volatile ("" ::: "memory"); 29196: 0d 94 26 3b jmp 0x2764c ; 0x2764c 0002919a : 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(){ 2919a: 4f 92 push r4 2919c: 5f 92 push r5 2919e: 6f 92 push r6 291a0: 7f 92 push r7 291a2: 8f 92 push r8 291a4: 9f 92 push r9 291a6: af 92 push r10 291a8: bf 92 push r11 291aa: cf 92 push r12 291ac: df 92 push r13 291ae: ef 92 push r14 291b0: ff 92 push r15 291b2: cf 93 push r28 291b4: df 93 push r29 291b6: cd b7 in r28, 0x3d ; 61 291b8: de b7 in r29, 0x3e ; 62 291ba: 2c 97 sbiw r28, 0x0c ; 12 291bc: 0f b6 in r0, 0x3f ; 63 291be: f8 94 cli 291c0: de bf out 0x3e, r29 ; 62 291c2: 0f be out 0x3f, r0 ; 63 291c4: 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]); 291c6: c0 90 69 12 lds r12, 0x1269 ; 0x801269 291ca: d0 90 6a 12 lds r13, 0x126A ; 0x80126a 291ce: e0 90 6b 12 lds r14, 0x126B ; 0x80126b 291d2: f0 90 6c 12 lds r15, 0x126C ; 0x80126c 291d6: 80 91 65 12 lds r24, 0x1265 ; 0x801265 291da: 90 91 66 12 lds r25, 0x1266 ; 0x801266 291de: a0 91 67 12 lds r26, 0x1267 ; 0x801267 291e2: b0 91 68 12 lds r27, 0x1268 ; 0x801268 291e6: 40 91 61 12 lds r20, 0x1261 ; 0x801261 291ea: 50 91 62 12 lds r21, 0x1262 ; 0x801262 291ee: 60 91 63 12 lds r22, 0x1263 ; 0x801263 291f2: 70 91 64 12 lds r23, 0x1264 ; 0x801264 291f6: 4d 83 std Y+5, r20 ; 0x05 291f8: 5e 83 std Y+6, r21 ; 0x06 291fa: 6f 83 std Y+7, r22 ; 0x07 291fc: 78 87 std Y+8, r23 ; 0x08 291fe: 89 83 std Y+1, r24 ; 0x01 29200: 9a 83 std Y+2, r25 ; 0x02 29202: ab 83 std Y+3, r26 ; 0x03 29204: 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); 29206: be 01 movw r22, r28 29208: 6f 5f subi r22, 0xFF ; 255 2920a: 7f 4f sbci r23, 0xFF ; 255 2920c: ce 01 movw r24, r28 2920e: 05 96 adiw r24, 0x05 ; 5 29210: 0e 94 c7 68 call 0xd18e ; 0xd18e position[X_AXIS] = lround(x*cs.axis_steps_per_mm[X_AXIS]); 29214: 4d 80 ldd r4, Y+5 ; 0x05 29216: 5e 80 ldd r5, Y+6 ; 0x06 29218: 6f 80 ldd r6, Y+7 ; 0x07 2921a: 78 84 ldd r7, Y+8 ; 0x08 2921c: 20 91 6b 0d lds r18, 0x0D6B ; 0x800d6b 29220: 30 91 6c 0d lds r19, 0x0D6C ; 0x800d6c 29224: 40 91 6d 0d lds r20, 0x0D6D ; 0x800d6d 29228: 50 91 6e 0d lds r21, 0x0D6E ; 0x800d6e 2922c: c3 01 movw r24, r6 2922e: b2 01 movw r22, r4 29230: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 29234: 0f 94 e6 a8 call 0x351cc ; 0x351cc 29238: 60 93 3c 06 sts 0x063C, r22 ; 0x80063c 2923c: 70 93 3d 06 sts 0x063D, r23 ; 0x80063d 29240: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 29244: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f position[Y_AXIS] = lround(y*cs.axis_steps_per_mm[Y_AXIS]); 29248: 89 80 ldd r8, Y+1 ; 0x01 2924a: 9a 80 ldd r9, Y+2 ; 0x02 2924c: ab 80 ldd r10, Y+3 ; 0x03 2924e: bc 80 ldd r11, Y+4 ; 0x04 29250: 20 91 6f 0d lds r18, 0x0D6F ; 0x800d6f 29254: 30 91 70 0d lds r19, 0x0D70 ; 0x800d70 29258: 40 91 71 0d lds r20, 0x0D71 ; 0x800d71 2925c: 50 91 72 0d lds r21, 0x0D72 ; 0x800d72 29260: c5 01 movw r24, r10 29262: b4 01 movw r22, r8 29264: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 29268: 0f 94 e6 a8 call 0x351cc ; 0x351cc 2926c: 60 93 40 06 sts 0x0640, r22 ; 0x800640 29270: 70 93 41 06 sts 0x0641, r23 ; 0x800641 29274: 80 93 42 06 sts 0x0642, r24 ; 0x800642 29278: 90 93 43 06 sts 0x0643, r25 ; 0x800643 #ifdef MESH_BED_LEVELING position[Z_AXIS] = mbl.active ? 2927c: 80 91 09 13 lds r24, 0x1309 ; 0x801309 29280: 88 23 and r24, r24 29282: 09 f4 brne .+2 ; 0x29286 29284: 8c c0 rjmp .+280 ; 0x2939e lround((z+mbl.get_z(x, y))*cs.axis_steps_per_mm[Z_AXIS]) : 29286: a5 01 movw r20, r10 29288: 94 01 movw r18, r8 2928a: c3 01 movw r24, r6 2928c: b2 01 movw r22, r4 2928e: 0f 94 19 92 call 0x32432 ; 0x32432 29292: 9b 01 movw r18, r22 29294: ac 01 movw r20, r24 29296: c7 01 movw r24, r14 29298: b6 01 movw r22, r12 2929a: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2929e: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 292a2: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 292a6: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 292aa: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 lround(z*cs.axis_steps_per_mm[Z_AXIS]); 292ae: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__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 ? 292b2: 0f 94 e6 a8 call 0x351cc ; 0x351cc 292b6: 60 93 44 06 sts 0x0644, r22 ; 0x800644 292ba: 70 93 45 06 sts 0x0645, r23 ; 0x800645 292be: 80 93 46 06 sts 0x0646, r24 ; 0x800646 292c2: 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]); 292c6: 80 91 6d 12 lds r24, 0x126D ; 0x80126d 292ca: 90 91 6e 12 lds r25, 0x126E ; 0x80126e 292ce: a0 91 6f 12 lds r26, 0x126F ; 0x80126f 292d2: b0 91 70 12 lds r27, 0x1270 ; 0x801270 292d6: 89 87 std Y+9, r24 ; 0x09 292d8: 9a 87 std Y+10, r25 ; 0x0a 292da: ab 87 std Y+11, r26 ; 0x0b 292dc: bc 87 std Y+12, r27 ; 0x0c 292de: 20 91 77 0d lds r18, 0x0D77 ; 0x800d77 292e2: 30 91 78 0d lds r19, 0x0D78 ; 0x800d78 292e6: 40 91 79 0d lds r20, 0x0D79 ; 0x800d79 292ea: 50 91 7a 0d lds r21, 0x0D7A ; 0x800d7a 292ee: bc 01 movw r22, r24 292f0: cd 01 movw r24, r26 292f2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 292f6: 0f 94 e6 a8 call 0x351cc ; 0x351cc 292fa: 60 93 48 06 sts 0x0648, r22 ; 0x800648 292fe: 70 93 49 06 sts 0x0649, r23 ; 0x800649 29302: 80 93 4a 06 sts 0x064A, r24 ; 0x80064a 29306: 90 93 4b 06 sts 0x064B, r25 ; 0x80064b #ifdef LIN_ADVANCE position_float[X_AXIS] = x; 2930a: 40 92 36 04 sts 0x0436, r4 ; 0x800436 2930e: 50 92 37 04 sts 0x0437, r5 ; 0x800437 29312: 60 92 38 04 sts 0x0438, r6 ; 0x800438 29316: 70 92 39 04 sts 0x0439, r7 ; 0x800439 position_float[Y_AXIS] = y; 2931a: 80 92 3a 04 sts 0x043A, r8 ; 0x80043a 2931e: 90 92 3b 04 sts 0x043B, r9 ; 0x80043b 29322: a0 92 3c 04 sts 0x043C, r10 ; 0x80043c 29326: b0 92 3d 04 sts 0x043D, r11 ; 0x80043d position_float[Z_AXIS] = z; 2932a: c0 92 3e 04 sts 0x043E, r12 ; 0x80043e 2932e: d0 92 3f 04 sts 0x043F, r13 ; 0x80043f 29332: e0 92 40 04 sts 0x0440, r14 ; 0x800440 29336: f0 92 41 04 sts 0x0441, r15 ; 0x800441 position_float[E_AXIS] = e; 2933a: 89 85 ldd r24, Y+9 ; 0x09 2933c: 9a 85 ldd r25, Y+10 ; 0x0a 2933e: ab 85 ldd r26, Y+11 ; 0x0b 29340: bc 85 ldd r27, Y+12 ; 0x0c 29342: 80 93 42 04 sts 0x0442, r24 ; 0x800442 29346: 90 93 43 04 sts 0x0443, r25 ; 0x800443 2934a: a0 93 44 04 sts 0x0444, r26 ; 0x800444 2934e: b0 93 45 04 sts 0x0445, r27 ; 0x800445 #endif st_set_position(position); 29352: 0f 94 06 7a call 0x2f40c ; 0x2f40c previous_nominal_speed = 0.0; // Resets planner junction speeds. Assumes start from rest. 29356: 10 92 22 04 sts 0x0422, r1 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.443> 2935a: 10 92 23 04 sts 0x0423, r1 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.443+0x1> 2935e: 10 92 24 04 sts 0x0424, r1 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.443+0x2> 29362: 10 92 25 04 sts 0x0425, r1 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.443+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 29366: e6 e2 ldi r30, 0x26 ; 38 29368: f4 e0 ldi r31, 0x04 ; 4 2936a: 80 e1 ldi r24, 0x10 ; 16 2936c: df 01 movw r26, r30 2936e: 1d 92 st X+, r1 29370: 8a 95 dec r24 29372: e9 f7 brne .-6 ; 0x2936e 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]); } 29374: 2c 96 adiw r28, 0x0c ; 12 29376: 0f b6 in r0, 0x3f ; 63 29378: f8 94 cli 2937a: de bf out 0x3e, r29 ; 62 2937c: 0f be out 0x3f, r0 ; 63 2937e: cd bf out 0x3d, r28 ; 61 29380: df 91 pop r29 29382: cf 91 pop r28 29384: ff 90 pop r15 29386: ef 90 pop r14 29388: df 90 pop r13 2938a: cf 90 pop r12 2938c: bf 90 pop r11 2938e: af 90 pop r10 29390: 9f 90 pop r9 29392: 8f 90 pop r8 29394: 7f 90 pop r7 29396: 6f 90 pop r6 29398: 5f 90 pop r5 2939a: 4f 90 pop r4 2939c: 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]); 2939e: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 293a2: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 293a6: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 293aa: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 293ae: c7 01 movw r24, r14 293b0: b6 01 movw r22, r12 293b2: 7d cf rjmp .-262 ; 0x292ae 000293b4 : 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) { 293b4: 8f 92 push r8 293b6: 9f 92 push r9 293b8: af 92 push r10 293ba: bf 92 push r11 293bc: cf 92 push r12 293be: df 92 push r13 293c0: ef 92 push r14 293c2: ff 92 push r15 293c4: 0f 93 push r16 293c6: 1f 93 push r17 293c8: 4b 01 movw r8, r22 293ca: 5c 01 movw r10, r24 plan_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], feed_rate); 293cc: e9 e2 ldi r30, 0x29 ; 41 293ce: f6 e0 ldi r31, 0x06 ; 6 293d0: e0 84 ldd r14, Z+8 ; 0x08 293d2: f1 84 ldd r15, Z+9 ; 0x09 293d4: 02 85 ldd r16, Z+10 ; 0x0a 293d6: 13 85 ldd r17, Z+11 ; 0x0b 293d8: 24 81 ldd r18, Z+4 ; 0x04 293da: 35 81 ldd r19, Z+5 ; 0x05 293dc: 46 81 ldd r20, Z+6 ; 0x06 293de: 57 81 ldd r21, Z+7 ; 0x07 293e0: 60 81 ld r22, Z 293e2: 71 81 ldd r23, Z+1 ; 0x01 293e4: 82 81 ldd r24, Z+2 ; 0x02 293e6: 93 81 ldd r25, Z+3 ; 0x03 293e8: 1f 92 push r1 293ea: 1f 92 push r1 293ec: 1f 92 push r1 293ee: 1f 92 push r1 293f0: e5 e3 ldi r30, 0x35 ; 53 293f2: ce 2e mov r12, r30 293f4: e6 e0 ldi r30, 0x06 ; 6 293f6: de 2e mov r13, r30 293f8: 0f 94 bf 3a call 0x2757e ; 0x2757e 293fc: 0f 90 pop r0 293fe: 0f 90 pop r0 29400: 0f 90 pop r0 29402: 0f 90 pop r0 } 29404: 1f 91 pop r17 29406: 0f 91 pop r16 29408: ff 90 pop r15 2940a: ef 90 pop r14 2940c: df 90 pop r13 2940e: cf 90 pop r12 29410: bf 90 pop r11 29412: af 90 pop r10 29414: 9f 90 pop r9 29416: 8f 90 pop r8 29418: 08 95 ret 0002941a : // Reset position sync requests plan_reset_next_e_queue = false; plan_reset_next_e_sched = false; } void plan_buffer_line_curposXYZE(float feed_rate) { 2941a: 8f 92 push r8 2941c: 9f 92 push r9 2941e: af 92 push r10 29420: bf 92 push r11 29422: cf 92 push r12 29424: df 92 push r13 29426: ef 92 push r14 29428: ff 92 push r15 2942a: 0f 93 push r16 2942c: 1f 93 push r17 2942e: 4b 01 movw r8, r22 29430: 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); 29432: e1 e6 ldi r30, 0x61 ; 97 29434: f2 e1 ldi r31, 0x12 ; 18 29436: e0 84 ldd r14, Z+8 ; 0x08 29438: f1 84 ldd r15, Z+9 ; 0x09 2943a: 02 85 ldd r16, Z+10 ; 0x0a 2943c: 13 85 ldd r17, Z+11 ; 0x0b 2943e: 24 81 ldd r18, Z+4 ; 0x04 29440: 35 81 ldd r19, Z+5 ; 0x05 29442: 46 81 ldd r20, Z+6 ; 0x06 29444: 57 81 ldd r21, Z+7 ; 0x07 29446: 60 81 ld r22, Z 29448: 71 81 ldd r23, Z+1 ; 0x01 2944a: 82 81 ldd r24, Z+2 ; 0x02 2944c: 93 81 ldd r25, Z+3 ; 0x03 2944e: 1f 92 push r1 29450: 1f 92 push r1 29452: 1f 92 push r1 29454: 1f 92 push r1 29456: ed e6 ldi r30, 0x6D ; 109 29458: ce 2e mov r12, r30 2945a: e2 e1 ldi r30, 0x12 ; 18 2945c: de 2e mov r13, r30 2945e: 0f 94 bf 3a call 0x2757e ; 0x2757e 29462: 0f 90 pop r0 29464: 0f 90 pop r0 29466: 0f 90 pop r0 29468: 0f 90 pop r0 } 2946a: 1f 91 pop r17 2946c: 0f 91 pop r16 2946e: ff 90 pop r15 29470: ef 90 pop r14 29472: df 90 pop r13 29474: cf 90 pop r12 29476: bf 90 pop r11 29478: af 90 pop r10 2947a: 9f 90 pop r9 2947c: 8f 90 pop r8 2947e: 08 95 ret 00029480 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]>: } } static void _lcd_move(const char *name, uint8_t axis, int min, int max) { 29480: 2f 92 push r2 29482: 3f 92 push r3 29484: 4f 92 push r4 29486: 5f 92 push r5 29488: 6f 92 push r6 2948a: 7f 92 push r7 2948c: 9f 92 push r9 2948e: af 92 push r10 29490: bf 92 push r11 29492: cf 92 push r12 29494: df 92 push r13 29496: ef 92 push r14 29498: ff 92 push r15 2949a: 0f 93 push r16 2949c: 1f 93 push r17 2949e: cf 93 push r28 294a0: df 93 push r29 if (homing_flag || mesh_bed_leveling_flag) 294a2: 70 91 71 12 lds r23, 0x1271 ; 0x801271 294a6: 71 11 cpse r23, r1 294a8: 04 c0 rjmp .+8 ; 0x294b2 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x32> 294aa: 70 91 72 12 lds r23, 0x1272 ; 0x801272 294ae: 77 23 and r23, r23 294b0: 99 f0 breq .+38 ; 0x294d8 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+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(); } 294b2: df 91 pop r29 294b4: cf 91 pop r28 294b6: 1f 91 pop r17 294b8: 0f 91 pop r16 294ba: ff 90 pop r15 294bc: ef 90 pop r14 294be: df 90 pop r13 294c0: cf 90 pop r12 294c2: bf 90 pop r11 294c4: af 90 pop r10 294c6: 9f 90 pop r9 294c8: 7f 90 pop r7 294ca: 6f 90 pop r6 294cc: 5f 90 pop r5 294ce: 4f 90 pop r4 294d0: 3f 90 pop r3 294d2: 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(); 294d4: 0c 94 6c 63 jmp 0xc6d8 ; 0xc6d8 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) 294d8: 70 91 96 03 lds r23, 0x0396 ; 0x800396 294dc: 71 11 cpse r23, r1 294de: 09 c0 rjmp .+18 ; 0x294f2 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x72> return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 294e0: 70 91 77 02 lds r23, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.385> check_endstops = check; 294e4: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.385> { _md->endstopsEnabledPrevious = enable_endstops(false); 294e8: 70 93 97 03 sts 0x0397, r23 ; 0x800397 _md->initialized = true; 294ec: 71 e0 ldi r23, 0x01 ; 1 294ee: 70 93 96 03 sts 0x0396, r23 ; 0x800396 294f2: 19 01 movw r2, r18 294f4: 6a 01 movw r12, r20 294f6: c6 2f mov r28, r22 294f8: d9 2f mov r29, r25 294fa: 98 2e mov r9, r24 } if (lcd_encoder != 0) 294fc: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 29500: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 29504: 89 2b or r24, r25 29506: 09 f4 brne .+2 ; 0x2950a <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x8a> 29508: 71 c0 rjmp .+226 ; 0x295ec <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x16c> { refresh_cmd_timeout(); 2950a: 0e 94 92 65 call 0xcb24 ; 0xcb24 } FORCE_INLINE bool planner_queue_full() { uint8_t next_block_index = block_buffer_head; 2950e: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e if (++ next_block_index == BLOCK_BUFFER_SIZE) 29512: 8f 5f subi r24, 0xFF ; 255 29514: 80 31 cpi r24, 0x10 ; 16 29516: 09 f4 brne .+2 ; 0x2951a <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x9a> next_block_index = 0; 29518: 80 e0 ldi r24, 0x00 ; 0 return block_buffer_tail == next_block_index; 2951a: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f if (! planner_queue_full()) 2951e: 98 17 cp r25, r24 29520: 09 f4 brne .+2 ; 0x29524 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0xa4> 29522: 64 c0 rjmp .+200 ; 0x295ec <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x16c> { current_position[axis] += lcd_encoder; 29524: 84 e0 ldi r24, 0x04 ; 4 29526: c8 9f mul r28, r24 29528: 80 01 movw r16, r0 2952a: 11 24 eor r1, r1 2952c: f8 01 movw r30, r16 2952e: ef 59 subi r30, 0x9F ; 159 29530: fd 4e sbci r31, 0xED ; 237 29532: 5f 01 movw r10, r30 29534: 60 91 1e 06 lds r22, 0x061E ; 0x80061e 29538: 70 91 1f 06 lds r23, 0x061F ; 0x80061f 2953c: 07 2e mov r0, r23 2953e: 00 0c add r0, r0 29540: 88 0b sbc r24, r24 29542: 99 0b sbc r25, r25 29544: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 29548: f5 01 movw r30, r10 2954a: 20 81 ld r18, Z 2954c: 31 81 ldd r19, Z+1 ; 0x01 2954e: 42 81 ldd r20, Z+2 ; 0x02 29550: 53 81 ldd r21, Z+3 ; 0x03 29552: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 29556: 2b 01 movw r4, r22 29558: 3c 01 movw r6, r24 if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 2955a: b6 01 movw r22, r12 2955c: dd 0c add r13, r13 2955e: 88 0b sbc r24, r24 29560: 99 0b sbc r25, r25 29562: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 29566: 6b 01 movw r12, r22 29568: 7c 01 movw r14, r24 2956a: ac 01 movw r20, r24 2956c: 9b 01 movw r18, r22 2956e: c3 01 movw r24, r6 29570: b2 01 movw r22, r4 29572: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 29576: f5 01 movw r30, r10 29578: 87 fd sbrc r24, 7 2957a: 7d c0 rjmp .+250 ; 0x29676 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x1f6> if (lcd_encoder != 0) { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; 2957c: 40 82 st Z, r4 2957e: 51 82 std Z+1, r5 ; 0x01 29580: 62 82 std Z+2, r6 ; 0x02 29582: 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; 29584: b1 01 movw r22, r2 29586: 33 0c add r3, r3 29588: 88 0b sbc r24, r24 2958a: 99 0b sbc r25, r25 2958c: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 29590: 2b 01 movw r4, r22 29592: 3c 01 movw r6, r24 29594: c8 01 movw r24, r16 29596: 8f 59 subi r24, 0x9F ; 159 29598: 9d 4e sbci r25, 0xED ; 237 2959a: 7c 01 movw r14, r24 2959c: a3 01 movw r20, r6 2959e: 92 01 movw r18, r4 295a0: fc 01 movw r30, r24 295a2: 60 81 ld r22, Z 295a4: 71 81 ldd r23, Z+1 ; 0x01 295a6: 82 81 ldd r24, Z+2 ; 0x02 295a8: 93 81 ldd r25, Z+3 ; 0x03 295aa: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 295ae: 18 16 cp r1, r24 295b0: 2c f4 brge .+10 ; 0x295bc <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x13c> 295b2: f7 01 movw r30, r14 295b4: 40 82 st Z, r4 295b6: 51 82 std Z+1, r5 ; 0x01 295b8: 62 82 std Z+2, r6 ; 0x02 295ba: 73 82 std Z+3, r7 ; 0x03 lcd_encoder = 0; 295bc: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 295c0: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 295c4: 65 e6 ldi r22, 0x65 ; 101 295c6: 72 e1 ldi r23, 0x12 ; 18 295c8: 81 e6 ldi r24, 0x61 ; 97 295ca: 92 e1 ldi r25, 0x12 ; 18 295cc: 0e 94 6f 69 call 0xd2de ; 0xd2de plan_buffer_line_curposXYZE(get_feedrate_mm_s(manual_feedrate[axis])); 295d0: f8 01 movw r30, r16 295d2: e0 52 subi r30, 0x20 ; 32 295d4: fd 4f sbci r31, 0xFD ; 253 295d6: 60 81 ld r22, Z 295d8: 71 81 ldd r23, Z+1 ; 0x01 295da: 82 81 ldd r24, Z+2 ; 0x02 295dc: 93 81 ldd r25, Z+3 ; 0x03 295de: 0e 94 96 65 call 0xcb2c ; 0xcb2c 295e2: 0f 94 0d 4a call 0x2941a ; 0x2941a lcd_draw_update = 1; 295e6: 81 e0 ldi r24, 0x01 ; 1 295e8: 80 93 59 02 sts 0x0259, r24 ; 0x800259 } } if (lcd_draw_update) 295ec: 80 91 59 02 lds r24, 0x0259 ; 0x800259 295f0: 88 23 and r24, r24 295f2: 11 f1 breq .+68 ; 0x29638 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x1b8> { lcd_set_cursor(0, 1); 295f4: 61 e0 ldi r22, 0x01 ; 1 295f6: 80 e0 ldi r24, 0x00 ; 0 295f8: 0e 94 ab 6f call 0xdf56 ; 0xdf56 menu_draw_float31(name, current_position[axis]); 295fc: 84 e0 ldi r24, 0x04 ; 4 295fe: c8 9f mul r28, r24 29600: f0 01 movw r30, r0 29602: 11 24 eor r1, r1 29604: ef 59 subi r30, 0x9F ; 159 29606: 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); 29608: 83 81 ldd r24, Z+3 ; 0x03 2960a: 8f 93 push r24 2960c: 82 81 ldd r24, Z+2 ; 0x02 2960e: 8f 93 push r24 29610: 81 81 ldd r24, Z+1 ; 0x01 29612: 8f 93 push r24 29614: 80 81 ld r24, Z 29616: 8f 93 push r24 29618: df 93 push r29 2961a: 9f 92 push r9 2961c: 8d e1 ldi r24, 0x1D ; 29 2961e: 93 e8 ldi r25, 0x83 ; 131 29620: 9f 93 push r25 29622: 8f 93 push r24 29624: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 29628: ed b7 in r30, 0x3d ; 61 2962a: fe b7 in r31, 0x3e ; 62 2962c: 38 96 adiw r30, 0x08 ; 8 2962e: 0f b6 in r0, 0x3f ; 63 29630: f8 94 cli 29632: fe bf out 0x3e, r31 ; 62 29634: 0f be out 0x3f, r0 ; 63 29636: ed bf out 0x3d, r30 ; 61 } if (menu_leaving || LCD_CLICKED) (void)enable_endstops(_md->endstopsEnabledPrevious); 29638: 80 91 c4 03 lds r24, 0x03C4 ; 0x8003c4 2963c: 81 11 cpse r24, r1 2963e: 04 c0 rjmp .+8 ; 0x29648 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x1c8> 29640: 80 91 95 03 lds r24, 0x0395 ; 0x800395 29644: 88 23 and r24, r24 29646: 21 f0 breq .+8 ; 0x29650 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x1d0> 29648: 80 91 97 03 lds r24, 0x0397 ; 0x800397 2964c: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.385> menu_back_if_clicked(); } 29650: df 91 pop r29 29652: cf 91 pop r28 29654: 1f 91 pop r17 29656: 0f 91 pop r16 29658: ff 90 pop r15 2965a: ef 90 pop r14 2965c: df 90 pop r13 2965e: cf 90 pop r12 29660: bf 90 pop r11 29662: af 90 pop r10 29664: 9f 90 pop r9 29666: 7f 90 pop r7 29668: 6f 90 pop r6 2966a: 5f 90 pop r5 2966c: 4f 90 pop r4 2966e: 3f 90 pop r3 29670: 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(); 29672: 0c 94 57 74 jmp 0xe8ae ; 0xe8ae { refresh_cmd_timeout(); if (! planner_queue_full()) { current_position[axis] += lcd_encoder; if (min_software_endstops && current_position[axis] < min) current_position[axis] = min; 29676: c0 82 st Z, r12 29678: d1 82 std Z+1, r13 ; 0x01 2967a: e2 82 std Z+2, r14 ; 0x02 2967c: f3 82 std Z+3, r15 ; 0x03 2967e: 82 cf rjmp .-252 ; 0x29584 <_lcd_move(char const*, unsigned char, int, int) [clone .lto_priv.406]+0x104> 00029680 : #endif /* PLANNER_DIAGNOSTICS */ extern volatile uint32_t step_events_completed; // The number of step events executed in the current block void planner_reset_position() { 29680: 4f 92 push r4 29682: 5f 92 push r5 29684: 6f 92 push r6 29686: 7f 92 push r7 29688: 8f 92 push r8 2968a: 9f 92 push r9 2968c: af 92 push r10 2968e: bf 92 push r11 29690: cf 92 push r12 29692: df 92 push r13 29694: ef 92 push r14 29696: ff 92 push r15 29698: cf 93 push r28 // First update the planner's current position in the physical motor steps. position[X_AXIS] = st_get_position(X_AXIS); 2969a: 80 e0 ldi r24, 0x00 ; 0 2969c: 0f 94 72 18 call 0x230e4 ; 0x230e4 296a0: 60 93 3c 06 sts 0x063C, r22 ; 0x80063c 296a4: 70 93 3d 06 sts 0x063D, r23 ; 0x80063d 296a8: 80 93 3e 06 sts 0x063E, r24 ; 0x80063e 296ac: 90 93 3f 06 sts 0x063F, r25 ; 0x80063f position[Y_AXIS] = st_get_position(Y_AXIS); 296b0: 81 e0 ldi r24, 0x01 ; 1 296b2: 0f 94 72 18 call 0x230e4 ; 0x230e4 296b6: 60 93 40 06 sts 0x0640, r22 ; 0x800640 296ba: 70 93 41 06 sts 0x0641, r23 ; 0x800641 296be: 80 93 42 06 sts 0x0642, r24 ; 0x800642 296c2: 90 93 43 06 sts 0x0643, r25 ; 0x800643 position[Z_AXIS] = st_get_position(Z_AXIS); 296c6: 82 e0 ldi r24, 0x02 ; 2 296c8: 0f 94 72 18 call 0x230e4 ; 0x230e4 296cc: 60 93 44 06 sts 0x0644, r22 ; 0x800644 296d0: 70 93 45 06 sts 0x0645, r23 ; 0x800645 296d4: 80 93 46 06 sts 0x0646, r24 ; 0x800646 296d8: 90 93 47 06 sts 0x0647, r25 ; 0x800647 position[E_AXIS] = st_get_position(E_AXIS); 296dc: 83 e0 ldi r24, 0x03 ; 3 296de: 0f 94 72 18 call 0x230e4 ; 0x230e4 296e2: 60 93 48 06 sts 0x0648, r22 ; 0x800648 296e6: 70 93 49 06 sts 0x0649, r23 ; 0x800649 296ea: 80 93 4a 06 sts 0x064A, r24 ; 0x80064a 296ee: 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); 296f2: 80 e0 ldi r24, 0x00 ; 0 296f4: 0f 94 80 18 call 0x23100 ; 0x23100 296f8: 60 93 61 12 sts 0x1261, r22 ; 0x801261 296fc: 70 93 62 12 sts 0x1262, r23 ; 0x801262 29700: 80 93 63 12 sts 0x1263, r24 ; 0x801263 29704: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = st_get_position_mm(Y_AXIS); 29708: 81 e0 ldi r24, 0x01 ; 1 2970a: 0f 94 80 18 call 0x23100 ; 0x23100 2970e: 60 93 65 12 sts 0x1265, r22 ; 0x801265 29712: 70 93 66 12 sts 0x1266, r23 ; 0x801266 29716: 80 93 67 12 sts 0x1267, r24 ; 0x801267 2971a: 90 93 68 12 sts 0x1268, r25 ; 0x801268 current_position[Z_AXIS] = st_get_position_mm(Z_AXIS); 2971e: 82 e0 ldi r24, 0x02 ; 2 29720: 0f 94 80 18 call 0x23100 ; 0x23100 29724: 60 93 69 12 sts 0x1269, r22 ; 0x801269 29728: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 2972c: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 29730: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c current_position[E_AXIS] = st_get_position_mm(E_AXIS); 29734: 83 e0 ldi r24, 0x03 ; 3 29736: 0f 94 80 18 call 0x23100 ; 0x23100 2973a: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 2973e: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 29742: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 29746: 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) { 2974a: 80 91 09 13 lds r24, 0x1309 ; 0x801309 2974e: 88 23 and r24, r24 29750: 31 f1 breq .+76 ; 0x2979e #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]); 29752: 20 91 65 12 lds r18, 0x1265 ; 0x801265 29756: 30 91 66 12 lds r19, 0x1266 ; 0x801266 2975a: 40 91 67 12 lds r20, 0x1267 ; 0x801267 2975e: 50 91 68 12 lds r21, 0x1268 ; 0x801268 29762: 60 91 61 12 lds r22, 0x1261 ; 0x801261 29766: 70 91 62 12 lds r23, 0x1262 ; 0x801262 2976a: 80 91 63 12 lds r24, 0x1263 ; 0x801263 2976e: 90 91 64 12 lds r25, 0x1264 ; 0x801264 29772: 0f 94 19 92 call 0x32432 ; 0x32432 29776: 9b 01 movw r18, r22 29778: ac 01 movw r20, r24 2977a: 60 91 69 12 lds r22, 0x1269 ; 0x801269 2977e: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 29782: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 29786: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 2978a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2978e: 60 93 69 12 sts 0x1269, r22 ; 0x801269 29792: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 29796: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 2979a: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c } } inline void machine2world(float &x, float &y) { if (world2machine_correction_mode == WORLD2MACHINE_CORRECTION_NONE) { 2979e: c0 91 a2 04 lds r28, 0x04A2 ; 0x8004a2 297a2: cc 23 and r28, r28 297a4: 09 f4 brne .+2 ; 0x297a8 297a6: 9a c0 rjmp .+308 ; 0x298dc // No correction. } else { if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SHIFT) { 297a8: c0 ff sbrs r28, 0 297aa: 34 c0 rjmp .+104 ; 0x29814 // Then add the offset. x -= world2machine_shift[0]; 297ac: 20 91 9a 04 lds r18, 0x049A ; 0x80049a 297b0: 30 91 9b 04 lds r19, 0x049B ; 0x80049b 297b4: 40 91 9c 04 lds r20, 0x049C ; 0x80049c 297b8: 50 91 9d 04 lds r21, 0x049D ; 0x80049d 297bc: 60 91 61 12 lds r22, 0x1261 ; 0x801261 297c0: 70 91 62 12 lds r23, 0x1262 ; 0x801262 297c4: 80 91 63 12 lds r24, 0x1263 ; 0x801263 297c8: 90 91 64 12 lds r25, 0x1264 ; 0x801264 297cc: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 297d0: 60 93 61 12 sts 0x1261, r22 ; 0x801261 297d4: 70 93 62 12 sts 0x1262, r23 ; 0x801262 297d8: 80 93 63 12 sts 0x1263, r24 ; 0x801263 297dc: 90 93 64 12 sts 0x1264, r25 ; 0x801264 y -= world2machine_shift[1]; 297e0: 20 91 9e 04 lds r18, 0x049E ; 0x80049e 297e4: 30 91 9f 04 lds r19, 0x049F ; 0x80049f 297e8: 40 91 a0 04 lds r20, 0x04A0 ; 0x8004a0 297ec: 50 91 a1 04 lds r21, 0x04A1 ; 0x8004a1 297f0: 60 91 65 12 lds r22, 0x1265 ; 0x801265 297f4: 70 91 66 12 lds r23, 0x1266 ; 0x801266 297f8: 80 91 67 12 lds r24, 0x1267 ; 0x801267 297fc: 90 91 68 12 lds r25, 0x1268 ; 0x801268 29800: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 29804: 60 93 65 12 sts 0x1265, r22 ; 0x801265 29808: 70 93 66 12 sts 0x1266, r23 ; 0x801266 2980c: 80 93 67 12 sts 0x1267, r24 ; 0x801267 29810: 90 93 68 12 sts 0x1268, r25 ; 0x801268 } if (world2machine_correction_mode & WORLD2MACHINE_CORRECTION_SKEW) { 29814: c1 ff sbrs r28, 1 29816: 62 c0 rjmp .+196 ; 0x298dc // Firs the skew & rotation correction. float out_x = world2machine_rotation_and_skew_inv[0][0] * x + world2machine_rotation_and_skew_inv[0][1] * y; 29818: 80 90 61 12 lds r8, 0x1261 ; 0x801261 2981c: 90 90 62 12 lds r9, 0x1262 ; 0x801262 29820: a0 90 63 12 lds r10, 0x1263 ; 0x801263 29824: b0 90 64 12 lds r11, 0x1264 ; 0x801264 29828: c0 90 65 12 lds r12, 0x1265 ; 0x801265 2982c: d0 90 66 12 lds r13, 0x1266 ; 0x801266 29830: e0 90 67 12 lds r14, 0x1267 ; 0x801267 29834: 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; 29838: 20 91 92 04 lds r18, 0x0492 ; 0x800492 2983c: 30 91 93 04 lds r19, 0x0493 ; 0x800493 29840: 40 91 94 04 lds r20, 0x0494 ; 0x800494 29844: 50 91 95 04 lds r21, 0x0495 ; 0x800495 29848: c5 01 movw r24, r10 2984a: b4 01 movw r22, r8 2984c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 29850: 2b 01 movw r4, r22 29852: 3c 01 movw r6, r24 29854: 20 91 96 04 lds r18, 0x0496 ; 0x800496 29858: 30 91 97 04 lds r19, 0x0497 ; 0x800497 2985c: 40 91 98 04 lds r20, 0x0498 ; 0x800498 29860: 50 91 99 04 lds r21, 0x0499 ; 0x800499 29864: c7 01 movw r24, r14 29866: b6 01 movw r22, r12 29868: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2986c: 9b 01 movw r18, r22 2986e: ac 01 movw r20, r24 29870: c3 01 movw r24, r6 29872: b2 01 movw r22, r4 29874: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 29878: 2b 01 movw r4, r22 2987a: 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; 2987c: 20 91 8a 04 lds r18, 0x048A ; 0x80048a 29880: 30 91 8b 04 lds r19, 0x048B ; 0x80048b 29884: 40 91 8c 04 lds r20, 0x048C ; 0x80048c 29888: 50 91 8d 04 lds r21, 0x048D ; 0x80048d 2988c: c5 01 movw r24, r10 2988e: b4 01 movw r22, r8 29890: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 29894: 4b 01 movw r8, r22 29896: 5c 01 movw r10, r24 29898: 20 91 8e 04 lds r18, 0x048E ; 0x80048e 2989c: 30 91 8f 04 lds r19, 0x048F ; 0x80048f 298a0: 40 91 90 04 lds r20, 0x0490 ; 0x800490 298a4: 50 91 91 04 lds r21, 0x0491 ; 0x800491 298a8: c7 01 movw r24, r14 298aa: b6 01 movw r22, r12 298ac: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 298b0: 9b 01 movw r18, r22 298b2: ac 01 movw r20, r24 298b4: c5 01 movw r24, r10 298b6: b4 01 movw r22, r8 298b8: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> float out_y = world2machine_rotation_and_skew_inv[1][0] * x + world2machine_rotation_and_skew_inv[1][1] * y; x = out_x; 298bc: 60 93 61 12 sts 0x1261, r22 ; 0x801261 298c0: 70 93 62 12 sts 0x1262, r23 ; 0x801262 298c4: 80 93 63 12 sts 0x1263, r24 ; 0x801263 298c8: 90 93 64 12 sts 0x1264, r25 ; 0x801264 y = out_y; 298cc: 40 92 65 12 sts 0x1265, r4 ; 0x801265 298d0: 50 92 66 12 sts 0x1266, r5 ; 0x801266 298d4: 60 92 67 12 sts 0x1267, r6 ; 0x801267 298d8: 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(); 298dc: 0e 94 ff 66 call 0xcdfe ; 0xcdfe #ifdef LIN_ADVANCE memcpy(position_float, current_position, sizeof(position_float)); 298e0: 80 e1 ldi r24, 0x10 ; 16 298e2: e1 e6 ldi r30, 0x61 ; 97 298e4: f2 e1 ldi r31, 0x12 ; 18 298e6: a6 e3 ldi r26, 0x36 ; 54 298e8: b4 e0 ldi r27, 0x04 ; 4 298ea: 01 90 ld r0, Z+ 298ec: 0d 92 st X+, r0 298ee: 8a 95 dec r24 298f0: e1 f7 brne .-8 ; 0x298ea #endif } 298f2: cf 91 pop r28 298f4: ff 90 pop r15 298f6: ef 90 pop r14 298f8: df 90 pop r13 298fa: cf 90 pop r12 298fc: bf 90 pop r11 298fe: af 90 pop r10 29900: 9f 90 pop r9 29902: 8f 90 pop r8 29904: 7f 90 pop r7 29906: 6f 90 pop r6 29908: 5f 90 pop r5 2990a: 4f 90 pop r4 2990c: 08 95 ret 0002990e : void planner_abort_hard() { // Abort the stepper routine and flush the planner queue. DISABLE_STEPPER_DRIVER_INTERRUPT(); 2990e: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 29912: 8d 7f andi r24, 0xFD ; 253 29914: 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(); 29918: 0f 94 40 4b call 0x29680 ; 0x29680 // Relay to planner wait routine that the current line shall be canceled. planner_aborted = true; 2991c: 81 e0 ldi r24, 0x01 ; 1 2991e: 80 93 42 0d sts 0x0D42, r24 ; 0x800d42 } void quickStop() { DISABLE_STEPPER_DRIVER_INTERRUPT(); 29922: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 29926: 8d 7f andi r24, 0xFD ; 253 29928: 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); 2992c: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 29930: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f while (blocks_queued()) plan_discard_current_block(); 29934: 98 17 cp r25, r24 29936: 69 f0 breq .+26 ; 0x29952 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) { 29938: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 2993c: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 29940: 98 17 cp r25, r24 29942: a1 f3 breq .-24 ; 0x2992c block_buffer_tail = (block_buffer_tail + 1) & (BLOCK_BUFFER_SIZE - 1); 29944: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 29948: 8f 5f subi r24, 0xFF ; 255 2994a: 8f 70 andi r24, 0x0F ; 15 2994c: 80 93 3f 0d sts 0x0D3F, r24 ; 0x800d3f 29950: ed cf rjmp .-38 ; 0x2992c current_block = NULL; 29952: 10 92 52 12 sts 0x1252, r1 ; 0x801252 29956: 10 92 51 12 sts 0x1251, r1 ; 0x801251 #ifdef LIN_ADVANCE nextAdvanceISR = ADV_NEVER; 2995a: 8f ef ldi r24, 0xFF ; 255 2995c: 9f ef ldi r25, 0xFF ; 255 2995e: 90 93 4d 04 sts 0x044D, r25 ; 0x80044d <_ZL14nextAdvanceISR.lto_priv.437+0x1> 29962: 80 93 4c 04 sts 0x044C, r24 ; 0x80044c <_ZL14nextAdvanceISR.lto_priv.437> current_adv_steps = 0; 29966: 10 92 49 04 sts 0x0449, r1 ; 0x800449 <_ZL17current_adv_steps.lto_priv.439+0x1> 2996a: 10 92 48 04 sts 0x0448, r1 ; 0x800448 <_ZL17current_adv_steps.lto_priv.439> #endif st_reset_timer(); 2996e: 0f 94 de 18 call 0x231bc ; 0x231bc ENABLE_STEPPER_DRIVER_INTERRUPT(); 29972: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 29976: 82 60 ori r24, 0x02 ; 2 29978: 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; 2997c: 10 92 22 04 sts 0x0422, r1 ; 0x800422 <_ZL22previous_nominal_speed.lto_priv.443> 29980: 10 92 23 04 sts 0x0423, r1 ; 0x800423 <_ZL22previous_nominal_speed.lto_priv.443+0x1> 29984: 10 92 24 04 sts 0x0424, r1 ; 0x800424 <_ZL22previous_nominal_speed.lto_priv.443+0x2> 29988: 10 92 25 04 sts 0x0425, r1 ; 0x800425 <_ZL22previous_nominal_speed.lto_priv.443+0x3> memset(previous_speed, 0, sizeof(previous_speed)); 2998c: e6 e2 ldi r30, 0x26 ; 38 2998e: f4 e0 ldi r31, 0x04 ; 4 29990: 80 e1 ldi r24, 0x10 ; 16 29992: df 01 movw r26, r30 29994: 1d 92 st X+, r1 29996: 8a 95 dec r24 29998: e9 f7 brne .-6 ; 0x29994 // Reset position sync requests plan_reset_next_e_queue = false; 2999a: 10 92 21 04 sts 0x0421, r1 ; 0x800421 <_ZL23plan_reset_next_e_queue.lto_priv.441> plan_reset_next_e_sched = false; 2999e: 10 92 20 04 sts 0x0420, r1 ; 0x800420 <_ZL23plan_reset_next_e_sched.lto_priv.442> } 299a2: 08 95 ret 000299a4 : pat9125_PID2 = 0xff; return 0; } static void pat9125_wr_reg(uint8_t addr, uint8_t data) { 299a4: cf 93 push r28 299a6: c6 2f mov r28, r22 } uint8_t twi_w8(uint8_t address, uint8_t reg, uint8_t data) { if(twi_start(address, reg)) 299a8: 0f 94 04 6d call 0x2da08 ; 0x2da08 299ac: 81 11 cpse r24, r1 299ae: 0f c0 rjmp .+30 ; 0x299ce return 1; // send data TWDR = data; 299b0: c0 93 bb 00 sts 0x00BB, r28 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 299b4: 84 e8 ldi r24, 0x84 ; 132 299b6: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_DATA_ACK)) 299ba: 88 e2 ldi r24, 0x28 ; 40 299bc: 0f 94 f3 0b call 0x217e6 ; 0x217e6 299c0: 81 11 cpse r24, r1 299c2: 05 c0 rjmp .+10 ; 0x299ce } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 299c4: 84 e9 ldi r24, 0x94 ; 148 299c6: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> error: pat9125_PID1 = 0xff; pat9125_PID2 = 0xff; return; } 299ca: cf 91 pop r28 299cc: 08 95 ret goto error; #endif return; error: pat9125_PID1 = 0xff; 299ce: 8f ef ldi r24, 0xFF ; 255 299d0: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = 0xff; 299d4: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 299d8: f8 cf rjmp .-16 ; 0x299ca 000299da : } return 0; } static uint8_t pat9125_rd_reg(uint8_t addr) { 299da: cf 93 push r28 } uint8_t twi_r8(uint8_t address, uint8_t reg, uint8_t* data) { if(twi_start(address, reg)) 299dc: 0f 94 04 6d call 0x2da08 ; 0x2da08 299e0: 81 11 cpse r24, r1 299e2: 21 c0 rjmp .+66 ; 0x29a26 return 1; // repeat start TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 299e4: 84 ea ldi r24, 0xA4 ; 164 299e6: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_REP_START)) 299ea: 80 e1 ldi r24, 0x10 ; 16 299ec: 0f 94 f3 0b call 0x217e6 ; 0x217e6 299f0: 81 11 cpse r24, r1 299f2: 19 c0 rjmp .+50 ; 0x29a26 return 2; // start receiving TWDR = TW_READ | (address << 1); 299f4: 8b ee ldi r24, 0xEB ; 235 299f6: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 299fa: c4 e8 ldi r28, 0x84 ; 132 299fc: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MR_SLA_ACK)) 29a00: 80 e4 ldi r24, 0x40 ; 64 29a02: 0f 94 f3 0b call 0x217e6 ; 0x217e6 29a06: 81 11 cpse r24, r1 29a08: 0e c0 rjmp .+28 ; 0x29a26 return 3; // receive data TWCR = _BV(TWEN) | _BV(TWINT); 29a0a: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MR_DATA_NACK)) 29a0e: 88 e5 ldi r24, 0x58 ; 88 29a10: 0f 94 f3 0b call 0x217e6 ; 0x217e6 29a14: 81 11 cpse r24, r1 29a16: 07 c0 rjmp .+14 ; 0x29a26 return 4; *data = TWDR; 29a18: 80 91 bb 00 lds r24, 0x00BB ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 29a1c: 94 e9 ldi r25, 0x94 ; 148 29a1e: 90 93 bc 00 sts 0x00BC, r25 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> error: pat9125_PID1 = 0xff; pat9125_PID2 = 0xff; return 0; } 29a22: cf 91 pop r28 29a24: 08 95 ret goto error; #endif return data; error: pat9125_PID1 = 0xff; 29a26: 8f ef ldi r24, 0xFF ; 255 29a28: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = 0xff; 29a2c: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 return 0; 29a30: 80 e0 ldi r24, 0x00 ; 0 29a32: f7 cf rjmp .-18 ; 0x29a22 00029a34 : pat9125_wr_reg(addr, data); return pat9125_rd_reg(addr) == data; } static uint8_t pat9125_wr_seq(const uint8_t* seq) { 29a34: 0f 93 push r16 29a36: 1f 93 push r17 29a38: cf 93 push r28 29a3a: df 93 push r29 29a3c: 8c 01 movw r16, r24 for (;;) { const uint8_t addr = pgm_read_byte(seq++); 29a3e: f8 01 movw r30, r16 29a40: d4 91 lpm r29, Z if (addr == 0xff) 29a42: df 3f cpi r29, 0xFF ; 255 29a44: 99 f0 breq .+38 ; 0x29a6c break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 29a46: 31 96 adiw r30, 0x01 ; 1 29a48: c4 91 lpm r28, Z return; } static uint8_t pat9125_wr_reg_verify(uint8_t addr, uint8_t data) { pat9125_wr_reg(addr, data); 29a4a: 6c 2f mov r22, r28 29a4c: 8d 2f mov r24, r29 29a4e: 0f 94 d2 4c call 0x299a4 ; 0x299a4 return pat9125_rd_reg(addr) == data; 29a52: 8d 2f mov r24, r29 29a54: 0f 94 ed 4c call 0x299da ; 0x299da { for (;;) { const uint8_t addr = pgm_read_byte(seq++); if (addr == 0xff) break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) 29a58: 0e 5f subi r16, 0xFE ; 254 29a5a: 1f 4f sbci r17, 0xFF ; 255 29a5c: c8 17 cp r28, r24 29a5e: 79 f3 breq .-34 ; 0x29a3e // Verification of the register write failed. return 0; 29a60: 80 e0 ldi r24, 0x00 ; 0 } return 1; } 29a62: df 91 pop r29 29a64: cf 91 pop r28 29a66: 1f 91 pop r17 29a68: 0f 91 pop r16 29a6a: 08 95 ret break; if (!pat9125_wr_reg_verify(addr, pgm_read_byte(seq++))) // Verification of the register write failed. return 0; } return 1; 29a6c: 81 e0 ldi r24, 0x01 ; 1 29a6e: f9 cf rjmp .-14 ; 0x29a62 00029a70 : return 1; } uint8_t pat9125_update(void) { 29a70: cf 93 push r28 29a72: df 93 push r29 if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 29a74: 80 91 66 0d lds r24, 0x0D66 ; 0x800d66 29a78: 81 33 cpi r24, 0x31 ; 49 29a7a: 21 f0 breq .+8 ; 0x29a84 pat9125_x += iDX; pat9125_y += iDY; } return 1; } return 0; 29a7c: 80 e0 ldi r24, 0x00 ; 0 } 29a7e: df 91 pop r29 29a80: cf 91 pop r28 29a82: 08 95 ret return 1; } uint8_t pat9125_update(void) { if ((pat9125_PID1 == 0x31) && (pat9125_PID2 == 0x91)) 29a84: 80 91 65 0d lds r24, 0x0D65 ; 0x800d65 29a88: 81 39 cpi r24, 0x91 ; 145 29a8a: c1 f7 brne .-16 ; 0x29a7c { uint8_t ucMotion = pat9125_rd_reg(PAT9125_MOTION); 29a8c: 82 e0 ldi r24, 0x02 ; 2 29a8e: 0f 94 ed 4c call 0x299da ; 0x299da 29a92: c8 2f mov r28, r24 pat9125_b = pat9125_rd_reg(PAT9125_FRAME); 29a94: 87 e1 ldi r24, 0x17 ; 23 29a96: 0f 94 ed 4c call 0x299da ; 0x299da 29a9a: 80 93 63 0d sts 0x0D63, r24 ; 0x800d63 pat9125_s = pat9125_rd_reg(PAT9125_SHUTTER); 29a9e: 84 e1 ldi r24, 0x14 ; 20 29aa0: 0f 94 ed 4c call 0x299da ; 0x299da 29aa4: 80 93 64 0d sts 0x0D64, r24 ; 0x800d64 if (pat9125_PID1 == 0xff) return 0; 29aa8: 80 91 66 0d lds r24, 0x0D66 ; 0x800d66 29aac: 8f 3f cpi r24, 0xFF ; 255 29aae: 31 f3 breq .-52 ; 0x29a7c if (ucMotion & 0x80) 29ab0: c7 ff sbrs r28, 7 29ab2: 36 c0 rjmp .+108 ; 0x29b20 { uint16_t ucXL = pat9125_rd_reg(PAT9125_DELTA_XL); 29ab4: 83 e0 ldi r24, 0x03 ; 3 29ab6: 0f 94 ed 4c call 0x299da ; 0x299da 29aba: d8 2f mov r29, r24 uint16_t ucYL = pat9125_rd_reg(PAT9125_DELTA_YL); 29abc: 84 e0 ldi r24, 0x04 ; 4 29abe: 0f 94 ed 4c call 0x299da ; 0x299da 29ac2: c8 2f mov r28, r24 uint16_t ucXYH = pat9125_rd_reg(PAT9125_DELTA_XYH); 29ac4: 82 e1 ldi r24, 0x12 ; 18 29ac6: 0f 94 ed 4c call 0x299da ; 0x299da if (pat9125_PID1 == 0xff) return 0; 29aca: 90 91 66 0d lds r25, 0x0D66 ; 0x800d66 29ace: 9f 3f cpi r25, 0xFF ; 255 29ad0: a9 f2 breq .-86 ; 0x29a7c 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); 29ad2: 90 e0 ldi r25, 0x00 ; 0 if (pat9125_PID1 == 0xff) return 0; int16_t iDX = ucXL | ((ucXYH << 4) & 0xf00); 29ad4: 9c 01 movw r18, r24 29ad6: 44 e0 ldi r20, 0x04 ; 4 29ad8: 22 0f add r18, r18 29ada: 33 1f adc r19, r19 29adc: 4a 95 dec r20 29ade: e1 f7 brne .-8 ; 0x29ad8 29ae0: 22 27 eor r18, r18 29ae2: 3f 70 andi r19, 0x0F ; 15 29ae4: 2d 2b or r18, r29 int16_t iDY = ucYL | ((ucXYH << 8) & 0xf00); 29ae6: 98 2f mov r25, r24 29ae8: 88 27 eor r24, r24 29aea: 88 27 eor r24, r24 29aec: 9f 70 andi r25, 0x0F ; 15 29aee: 8c 2b or r24, r28 if (iDX & 0x800) iDX -= 4096; 29af0: 33 fd sbrc r19, 3 29af2: 30 51 subi r19, 0x10 ; 16 if (iDY & 0x800) iDY -= 4096; 29af4: 93 fd sbrc r25, 3 29af6: 90 51 subi r25, 0x10 ; 16 pat9125_x += iDX; 29af8: 40 91 89 03 lds r20, 0x0389 ; 0x800389 29afc: 50 91 8a 03 lds r21, 0x038A ; 0x80038a 29b00: 24 0f add r18, r20 29b02: 35 1f adc r19, r21 29b04: 30 93 8a 03 sts 0x038A, r19 ; 0x80038a 29b08: 20 93 89 03 sts 0x0389, r18 ; 0x800389 pat9125_y += iDY; 29b0c: 20 91 38 0e lds r18, 0x0E38 ; 0x800e38 29b10: 30 91 39 0e lds r19, 0x0E39 ; 0x800e39 29b14: 82 0f add r24, r18 29b16: 93 1f adc r25, r19 29b18: 90 93 39 0e sts 0x0E39, r25 ; 0x800e39 29b1c: 80 93 38 0e sts 0x0E38, r24 ; 0x800e38 } return 1; 29b20: 81 e0 ldi r24, 0x01 ; 1 29b22: ad cf rjmp .-166 ; 0x29a7e 00029b24 : void FullScreenMsgRestoringTemperature(){ lcd_display_message_fullscreen_P(_T(MSG_MMU_RESTORE_TEMP)); } void ScreenUpdateEnable(){ lcd_update_enable(true); 29b24: 81 e0 ldi r24, 0x01 ; 1 29b26: 0c 94 89 70 jmp 0xe112 ; 0xe112 00029b2a : void MakeSound(SoundType s){ Sound_MakeSound( (eSOUND_TYPE)s); } static void FullScreenMsg(const char *pgmS, uint8_t slot){ 29b2a: 0f 93 push r16 29b2c: 1f 93 push r17 29b2e: cf 93 push r28 29b30: 8c 01 movw r16, r24 29b32: c6 2f mov r28, r22 lcd_update_enable(false); 29b34: 80 e0 ldi r24, 0x00 ; 0 29b36: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_clear(); 29b3a: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 1, pgmS); 29b3e: a8 01 movw r20, r16 29b40: 61 e0 ldi r22, 0x01 ; 1 29b42: 80 e0 ldi r24, 0x00 ; 0 29b44: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 } void lcd_print(long n, int base) { if (base == 0) lcd_write(n); 29b48: 80 e2 ldi r24, 0x20 ; 32 29b4a: 0e 94 f3 70 call 0xe1e6 ; 0xe1e6 lcd_print(' '); lcd_print(slot + 1); 29b4e: 6c 2f mov r22, r28 29b50: 70 e0 ldi r23, 0x00 ; 0 29b52: 6f 5f subi r22, 0xFF ; 255 29b54: 7f 4f sbci r23, 0xFF ; 255 lcd_print((unsigned long) b, base); } void lcd_print(int n, int base) { lcd_print((long) n, base); 29b56: 07 2e mov r0, r23 29b58: 00 0c add r0, r0 29b5a: 88 0b sbc r24, r24 29b5c: 99 0b sbc r25, r25 } 29b5e: cf 91 pop r28 29b60: 1f 91 pop r17 29b62: 0f 91 pop r16 29b64: 0c 94 2c 72 jmp 0xe458 ; 0xe458 00029b68 : 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); 29b68: 82 ed ldi r24, 0xD2 ; 210 29b6a: 9e e0 ldi r25, 0x0E ; 14 29b6c: 0e 94 cd 78 call 0xf19a ; 0xf19a eeprom_increment_word((uint16_t *)EEPROM_MMU_FAIL_TOT); 29b70: 83 ed ldi r24, 0xD3 ; 211 29b72: 9e e0 ldi r25, 0x0E ; 14 29b74: 0c 94 c0 78 jmp 0xf180 ; 0xf180 00029b78 : inline bool Running() const { return state == State::Running; } inline bool FindaPressed() const { return regs8[0]; 29b78: 41 e0 ldi r20, 0x01 ; 1 29b7a: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 29b7e: 81 11 cpse r24, r1 29b80: 01 c0 rjmp .+2 ; 0x29b84 29b82: 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'); 29b84: 40 5d subi r20, 0xD0 ; 208 29b86: 62 e0 ldi r22, 0x02 ; 2 29b88: 83 e0 ldi r24, 0x03 ; 3 29b8a: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 class PAT9125_sensor: public Filament_sensor { public: void init(); void deinit(); bool update(); bool getFilamentPresent() const { return filterFilPresent; } 29b8e: 41 e0 ldi r20, 0x01 ; 1 29b90: 80 91 fe 16 lds r24, 0x16FE ; 0x8016fe 29b94: 81 11 cpse r24, r1 29b96: 01 c0 rjmp .+2 ; 0x29b9a 29b98: 40 e0 ldi r20, 0x00 ; 0 lcd_putc_at(8, 2, fsensor.getFilamentPresent() + '0'); 29b9a: 40 5d subi r20, 0xD0 ; 208 29b9c: 62 e0 ldi r22, 0x02 ; 2 29b9e: 88 e0 ldi r24, 0x08 ; 8 29ba0: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 // print active/changing filament slot lcd_set_cursor(10, 2); 29ba4: 62 e0 ldi r22, 0x02 ; 2 29ba6: 8a e0 ldi r24, 0x0A ; 10 29ba8: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcdui_print_extruder(); 29bac: 0f 94 7f 05 call 0x20afe ; 0x20afe // Print active extruder temperature lcd_set_cursor(16, 2); 29bb0: 62 e0 ldi r22, 0x02 ; 2 29bb2: 80 e1 ldi r24, 0x10 ; 16 29bb4: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(PSTR("%3d"), (int)(degHotend(0) + 0.5)); 29bb8: 20 e0 ldi r18, 0x00 ; 0 29bba: 30 e0 ldi r19, 0x00 ; 0 29bbc: 40 e0 ldi r20, 0x00 ; 0 29bbe: 5f e3 ldi r21, 0x3F ; 63 29bc0: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 29bc4: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 29bc8: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 29bcc: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 29bd0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 29bd4: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 29bd8: 7f 93 push r23 29bda: 6f 93 push r22 29bdc: 86 ed ldi r24, 0xD6 ; 214 29bde: 98 e8 ldi r25, 0x88 ; 136 29be0: 9f 93 push r25 29be2: 8f 93 push r24 29be4: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 29be8: 0f 90 pop r0 29bea: 0f 90 pop r0 29bec: 0f 90 pop r0 29bee: 0f 90 pop r0 } 29bf0: 08 95 ret 00029bf2 : return 0; } } static constexpr uint8_t Nibble2Char(uint8_t n) { switch (n) { 29bf2: 8a 30 cpi r24, 0x0A ; 10 29bf4: 20 f0 brcs .+8 ; 0x29bfe 29bf6: 80 31 cpi r24, 0x10 ; 16 29bf8: 20 f4 brcc .+8 ; 0x29c02 case 0xb: case 0xc: case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; 29bfa: 89 5a subi r24, 0xA9 ; 169 29bfc: 08 95 ret case 5: case 6: case 7: case 8: case 9: return n + '0'; 29bfe: 80 5d subi r24, 0xD0 ; 208 29c00: 08 95 ret case 0xd: case 0xe: case 0xf: return n - 10 + 'a'; default: return 0; 29c02: 80 e0 ldi r24, 0x00 ; 0 } } 29c04: 08 95 ret 00029c06 : i += AppendCRC(rsp.CRC(), txbuff + i); txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { 29c06: 0f 93 push r16 29c08: 1f 93 push r17 29c0a: cf 93 push r28 29c0c: df 93 push r29 29c0e: 08 2f mov r16, r24 29c10: eb 01 movw r28, r22 if (value == 0) { *dst = '0'; return 1; } uint8_t v = value >> 4U; 29c12: 90 e0 ldi r25, 0x00 ; 0 29c14: 24 e0 ldi r18, 0x04 ; 4 29c16: 95 95 asr r25 29c18: 87 95 ror r24 29c1a: 2a 95 dec r18 29c1c: e1 f7 brne .-8 ; 0x29c16 uint8_t charsOut = 1; 29c1e: 11 e0 ldi r17, 0x01 ; 1 if (v != 0) { // skip the first '0' if any 29c20: 00 97 sbiw r24, 0x00 ; 0 29c22: 21 f0 breq .+8 ; 0x29c2c *dst = Nibble2Char(v); 29c24: 0f 94 f9 4d call 0x29bf2 ; 0x29bf2 29c28: 89 93 st Y+, r24 ++dst; charsOut = 2; 29c2a: 12 e0 ldi r17, 0x02 ; 2 } v = value & 0xfU; *dst = Nibble2Char(v); 29c2c: 80 2f mov r24, r16 29c2e: 8f 70 andi r24, 0x0F ; 15 29c30: 0f 94 f9 4d call 0x29bf2 ; 0x29bf2 29c34: 88 83 st Y, r24 return charsOut; } 29c36: 81 2f mov r24, r17 29c38: df 91 pop r29 29c3a: cf 91 pop r28 29c3c: 1f 91 pop r17 29c3e: 0f 91 pop r16 29c40: 08 95 ret 00029c42 : } 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) { 29c42: 80 33 cpi r24, 0x30 ; 48 29c44: 30 f0 brcs .+12 ; 0x29c52 29c46: 8a 33 cpi r24, 0x3A ; 58 29c48: 30 f0 brcs .+12 ; 0x29c56 29c4a: 9f e9 ldi r25, 0x9F ; 159 29c4c: 98 0f add r25, r24 29c4e: 96 30 cpi r25, 0x06 ; 6 29c50: 20 f0 brcs .+8 ; 0x29c5a case 'd': case 'e': case 'f': return c - 'a' + 10; default: return 0; 29c52: 80 e0 ldi r24, 0x00 ; 0 } } 29c54: 08 95 ret case '5': case '6': case '7': case '8': case '9': return c - '0'; 29c56: 80 53 subi r24, 0x30 ; 48 29c58: 08 95 ret case 'b': case 'c': case 'd': case 'e': case 'f': return c - 'a' + 10; 29c5a: 87 55 subi r24, 0x57 ; 87 29c5c: 08 95 ret 00029c5e : /// 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 { 29c5e: cf 93 push r28 29c60: df 93 push r29 29c62: ec 01 movw r28, r24 uint8_t crc = 0; crc = modules::crc::CRC8::CCITT_updateCX(0, (uint8_t)code); 29c64: 68 81 ld r22, Y 29c66: 80 e0 ldi r24, 0x00 ; 0 29c68: 0f 94 3c 01 call 0x20278 ; 0x20278 crc = modules::crc::CRC8::CCITT_updateCX(crc, value); 29c6c: 69 81 ldd r22, Y+1 ; 0x01 29c6e: 0f 94 3c 01 call 0x20278 ; 0x20278 crc = modules::crc::CRC8::CCITT_updateW(crc, value2); 29c72: 6a 81 ldd r22, Y+2 ; 0x02 29c74: 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]); 29c76: 0f 94 3c 01 call 0x20278 ; 0x20278 29c7a: 6c 2f mov r22, r28 return crc; } 29c7c: df 91 pop r29 29c7e: cf 91 pop r28 29c80: 0d 94 3c 01 jmp 0x20278 ; 0x20278 00029c84 : 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 { 29c84: cf 93 push r28 29c86: df 93 push r29 29c88: ec 01 movw r28, r24 uint8_t crc = request.ComputeCRC8(); 29c8a: 0f 94 2f 4e call 0x29c5e ; 0x29c5e crc = modules::crc::CRC8::CCITT_updateCX(crc, (uint8_t)paramCode); 29c8e: 6d 81 ldd r22, Y+5 ; 0x05 29c90: 0f 94 3c 01 call 0x20278 ; 0x20278 crc = modules::crc::CRC8::CCITT_updateW(crc, paramValue); 29c94: 6e 81 ldd r22, Y+6 ; 0x06 29c96: cf 81 ldd r28, Y+7 ; 0x07 29c98: 0f 94 3c 01 call 0x20278 ; 0x20278 29c9c: 6c 2f mov r22, r28 return crc; } 29c9e: df 91 pop r29 29ca0: cf 91 pop r28 29ca2: 0d 94 3c 01 jmp 0x20278 ; 0x20278 00029ca6 : return crc; } /// @param code of the request message /// @param value of the request message inline constexpr RequestMsg(RequestMsgCodes code, uint8_t value) 29ca6: cf 93 push r28 29ca8: df 93 push r29 29caa: ec 01 movw r28, r24 : code(code) , value(value) , value2(0) , crc8(ComputeCRC8()) { 29cac: 68 83 st Y, r22 29cae: 49 83 std Y+1, r20 ; 0x01 29cb0: 1b 82 std Y+3, r1 ; 0x03 29cb2: 1a 82 std Y+2, r1 ; 0x02 29cb4: 0f 94 2f 4e call 0x29c5e ; 0x29c5e 29cb8: 8c 83 std Y+4, r24 ; 0x04 } 29cba: df 91 pop r29 29cbc: cf 91 pop r28 29cbe: 08 95 ret 00029cc0 : void Enable_E0() { enable_e0(); } void Disable_E0() { disable_e0(); 29cc0: 14 9a sbi 0x02, 4 ; 2 } 29cc2: 08 95 ret 00029cc4 : 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) { 29cc4: cf 92 push r12 29cc6: df 92 push r13 29cc8: ef 92 push r14 29cca: ff 92 push r15 29ccc: cf 93 push r28 29cce: df 93 push r29 29cd0: 69 01 movw r12, r18 29cd2: 7a 01 movw r14, r20 current_position[E_AXIS] += delta; 29cd4: c1 e6 ldi r28, 0x61 ; 97 29cd6: d2 e1 ldi r29, 0x12 ; 18 29cd8: 9b 01 movw r18, r22 29cda: ac 01 movw r20, r24 29cdc: 6c 85 ldd r22, Y+12 ; 0x0c 29cde: 7d 85 ldd r23, Y+13 ; 0x0d 29ce0: 8e 85 ldd r24, Y+14 ; 0x0e 29ce2: 9f 85 ldd r25, Y+15 ; 0x0f 29ce4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 29ce8: 6c 87 std Y+12, r22 ; 0x0c 29cea: 7d 87 std Y+13, r23 ; 0x0d 29cec: 8e 87 std Y+14, r24 ; 0x0e 29cee: 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); 29cf0: c7 01 movw r24, r14 29cf2: b6 01 movw r22, r12 } void extruder_move(float delta, float feedRate) { current_position[E_AXIS] += delta; planner_line_to_current_position(feedRate); } 29cf4: df 91 pop r29 29cf6: cf 91 pop r28 29cf8: ff 90 pop r15 29cfa: ef 90 pop r14 29cfc: df 90 pop r13 29cfe: 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); 29d00: 0d 94 0d 4a jmp 0x2941a ; 0x2941a 00029d04 : st_synchronize(); } static inline void go_to_current(float fr) { plan_buffer_line_curposXYZE(fr); 29d04: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 29d08: 0d 94 94 18 jmp 0x23128 ; 0x23128 00029d0c : #include "mmu2_log.h" namespace MMU2 { void LogErrorEvent_P(const char *msg){ 29d0c: cf 93 push r28 29d0e: df 93 push r29 29d10: ec 01 movw r28, r24 SERIAL_ECHO_START; //!@todo Decide MMU errors on serial line 29d12: 84 ee ldi r24, 0xE4 ; 228 29d14: 92 ea ldi r25, 0xA2 ; 162 29d16: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_MMU2(); 29d1a: 80 ed ldi r24, 0xD0 ; 208 29d1c: 98 e8 ldi r25, 0x88 ; 136 29d1e: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNRPGM(msg); 29d22: ce 01 movw r24, r28 } 29d24: df 91 pop r29 29d26: 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); 29d28: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c 00029d2c : #include "Filament_sensor.h" namespace MMU2 { FilamentState WhereIsFilament(){ return fsensor.getFilamentPresent() ? FilamentState::AT_FSENSOR : FilamentState::NOT_PRESENT; 29d2c: 81 e0 ldi r24, 0x01 ; 1 29d2e: 90 91 fe 16 lds r25, 0x16FE ; 0x8016fe 29d32: 91 11 cpse r25, r1 29d34: 01 c0 rjmp .+2 ; 0x29d38 29d36: 80 e0 ldi r24, 0x00 ; 0 } 29d38: 08 95 ret 00029d3a : constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29d3a: 89 32 cpi r24, 0x29 ; 41 29d3c: 20 e8 ldi r18, 0x80 ; 128 29d3e: 92 07 cpc r25, r18 29d40: 09 f4 brne .+2 ; 0x29d44 29d42: 97 c0 rjmp .+302 ; 0x29e72 29d44: 08 f0 brcs .+2 ; 0x29d48 29d46: 48 c0 rjmp .+144 ; 0x29dd8 29d48: 86 30 cpi r24, 0x06 ; 6 29d4a: 60 e8 ldi r22, 0x80 ; 128 29d4c: 96 07 cpc r25, r22 29d4e: 09 f4 brne .+2 ; 0x29d52 29d50: 9a c0 rjmp .+308 ; 0x29e86 29d52: 30 f5 brcc .+76 ; 0x29da0 29d54: 83 30 cpi r24, 0x03 ; 3 29d56: 40 e8 ldi r20, 0x80 ; 128 29d58: 94 07 cpc r25, r20 29d5a: 09 f4 brne .+2 ; 0x29d5e 29d5c: 80 c0 rjmp .+256 ; 0x29e5e 29d5e: a8 f4 brcc .+42 ; 0x29d8a 29d60: 81 30 cpi r24, 0x01 ; 1 29d62: 20 e8 ldi r18, 0x80 ; 128 29d64: 92 07 cpc r25, r18 29d66: 09 f4 brne .+2 ; 0x29d6a 29d68: 17 c1 rjmp .+558 ; 0x29f98 29d6a: 82 30 cpi r24, 0x02 ; 2 29d6c: 40 e8 ldi r20, 0x80 ; 128 29d6e: 94 07 cpc r25, r20 29d70: 09 f4 brne .+2 ; 0x29d74 29d72: 73 c0 rjmp .+230 ; 0x29e5a 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); 29d74: 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)) { 29d76: 86 ff sbrs r24, 6 29d78: 8e c0 rjmp .+284 ; 0x29e96 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); 29d7a: 22 27 eor r18, r18 29d7c: 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) { 29d7e: 21 15 cp r18, r1 29d80: 32 4c sbci r19, 0xC2 ; 194 29d82: 09 f0 breq .+2 ; 0x29d86 29d84: 9e c0 rjmp .+316 ; 0x29ec2 return FindErrorIndex(ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED); 29d86: 8e e1 ldi r24, 0x1E ; 30 29d88: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29d8a: 84 30 cpi r24, 0x04 ; 4 29d8c: 60 e8 ldi r22, 0x80 ; 128 29d8e: 96 07 cpc r25, r22 29d90: 09 f4 brne .+2 ; 0x29d94 29d92: 67 c0 rjmp .+206 ; 0x29e62 29d94: 85 30 cpi r24, 0x05 ; 5 29d96: 20 e8 ldi r18, 0x80 ; 128 29d98: 92 07 cpc r25, r18 29d9a: 61 f7 brne .-40 ; 0x29d74 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); 29d9c: 84 e2 ldi r24, 0x24 ; 36 29d9e: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29da0: 8a 30 cpi r24, 0x0A ; 10 29da2: 40 e8 ldi r20, 0x80 ; 128 29da4: 94 07 cpc r25, r20 29da6: 09 f4 brne .+2 ; 0x29daa 29da8: 5e c0 rjmp .+188 ; 0x29e66 29daa: 58 f4 brcc .+22 ; 0x29dc2 29dac: 88 30 cpi r24, 0x08 ; 8 29dae: 20 e8 ldi r18, 0x80 ; 128 29db0: 92 07 cpc r25, r18 29db2: 09 f4 brne .+2 ; 0x29db6 29db4: 6e c0 rjmp .+220 ; 0x29e92 29db6: 89 30 cpi r24, 0x09 ; 9 29db8: 40 e8 ldi r20, 0x80 ; 128 29dba: 94 07 cpc r25, r20 29dbc: d9 f6 brne .-74 ; 0x29d74 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); 29dbe: 85 e0 ldi r24, 0x05 ; 5 29dc0: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29dc2: 8c 30 cpi r24, 0x0C ; 12 29dc4: 60 e8 ldi r22, 0x80 ; 128 29dc6: 96 07 cpc r25, r22 29dc8: 09 f4 brne .+2 ; 0x29dcc 29dca: 51 c0 rjmp .+162 ; 0x29e6e 29dcc: 8d 30 cpi r24, 0x0D ; 13 29dce: 20 e8 ldi r18, 0x80 ; 128 29dd0: 92 07 cpc r25, r18 29dd2: 81 f6 brne .-96 ; 0x29d74 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); 29dd4: 81 e2 ldi r24, 0x21 ; 33 29dd6: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29dd8: 8f 32 cpi r24, 0x2F ; 47 29dda: 40 e8 ldi r20, 0x80 ; 128 29ddc: 94 07 cpc r25, r20 29dde: 09 f4 brne .+2 ; 0x29de2 29de0: 56 c0 rjmp .+172 ; 0x29e8e 29de2: e0 f4 brcc .+56 ; 0x29e1c 29de4: 8c 32 cpi r24, 0x2C ; 44 29de6: 20 e8 ldi r18, 0x80 ; 128 29de8: 92 07 cpc r25, r18 29dea: 09 f4 brne .+2 ; 0x29dee 29dec: 4e c0 rjmp .+156 ; 0x29e8a 29dee: 58 f4 brcc .+22 ; 0x29e06 29df0: 8a 32 cpi r24, 0x2A ; 42 29df2: 60 e8 ldi r22, 0x80 ; 128 29df4: 96 07 cpc r25, r22 29df6: c9 f1 breq .+114 ; 0x29e6a 29df8: 8b 32 cpi r24, 0x2B ; 43 29dfa: 20 e8 ldi r18, 0x80 ; 128 29dfc: 92 07 cpc r25, r18 29dfe: 09 f0 breq .+2 ; 0x29e02 29e00: b9 cf rjmp .-142 ; 0x29d74 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); 29e02: 86 e2 ldi r24, 0x26 ; 38 29e04: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29e06: 8d 32 cpi r24, 0x2D ; 45 29e08: 40 e8 ldi r20, 0x80 ; 128 29e0a: 94 07 cpc r25, r20 29e0c: d1 f1 breq .+116 ; 0x29e82 29e0e: 8e 32 cpi r24, 0x2E ; 46 29e10: 60 e8 ldi r22, 0x80 ; 128 29e12: 96 07 cpc r25, r22 29e14: 09 f0 breq .+2 ; 0x29e18 29e16: ae cf rjmp .-164 ; 0x29d74 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); 29e18: 82 e2 ldi r24, 0x22 ; 34 29e1a: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29e1c: 87 38 cpi r24, 0x87 ; 135 29e1e: 20 e8 ldi r18, 0x80 ; 128 29e20: 92 07 cpc r25, r18 29e22: 49 f1 breq .+82 ; 0x29e76 29e24: 58 f4 brcc .+22 ; 0x29e3c 29e26: 87 34 cpi r24, 0x47 ; 71 29e28: 60 e8 ldi r22, 0x80 ; 128 29e2a: 96 07 cpc r25, r22 29e2c: 29 f0 breq .+10 ; 0x29e38 29e2e: 8b 34 cpi r24, 0x4B ; 75 29e30: 20 e8 ldi r18, 0x80 ; 128 29e32: 92 07 cpc r25, r18 29e34: 09 f0 breq .+2 ; 0x29e38 29e36: 9e cf rjmp .-196 ; 0x29d74 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); 29e38: 84 e0 ldi r24, 0x04 ; 4 29e3a: 08 95 ret constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { 29e3c: 87 30 cpi r24, 0x07 ; 7 29e3e: 41 e8 ldi r20, 0x81 ; 129 29e40: 94 07 cpc r25, r20 29e42: d9 f0 breq .+54 ; 0x29e7a 29e44: 8b 30 cpi r24, 0x0B ; 11 29e46: 61 e8 ldi r22, 0x81 ; 129 29e48: 96 07 cpc r25, r22 29e4a: c9 f0 breq .+50 ; 0x29e7e 29e4c: 8b 38 cpi r24, 0x8B ; 139 29e4e: 20 e8 ldi r18, 0x80 ; 128 29e50: 92 07 cpc r25, r18 29e52: 09 f0 breq .+2 ; 0x29e56 29e54: 8f cf rjmp .-226 ; 0x29d74 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); 29e56: 89 e0 ldi r24, 0x09 ; 9 29e58: 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); 29e5a: 81 e0 ldi r24, 0x01 ; 1 29e5c: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER); 29e5e: 82 e0 ldi r24, 0x02 ; 2 29e60: 08 95 ret case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: return FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK); 29e62: 83 e0 ldi r24, 0x03 ; 3 29e64: 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); 29e66: 86 e0 ldi r24, 0x06 ; 6 29e68: 08 95 ret case ErrorCode::LOAD_TO_EXTRUDER_FAILED: return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); 29e6a: 87 e0 ldi r24, 0x07 ; 7 29e6c: 08 95 ret case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); 29e6e: 8a e2 ldi r24, 0x2A ; 42 29e70: 08 95 ret case ErrorCode::FILAMENT_CHANGE: return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); 29e72: 8b e2 ldi r24, 0x2B ; 43 29e74: 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); 29e76: 88 e0 ldi r24, 0x08 ; 8 29e78: 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); 29e7a: 8a e0 ldi r24, 0x0A ; 10 29e7c: 08 95 ret case ErrorCode::MOVE_IDLER_FAILED: return FindErrorIndex(ERR_MECHANICAL_IDLER_CANNOT_MOVE); 29e7e: 8b e0 ldi r24, 0x0B ; 11 29e80: 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); 29e82: 83 e2 ldi r24, 0x23 ; 35 29e84: 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); 29e86: 85 e2 ldi r24, 0x25 ; 37 29e88: 08 95 ret case ErrorCode::QUEUE_FULL: return FindErrorIndex(ERR_SYSTEM_QUEUE_FULL); case ErrorCode::VERSION_MISMATCH: return FindErrorIndex(ERR_SYSTEM_FW_UPDATE_NEEDED); 29e8a: 87 e2 ldi r24, 0x27 ; 39 29e8c: 08 95 ret case ErrorCode::INTERNAL: return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); 29e8e: 88 e2 ldi r24, 0x28 ; 40 29e90: 08 95 ret case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); 29e92: 89 e2 ldi r24, 0x29 ; 41 29e94: 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)) { 29e96: 87 ff sbrs r24, 7 29e98: 07 c0 rjmp .+14 ; 0x29ea8 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); 29e9a: 22 27 eor r18, r18 29e9c: 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) { 29e9e: 21 15 cp r18, r1 29ea0: 32 4c sbci r19, 0xC2 ; 194 29ea2: a1 f5 brne .+104 ; 0x29f0c return FindErrorIndex(ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED); 29ea4: 8f e1 ldi r24, 0x1F ; 31 29ea6: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 29ea8: 22 27 eor r18, r18 29eaa: 31 70 andi r19, 0x01 ; 1 29eac: 90 ff sbrs r25, 0 29eae: 52 c0 rjmp .+164 ; 0x29f54 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); 29eb0: ac 01 movw r20, r24 29eb2: 44 27 eor r20, r20 29eb4: 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) { 29eb6: 41 15 cp r20, r1 29eb8: 52 4c sbci r21, 0xC2 ; 194 29eba: 09 f0 breq .+2 ; 0x29ebe 29ebc: 4b c0 rjmp .+150 ; 0x29f54 return FindErrorIndex(ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED); 29ebe: 80 e2 ldi r24, 0x20 ; 32 29ec0: 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; 29ec2: 9c 01 movw r18, r24 29ec4: 22 27 eor r18, r18 29ec6: 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)) { 29ec8: 23 2b or r18, r19 29eca: 09 f0 breq .+2 ; 0x29ece 29ecc: 67 c0 rjmp .+206 ; 0x29f9c 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; 29ece: 9c 01 movw r18, r24 29ed0: 22 27 eor r18, r18 29ed2: 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)) { 29ed4: 23 2b or r18, r19 29ed6: 09 f0 breq .+2 ; 0x29eda 29ed8: 63 c0 rjmp .+198 ; 0x29fa0 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; 29eda: 9c 01 movw r18, r24 29edc: 22 27 eor r18, r18 29ede: 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)) { 29ee0: 23 2b or r18, r19 29ee2: 09 f0 breq .+2 ; 0x29ee6 29ee4: 5f c0 rjmp .+190 ; 0x29fa4 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; 29ee6: 9c 01 movw r18, r24 29ee8: 22 27 eor r18, r18 29eea: 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)) { 29eec: 23 2b or r18, r19 29eee: 09 f0 breq .+2 ; 0x29ef2 29ef0: 5b c0 rjmp .+182 ; 0x29fa8 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; 29ef2: 9c 01 movw r18, r24 29ef4: 22 27 eor r18, r18 29ef6: 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)) { 29ef8: 23 2b or r18, r19 29efa: 09 f0 breq .+2 ; 0x29efe 29efc: 57 c0 rjmp .+174 ; 0x29fac 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; 29efe: 88 27 eor r24, r24 29f00: 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)) { 29f02: 89 2b or r24, r25 29f04: 09 f4 brne .+2 ; 0x29f08 29f06: 68 c0 rjmp .+208 ; 0x29fd8 return FindErrorIndex(ERR_TEMPERATURE_TMC_PULLEY_OVERHEAT_ERROR); 29f08: 8f e0 ldi r24, 0x0F ; 15 29f0a: 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; 29f0c: 9c 01 movw r18, r24 29f0e: 22 27 eor r18, r18 29f10: 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)) { 29f12: 23 2b or r18, r19 29f14: 09 f0 breq .+2 ; 0x29f18 29f16: 4c c0 rjmp .+152 ; 0x29fb0 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; 29f18: 9c 01 movw r18, r24 29f1a: 22 27 eor r18, r18 29f1c: 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)) { 29f1e: 23 2b or r18, r19 29f20: 09 f0 breq .+2 ; 0x29f24 29f22: 48 c0 rjmp .+144 ; 0x29fb4 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; 29f24: 9c 01 movw r18, r24 29f26: 22 27 eor r18, r18 29f28: 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)) { 29f2a: 23 2b or r18, r19 29f2c: 09 f0 breq .+2 ; 0x29f30 29f2e: 44 c0 rjmp .+136 ; 0x29fb8 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; 29f30: 9c 01 movw r18, r24 29f32: 22 27 eor r18, r18 29f34: 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)) { 29f36: 23 2b or r18, r19 29f38: 09 f0 breq .+2 ; 0x29f3c 29f3a: 40 c0 rjmp .+128 ; 0x29fbc 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: 9c 01 movw r18, r24 29f3e: 22 27 eor r18, r18 29f40: 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)) { 29f42: 23 2b or r18, r19 29f44: e9 f5 brne .+122 ; 0x29fc0 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; 29f46: 88 27 eor r24, r24 29f48: 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)) { 29f4a: 89 2b or r24, r25 29f4c: 09 f4 brne .+2 ; 0x29f50 29f4e: 44 c0 rjmp .+136 ; 0x29fd8 return FindErrorIndex(ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR); 29f50: 80 e1 ldi r24, 0x10 ; 16 29f52: 08 95 ret } } else if (ContainsBit(ec, ErrorCode::TMC_IDLER_BIT)) { 29f54: 23 2b or r18, r19 29f56: 09 f4 brne .+2 ; 0x29f5a 29f58: 3f c0 rjmp .+126 ; 0x29fd8 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 29f5a: 9c 01 movw r18, r24 29f5c: 22 27 eor r18, r18 29f5e: 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)) { 29f60: 23 2b or r18, r19 29f62: 81 f5 brne .+96 ; 0x29fc4 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; 29f64: 9c 01 movw r18, r24 29f66: 22 27 eor r18, r18 29f68: 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)) { 29f6a: 23 2b or r18, r19 29f6c: 69 f5 brne .+90 ; 0x29fc8 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; 29f6e: 9c 01 movw r18, r24 29f70: 22 27 eor r18, r18 29f72: 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)) { 29f74: 23 2b or r18, r19 29f76: 51 f5 brne .+84 ; 0x29fcc 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; 29f78: 9c 01 movw r18, r24 29f7a: 22 27 eor r18, r18 29f7c: 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)) { 29f7e: 23 2b or r18, r19 29f80: 39 f5 brne .+78 ; 0x29fd0 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; 29f82: 9c 01 movw r18, r24 29f84: 22 27 eor r18, r18 29f86: 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)) { 29f88: 23 2b or r18, r19 29f8a: 21 f5 brne .+72 ; 0x29fd4 constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); } constexpr bool ContainsBit(ErrorCode ec, ErrorCode mask) { return (uint16_t)ec & (uint16_t)mask; 29f8c: 88 27 eor r24, r24 29f8e: 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)) { 29f90: 89 2b or r24, r25 29f92: 11 f1 breq .+68 ; 0x29fd8 return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); 29f94: 81 e1 ldi r24, 0x11 ; 17 29f96: 08 95 ret } uint8_t PrusaErrorCodeIndex(ErrorCode ec) { switch (ec) { case ErrorCode::FINDA_DIDNT_SWITCH_ON: return FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER); 29f98: 80 e0 ldi r24, 0x00 ; 0 29f9a: 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); 29f9c: 82 e1 ldi r24, 0x12 ; 18 29f9e: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_RESET); 29fa0: 85 e1 ldi r24, 0x15 ; 21 29fa2: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_UNDERVOLTAGE_ERROR); 29fa4: 88 e1 ldi r24, 0x18 ; 24 29fa6: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_PULLEY_DRIVER_SHORTED); 29fa8: 8b e1 ldi r24, 0x1B ; 27 29faa: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT); 29fac: 8c e0 ldi r24, 0x0C ; 12 29fae: 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); 29fb0: 83 e1 ldi r24, 0x13 ; 19 29fb2: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_RESET); 29fb4: 86 e1 ldi r24, 0x16 ; 22 29fb6: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_UNDERVOLTAGE_ERROR); 29fb8: 89 e1 ldi r24, 0x19 ; 25 29fba: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_SHORTED); 29fbc: 8c e1 ldi r24, 0x1C ; 28 29fbe: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT); 29fc0: 8d e0 ldi r24, 0x0D ; 13 29fc2: 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); 29fc4: 84 e1 ldi r24, 0x14 ; 20 29fc6: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_RESET)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_RESET); 29fc8: 87 e1 ldi r24, 0x17 ; 23 29fca: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_UNDERVOLTAGE_ON_CHARGE_PUMP)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_UNDERVOLTAGE_ERROR); 29fcc: 8a e1 ldi r24, 0x1A ; 26 29fce: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_SHORT_TO_GROUND)) { return FindErrorIndex(ERR_ELECTRICAL_TMC_IDLER_DRIVER_SHORTED); 29fd0: 8d e1 ldi r24, 0x1D ; 29 29fd2: 08 95 ret } if (ContainsBit(ec, ErrorCode::TMC_OVER_TEMPERATURE_WARN)) { return FindErrorIndex(ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT); 29fd4: 8e e0 ldi r24, 0x0E ; 14 29fd6: 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); 29fd8: 8c e2 ldi r24, 0x2C ; 44 } 29fda: 08 95 ret 00029fdc : bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { 29fdc: cf 92 push r12 29fde: df 92 push r13 29fe0: ef 92 push r14 29fe2: ff 92 push r15 29fe4: 0f 93 push r16 29fe6: 1f 93 push r17 29fe8: cf 93 push r28 29fea: df 93 push r29 if (putErrorScreenToSleep) return; if (mmu2.MMUCurrentErrorCode() == ErrorCode::OK && mmu2.MMULastErrorSource() == MMU2::ErrorSourceMMU) { 29fec: 20 91 d2 12 lds r18, 0x12D2 ; 0x8012d2 29ff0: 30 91 d3 12 lds r19, 0x12D3 ; 0x8012d3 29ff4: 21 30 cpi r18, 0x01 ; 1 29ff6: 31 05 cpc r19, r1 29ff8: 39 f4 brne .+14 ; 0x2a008 29ffa: 20 91 fb 12 lds r18, 0x12FB ; 0x8012fb 29ffe: 21 30 cpi r18, 0x01 ; 1 2a000: 19 f4 brne .+6 ; 0x2a008 // 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; 2a002: 22 e0 ldi r18, 0x02 ; 2 2a004: 20 93 89 04 sts 0x0489, r18 ; 0x800489 } const uint8_t ei = PrusaErrorCodeIndex((ErrorCode)ec); 2a008: 0f 94 9d 4e call 0x29d3a ; 0x29d3a 2a00c: d8 2f mov r29, r24 switch ((uint8_t)ReportErrorHookState) { 2a00e: 80 91 89 04 lds r24, 0x0489 ; 0x800489 2a012: 81 30 cpi r24, 0x01 ; 1 2a014: 09 f4 brne .+2 ; 0x2a018 2a016: 64 c0 rjmp .+200 ; 0x2a0e0 2a018: 60 f0 brcs .+24 ; 0x2a032 2a01a: 82 30 cpi r24, 0x02 ; 2 2a01c: 09 f4 brne .+2 ; 0x2a020 2a01e: f4 c0 rjmp .+488 ; 0x2a208 ReportErrorHookState = ReportErrorHookStates::RENDER_ERROR_SCREEN; break; default: break; } } 2a020: df 91 pop r29 2a022: cf 91 pop r28 2a024: 1f 91 pop r17 2a026: 0f 91 pop r16 2a028: ff 90 pop r15 2a02a: ef 90 pop r14 2a02c: df 90 pop r13 2a02e: cf 90 pop r12 2a030: 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); 2a032: 84 e0 ldi r24, 0x04 ; 4 2a034: 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); 2a038: 0d 2f mov r16, r29 2a03a: 10 e0 ldi r17, 0x00 ; 0 2a03c: f8 01 movw r30, r16 2a03e: e6 5c subi r30, 0xC6 ; 198 2a040: f6 47 sbci r31, 0x76 ; 118 2a042: 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); 2a044: fc 2e mov r15, r28 2a046: f2 94 swap r15 2a048: 6f e0 ldi r22, 0x0F ; 15 2a04a: f6 22 and r15, r22 const uint8_t button_op_middle = BUTTON_OP_MIDDLE(button_operation); 2a04c: 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); 2a04e: 80 e0 ldi r24, 0x00 ; 0 2a050: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_clear(); 2a054: 0e 94 77 70 call 0xe0ee ; 0xe0ee // 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); 2a058: 00 0f add r16, r16 2a05a: 11 1f adc r17, r17 2a05c: f8 01 movw r30, r16 2a05e: e9 59 subi r30, 0x99 ; 153 2a060: f6 47 sbci r31, 0x76 ; 118 2a062: c5 90 lpm r12, Z+ 2a064: d4 90 lpm r13, Z } const char *PrusaErrorTitle(uint8_t i) { return (const char *)pgm_read_ptr(errorTitles + i); 2a066: 0a 5c subi r16, 0xCA ; 202 2a068: 1f 45 sbci r17, 0x5F ; 95 2a06a: f8 01 movw r30, r16 2a06c: 85 91 lpm r24, Z+ 2a06e: 94 91 lpm r25, Z // Print title and header lcd_printf_P(PSTR("%.20S\nprusa.io/04%hu"), _T(PrusaErrorTitle(ei)), PrusaErrorCode(ei) ); 2a070: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2a074: df 92 push r13 2a076: cf 92 push r12 2a078: 9f 93 push r25 2a07a: 8f 93 push r24 2a07c: 83 ed ldi r24, 0xD3 ; 211 2a07e: 99 e8 ldi r25, 0x89 ; 137 2a080: 9f 93 push r25 2a082: 8f 93 push r24 2a084: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 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)); 2a088: 41 ec ldi r20, 0xC1 ; 193 2a08a: 50 ea ldi r21, 0xA0 ; 160 2a08c: 62 e0 ldi r22, 0x02 ; 2 2a08e: 80 e0 ldi r24, 0x00 ; 0 2a090: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 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()); 2a094: 0f 90 pop r0 2a096: 0f 90 pop r0 2a098: 0f 90 pop r0 2a09a: 0f 90 pop r0 2a09c: 0f 90 pop r0 2a09e: 0f 90 pop r0 2a0a0: f1 10 cpse r15, r1 2a0a2: c6 c0 rjmp .+396 ; 0x2a230 2a0a4: 10 e0 ldi r17, 0x00 ; 0 2a0a6: 00 e0 ldi r16, 0x00 ; 0 2a0a8: 42 e1 ldi r20, 0x12 ; 18 2a0aa: e4 2e mov r14, r20 2a0ac: 50 ea ldi r21, 0xA0 ; 160 2a0ae: c5 2e mov r12, r21 2a0b0: 5a e6 ldi r21, 0x6A ; 106 2a0b2: 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); 2a0b4: ec 2f mov r30, r28 2a0b6: f0 e0 ldi r31, 0x00 ; 0 2a0b8: ee 0f add r30, r30 2a0ba: ff 1f adc r31, r31 2a0bc: e1 54 subi r30, 0x41 ; 65 2a0be: f6 47 sbci r31, 0x76 ; 118 2a0c0: 85 91 lpm r24, Z+ 2a0c2: 94 91 lpm r25, Z 2a0c4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2a0c8: bc 01 movw r22, r24 2a0ca: 81 e0 ldi r24, 0x01 ; 1 2a0cc: f1 10 cpse r15, r1 2a0ce: 01 c0 rjmp .+2 ; 0x2a0d2 2a0d0: 80 e0 ldi r24, 0x00 ; 0 2a0d2: 2e 2d mov r18, r14 2a0d4: a6 01 movw r20, r12 2a0d6: 0e 94 59 dd call 0x1bab2 ; 0x1bab2 switch ((uint8_t)ReportErrorHookState) { case (uint8_t)ReportErrorHookStates::RENDER_ERROR_SCREEN: KEEPALIVE_STATE(PAUSED_FOR_USER); ReportErrorHookStaticRender(ei); ReportErrorHookState = ReportErrorHookStates::MONITOR_SELECTION; 2a0da: 81 e0 ldi r24, 0x01 ; 1 2a0dc: 80 93 89 04 sts 0x0489, r24 ; 0x800489 [[fallthrough]]; case (uint8_t)ReportErrorHookStates::MONITOR_SELECTION: is_mmu_error_monitor_active = true; 2a0e0: 81 e0 ldi r24, 0x01 ; 1 2a0e2: 80 93 5c 06 sts 0x065C, r24 ; 0x80065c <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.445> ReportErrorHookDynamicRender(); // Render dynamic characters 2a0e6: 0f 94 bc 4d call 0x29b78 ; 0x29b78 sound_wait_for_user(); 2a0ea: 0f 94 ee 25 call 0x24bdc ; 0x24bdc 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); 2a0ee: 0d 2f mov r16, r29 2a0f0: 10 e0 ldi r17, 0x00 ; 0 2a0f2: f8 01 movw r30, r16 2a0f4: e6 5c subi r30, 0xC6 ; 198 2a0f6: f6 47 sbci r31, 0x76 ; 118 2a0f8: 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); 2a0fa: dc 2f mov r29, r28 2a0fc: d2 95 swap r29 2a0fe: 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; 2a100: 80 91 81 04 lds r24, 0x0481 ; 0x800481 2a104: 81 11 cpse r24, r1 2a106: 09 c0 rjmp .+18 ; 0x2a11a 2a108: 81 e0 ldi r24, 0x01 ; 1 2a10a: d1 11 cpse r29, r1 2a10c: 01 c0 rjmp .+2 ; 0x2a110 2a10e: 80 e0 ldi r24, 0x00 ; 0 2a110: 80 93 80 04 sts 0x0480, r24 ; 0x800480 2a114: 81 e0 ldi r24, 0x01 ; 1 2a116: 80 93 81 04 sts 0x0481, r24 ; 0x800481 static int8_t choice_selected = -1; if (reset_button_selection) { 2a11a: 80 91 7f 04 lds r24, 0x047F ; 0x80047f 2a11e: 88 23 and r24, r24 2a120: 41 f0 breq .+16 ; 0x2a132 // 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; 2a122: 81 e0 ldi r24, 0x01 ; 1 2a124: d1 11 cpse r29, r1 2a126: 01 c0 rjmp .+2 ; 0x2a12a 2a128: 80 e0 ldi r24, 0x00 ; 0 2a12a: 80 93 80 04 sts 0x0480, r24 ; 0x800480 choice_selected = -1; reset_button_selection = 0; 2a12e: 10 92 7f 04 sts 0x047F, r1 ; 0x80047f } // Check if knob was rotated if (lcd_encoder) { 2a132: 20 91 1e 06 lds r18, 0x061E ; 0x80061e 2a136: 30 91 1f 06 lds r19, 0x061F ; 0x80061f 2a13a: 21 15 cp r18, r1 2a13c: 31 05 cpc r19, r1 2a13e: b9 f1 breq .+110 ; 0x2a1ae 2a140: 80 91 80 04 lds r24, 0x0480 ; 0x800480 if (two_choices == false) { // third_choice is not nullptr, safe to dereference 2a144: dd 23 and r29, r29 2a146: 61 f0 breq .+24 ; 0x2a160 if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2a148: 37 ff sbrs r19, 7 2a14a: 06 c0 rjmp .+12 ; 0x2a158 2a14c: 88 23 and r24, r24 2a14e: 69 f0 breq .+26 ; 0x2a16a // Rotating knob counter clockwise current_selection--; 2a150: 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; 2a152: 80 93 80 04 sts 0x0480, r24 ; 0x800480 2a156: 09 c0 rjmp .+18 ; 0x2a16a 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) { 2a158: 82 30 cpi r24, 0x02 ; 2 2a15a: 39 f0 breq .+14 ; 0x2a16a // Rotating knob clockwise current_selection++; 2a15c: 8f 5f subi r24, 0xFF ; 255 2a15e: f9 cf rjmp .-14 ; 0x2a152 } } else { if (lcd_encoder < 0 && current_selection != LCD_LEFT_BUTTON_CHOICE) { 2a160: 37 ff sbrs r19, 7 2a162: 41 c0 rjmp .+130 ; 0x2a1e6 2a164: 81 11 cpse r24, r1 // Rotating knob counter clockwise current_selection = LCD_LEFT_BUTTON_CHOICE; 2a166: 10 92 80 04 sts 0x0480, r1 ; 0x800480 //! ---------------------- //! |>(left) >(mid) | //! ---------------------- //! @endcode // lcd_putc_at(0, 3, current_selection == LCD_LEFT_BUTTON_CHOICE ? '>': ' '); 2a16a: 80 91 80 04 lds r24, 0x0480 ; 0x800480 2a16e: 4e e3 ldi r20, 0x3E ; 62 2a170: 81 11 cpse r24, r1 2a172: 40 e2 ldi r20, 0x20 ; 32 2a174: 63 e0 ldi r22, 0x03 ; 3 2a176: 80 e0 ldi r24, 0x00 ; 0 2a178: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 2a17c: 80 91 80 04 lds r24, 0x0480 ; 0x800480 if (two_choices == false) 2a180: dd 23 and r29, r29 2a182: b1 f1 breq .+108 ; 0x2a1f0 { lcd_putc_at(9, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 2a184: 4e e3 ldi r20, 0x3E ; 62 2a186: 81 30 cpi r24, 0x01 ; 1 2a188: 09 f0 breq .+2 ; 0x2a18c 2a18a: 40 e2 ldi r20, 0x20 ; 32 2a18c: 63 e0 ldi r22, 0x03 ; 3 2a18e: 89 e0 ldi r24, 0x09 ; 9 2a190: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_putc_at(18, 3, current_selection == LCD_RIGHT_BUTTON_CHOICE ? '>': ' '); 2a194: 80 91 80 04 lds r24, 0x0480 ; 0x800480 2a198: 82 30 cpi r24, 0x02 ; 2 2a19a: 61 f5 brne .+88 ; 0x2a1f4 } else { // More button for two button screen lcd_putc_at(18, 3, current_selection == LCD_MIDDLE_BUTTON_CHOICE ? '>': ' '); 2a19c: 4e e3 ldi r20, 0x3E ; 62 2a19e: 63 e0 ldi r22, 0x03 ; 3 2a1a0: 82 e1 ldi r24, 0x12 ; 18 2a1a2: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 } // Consume rotation event lcd_encoder = 0; 2a1a6: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 2a1aa: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } // Check if knob was clicked and consume the event if (lcd_clicked()) { 2a1ae: 0e 94 c6 73 call 0xe78c ; 0xe78c 2a1b2: 88 23 and r24, r24 2a1b4: 09 f4 brne .+2 ; 0x2a1b8 2a1b6: 34 cf rjmp .-408 ; 0x2a020 choice_selected = current_selection; 2a1b8: 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 2a1bc: d1 11 cpse r29, r1 2a1be: 1c c0 rjmp .+56 ; 0x2a1f8 2a1c0: 81 30 cpi r24, 0x01 ; 1 2a1c2: 89 f5 brne .+98 ; 0x2a226 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); 2a1c4: f8 01 movw r30, r16 2a1c6: ee 0f add r30, r30 2a1c8: ff 1f adc r31, r31 2a1ca: e0 52 subi r30, 0x20 ; 32 2a1cc: f7 47 sbci r31, 0x77 ; 119 2a1ce: 85 91 lpm r24, Z+ 2a1d0: 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))); 2a1d2: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2a1d6: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 2a1da: 81 e0 ldi r24, 0x01 ; 1 2a1dc: 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; 2a1e0: 10 92 89 04 sts 0x0489, r1 ; 0x800489 2a1e4: 1d cf rjmp .-454 ; 0x2a020 } } 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) { 2a1e6: 81 30 cpi r24, 0x01 ; 1 2a1e8: 09 f4 brne .+2 ; 0x2a1ec 2a1ea: bf cf rjmp .-130 ; 0x2a16a // Rotating knob clockwise current_selection = LCD_MIDDLE_BUTTON_CHOICE; 2a1ec: 81 e0 ldi r24, 0x01 ; 1 2a1ee: b1 cf rjmp .-158 ; 0x2a152 { 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 ? '>': ' '); 2a1f0: 81 30 cpi r24, 0x01 ; 1 2a1f2: a1 f2 breq .-88 ; 0x2a19c 2a1f4: 40 e2 ldi r20, 0x20 ; 32 2a1f6: d3 cf rjmp .-90 ; 0x2a19e // 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 2a1f8: 82 30 cpi r24, 0x02 ; 2 2a1fa: 21 f3 breq .-56 ; 0x2a1c4 { // 'More' show error description lcd_show_fullscreen_message_and_wait_P(_T(PrusaErrorDesc(ei))); ret = 1; } else if(choice_selected == LCD_MIDDLE_BUTTON_CHOICE) { 2a1fc: 81 30 cpi r24, 0x01 ; 1 2a1fe: 99 f4 brne .+38 ; 0x2a226 return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 2a200: d0 93 44 0d sts 0x0D44, r29 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 2a204: 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); 2a208: 81 e0 ldi r24, 0x01 ; 1 2a20a: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_return_to_status(); 2a20e: 0f 94 6e 05 call 0x20adc ; 0x20adc 2a212: 10 92 be 04 sts 0x04BE, r1 ; 0x8004be <_ZL10beep_timer.lto_priv.496> /// @brief Resets the global state of sound_wait_for_user() void sound_wait_for_user_reset() { beep_timer.stop(); bFirst = false; 2a216: 10 92 c1 04 sts 0x04C1, r1 ; 0x8004c1 <_ZL6bFirst.lto_priv.497> sound_wait_for_user_reset(); // Reset the state in case a new error is reported is_mmu_error_monitor_active = false; 2a21a: 10 92 5c 06 sts 0x065C, r1 ; 0x80065c <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.445> KEEPALIVE_STATE(IN_HANDLER); 2a21e: 82 e0 ldi r24, 0x02 ; 2 2a220: 80 93 78 02 sts 0x0278, r24 ; 0x800278 2a224: dd cf rjmp .-70 ; 0x2a1e0 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); 2a226: cf 70 andi r28, 0x0F ; 15 2a228: c0 93 44 0d sts 0x0D44, r28 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> SetButtonResponse((ButtonOperations)button_op_middle); ret = 2; } // Next MMU error screen should reset the choice selection reset_button_selection = 1; 2a22c: 81 e0 ldi r24, 0x01 ; 1 2a22e: ea cf rjmp .-44 ; 0x2a204 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); 2a230: ef 2d mov r30, r15 2a232: f0 e0 ldi r31, 0x00 ; 0 2a234: ee 0f add r30, r30 2a236: ff 1f adc r31, r31 2a238: e1 54 subi r30, 0x41 ; 65 2a23a: f6 47 sbci r31, 0x76 ; 118 2a23c: 85 91 lpm r24, Z+ 2a23e: 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()); 2a240: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2a244: 6c 01 movw r12, r24 2a246: 00 ea ldi r16, 0xA0 ; 160 2a248: 1a e6 ldi r17, 0x6A ; 106 2a24a: 99 e0 ldi r25, 0x09 ; 9 2a24c: e9 2e mov r14, r25 2a24e: 32 cf rjmp .-412 ; 0x2a0b4 0002a250 : buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation return result; } Buttons ButtonAvailable(ErrorCode ec) { uint8_t ei = PrusaErrorCodeIndex(ec); 2a250: 0f 94 9d 4e call 0x29d3a ; 0x29d3a // 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); 2a254: e8 2f mov r30, r24 2a256: f0 e0 ldi r31, 0x00 ; 0 2a258: ee 0f add r30, r30 2a25a: ff 1f adc r31, r31 2a25c: e9 59 subi r30, 0x99 ; 153 2a25e: f6 47 sbci r31, 0x76 ; 118 2a260: 25 91 lpm r18, Z+ 2a262: 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) ) { 2a264: 23 33 cpi r18, 0x33 ; 51 2a266: 81 e0 ldi r24, 0x01 ; 1 2a268: 38 07 cpc r19, r24 2a26a: 08 f0 brcs .+2 ; 0x2a26e 2a26c: 41 c0 rjmp .+130 ; 0x2a2f0 2a26e: 2d 32 cpi r18, 0x2D ; 45 2a270: 81 e0 ldi r24, 0x01 ; 1 2a272: 38 07 cpc r19, r24 2a274: 78 f5 brcc .+94 ; 0x2a2d4 2a276: 2e 37 cpi r18, 0x7E ; 126 2a278: 31 05 cpc r19, r1 2a27a: 09 f4 brne .+2 ; 0x2a27e 2a27c: 83 c0 rjmp .+262 ; 0x2a384 2a27e: f0 f4 brcc .+60 ; 0x2a2bc 2a280: 2c 36 cpi r18, 0x6C ; 108 2a282: 31 05 cpc r19, r1 2a284: 09 f4 brne .+2 ; 0x2a288 2a286: 85 c0 rjmp .+266 ; 0x2a392 2a288: 30 f4 brcc .+12 ; 0x2a296 2a28a: 25 36 cpi r18, 0x65 ; 101 2a28c: 31 05 cpc r19, r1 2a28e: 08 f0 brcs .+2 ; 0x2a292 2a290: 79 c0 rjmp .+242 ; 0x2a384 default: break; } return Buttons::NoButton; 2a292: 8f ef ldi r24, 0xFF ; 255 2a294: 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) ) { 2a296: 24 37 cpi r18, 0x74 ; 116 2a298: 31 05 cpc r19, r1 2a29a: 09 f4 brne .+2 ; 0x2a29e 2a29c: 73 c0 rjmp .+230 ; 0x2a384 2a29e: 2d 37 cpi r18, 0x7D ; 125 2a2a0: 31 05 cpc r19, r1 2a2a2: 19 f0 breq .+6 ; 0x2a2aa 2a2a4: 23 37 cpi r18, 0x73 ; 115 2a2a6: 31 05 cpc r19, r1 2a2a8: a1 f7 brne .-24 ; 0x2a292 break; } break; case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { 2a2aa: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 2a2ae: 81 30 cpi r24, 0x01 ; 1 2a2b0: 09 f4 brne .+2 ; 0x2a2b4 2a2b2: 6d c0 rjmp .+218 ; 0x2a38e 2a2b4: 87 30 cpi r24, 0x07 ; 7 2a2b6: 69 f7 brne .-38 ; 0x2a292 // may be allow move selector right and left in the future case ButtonOperations::Tune: // Tune Stallguard threshold return Buttons::TuneMMU; 2a2b8: 88 e0 ldi r24, 0x08 ; 8 2a2ba: 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) ) { 2a2bc: 23 3d cpi r18, 0xD3 ; 211 2a2be: 31 05 cpc r19, r1 2a2c0: 09 f4 brne .+2 ; 0x2a2c4 2a2c2: 6e c0 rjmp .+220 ; 0x2a3a0 2a2c4: 50 f4 brcc .+20 ; 0x2a2da 2a2c6: 29 3c cpi r18, 0xC9 ; 201 2a2c8: 31 05 cpc r19, r1 2a2ca: 09 f4 brne .+2 ; 0x2a2ce 2a2cc: 69 c0 rjmp .+210 ; 0x2a3a0 2a2ce: 2a 3c cpi r18, 0xCA ; 202 2a2d0: 31 05 cpc r19, r1 2a2d2: f9 f6 brne .-66 ; 0x2a292 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) { 2a2d4: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 2a2d8: 67 c0 rjmp .+206 ; 0x2a3a8 // 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) ) { 2a2da: 2d 3d cpi r18, 0xDD ; 221 2a2dc: 31 05 cpc r19, r1 2a2de: 09 f4 brne .+2 ; 0x2a2e2 2a2e0: 5f c0 rjmp .+190 ; 0x2a3a0 2a2e2: 2e 3d cpi r18, 0xDE ; 222 2a2e4: 31 05 cpc r19, r1 2a2e6: b1 f3 breq .-20 ; 0x2a2d4 2a2e8: 24 3d cpi r18, 0xD4 ; 212 2a2ea: 31 05 cpc r19, r1 2a2ec: 91 f6 brne .-92 ; 0x2a292 2a2ee: f2 cf rjmp .-28 ; 0x2a2d4 2a2f0: 25 3f cpi r18, 0xF5 ; 245 2a2f2: 81 e0 ldi r24, 0x01 ; 1 2a2f4: 38 07 cpc r19, r24 2a2f6: 09 f4 brne .+2 ; 0x2a2fa 2a2f8: 5c c0 rjmp .+184 ; 0x2a3b2 2a2fa: f8 f4 brcc .+62 ; 0x2a33a 2a2fc: 26 34 cpi r18, 0x46 ; 70 2a2fe: 81 e0 ldi r24, 0x01 ; 1 2a300: 38 07 cpc r19, r24 2a302: 58 f4 brcc .+22 ; 0x2a31a 2a304: 21 34 cpi r18, 0x41 ; 65 2a306: 81 e0 ldi r24, 0x01 ; 1 2a308: 38 07 cpc r19, r24 2a30a: 20 f7 brcc .-56 ; 0x2a2d4 2a30c: 27 53 subi r18, 0x37 ; 55 2a30e: 31 40 sbci r19, 0x01 ; 1 2a310: 25 30 cpi r18, 0x05 ; 5 2a312: 31 05 cpc r19, r1 2a314: 08 f0 brcs .+2 ; 0x2a318 2a316: bd cf rjmp .-134 ; 0x2a292 2a318: dd cf rjmp .-70 ; 0x2a2d4 2a31a: 21 59 subi r18, 0x91 ; 145 2a31c: 31 40 sbci r19, 0x01 ; 1 2a31e: 22 30 cpi r18, 0x02 ; 2 2a320: 31 05 cpc r19, r1 2a322: 08 f0 brcs .+2 ; 0x2a326 2a324: b6 cf rjmp .-148 ; 0x2a292 } break; case ERR_CONNECT_MMU_NOT_RESPONDING: case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { 2a326: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 2a32a: 83 30 cpi r24, 0x03 ; 3 2a32c: 09 f4 brne .+2 ; 0x2a330 2a32e: 3f c0 rjmp .+126 ; 0x2a3ae 2a330: 89 30 cpi r24, 0x09 ; 9 2a332: 09 f0 breq .+2 ; 0x2a336 2a334: ae cf rjmp .-164 ; 0x2a292 case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; 2a336: 87 e0 ldi r24, 0x07 ; 7 2a338: 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) ) { 2a33a: 29 3f cpi r18, 0xF9 ; 249 2a33c: 81 e0 ldi r24, 0x01 ; 1 2a33e: 38 07 cpc r19, r24 2a340: 49 f2 breq .-110 ; 0x2a2d4 2a342: 70 f4 brcc .+28 ; 0x2a360 2a344: 27 3f cpi r18, 0xF7 ; 247 2a346: 81 e0 ldi r24, 0x01 ; 1 2a348: 38 07 cpc r19, r24 2a34a: 21 f2 breq .-120 ; 0x2a2d4 2a34c: 60 f7 brcc .-40 ; 0x2a326 break; } break; case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { 2a34e: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 2a352: 83 30 cpi r24, 0x03 ; 3 2a354: 61 f1 breq .+88 ; 0x2a3ae 2a356: 88 30 cpi r24, 0x08 ; 8 2a358: 09 f0 breq .+2 ; 0x2a35c 2a35a: 9b cf rjmp .-202 ; 0x2a292 case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; 2a35c: 86 e0 ldi r24, 0x06 ; 6 2a35e: 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) ) { 2a360: 2b 3f cpi r18, 0xFB ; 251 2a362: 81 e0 ldi r24, 0x01 ; 1 2a364: 38 07 cpc r19, r24 2a366: a9 f0 breq .+42 ; 0x2a392 2a368: 68 f0 brcs .+26 ; 0x2a384 2a36a: 2c 3f cpi r18, 0xFC ; 252 2a36c: 31 40 sbci r19, 0x01 ; 1 2a36e: 09 f0 breq .+2 ; 0x2a372 2a370: 90 cf rjmp .-224 ; 0x2a292 default: break; } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { 2a372: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 2a376: 85 30 cpi r24, 0x05 ; 5 2a378: 89 f0 breq .+34 ; 0x2a39c 2a37a: 86 30 cpi r24, 0x06 ; 6 2a37c: 09 f0 breq .+2 ; 0x2a380 2a37e: 89 cf rjmp .-238 ; 0x2a292 case ButtonOperations::Load: return Buttons::Load; case ButtonOperations::Eject: return Buttons::Eject; 2a380: 85 e0 ldi r24, 0x05 ; 5 2a382: 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) { 2a384: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 2a388: 81 30 cpi r24, 0x01 ; 1 2a38a: 09 f0 breq .+2 ; 0x2a38e 2a38c: 82 cf rjmp .-252 ; 0x2a292 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; 2a38e: 81 e0 ldi r24, 0x01 ; 1 2a390: 08 95 ret break; } break; case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { 2a392: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 2a396: 82 30 cpi r24, 0x02 ; 2 2a398: d1 f3 breq .-12 ; 0x2a38e 2a39a: 7b cf rjmp .-266 ; 0x2a292 } break; case ERR_SYSTEM_FILAMENT_CHANGE: switch (buttonSelectedOperation) { case ButtonOperations::Load: return Buttons::Load; 2a39c: 84 e0 ldi r24, 0x04 ; 4 2a39e: 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) { 2a3a0: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 2a3a4: 82 30 cpi r24, 0x02 ; 2 2a3a6: 61 f0 breq .+24 ; 0x2a3c0 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) { 2a3a8: 83 30 cpi r24, 0x03 ; 3 2a3aa: 09 f0 breq .+2 ; 0x2a3ae 2a3ac: 72 cf rjmp .-284 ; 0x2a292 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; 2a3ae: 83 e0 ldi r24, 0x03 ; 3 default: break; } return Buttons::NoButton; } 2a3b0: 08 95 ret default: break; } break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { 2a3b2: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 2a3b6: 82 30 cpi r24, 0x02 ; 2 2a3b8: 29 f0 breq .+10 ; 0x2a3c4 2a3ba: 84 30 cpi r24, 0x04 ; 4 2a3bc: 09 f0 breq .+2 ; 0x2a3c0 2a3be: 69 cf rjmp .-302 ; 0x2a292 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; 2a3c0: 82 e0 ldi r24, 0x02 ; 2 2a3c2: 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; 2a3c4: 80 e0 ldi r24, 0x00 ; 0 2a3c6: 08 95 ret 0002a3c8 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.372]>: #endif namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { 2a3c8: cf 93 push r28 2a3ca: df 93 push r29 2a3cc: ec 01 movw r28, r24 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 2a3ce: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2a3d2: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2a3d6: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2a3da: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2a3de: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 2a3e2: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 2a3e6: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 2a3ea: c9 01 movw r24, r18 2a3ec: 86 1b sub r24, r22 2a3ee: 97 0b sbc r25, r23 2a3f0: 06 97 sbiw r24, 0x06 ; 6 2a3f2: 24 f0 brlt .+8 ; 0x2a3fc (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.372]+0x34> void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 2a3f4: ce 01 movw r24, r28 2a3f6: 0e 94 07 8d call 0x11a0e ; 0x11a0e 2a3fa: e9 cf rjmp .-46 ; 0x2a3ce (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.372]+0x6> f(); safe_delay_keep_alive(delay); } } 2a3fc: df 91 pop r29 2a3fe: cf 91 pop r28 2a400: 08 95 ret 0002a402 : } //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) { 2a402: cf 93 push r28 2a404: df 93 push r29 2a406: 00 d0 rcall .+0 ; 0x2a408 2a408: 00 d0 rcall .+0 ; 0x2a40a 2a40a: 1f 92 push r1 2a40c: cd b7 in r28, 0x3d ; 61 2a40e: 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)) 2a410: 87 30 cpi r24, 0x07 ; 7 2a412: 50 f5 brcc .+84 ; 0x2a468 2a414: 67 30 cpi r22, 0x07 ; 7 2a416: 40 f5 brcc .+80 ; 0x2a468 return false; uint8_t valid_points_mask[7] = { 2a418: 97 e0 ldi r25, 0x07 ; 7 2a41a: ed eb ldi r30, 0xBD ; 189 2a41c: f2 e0 ldi r31, 0x02 ; 2 2a41e: de 01 movw r26, r28 2a420: 11 96 adiw r26, 0x01 ; 1 2a422: 01 90 ld r0, Z+ 2a424: 0d 92 st X+, r0 2a426: 9a 95 dec r25 2a428: e1 f7 brne .-8 ; 0x2a422 0b1110111,//2 0b1111111,//1 0b1111111,//0 //[0,0] }; return (valid_points_mask[6 - iy] & (1 << (6 - ix))); 2a42a: 46 e0 ldi r20, 0x06 ; 6 2a42c: 50 e0 ldi r21, 0x00 ; 0 2a42e: fa 01 movw r30, r20 2a430: e6 1b sub r30, r22 2a432: f1 09 sbc r31, r1 2a434: 21 e0 ldi r18, 0x01 ; 1 2a436: 30 e0 ldi r19, 0x00 ; 0 2a438: 2c 0f add r18, r28 2a43a: 3d 1f adc r19, r29 2a43c: e2 0f add r30, r18 2a43e: f3 1f adc r31, r19 2a440: 20 81 ld r18, Z 2a442: 30 e0 ldi r19, 0x00 ; 0 2a444: 48 1b sub r20, r24 2a446: 51 09 sbc r21, r1 2a448: c9 01 movw r24, r18 2a44a: 02 c0 rjmp .+4 ; 0x2a450 2a44c: 95 95 asr r25 2a44e: 87 95 ror r24 2a450: 4a 95 dec r20 2a452: e2 f7 brpl .-8 ; 0x2a44c 2a454: 81 70 andi r24, 0x01 ; 1 } 2a456: 27 96 adiw r28, 0x07 ; 7 2a458: 0f b6 in r0, 0x3f ; 63 2a45a: f8 94 cli 2a45c: de bf out 0x3e, r29 ; 62 2a45e: 0f be out 0x3f, r0 ; 63 2a460: cd bf out 0x3d, r28 ; 61 2a462: df 91 pop r29 2a464: cf 91 pop r28 2a466: 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; 2a468: 80 e0 ldi r24, 0x00 ; 0 2a46a: f5 cf rjmp .-22 ; 0x2a456 0002a46c : #endif //NEW_XYZCAL // Shift a Z axis by a given delta. // To replace loading of the babystep correction. static void shift_z(float delta) { 2a46c: 0f 93 push r16 2a46e: 1f 93 push r17 2a470: cf 93 push r28 2a472: df 93 push r29 2a474: 00 d0 rcall .+0 ; 0x2a476 2a476: 1f 92 push r1 2a478: cd b7 in r28, 0x3d ; 61 2a47a: de b7 in r29, 0x3e ; 62 2a47c: 9b 01 movw r18, r22 2a47e: ac 01 movw r20, r24 const float curpos_z = current_position[Z_AXIS]; 2a480: 01 e6 ldi r16, 0x61 ; 97 2a482: 12 e1 ldi r17, 0x12 ; 18 2a484: f8 01 movw r30, r16 2a486: 60 85 ldd r22, Z+8 ; 0x08 2a488: 71 85 ldd r23, Z+9 ; 0x09 2a48a: 82 85 ldd r24, Z+10 ; 0x0a 2a48c: 93 85 ldd r25, Z+11 ; 0x0b 2a48e: 69 83 std Y+1, r22 ; 0x01 2a490: 7a 83 std Y+2, r23 ; 0x02 2a492: 8b 83 std Y+3, r24 ; 0x03 2a494: 9c 83 std Y+4, r25 ; 0x04 current_position[Z_AXIS] -= delta; 2a496: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2a49a: f8 01 movw r30, r16 2a49c: 60 87 std Z+8, r22 ; 0x08 2a49e: 71 87 std Z+9, r23 ; 0x09 2a4a0: 82 87 std Z+10, r24 ; 0x0a 2a4a2: 93 87 std Z+11, r25 ; 0x0b plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 60); 2a4a4: 65 e5 ldi r22, 0x55 ; 85 2a4a6: 75 e5 ldi r23, 0x55 ; 85 2a4a8: 85 e5 ldi r24, 0x55 ; 85 2a4aa: 91 e4 ldi r25, 0x41 ; 65 2a4ac: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 2a4b0: 0f 94 94 18 call 0x23128 ; 0x23128 current_position[Z_AXIS] = curpos_z; 2a4b4: 89 81 ldd r24, Y+1 ; 0x01 2a4b6: 9a 81 ldd r25, Y+2 ; 0x02 2a4b8: ab 81 ldd r26, Y+3 ; 0x03 2a4ba: bc 81 ldd r27, Y+4 ; 0x04 2a4bc: f8 01 movw r30, r16 2a4be: 80 87 std Z+8, r24 ; 0x08 2a4c0: 91 87 std Z+9, r25 ; 0x09 2a4c2: a2 87 std Z+10, r26 ; 0x0a 2a4c4: b3 87 std Z+11, r27 ; 0x0b plan_set_z_position(curpos_z); 2a4c6: ce 01 movw r24, r28 2a4c8: 01 96 adiw r24, 0x01 ; 1 2a4ca: 0f 94 98 3a call 0x27530 ; 0x27530 } 2a4ce: 0f 90 pop r0 2a4d0: 0f 90 pop r0 2a4d2: 0f 90 pop r0 2a4d4: 0f 90 pop r0 2a4d6: df 91 pop r29 2a4d8: cf 91 pop r28 2a4da: 1f 91 pop r17 2a4dc: 0f 91 pop r16 2a4de: 08 95 ret 0002a4e0 : 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])); 2a4e0: 60 91 26 06 lds r22, 0x0626 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.450> 2a4e4: 70 91 27 06 lds r23, 0x0627 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.450+0x1> 2a4e8: 07 2e mov r0, r23 2a4ea: 00 0c add r0, r0 2a4ec: 88 0b sbc r24, r24 2a4ee: 99 0b sbc r25, r25 2a4f0: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2a4f4: 20 91 73 0d lds r18, 0x0D73 ; 0x800d73 2a4f8: 30 91 74 0d lds r19, 0x0D74 ; 0x800d74 2a4fc: 40 91 75 0d lds r20, 0x0D75 ; 0x800d75 2a500: 50 91 76 0d lds r21, 0x0D76 ; 0x800d76 2a504: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 2a508: 0f 94 36 52 call 0x2a46c ; 0x2a46c babystepLoadZ = 0; 2a50c: 10 92 27 06 sts 0x0627, r1 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.450+0x1> 2a510: 10 92 26 06 sts 0x0626, r1 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.450> } 2a514: 08 95 ret 0002a516 : // 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() { 2a516: 2f 92 push r2 2a518: 3f 92 push r3 2a51a: 4f 92 push r4 2a51c: 5f 92 push r5 2a51e: 6f 92 push r6 2a520: 7f 92 push r7 2a522: 8f 92 push r8 2a524: 9f 92 push r9 2a526: af 92 push r10 2a528: bf 92 push r11 2a52a: cf 92 push r12 2a52c: df 92 push r13 2a52e: ef 92 push r14 2a530: ff 92 push r15 2a532: 0f 93 push r16 2a534: 1f 93 push r17 2a536: cf 93 push r28 2a538: df 93 push r29 2a53a: 00 d0 rcall .+0 ; 0x2a53c 2a53c: 00 d0 rcall .+0 ; 0x2a53e 2a53e: cd b7 in r28, 0x3d ; 61 2a540: de b7 in r29, 0x3e ; 62 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2a542: 80 91 77 02 lds r24, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.385> 2a546: 8c 83 std Y+4, r24 ; 0x04 check_endstops = check; 2a548: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.385> 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); 2a54c: 80 e0 ldi r24, 0x00 ; 0 2a54e: 0f 94 1a 23 call 0x24634 ; 0x24634 2a552: 8b 83 std Y+3, r24 ; 0x03 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 2a554: 0e 94 92 65 call 0xcb24 ; 0xcb24 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 2a558: 85 e1 ldi r24, 0x15 ; 21 2a55a: 92 e6 ldi r25, 0x62 ; 98 2a55c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2a560: 0e 94 91 de call 0x1bd22 ; 0x1bd22 // display "point xx of yy" lcd_puts_at_P(0,3,_n("1/9")); 2a564: 4c e9 ldi r20, 0x9C ; 156 2a566: 5a e6 ldi r21, 0x6A ; 106 2a568: 63 e0 ldi r22, 0x03 ; 3 2a56a: 80 e0 ldi r24, 0x00 ; 0 2a56c: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 2a570: 81 e0 ldi r24, 0x01 ; 1 2a572: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.385> // 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; 2a576: 80 e0 ldi r24, 0x00 ; 0 2a578: 90 e0 ldi r25, 0x00 ; 0 2a57a: a0 ea ldi r26, 0xA0 ; 160 2a57c: b0 e4 ldi r27, 0x40 ; 64 2a57e: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2a582: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 2a586: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 2a58a: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/60); 2a58e: 65 e5 ldi r22, 0x55 ; 85 2a590: 75 e5 ldi r23, 0x55 ; 85 2a592: 85 e5 ldi r24, 0x55 ; 85 2a594: 91 e4 ldi r25, 0x41 ; 65 2a596: 0f 94 82 4e call 0x29d04 ; 0x29d04 2a59a: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.385> check_Z_crash(); #endif enable_endstops(false); // Move XY to first point current_position[X_AXIS] = BED_X0; 2a59e: 80 e0 ldi r24, 0x00 ; 0 2a5a0: 90 e0 ldi r25, 0x00 ; 0 2a5a2: a0 e8 ldi r26, 0x80 ; 128 2a5a4: bf e3 ldi r27, 0x3F ; 63 2a5a6: 80 93 61 12 sts 0x1261, r24 ; 0x801261 2a5aa: 90 93 62 12 sts 0x1262, r25 ; 0x801262 2a5ae: a0 93 63 12 sts 0x1263, r26 ; 0x801263 2a5b2: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = BED_Y0; 2a5b6: 80 93 65 12 sts 0x1265, r24 ; 0x801265 2a5ba: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2a5be: a0 93 67 12 sts 0x1267, r26 ; 0x801267 2a5c2: b0 93 68 12 sts 0x1268, r27 ; 0x801268 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 2a5c6: 65 e6 ldi r22, 0x65 ; 101 2a5c8: 72 e1 ldi r23, 0x12 ; 18 2a5ca: 81 e6 ldi r24, 0x61 ; 97 2a5cc: 92 e1 ldi r25, 0x12 ; 18 2a5ce: 0e 94 6f 69 call 0xd2de ; 0xd2de go_to_current(homing_feedrate[X_AXIS]/60); 2a5d2: 60 e0 ldi r22, 0x00 ; 0 2a5d4: 70 e0 ldi r23, 0x00 ; 0 2a5d6: 88 e4 ldi r24, 0x48 ; 72 2a5d8: 92 e4 ldi r25, 0x42 ; 66 2a5da: 0f 94 82 4e call 0x29d04 ; 0x29d04 set_destination_to_current(); 2a5de: 0e 94 ff 66 call 0xcdfe ; 0xcdfe homeaxis(Z_AXIS); 2a5e2: 82 e0 ldi r24, 0x02 ; 2 2a5e4: 0f 94 4f 7a call 0x2f49e ; 0x2f49e if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 2a5e8: 43 e0 ldi r20, 0x03 ; 3 2a5ea: 60 e0 ldi r22, 0x00 ; 0 2a5ec: 70 e0 ldi r23, 0x00 ; 0 2a5ee: 80 e2 ldi r24, 0x20 ; 32 2a5f0: 91 ec ldi r25, 0xC1 ; 193 2a5f2: 0f 94 8e 7c call 0x2f91c ; 0x2f91c 2a5f6: 81 11 cpse r24, r1 2a5f8: 06 c0 rjmp .+12 ; 0x2a606 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)); 2a5fa: 82 e6 ldi r24, 0x62 ; 98 2a5fc: 96 e5 ldi r25, 0x56 ; 86 2a5fe: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2a602: 0e 94 74 83 call 0x106e8 ; 0x106e8 2a606: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2a60a: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2a60e: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2a612: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2a616: 80 93 0a 13 sts 0x130A, r24 ; 0x80130a 2a61a: 90 93 0b 13 sts 0x130B, r25 ; 0x80130b 2a61e: a0 93 0c 13 sts 0x130C, r26 ; 0x80130c 2a622: b0 93 0d 13 sts 0x130D, r27 ; 0x80130d 2a626: e2 e0 ldi r30, 0x02 ; 2 2a628: f0 e0 ldi r31, 0x00 ; 0 2a62a: fa 83 std Y+2, r31 ; 0x02 2a62c: 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; 2a62e: c1 2c mov r12, r1 2a630: d1 2c mov r13, r1 2a632: 30 ea ldi r19, 0xA0 ; 160 2a634: e3 2e mov r14, r19 2a636: 30 e4 ldi r19, 0x40 ; 64 2a638: f3 2e mov r15, r19 go_to_current(homing_feedrate[Z_AXIS]/60); uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 2a63a: 43 e0 ldi r20, 0x03 ; 3 2a63c: 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 2a63e: 52 e0 ldi r21, 0x02 ; 2 2a640: 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); 2a642: 0b ec ldi r16, 0xCB ; 203 2a644: 18 e8 ldi r17, 0x88 ; 136 2a646: 67 e0 ldi r22, 0x07 ; 7 2a648: 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(); 2a64a: 0e 94 92 65 call 0xcb24 ; 0xcb24 // Print the decrasing ID of the measurement point. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 2a64e: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2a652: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2a656: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2a65a: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/60); 2a65e: 65 e5 ldi r22, 0x55 ; 85 2a660: 75 e5 ldi r23, 0x55 ; 85 2a662: 85 e5 ldi r24, 0x55 ; 85 2a664: 91 e4 ldi r25, 0x41 ; 65 2a666: 0f 94 82 4e call 0x29d04 ; 0x29d04 uint8_t ix = mesh_point % MESH_MEAS_NUM_X_POINTS; 2a66a: 29 81 ldd r18, Y+1 ; 0x01 2a66c: 21 50 subi r18, 0x01 ; 1 2a66e: 82 2f mov r24, r18 2a670: 6b 2d mov r22, r11 2a672: 0f 94 30 a5 call 0x34a60 ; 0x34a60 <__udivmodqi4> 2a676: 89 2e mov r8, r25 uint8_t iy = mesh_point / MESH_MEAS_NUM_X_POINTS; 2a678: 82 2f mov r24, r18 2a67a: 0f 94 3c a5 call 0x34a78 ; 0x34a78 <__divmodqi4> 2a67e: 78 2e mov r7, r24 if (iy & 1) ix = (MESH_MEAS_NUM_X_POINTS - 1) - ix; // Zig zag 2a680: 80 ff sbrs r24, 0 2a682: 03 c0 rjmp .+6 ; 0x2a68a 2a684: f9 2d mov r31, r9 2a686: f8 19 sub r31, r8 2a688: 8f 2e mov r8, r31 current_position[X_AXIS] = BED_X(ix * 3); 2a68a: 88 2d mov r24, r8 2a68c: 88 0f add r24, r24 2a68e: 88 0d add r24, r8 2a690: 0e 94 31 5f call 0xbe62 ; 0xbe62 2a694: 60 93 61 12 sts 0x1261, r22 ; 0x801261 2a698: 70 93 62 12 sts 0x1262, r23 ; 0x801262 2a69c: 80 93 63 12 sts 0x1263, r24 ; 0x801263 2a6a0: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] = BED_Y(iy * 3); 2a6a4: 87 2d mov r24, r7 2a6a6: 88 0f add r24, r24 2a6a8: 87 0d add r24, r7 2a6aa: 0e 94 31 5f call 0xbe62 ; 0xbe62 2a6ae: 60 93 65 12 sts 0x1265, r22 ; 0x801265 2a6b2: 70 93 66 12 sts 0x1266, r23 ; 0x801266 2a6b6: 80 93 67 12 sts 0x1267, r24 ; 0x801267 2a6ba: 90 93 68 12 sts 0x1268, r25 ; 0x801268 world2machine_clamp(current_position[X_AXIS], current_position[Y_AXIS]); 2a6be: 65 e6 ldi r22, 0x65 ; 101 2a6c0: 72 e1 ldi r23, 0x12 ; 18 2a6c2: 81 e6 ldi r24, 0x61 ; 97 2a6c4: 92 e1 ldi r25, 0x12 ; 18 2a6c6: 0e 94 6f 69 call 0xd2de ; 0xd2de go_to_current(homing_feedrate[X_AXIS]/60); 2a6ca: 60 e0 ldi r22, 0x00 ; 0 2a6cc: 70 e0 ldi r23, 0x00 ; 0 2a6ce: 88 e4 ldi r24, 0x48 ; 72 2a6d0: 92 e4 ldi r25, 0x42 ; 66 2a6d2: 0f 94 82 4e call 0x29d04 ; 0x29d04 #ifdef MESH_BED_CALIBRATION_SHOW_LCD // display "point xx of yy" lcd_set_cursor(0, 3); 2a6d6: 63 e0 ldi r22, 0x03 ; 3 2a6d8: 80 e0 ldi r24, 0x00 ; 0 2a6da: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(PSTR("%d/9"),mesh_point+1); 2a6de: 8a 81 ldd r24, Y+2 ; 0x02 2a6e0: 8f 93 push r24 2a6e2: 99 81 ldd r25, Y+1 ; 0x01 2a6e4: 9f 93 push r25 2a6e6: 1f 93 push r17 2a6e8: 0f 93 push r16 2a6ea: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 #endif /* MESH_BED_CALIBRATION_SHOW_LCD */ if (!find_bed_induction_sensor_point_z()) //Z crash or deviation > 50um 2a6ee: 43 e0 ldi r20, 0x03 ; 3 2a6f0: 60 e0 ldi r22, 0x00 ; 0 2a6f2: 70 e0 ldi r23, 0x00 ; 0 2a6f4: 80 e2 ldi r24, 0x20 ; 32 2a6f6: 91 ec ldi r25, 0xC1 ; 193 2a6f8: 0f 94 8e 7c call 0x2f91c ; 0x2f91c 2a6fc: 58 2e mov r5, r24 2a6fe: 0f 90 pop r0 2a700: 0f 90 pop r0 2a702: 0f 90 pop r0 2a704: 0f 90 pop r0 2a706: 88 23 and r24, r24 2a708: 09 f4 brne .+2 ; 0x2a70c 2a70a: 77 cf rjmp .-274 ; 0x2a5fa 2a70c: a7 9c mul r10, r7 2a70e: f0 01 movw r30, r0 2a710: 11 24 eor r1, r1 2a712: e8 0d add r30, r8 2a714: f1 1d adc r31, r1 2a716: ee 0f add r30, r30 2a718: ff 1f adc r31, r31 2a71a: ee 0f add r30, r30 2a71c: ff 1f adc r31, r31 2a71e: e7 5f subi r30, 0xF7 ; 247 2a720: fc 4e sbci r31, 0xEC ; 236 2a722: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2a726: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2a72a: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2a72e: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2a732: 81 83 std Z+1, r24 ; 0x01 2a734: 92 83 std Z+2, r25 ; 0x02 2a736: a3 83 std Z+3, r26 ; 0x03 2a738: b4 83 std Z+4, r27 ; 0x04 2a73a: e9 81 ldd r30, Y+1 ; 0x01 2a73c: fa 81 ldd r31, Y+2 ; 0x02 2a73e: 31 96 adiw r30, 0x01 ; 1 2a740: fa 83 std Y+2, r31 ; 0x02 2a742: 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) { 2a744: 3a 97 sbiw r30, 0x0a ; 10 2a746: 09 f0 breq .+2 ; 0x2a74a 2a748: 80 cf rjmp .-256 ; 0x2a64a mbl.set_z(ix, iy, current_position[Z_AXIS]); } { // Verify the span of the Z values. float zmin = mbl.z_values[0][0]; 2a74a: 60 90 0a 13 lds r6, 0x130A ; 0x80130a 2a74e: 70 90 0b 13 lds r7, 0x130B ; 0x80130b 2a752: 80 90 0c 13 lds r8, 0x130C ; 0x80130c 2a756: 90 90 0d 13 lds r9, 0x130D ; 0x80130d float zmax = zmin; 2a75a: 46 2c mov r4, r6 2a75c: a7 2c mov r10, r7 2a75e: b8 2c mov r11, r8 2a760: 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]; 2a762: 1e 82 std Y+6, r1 ; 0x06 2a764: 1d 82 std Y+5, r1 ; 0x05 2a766: 09 e0 ldi r16, 0x09 ; 9 2a768: 13 e1 ldi r17, 0x13 ; 19 2a76a: 8d 81 ldd r24, Y+5 ; 0x05 2a76c: 9e 81 ldd r25, Y+6 ; 0x06 2a76e: 86 5f subi r24, 0xF6 ; 246 2a770: 9c 4e sbci r25, 0xEC ; 236 2a772: 9a 83 std Y+2, r25 ; 0x02 2a774: 89 83 std Y+1, r24 ; 0x01 2a776: 93 e0 ldi r25, 0x03 ; 3 2a778: 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]); 2a77a: e9 81 ldd r30, Y+1 ; 0x01 2a77c: fa 81 ldd r31, Y+2 ; 0x02 2a77e: c1 90 ld r12, Z+ 2a780: d1 90 ld r13, Z+ 2a782: e1 90 ld r14, Z+ 2a784: f1 90 ld r15, Z+ 2a786: fa 83 std Y+2, r31 ; 0x02 2a788: e9 83 std Y+1, r30 ; 0x01 2a78a: 93 01 movw r18, r6 2a78c: a4 01 movw r20, r8 2a78e: c7 01 movw r24, r14 2a790: b6 01 movw r22, r12 2a792: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2a796: 18 16 cp r1, r24 2a798: 14 f0 brlt .+4 ; 0x2a79e 2a79a: 36 01 movw r6, r12 2a79c: 47 01 movw r8, r14 zmax = max(zmax, mbl.z_values[j][i]); 2a79e: 24 2d mov r18, r4 2a7a0: 3a 2d mov r19, r10 2a7a2: 4b 2d mov r20, r11 2a7a4: 52 2d mov r21, r2 2a7a6: c7 01 movw r24, r14 2a7a8: b6 01 movw r22, r12 2a7aa: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2a7ae: 87 fd sbrc r24, 7 2a7b0: 04 c0 rjmp .+8 ; 0x2a7ba 2a7b2: 4c 2c mov r4, r12 2a7b4: ad 2c mov r10, r13 2a7b6: be 2c mov r11, r14 2a7b8: 2f 2c mov r2, r15 2a7ba: 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) { 2a7bc: 31 10 cpse r3, r1 2a7be: dd cf rjmp .-70 ; 0x2a77a 2a7c0: 8d 81 ldd r24, Y+5 ; 0x05 2a7c2: 9e 81 ldd r25, Y+6 ; 0x06 2a7c4: 4c 96 adiw r24, 0x1c ; 28 2a7c6: 9e 83 std Y+6, r25 ; 0x06 2a7c8: 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) 2a7ca: 84 35 cpi r24, 0x54 ; 84 2a7cc: 91 05 cpc r25, r1 2a7ce: 59 f6 brne .-106 ; 0x2a766 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) { 2a7d0: 93 01 movw r18, r6 2a7d2: a4 01 movw r20, r8 2a7d4: 64 2d mov r22, r4 2a7d6: 7a 2d mov r23, r10 2a7d8: 8b 2d mov r24, r11 2a7da: 92 2d mov r25, r2 2a7dc: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2a7e0: 20 e0 ldi r18, 0x00 ; 0 2a7e2: 30 e0 ldi r19, 0x00 ; 0 2a7e4: 40 e4 ldi r20, 0x40 ; 64 2a7e6: 50 e4 ldi r21, 0x40 ; 64 2a7e8: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2a7ec: 18 16 cp r1, r24 2a7ee: 2c f5 brge .+74 ; 0x2a83a // 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!"); 2a7f0: 8e ea ldi r24, 0xAE ; 174 2a7f2: 98 e8 ldi r25, 0x88 ; 136 2a7f4: 0e 94 0e 7d call 0xfa1c ; 0xfa1c // 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; 2a7f8: 51 2c mov r5, r1 2a7fa: fc 81 ldd r31, Y+4 ; 0x04 2a7fc: f0 93 77 02 sts 0x0277, r31 ; 0x800277 <_ZL14check_endstops.lto_priv.385> go_home_with_z_lift(); result = true; end: enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2a800: 8b 81 ldd r24, Y+3 ; 0x03 2a802: 0f 94 1a 23 call 0x24634 ; 0x24634 #ifdef TMC2130 tmc2130_home_exit(); #endif return result; } 2a806: 85 2d mov r24, r5 2a808: 26 96 adiw r28, 0x06 ; 6 2a80a: 0f b6 in r0, 0x3f ; 63 2a80c: f8 94 cli 2a80e: de bf out 0x3e, r29 ; 62 2a810: 0f be out 0x3f, r0 ; 63 2a812: cd bf out 0x3d, r28 ; 61 2a814: df 91 pop r29 2a816: cf 91 pop r28 2a818: 1f 91 pop r17 2a81a: 0f 91 pop r16 2a81c: ff 90 pop r15 2a81e: ef 90 pop r14 2a820: df 90 pop r13 2a822: cf 90 pop r12 2a824: bf 90 pop r11 2a826: af 90 pop r10 2a828: 9f 90 pop r9 2a82a: 8f 90 pop r8 2a82c: 7f 90 pop r7 2a82e: 6f 90 pop r6 2a830: 5f 90 pop r5 2a832: 4f 90 pop r4 2a834: 3f 90 pop r3 2a836: 2f 90 pop r2 2a838: 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) 2a83a: 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; 2a83c: 85 ec ldi r24, 0xC5 ; 197 2a83e: e8 2e mov r14, r24 2a840: 8f e0 ldi r24, 0x0F ; 15 2a842: f8 2e mov r15, r24 2a844: 68 01 movw r12, r16 for (int8_t j = 0; j < 3; ++ j) for (int8_t i = 0; i < 3; ++ i) { 2a846: 1d 82 std Y+5, r1 ; 0x05 if (i == 0 && j == 0) 2a848: 9d 81 ldd r25, Y+5 ; 0x05 2a84a: 91 11 cpse r25, r1 2a84c: 03 c0 rjmp .+6 ; 0x2a854 2a84e: e9 81 ldd r30, Y+1 ; 0x01 2a850: ee 23 and r30, r30 2a852: 29 f1 breq .+74 ; 0x2a89e continue; float dif = mbl.z_values[j][i] - mbl.z_values[0][0]; 2a854: 20 91 0a 13 lds r18, 0x130A ; 0x80130a 2a858: 30 91 0b 13 lds r19, 0x130B ; 0x80130b 2a85c: 40 91 0c 13 lds r20, 0x130C ; 0x80130c 2a860: 50 91 0d 13 lds r21, 0x130D ; 0x80130d 2a864: f6 01 movw r30, r12 2a866: 61 81 ldd r22, Z+1 ; 0x01 2a868: 72 81 ldd r23, Z+2 ; 0x02 2a86a: 83 81 ldd r24, Z+3 ; 0x03 2a86c: 94 81 ldd r25, Z+4 ; 0x04 2a86e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> int16_t dif_quantized = int16_t(floor(dif * 100.f + 0.5f)); 2a872: 20 e0 ldi r18, 0x00 ; 0 2a874: 30 e0 ldi r19, 0x00 ; 0 2a876: 48 ec ldi r20, 0xC8 ; 200 2a878: 52 e4 ldi r21, 0x42 ; 66 2a87a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2a87e: 20 e0 ldi r18, 0x00 ; 0 2a880: 30 e0 ldi r19, 0x00 ; 0 2a882: 40 e0 ldi r20, 0x00 ; 0 2a884: 5f e3 ldi r21, 0x3F ; 63 2a886: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2a88a: 0f 94 50 a7 call 0x34ea0 ; 0x34ea0 2a88e: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> if (previous_value != value) { eeprom_word_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_word(dst, value); 2a892: c7 01 movw r24, r14 2a894: 0f 94 c3 a4 call 0x34986 ; 0x34986 SERIAL_ECHOPGM(", read: "); MYSERIAL.print(dif2, 5); SERIAL_ECHOLNPGM(""); } #endif addr += 2; 2a898: f2 e0 ldi r31, 0x02 ; 2 2a89a: ef 0e add r14, r31 2a89c: f1 1c adc r15, r1 2a89e: 84 e0 ldi r24, 0x04 ; 4 2a8a0: c8 0e add r12, r24 2a8a2: d1 1c adc r13, r1 2a8a4: 9d 81 ldd r25, Y+5 ; 0x05 2a8a6: 9f 5f subi r25, 0xFF ; 255 2a8a8: 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) { 2a8aa: 93 30 cpi r25, 0x03 ; 3 2a8ac: 69 f6 brne .-102 ; 0x2a848 2a8ae: 04 5e subi r16, 0xE4 ; 228 2a8b0: 1f 4f sbci r17, 0xFF ; 255 2a8b2: e9 81 ldd r30, Y+1 ; 0x01 2a8b4: ef 5f subi r30, 0xFF ; 255 2a8b6: 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) 2a8b8: e3 30 cpi r30, 0x03 ; 3 2a8ba: 21 f6 brne .-120 ; 0x2a844 #endif addr += 2; } } mbl.reset(); 2a8bc: 0f 94 84 7c call 0x2f908 ; 0x2f908 go_home_with_z_lift(); 2a8c0: 0e 94 8e 6a call 0xd51c ; 0xd51c 2a8c4: 9a cf rjmp .-204 ; 0x2a7fa 0002a8c6 : * 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) { 2a8c6: 2f 92 push r2 2a8c8: 3f 92 push r3 2a8ca: 4f 92 push r4 2a8cc: 5f 92 push r5 2a8ce: 6f 92 push r6 2a8d0: 7f 92 push r7 2a8d2: 8f 92 push r8 2a8d4: 9f 92 push r9 2a8d6: af 92 push r10 2a8d8: bf 92 push r11 2a8da: cf 92 push r12 2a8dc: df 92 push r13 2a8de: ef 92 push r14 2a8e0: ff 92 push r15 2a8e2: 0f 93 push r16 2a8e4: 1f 93 push r17 2a8e6: cf 93 push r28 2a8e8: df 93 push r29 2a8ea: cd b7 in r28, 0x3d ; 61 2a8ec: de b7 in r29, 0x3e ; 62 2a8ee: c2 54 subi r28, 0x42 ; 66 2a8f0: d1 09 sbc r29, r1 2a8f2: 0f b6 in r0, 0x3f ; 63 2a8f4: f8 94 cli 2a8f6: de bf out 0x3e, r29 ; 62 2a8f8: 0f be out 0x3f, r0 ; 63 2a8fa: cd bf out 0x3d, r28 ; 61 2a8fc: 4c 01 movw r8, r24 2a8fe: 5b 01 movw r10, r22 2a900: 6a 01 movw r12, r20 2a902: 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) {} 2a904: 19 82 std Y+1, r1 ; 0x01 2a906: 1c 82 std Y+4, r1 ; 0x04 2a908: 1c 8e std Y+28, r1 ; 0x1c 2a90a: 1f 8e std Y+31, r1 ; 0x1f uint8_t dname[11]; SdBaseFile dir1, dir2; SdBaseFile *parent = dirFile; SdBaseFile *sub = &dir1; if (!dirFile) goto fail; 2a90c: 67 2b or r22, r23 2a90e: 21 f5 brne .+72 ; 0x2a958 sub = parent != &dir1 ? &dir1 : &dir2; } return open(parent, dname, oflag); fail: return false; 2a910: 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; 2a912: ce 01 movw r24, r28 2a914: 4c 96 adiw r24, 0x1c ; 28 2a916: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 2a91a: ce 01 movw r24, r28 2a91c: 01 96 adiw r24, 0x01 ; 1 2a91e: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 } return open(parent, dname, oflag); fail: return false; } 2a922: 81 2f mov r24, r17 2a924: ce 5b subi r28, 0xBE ; 190 2a926: df 4f sbci r29, 0xFF ; 255 2a928: 0f b6 in r0, 0x3f ; 63 2a92a: f8 94 cli 2a92c: de bf out 0x3e, r29 ; 62 2a92e: 0f be out 0x3f, r0 ; 63 2a930: cd bf out 0x3d, r28 ; 61 2a932: df 91 pop r29 2a934: cf 91 pop r28 2a936: 1f 91 pop r17 2a938: 0f 91 pop r16 2a93a: ff 90 pop r15 2a93c: ef 90 pop r14 2a93e: df 90 pop r13 2a940: cf 90 pop r12 2a942: bf 90 pop r11 2a944: af 90 pop r10 2a946: 9f 90 pop r9 2a948: 8f 90 pop r8 2a94a: 7f 90 pop r7 2a94c: 6f 90 pop r6 2a94e: 5f 90 pop r5 2a950: 4f 90 pop r4 2a952: 3f 90 pop r3 2a954: 2f 90 pop r2 2a956: 08 95 ret SdBaseFile *sub = &dir1; if (!dirFile) goto fail; // error if already open if (isOpen()) goto fail; 2a958: fc 01 movw r30, r24 2a95a: 83 81 ldd r24, Z+3 ; 0x03 2a95c: 81 11 cpse r24, r1 2a95e: d8 cf rjmp .-80 ; 0x2a910 if (*path == '/') { 2a960: fa 01 movw r30, r20 2a962: 80 81 ld r24, Z 2a964: 8f 32 cpi r24, 0x2F ; 47 2a966: c1 f4 brne .+48 ; 0x2a998 2a968: ca 01 movw r24, r20 2a96a: 6c 01 movw r12, r24 2a96c: 01 96 adiw r24, 0x01 ; 1 while (*path == '/') path++; 2a96e: f6 01 movw r30, r12 2a970: 20 81 ld r18, Z 2a972: 2f 32 cpi r18, 0x2F ; 47 2a974: d1 f3 breq .-12 ; 0x2a96a 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; 2a976: f5 01 movw r30, r10 2a978: 83 81 ldd r24, Z+3 ; 0x03 2a97a: 82 50 subi r24, 0x02 ; 2 if (!dirFile->isRoot()) { 2a97c: 82 30 cpi r24, 0x02 ; 2 2a97e: 60 f0 brcs .+24 ; 0x2a998 if (!dir2.openRoot(dirFile->vol_)) goto fail; 2a980: 61 8d ldd r22, Z+25 ; 0x19 2a982: 72 8d ldd r23, Z+26 ; 0x1a 2a984: ce 01 movw r24, r28 2a986: 4c 96 adiw r24, 0x1c ; 28 2a988: 0f 94 ce 29 call 0x2539c ; 0x2539c parent = &dir2; 2a98c: 8e 01 movw r16, r28 2a98e: 04 5e subi r16, 0xE4 ; 228 2a990: 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; 2a992: 81 11 cpse r24, r1 2a994: 02 c0 rjmp .+4 ; 0x2a99a 2a996: bc cf rjmp .-136 ; 0x2a910 // error if already open if (isOpen()) goto fail; if (*path == '/') { while (*path == '/') path++; if (!dirFile->isRoot()) { 2a998: 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; 2a99a: ce 01 movw r24, r28 2a99c: 01 96 adiw r24, 0x01 ; 1 2a99e: 7c 01 movw r14, r24 2a9a0: 3c 01 movw r6, r24 2a9a2: 2e 01 movw r4, r28 2a9a4: 9c e1 ldi r25, 0x1C ; 28 2a9a6: 49 0e add r4, r25 2a9a8: 51 1c adc r5, r1 2a9aa: 23 96 adiw r28, 0x03 ; 3 2a9ac: ef ae std Y+63, r14 ; 0x3f 2a9ae: 23 97 sbiw r28, 0x03 ; 3 2a9b0: 2f 2c mov r2, r15 2a9b2: fe 01 movw r30, r28 2a9b4: f7 96 adiw r30, 0x37 ; 55 2a9b6: cf 01 movw r24, r30 2a9b8: 0b 96 adiw r24, 0x0b ; 11 2a9ba: 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++] = ' '; 2a9bc: 20 e2 ldi r18, 0x20 ; 32 2a9be: 21 93 st Z+, r18 2a9c0: e8 17 cp r30, r24 2a9c2: f9 07 cpc r31, r25 2a9c4: d9 f7 brne .-10 ; 0x2a9bc 2a9c6: 96 01 movw r18, r12 i = 0; 2a9c8: 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 2a9ca: 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 != '/') { 2a9cc: d9 01 movw r26, r18 2a9ce: 8d 91 ld r24, X+ 2a9d0: 88 23 and r24, r24 2a9d2: 49 f1 breq .+82 ; 0x2aa26 2a9d4: 8f 32 cpi r24, 0x2F ; 47 2a9d6: 39 f1 breq .+78 ; 0x2aa26 c = *str++; 2a9d8: 28 2f mov r18, r24 if (c == '.') { 2a9da: 8e 32 cpi r24, 0x2E ; 46 2a9dc: 39 f4 brne .+14 ; 0x2a9ec if (n == 10) goto fail; // only one dot allowed 2a9de: 6a 30 cpi r22, 0x0A ; 10 2a9e0: 09 f4 brne .+2 ; 0x2a9e4 2a9e2: 96 cf rjmp .-212 ; 0x2a910 n = 10; // max index for full 8.3 name i = 8; // place for extension 2a9e4: 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 2a9e6: 6a e0 ldi r22, 0x0A ; 10 2a9e8: 9d 01 movw r18, r26 2a9ea: f0 cf rjmp .-32 ; 0x2a9cc 2a9ec: ee e8 ldi r30, 0x8E ; 142 2a9ee: 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; 2a9f0: 34 91 lpm r19, Z 2a9f2: 33 23 and r19, r19 2a9f4: 21 f0 breq .+8 ; 0x2a9fe 2a9f6: 31 96 adiw r30, 0x01 ; 1 2a9f8: 83 13 cpse r24, r19 2a9fa: fa cf rjmp .-12 ; 0x2a9f0 2a9fc: 89 cf rjmp .-238 ; 0x2a910 // check size and only allow ASCII printable characters if (i > n || c < 0X21 || c > 0X7E)goto fail; 2a9fe: 69 17 cp r22, r25 2aa00: 08 f4 brcc .+2 ; 0x2aa04 2aa02: 86 cf rjmp .-244 ; 0x2a910 2aa04: 3f ed ldi r19, 0xDF ; 223 2aa06: 38 0f add r19, r24 2aa08: 3e 35 cpi r19, 0x5E ; 94 2aa0a: 08 f0 brcs .+2 ; 0x2aa0e 2aa0c: 81 cf rjmp .-254 ; 0x2a910 // only upper case allowed in 8.3 names - convert lower to upper name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); 2aa0e: 3f e9 ldi r19, 0x9F ; 159 2aa10: 38 0f add r19, r24 2aa12: 3a 31 cpi r19, 0x1A ; 26 2aa14: 10 f4 brcc .+4 ; 0x2aa1a 2aa16: 20 ee ldi r18, 0xE0 ; 224 2aa18: 28 0f add r18, r24 2aa1a: fa 01 movw r30, r20 2aa1c: e9 0f add r30, r25 2aa1e: f1 1d adc r31, r1 2aa20: 20 83 st Z, r18 2aa22: 9f 5f subi r25, 0xFF ; 255 2aa24: e1 cf rjmp .-62 ; 0x2a9e8 if (!dir2.openRoot(dirFile->vol_)) goto fail; parent = &dir2; } } while (1) { if (!make83Name(path, dname, &path)) goto fail; 2aa26: 8f a9 ldd r24, Y+55 ; 0x37 2aa28: 80 32 cpi r24, 0x20 ; 32 2aa2a: 09 f4 brne .+2 ; 0x2aa2e 2aa2c: 71 cf rjmp .-286 ; 0x2a910 2aa2e: 69 01 movw r12, r18 while (*path == '/') path++; 2aa30: f9 01 movw r30, r18 2aa32: 80 81 ld r24, Z 2aa34: 2f 5f subi r18, 0xFF ; 255 2aa36: 3f 4f sbci r19, 0xFF ; 255 2aa38: 8f 32 cpi r24, 0x2F ; 47 2aa3a: c9 f3 breq .-14 ; 0x2aa2e if (!*path) break; 2aa3c: 88 23 and r24, r24 2aa3e: d9 f0 breq .+54 ; 0x2aa76 if (!sub->open(parent, dname, O_READ)) goto fail; 2aa40: 21 e0 ldi r18, 0x01 ; 1 2aa42: b8 01 movw r22, r16 2aa44: c7 01 movw r24, r14 2aa46: 0f 94 3c 2e call 0x25c78 ; 0x25c78 2aa4a: 88 23 and r24, r24 2aa4c: 09 f4 brne .+2 ; 0x2aa50 2aa4e: 60 cf rjmp .-320 ; 0x2a910 if (parent != dirFile) parent->close(); 2aa50: 0a 15 cp r16, r10 2aa52: 1b 05 cpc r17, r11 2aa54: 19 f0 breq .+6 ; 0x2aa5c 2aa56: c8 01 movw r24, r16 2aa58: 0f 94 75 2c call 0x258ea ; 0x258ea parent = sub; sub = parent != &dir1 ? &dir1 : &dir2; 2aa5c: 94 2d mov r25, r4 2aa5e: 85 2d mov r24, r5 2aa60: 6e 14 cp r6, r14 2aa62: 7f 04 cpc r7, r15 2aa64: 21 f0 breq .+8 ; 0x2aa6e 2aa66: 23 96 adiw r28, 0x03 ; 3 2aa68: 9f ad ldd r25, Y+63 ; 0x3f 2aa6a: 23 97 sbiw r28, 0x03 ; 3 2aa6c: 82 2d mov r24, r2 2aa6e: 87 01 movw r16, r14 2aa70: e9 2e mov r14, r25 2aa72: f8 2e mov r15, r24 2aa74: 9e cf rjmp .-196 ; 0x2a9b2 } return open(parent, dname, oflag); 2aa76: 23 2d mov r18, r3 2aa78: b8 01 movw r22, r16 2aa7a: c4 01 movw r24, r8 2aa7c: 0f 94 3c 2e call 0x25c78 ; 0x25c78 2aa80: 18 2f mov r17, r24 2aa82: 47 cf rjmp .-370 ; 0x2a912 0002aa84 : } // 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; 2aa84: ef e6 ldi r30, 0x6F ; 111 2aa86: f6 e1 ldi r31, 0x16 ; 22 2aa88: 40 81 ld r20, Z 2aa8a: 51 81 ldd r21, Z+1 ; 0x01 2aa8c: 62 81 ldd r22, Z+2 ; 0x02 2aa8e: 73 81 ldd r23, Z+3 ; 0x03 2aa90: 48 0f add r20, r24 2aa92: 59 1f adc r21, r25 2aa94: 61 1d adc r22, r1 2aa96: 71 1d adc r23, r1 2aa98: 40 83 st Z, r20 2aa9a: 51 83 std Z+1, r21 ; 0x01 2aa9c: 62 83 std Z+2, r22 ; 0x02 2aa9e: 73 83 std Z+3, r23 ; 0x03 } 2aaa0: 08 95 ret 0002aaa2 : 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){ 2aaa2: 2f 92 push r2 2aaa4: 3f 92 push r3 2aaa6: 4f 92 push r4 2aaa8: 5f 92 push r5 2aaaa: 6f 92 push r6 2aaac: 7f 92 push r7 2aaae: 8f 92 push r8 2aab0: 9f 92 push r9 2aab2: af 92 push r10 2aab4: bf 92 push r11 2aab6: cf 92 push r12 2aab8: df 92 push r13 2aaba: ef 92 push r14 2aabc: ff 92 push r15 2aabe: 0f 93 push r16 2aac0: 1f 93 push r17 2aac2: cf 93 push r28 2aac4: df 93 push r29 2aac6: 00 d0 rcall .+0 ; 0x2aac8 2aac8: 1f 92 push r1 2aaca: 1f 92 push r1 2aacc: cd b7 in r28, 0x3d ; 61 2aace: de b7 in r29, 0x3e ; 62 2aad0: 1c 01 movw r2, r24 2aad2: 2a 01 movw r4, r20 2aad4: 3b 01 movw r6, r22 2aad6: 00 e2 ldi r16, 0x20 ; 32 2aad8: 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){ 2aada: 19 82 std Y+1, r1 ; 0x01 2aadc: 99 81 ldd r25, Y+1 ; 0x01 2aade: 89 2f mov r24, r25 2aae0: 90 e0 ldi r25, 0x00 ; 0 2aae2: 9b 83 std Y+3, r25 ; 0x03 2aae4: 8a 83 std Y+2, r24 ; 0x02 2aae6: 80 17 cp r24, r16 2aae8: 91 07 cpc r25, r17 2aaea: 9c f5 brge .+102 ; 0x2ab52 if (points[j] > points[j + 1]) 2aaec: 88 0f add r24, r24 2aaee: 99 1f adc r25, r25 2aaf0: 88 0f add r24, r24 2aaf2: 99 1f adc r25, r25 2aaf4: 9d 83 std Y+5, r25 ; 0x05 2aaf6: 8c 83 std Y+4, r24 ; 0x04 2aaf8: 82 0d add r24, r2 2aafa: 93 1d adc r25, r3 2aafc: 9b 83 std Y+3, r25 ; 0x03 2aafe: 8a 83 std Y+2, r24 ; 0x02 2ab00: fc 01 movw r30, r24 2ab02: c0 80 ld r12, Z 2ab04: d1 80 ldd r13, Z+1 ; 0x01 2ab06: e2 80 ldd r14, Z+2 ; 0x02 2ab08: f3 80 ldd r15, Z+3 ; 0x03 2ab0a: 8c 81 ldd r24, Y+4 ; 0x04 2ab0c: 9d 81 ldd r25, Y+5 ; 0x05 2ab0e: 04 96 adiw r24, 0x04 ; 4 2ab10: 82 0d add r24, r2 2ab12: 93 1d adc r25, r3 2ab14: 9d 83 std Y+5, r25 ; 0x05 2ab16: 8c 83 std Y+4, r24 ; 0x04 2ab18: fc 01 movw r30, r24 2ab1a: 80 80 ld r8, Z 2ab1c: 91 80 ldd r9, Z+1 ; 0x01 2ab1e: a2 80 ldd r10, Z+2 ; 0x02 2ab20: b3 80 ldd r11, Z+3 ; 0x03 2ab22: a5 01 movw r20, r10 2ab24: 94 01 movw r18, r8 2ab26: c7 01 movw r24, r14 2ab28: b6 01 movw r22, r12 2ab2a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2ab2e: 18 16 cp r1, r24 2ab30: 64 f4 brge .+24 ; 0x2ab4a SWAP(points[j], points[j + 1]); 2ab32: ea 81 ldd r30, Y+2 ; 0x02 2ab34: fb 81 ldd r31, Y+3 ; 0x03 2ab36: 80 82 st Z, r8 2ab38: 91 82 std Z+1, r9 ; 0x01 2ab3a: a2 82 std Z+2, r10 ; 0x02 2ab3c: b3 82 std Z+3, r11 ; 0x03 2ab3e: ec 81 ldd r30, Y+4 ; 0x04 2ab40: fd 81 ldd r31, Y+5 ; 0x05 2ab42: c0 82 st Z, r12 2ab44: d1 82 std Z+1, r13 ; 0x01 2ab46: e2 82 std Z+2, r14 ; 0x02 2ab48: 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){ 2ab4a: f9 81 ldd r31, Y+1 ; 0x01 2ab4c: ff 5f subi r31, 0xFF ; 255 2ab4e: f9 83 std Y+1, r31 ; 0x01 2ab50: c5 cf rjmp .-118 ; 0x2aadc 2ab52: 01 50 subi r16, 0x01 ; 1 2ab54: 11 09 sbc r17, r1 2ab56: 08 f6 brcc .-126 ; 0x2aada /// 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]; 2ab58: f1 01 movw r30, r2 2ab5a: e0 5c subi r30, 0xC0 ; 192 2ab5c: 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); 2ab5e: 20 81 ld r18, Z 2ab60: 31 81 ldd r19, Z+1 ; 0x01 2ab62: 42 81 ldd r20, Z+2 ; 0x02 2ab64: 53 81 ldd r21, Z+3 ; 0x03 2ab66: c3 01 movw r24, r6 2ab68: b2 01 movw r22, r4 2ab6a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2ab6e: 6b 01 movw r12, r22 2ab70: 7c 01 movw r14, r24 2ab72: 20 e0 ldi r18, 0x00 ; 0 2ab74: 30 e0 ldi r19, 0x00 ; 0 2ab76: 40 e0 ldi r20, 0x00 ; 0 2ab78: 5f eb ldi r21, 0xBF ; 191 2ab7a: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2ab7e: 87 fd sbrc r24, 7 2ab80: 10 c0 rjmp .+32 ; 0x2aba2 2ab82: 20 e0 ldi r18, 0x00 ; 0 2ab84: 30 e0 ldi r19, 0x00 ; 0 2ab86: 40 e0 ldi r20, 0x00 ; 0 2ab88: 5f e3 ldi r21, 0x3F ; 63 2ab8a: c7 01 movw r24, r14 2ab8c: b6 01 movw r22, r12 2ab8e: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2ab92: 18 16 cp r1, r24 2ab94: 5c f4 brge .+22 ; 0x2abac 2ab96: c1 2c mov r12, r1 2ab98: d1 2c mov r13, r1 2ab9a: e1 2c mov r14, r1 2ab9c: 8f e3 ldi r24, 0x3F ; 63 2ab9e: f8 2e mov r15, r24 2aba0: 05 c0 rjmp .+10 ; 0x2abac 2aba2: c1 2c mov r12, r1 2aba4: d1 2c mov r13, r1 2aba6: e1 2c mov r14, r1 2aba8: 9f eb ldi r25, 0xBF ; 191 2abaa: f9 2e mov r15, r25 } 2abac: c7 01 movw r24, r14 2abae: b6 01 movw r22, r12 2abb0: 0f 90 pop r0 2abb2: 0f 90 pop r0 2abb4: 0f 90 pop r0 2abb6: 0f 90 pop r0 2abb8: 0f 90 pop r0 2abba: df 91 pop r29 2abbc: cf 91 pop r28 2abbe: 1f 91 pop r17 2abc0: 0f 91 pop r16 2abc2: ff 90 pop r15 2abc4: ef 90 pop r14 2abc6: df 90 pop r13 2abc8: cf 90 pop r12 2abca: bf 90 pop r11 2abcc: af 90 pop r10 2abce: 9f 90 pop r9 2abd0: 8f 90 pop r8 2abd2: 7f 90 pop r7 2abd4: 6f 90 pop r6 2abd6: 5f 90 pop r5 2abd8: 4f 90 pop r4 2abda: 3f 90 pop r3 2abdc: 2f 90 pop r2 2abde: 08 95 ret 0002abe0 : bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); } void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); 2abe0: 0f 94 89 0b call 0x21712 ; 0x21712 2abe4: 60 93 a1 12 sts 0x12A1, r22 ; 0x8012a1 2abe8: 70 93 a2 12 sts 0x12A2, r23 ; 0x8012a2 2abec: 80 93 a3 12 sts 0x12A3, r24 ; 0x8012a3 2abf0: 90 93 a4 12 sts 0x12A4, r25 ; 0x8012a4 } 2abf4: 08 95 ret 0002abf6 : } return (uint8_t)ReqMsg().code; } void ProtocolLogic::DecrementRetryAttempts() { if (inAutoRetry && retryAttempts) { 2abf6: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 2abfa: 88 23 and r24, r24 2abfc: 69 f0 breq .+26 ; 0x2ac18 2abfe: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 2ac02: 88 23 and r24, r24 2ac04: 49 f0 breq .+18 ; 0x2ac18 SERIAL_ECHOLNPGM("DecrementRetryAttempts"); 2ac06: 8b e5 ldi r24, 0x5B ; 91 2ac08: 92 ea ldi r25, 0xA2 ; 162 2ac0a: 0e 94 0e 7d call 0xfa1c ; 0xfa1c retryAttempts--; 2ac0e: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 2ac12: 81 50 subi r24, 0x01 ; 1 2ac14: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 } } 2ac18: 08 95 ret 0002ac1a : MMU2_ECHO_MSGLN(tmp); } strncpy(lastMsg, tmp, rqs); } void ProtocolLogic::LogError(const char *reason_P) { 2ac1a: 9f 92 push r9 2ac1c: af 92 push r10 2ac1e: bf 92 push r11 2ac20: cf 92 push r12 2ac22: df 92 push r13 2ac24: ef 92 push r14 2ac26: ff 92 push r15 2ac28: 0f 93 push r16 2ac2a: 1f 93 push r17 2ac2c: cf 93 push r28 2ac2e: df 93 push r29 2ac30: cd b7 in r28, 0x3d ; 61 2ac32: de b7 in r29, 0x3e ; 62 2ac34: e0 97 sbiw r28, 0x30 ; 48 2ac36: 0f b6 in r0, 0x3f ; 63 2ac38: f8 94 cli 2ac3a: de bf out 0x3e, r29 ; 62 2ac3c: 0f be out 0x3f, r0 ; 63 2ac3e: cd bf out 0x3d, r28 ; 61 2ac40: 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()]; 2ac42: e0 90 cf 12 lds r14, 0x12CF ; 0x8012cf 2ac46: fe 01 movw r30, r28 2ac48: 31 96 adiw r30, 0x01 ; 1 2ac4a: 21 e0 ldi r18, 0x01 ; 1 2ac4c: 30 e0 ldi r19, 0x00 ; 0 2ac4e: 5f 01 movw r10, r30 2ac50: f1 2c mov r15, r1 2ac52: 40 e1 ldi r20, 0x10 ; 16 2ac54: c4 2e mov r12, r20 2ac56: d1 2c mov r13, r1 dst[i * 3] = NibbleToChar(b >> 4); dst[i * 3 + 1] = NibbleToChar(b & 0xf); dst[i * 3 + 2] = ' '; 2ac58: 50 e2 ldi r21, 0x20 ; 32 2ac5a: 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()]; 2ac5c: c7 01 movw r24, r14 2ac5e: 82 1b sub r24, r18 2ac60: 93 0b sbc r25, r19 2ac62: b6 01 movw r22, r12 2ac64: 0f 94 5e a5 call 0x34abc ; 0x34abc <__divmodhi4> 2ac68: dc 01 movw r26, r24 2ac6a: bb 27 eor r27, r27 2ac6c: ae 56 subi r26, 0x6E ; 110 2ac6e: bd 4e sbci r27, 0xED ; 237 2ac70: 9d 96 adiw r26, 0x2d ; 45 2ac72: 8c 91 ld r24, X dst[i * 3] = NibbleToChar(b >> 4); 2ac74: 48 2f mov r20, r24 2ac76: 50 e0 ldi r21, 0x00 ; 0 2ac78: 94 e0 ldi r25, 0x04 ; 4 2ac7a: 55 95 asr r21 2ac7c: 47 95 ror r20 2ac7e: 9a 95 dec r25 2ac80: e1 f7 brne .-8 ; 0x2ac7a lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2ac82: 96 ef ldi r25, 0xF6 ; 246 2ac84: 94 0f add r25, r20 2ac86: 96 30 cpi r25, 0x06 ; 6 2ac88: a8 f1 brcs .+106 ; 0x2acf4 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2ac8a: 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); 2ac8c: 40 83 st Z, r20 dst[i * 3 + 1] = NibbleToChar(b & 0xf); 2ac8e: 8f 70 andi r24, 0x0F ; 15 lastReceivedBytes[lrb] = c; lrb = (lrb + 1) % lastReceivedBytes.size(); } constexpr char NibbleToChar(uint8_t c) { switch (c) { 2ac90: 96 ef ldi r25, 0xF6 ; 246 2ac92: 98 0f add r25, r24 2ac94: 96 30 cpi r25, 0x06 ; 6 2ac96: 80 f1 brcs .+96 ; 0x2acf8 case 5: case 6: case 7: case 8: case 9: return c + '0'; 2ac98: 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); 2ac9a: 81 83 std Z+1, r24 ; 0x01 dst[i * 3 + 2] = ' '; 2ac9c: 92 82 std Z+2, r9 ; 0x02 2ac9e: 2f 5f subi r18, 0xFF ; 255 2aca0: 3f 4f sbci r19, 0xFF ; 255 2aca2: 33 96 adiw r30, 0x03 ; 3 return 0; } } void ProtocolLogic::FormatLastReceivedBytes(char *dst) { for (uint8_t i = 0; i < lastReceivedBytes.size(); ++i) { 2aca4: 21 31 cpi r18, 0x11 ; 17 2aca6: 31 05 cpc r19, r1 2aca8: c9 f6 brne .-78 ; 0x2ac5c 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 2acaa: 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); 2acac: 84 ee ldi r24, 0xE4 ; 228 2acae: 92 ea ldi r25, 0xA2 ; 162 2acb0: 0e 94 15 7b call 0xf62a ; 0xf62a 2acb4: 8e ed ldi r24, 0xDE ; 222 2acb6: 92 ea ldi r25, 0xA2 ; 162 2acb8: 0e 94 15 7b call 0xf62a ; 0xf62a 2acbc: c8 01 movw r24, r16 2acbe: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOPGM(", last bytes: "); 2acc2: 86 e8 ldi r24, 0x86 ; 134 2acc4: 92 ea ldi r25, 0xA2 ; 162 2acc6: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN(lrb); 2acca: c5 01 movw r24, r10 2accc: 0e 94 1a 86 call 0x10c34 ; 0x10c34 } 2acd0: e0 96 adiw r28, 0x30 ; 48 2acd2: 0f b6 in r0, 0x3f ; 63 2acd4: f8 94 cli 2acd6: de bf out 0x3e, r29 ; 62 2acd8: 0f be out 0x3f, r0 ; 63 2acda: cd bf out 0x3d, r28 ; 61 2acdc: df 91 pop r29 2acde: cf 91 pop r28 2ace0: 1f 91 pop r17 2ace2: 0f 91 pop r16 2ace4: ff 90 pop r15 2ace6: ef 90 pop r14 2ace8: df 90 pop r13 2acea: cf 90 pop r12 2acec: bf 90 pop r11 2acee: af 90 pop r10 2acf0: 9f 90 pop r9 2acf2: 08 95 ret case 11: case 12: case 13: case 14: case 15: return (c - 10) + 'a'; 2acf4: 49 5a subi r20, 0xA9 ; 169 2acf6: ca cf rjmp .-108 ; 0x2ac8c 2acf8: 89 5a subi r24, 0xA9 ; 169 2acfa: cf cf rjmp .-98 ; 0x2ac9a 0002acfc : char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); } StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) { 2acfc: 9c 01 movw r18, r24 SERIAL_ECHOLNPGM("RSTCommTimeout"); dataTO.Reset(); } bool DropOutFilter::Record(StepStatus ss) { if (occurrences == maxOccurrences) { 2acfe: 90 91 a6 12 lds r25, 0x12A6 ; 0x8012a6 2ad02: 9a 30 cpi r25, 0x0A ; 10 2ad04: 11 f4 brne .+4 ; 0x2ad0a cause = ss; 2ad06: 60 93 a5 12 sts 0x12A5, r22 ; 0x8012a5 } --occurrences; 2ad0a: 91 50 subi r25, 0x01 ; 1 2ad0c: 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)) { 2ad10: 91 11 cpse r25, r1 2ad12: 0d c0 rjmp .+26 ; 0x2ad2e 2ad14: c9 01 movw r24, r18 LogError(msg_P); 2ad16: 0f 94 0d 56 call 0x2ac1a ; 0x2ac1a SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 2ad1a: 87 e7 ldi r24, 0x77 ; 119 2ad1c: 92 ea ldi r25, 0xA2 ; 162 2ad1e: 0e 94 0e 7d call 0xfa1c ; 0xfa1c /// @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; } 2ad22: 8a e0 ldi r24, 0x0A ; 10 2ad24: 80 93 a6 12 sts 0x12A6, r24 ; 0x8012a6 2ad28: 80 91 a5 12 lds r24, 0x12A5 ; 0x8012a5 2ad2c: 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 2ad2e: 80 e0 ldi r24, 0x00 ; 0 } } 2ad30: 08 95 ret 0002ad32 : } *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) { 2ad32: cf 93 push r28 2ad34: df 93 push r29 2ad36: cd b7 in r28, 0x3d ; 61 2ad38: de b7 in r29, 0x3e ; 62 2ad3a: 2e 97 sbiw r28, 0x0e ; 14 2ad3c: 0f b6 in r0, 0x3f ; 63 2ad3e: f8 94 cli 2ad40: de bf out 0x3e, r29 ; 62 2ad42: 0f be out 0x3f, r0 ; 63 2ad44: cd bf out 0x3d, r28 ; 61 constexpr uint_fast8_t rqs = modules::protocol::Protocol::MaxRequestSize() + 1; char tmp[rqs] = ">"; 2ad46: 2e e3 ldi r18, 0x3E ; 62 2ad48: 30 e0 ldi r19, 0x00 ; 0 2ad4a: 3a 83 std Y+2, r19 ; 0x02 2ad4c: 29 83 std Y+1, r18 ; 0x01 2ad4e: fe 01 movw r30, r28 2ad50: 33 96 adiw r30, 0x03 ; 3 2ad52: 2c e0 ldi r18, 0x0C ; 12 2ad54: df 01 movw r26, r30 2ad56: 1d 92 st X+, r1 2ad58: 2a 95 dec r18 2ad5a: e9 f7 brne .-6 ; 0x2ad56 2ad5c: de 01 movw r26, r28 2ad5e: 12 96 adiw r26, 0x02 ; 2 2ad60: 48 2f mov r20, r24 2ad62: fc 01 movw r30, r24 2ad64: 9d 01 movw r18, r26 static char lastMsg[rqs] = ""; for (uint8_t i = 0; i < size; ++i) { 2ad66: 8e 2f mov r24, r30 2ad68: 84 1b sub r24, r20 2ad6a: 86 17 cp r24, r22 2ad6c: 40 f4 brcc .+16 ; 0x2ad7e uint8_t b = txbuff[i]; 2ad6e: 81 91 ld r24, Z+ // Check for printable character, including space if (b < 32 || b > 127) { 2ad70: 90 ee ldi r25, 0xE0 ; 224 2ad72: 98 0f add r25, r24 2ad74: 90 36 cpi r25, 0x60 ; 96 2ad76: 08 f0 brcs .+2 ; 0x2ad7a b = '.'; 2ad78: 8e e2 ldi r24, 0x2E ; 46 } tmp[i + 1] = b; 2ad7a: 8d 93 st X+, r24 2ad7c: f4 cf rjmp .-24 ; 0x2ad66 } tmp[size + 1] = 0; 2ad7e: f9 01 movw r30, r18 2ad80: e6 0f add r30, r22 2ad82: f1 1d adc r31, r1 2ad84: 10 82 st Z, r1 if (!strncmp_P(tmp, PSTR(">S0*c6."), rqs) && !strncmp(lastMsg, tmp, rqs)) { 2ad86: 4e e0 ldi r20, 0x0E ; 14 2ad88: 50 e0 ldi r21, 0x00 ; 0 2ad8a: 6a ee ldi r22, 0xEA ; 234 2ad8c: 72 ea ldi r23, 0xA2 ; 162 2ad8e: ce 01 movw r24, r28 2ad90: 01 96 adiw r24, 0x01 ; 1 2ad92: 0f 94 60 a2 call 0x344c0 ; 0x344c0 2ad96: 89 2b or r24, r25 2ad98: 59 f4 brne .+22 ; 0x2adb0 2ad9a: 4e e0 ldi r20, 0x0E ; 14 2ad9c: 50 e0 ldi r21, 0x00 ; 0 2ad9e: be 01 movw r22, r28 2ada0: 6f 5f subi r22, 0xFF ; 255 2ada2: 7f 4f sbci r23, 0xFF ; 255 2ada4: 82 e8 ldi r24, 0x82 ; 130 2ada6: 92 e1 ldi r25, 0x12 ; 18 2ada8: 0f 94 f3 aa call 0x355e6 ; 0x355e6 2adac: 89 2b or r24, r25 2adae: 61 f0 breq .+24 ; 0x2adc8 // 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); 2adb0: 84 ee ldi r24, 0xE4 ; 228 2adb2: 92 ea ldi r25, 0xA2 ; 162 2adb4: 0e 94 15 7b call 0xf62a ; 0xf62a 2adb8: 8e ed ldi r24, 0xDE ; 222 2adba: 92 ea ldi r25, 0xA2 ; 162 2adbc: 0e 94 15 7b call 0xf62a ; 0xf62a 2adc0: ce 01 movw r24, r28 2adc2: 01 96 adiw r24, 0x01 ; 1 2adc4: 0e 94 1a 86 call 0x10c34 ; 0x10c34 } strncpy(lastMsg, tmp, rqs); 2adc8: 4e e0 ldi r20, 0x0E ; 14 2adca: 50 e0 ldi r21, 0x00 ; 0 2adcc: be 01 movw r22, r28 2adce: 6f 5f subi r22, 0xFF ; 255 2add0: 7f 4f sbci r23, 0xFF ; 255 2add2: 82 e8 ldi r24, 0x82 ; 130 2add4: 92 e1 ldi r25, 0x12 ; 18 2add6: 0f 94 01 ab call 0x35602 ; 0x35602 } 2adda: 2e 96 adiw r28, 0x0e ; 14 2addc: 0f b6 in r0, 0x3f ; 63 2adde: f8 94 cli 2ade0: de bf out 0x3e, r29 ; 62 2ade2: 0f be out 0x3f, r0 ; 63 2ade4: cd bf out 0x3d, r28 ; 61 2ade6: df 91 pop r29 2ade8: cf 91 pop r28 2adea: 08 95 ret 0002adec : return CommunicationTimeout; } return Processing; } void ProtocolLogic::SendMsg(RequestMsg rq) { 2adec: cf 92 push r12 2adee: df 92 push r13 2adf0: ef 92 push r14 2adf2: ff 92 push r15 2adf4: 1f 93 push r17 2adf6: cf 93 push r28 2adf8: df 93 push r29 2adfa: cd b7 in r28, 0x3d ; 61 2adfc: de b7 in r29, 0x3e ; 62 2adfe: 62 97 sbiw r28, 0x12 ; 18 2ae00: 0f b6 in r0, 0x3f ; 63 2ae02: f8 94 cli 2ae04: de bf out 0x3e, r29 ; 62 2ae06: 0f be out 0x3f, r0 ; 63 2ae08: cd bf out 0x3d, r28 ; 61 2ae0a: 4e 87 std Y+14, r20 ; 0x0e 2ae0c: 5f 87 std Y+15, r21 ; 0x0f 2ae0e: 68 8b std Y+16, r22 ; 0x10 2ae10: 79 8b std Y+17, r23 ; 0x11 2ae12: 8a 8b std Y+18, r24 ; 0x12 } } } uint8_t Protocol::EncodeRequest(const RequestMsg &msg, uint8_t *txbuff) { txbuff[0] = (uint8_t)msg.code; 2ae14: 49 83 std Y+1, r20 ; 0x01 uint8_t i = 1 + UInt8ToHex(msg.value, txbuff + 1); 2ae16: 85 2f mov r24, r21 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2ae18: 51 11 cpse r21, r1 2ae1a: 31 c0 rjmp .+98 ; 0x2ae7e *dst = '0'; 2ae1c: 80 e3 ldi r24, 0x30 ; 48 2ae1e: 8a 83 std Y+2, r24 ; 0x02 return 1; 2ae20: 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); 2ae22: e1 e0 ldi r30, 0x01 ; 1 2ae24: e1 0f add r30, r17 2ae26: 81 e0 ldi r24, 0x01 ; 1 2ae28: 90 e0 ldi r25, 0x00 ; 0 2ae2a: 8c 0f add r24, r28 2ae2c: 9d 1f adc r25, r29 2ae2e: 8e 0f add r24, r30 2ae30: 91 1d adc r25, r1 2ae32: fc 01 movw r30, r24 2ae34: 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 2ae36: 9a e2 ldi r25, 0x2A ; 42 2ae38: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2ae3a: 81 11 cpse r24, r1 2ae3c: 27 c0 rjmp .+78 ; 0x2ae8c *dst = '0'; 2ae3e: 80 e3 ldi r24, 0x30 ; 48 2ae40: 81 83 std Z+1, r24 ; 0x01 return 1; 2ae42: 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); 2ae44: 1e 5f subi r17, 0xFE ; 254 2ae46: 18 0f add r17, r24 txbuff[i] = '\n'; 2ae48: e1 e0 ldi r30, 0x01 ; 1 2ae4a: f0 e0 ldi r31, 0x00 ; 0 2ae4c: ec 0f add r30, r28 2ae4e: fd 1f adc r31, r29 2ae50: e1 0f add r30, r17 2ae52: f1 1d adc r31, r1 2ae54: 8a e0 ldi r24, 0x0A ; 10 2ae56: 80 83 st Z, r24 ++i; 2ae58: 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); 2ae5a: fe 01 movw r30, r28 2ae5c: 31 96 adiw r30, 0x01 ; 1 2ae5e: 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--){ 2ae60: 6f 01 movw r12, r30 2ae62: c1 0e add r12, r17 2ae64: d1 1c adc r13, r1 2ae66: ec 14 cp r14, r12 2ae68: fd 04 cpc r15, r13 2ae6a: b1 f0 breq .+44 ; 0x2ae98 fputc(*buffer, uart2io); 2ae6c: f7 01 movw r30, r14 2ae6e: 81 91 ld r24, Z+ 2ae70: 7f 01 movw r14, r30 2ae72: 64 e7 ldi r22, 0x74 ; 116 2ae74: 72 e1 ldi r23, 0x12 ; 18 2ae76: 90 e0 ldi r25, 0x00 ; 0 2ae78: 0f 94 e9 a2 call 0x345d2 ; 0x345d2 2ae7c: f4 cf rjmp .-24 ; 0x2ae66 2ae7e: be 01 movw r22, r28 2ae80: 6e 5f subi r22, 0xFE ; 254 2ae82: 7f 4f sbci r23, 0xFF ; 255 2ae84: 0f 94 03 4e call 0x29c06 ; 0x29c06 2ae88: 18 2f mov r17, r24 2ae8a: cb cf rjmp .-106 ; 0x2ae22 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); 2ae8c: bf 01 movw r22, r30 2ae8e: 6f 5f subi r22, 0xFF ; 255 2ae90: 7f 4f sbci r23, 0xFF ; 255 2ae92: 0f 94 03 4e call 0x29c06 ; 0x29c06 2ae96: d6 cf rjmp .-84 ; 0x2ae44 LogRequestMsg(txbuff, len); 2ae98: 61 2f mov r22, r17 2ae9a: ce 01 movw r24, r28 2ae9c: 01 96 adiw r24, 0x01 ; 1 2ae9e: 0f 94 99 56 call 0x2ad32 ; 0x2ad32 RecordUARTActivity(); 2aea2: 0f 94 f0 55 call 0x2abe0 ; 0x2abe0 } 2aea6: 62 96 adiw r28, 0x12 ; 18 2aea8: 0f b6 in r0, 0x3f ; 63 2aeaa: f8 94 cli 2aeac: de bf out 0x3e, r29 ; 62 2aeae: 0f be out 0x3f, r0 ; 63 2aeb0: cd bf out 0x3d, r28 ; 61 2aeb2: df 91 pop r29 2aeb4: cf 91 pop r28 2aeb6: 1f 91 pop r17 2aeb8: ff 90 pop r15 2aeba: ef 90 pop r14 2aebc: df 90 pop r13 2aebe: cf 90 pop r12 2aec0: 08 95 ret 0002aec2 : 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) { 2aec2: 8f 92 push r8 2aec4: 9f 92 push r9 2aec6: af 92 push r10 2aec8: bf 92 push r11 2aeca: df 92 push r13 2aecc: ef 92 push r14 2aece: ff 92 push r15 2aed0: 0f 93 push r16 2aed2: 1f 93 push r17 2aed4: cf 93 push r28 2aed6: df 93 push r29 2aed8: cd b7 in r28, 0x3d ; 61 2aeda: de b7 in r29, 0x3e ; 62 2aedc: 67 97 sbiw r28, 0x17 ; 23 2aede: 0f b6 in r0, 0x3f ; 63 2aee0: f8 94 cli 2aee2: de bf out 0x3e, r29 ; 62 2aee4: 0f be out 0x3f, r0 ; 63 2aee6: cd bf out 0x3d, r28 ; 61 2aee8: 18 2f mov r17, r24 2aeea: 7b 01 movw r14, r22 2aeec: 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()) { 2aeee: 07 e5 ldi r16, 0x57 ; 87 2aef0: 0b 8b std Y+19, r16 ; 0x13 2aef2: 8c 8b std Y+20, r24 ; 0x14 2aef4: 7e 8b std Y+22, r23 ; 0x16 2aef6: 6d 8b std Y+21, r22 ; 0x15 2aef8: ce 01 movw r24, r28 2aefa: 43 96 adiw r24, 0x13 ; 19 2aefc: 0f 94 2f 4e call 0x29c5e ; 0x29c5e 2af00: 8f 8b std Y+23, r24 ; 0x17 2af02: 0e 87 std Y+14, r16 ; 0x0e 2af04: 1f 87 std Y+15, r17 ; 0x0f 2af06: f9 8a std Y+17, r15 ; 0x11 2af08: e8 8a std Y+16, r14 ; 0x10 2af0a: ce 01 movw r24, r28 2af0c: 0e 96 adiw r24, 0x0e ; 14 2af0e: 0f 94 2f 4e call 0x29c5e ; 0x29c5e 2af12: 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; 2af14: 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) { 2af16: 11 11 cpse r17, r1 2af18: 27 c0 rjmp .+78 ; 0x2af68 *dst = '0'; 2af1a: 80 e3 ldi r24, 0x30 ; 48 2af1c: 8a 83 std Y+2, r24 ; 0x02 return 1; 2af1e: 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); 2af20: e1 e0 ldi r30, 0x01 ; 1 2af22: e8 0f add r30, r24 dst[i] = ' '; 2af24: 21 e0 ldi r18, 0x01 ; 1 2af26: 30 e0 ldi r19, 0x00 ; 0 2af28: 2c 0f add r18, r28 2af2a: 3d 1f adc r19, r29 2af2c: 2e 0f add r18, r30 2af2e: 31 1d adc r19, r1 2af30: f9 01 movw r30, r18 2af32: 90 e2 ldi r25, 0x20 ; 32 2af34: 90 83 st Z, r25 return i + 1; 2af36: 02 e0 ldi r16, 0x02 ; 2 2af38: 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); 2af3a: aa 24 eor r10, r10 2af3c: a3 94 inc r10 2af3e: b1 2c mov r11, r1 2af40: ac 0e add r10, r28 2af42: bd 1e adc r11, r29 2af44: a0 0e add r10, r16 2af46: 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) { 2af48: e1 14 cp r14, r1 2af4a: f1 04 cpc r15, r1 2af4c: 39 f1 breq .+78 ; 0x2af9c *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; 2af4e: 14 e0 ldi r17, 0x04 ; 4 while ((value & topNibbleMask) == 0) { 2af50: c7 01 movw r24, r14 2af52: 88 27 eor r24, r24 2af54: 90 7f andi r25, 0xF0 ; 240 2af56: 89 2b or r24, r25 2af58: 71 f4 brne .+28 ; 0x2af76 value <<= 4U; 2af5a: 24 e0 ldi r18, 0x04 ; 4 2af5c: ee 0c add r14, r14 2af5e: ff 1c adc r15, r15 2af60: 2a 95 dec r18 2af62: e1 f7 brne .-8 ; 0x2af5c --charsOut; 2af64: 11 50 subi r17, 0x01 ; 1 2af66: f4 cf rjmp .-24 ; 0x2af50 2af68: be 01 movw r22, r28 2af6a: 6e 5f subi r22, 0xFE ; 254 2af6c: 7f 4f sbci r23, 0xFF ; 255 2af6e: 81 2f mov r24, r17 2af70: 0f 94 03 4e call 0x29c06 ; 0x29c06 2af74: d5 cf rjmp .-86 ; 0x2af20 *dst = '0'; return 1; } // skip initial zeros uint8_t charsOut = 4; while ((value & topNibbleMask) == 0) { 2af76: 45 01 movw r8, r10 value <<= 4U; --charsOut; } for (uint8_t i = 0; i < charsOut; ++i) { 2af78: 88 2d mov r24, r8 2af7a: 8a 19 sub r24, r10 2af7c: 81 17 cp r24, r17 2af7e: 90 f4 brcc .+36 ; 0x2afa4 uint8_t n = (value & topNibbleMask) >> (8U + 4U); value <<= 4U; *dst = Nibble2Char(n); 2af80: 8f 2d mov r24, r15 2af82: 82 95 swap r24 2af84: 8f 70 andi r24, 0x0F ; 15 2af86: 94 e0 ldi r25, 0x04 ; 4 2af88: ee 0c add r14, r14 2af8a: ff 1c adc r15, r15 2af8c: 9a 95 dec r25 2af8e: e1 f7 brne .-8 ; 0x2af88 2af90: 0f 94 f9 4d call 0x29bf2 ; 0x29bf2 2af94: f4 01 movw r30, r8 2af96: 81 93 st Z+, r24 2af98: 4f 01 movw r8, r30 2af9a: ee cf rjmp .-36 ; 0x2af78 } uint8_t Protocol::UInt16ToHex(uint16_t value, uint8_t *dst) { constexpr uint16_t topNibbleMask = 0xf000; if (value == 0) { *dst = '0'; 2af9c: 80 e3 ldi r24, 0x30 ; 48 2af9e: f5 01 movw r30, r10 2afa0: 80 83 st Z, r24 return 1; 2afa2: 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); 2afa4: 10 0f add r17, r16 i += AppendCRC(msg.CRC(), txbuff + i); 2afa6: e1 e0 ldi r30, 0x01 ; 1 2afa8: f0 e0 ldi r31, 0x00 ; 0 2afaa: ec 0f add r30, r28 2afac: fd 1f adc r31, r29 2afae: e1 0f add r30, r17 2afb0: f1 1d adc r31, r1 2afb2: 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 2afb4: 9a e2 ldi r25, 0x2A ; 42 2afb6: 90 83 st Z, r25 txbuff[i] = '\n'; return i + 1; } uint8_t Protocol::UInt8ToHex(uint8_t value, uint8_t *dst) { if (value == 0) { 2afb8: 81 11 cpse r24, r1 2afba: 21 c0 rjmp .+66 ; 0x2affe *dst = '0'; 2afbc: 80 e3 ldi r24, 0x30 ; 48 2afbe: 81 83 std Z+1, r24 ; 0x01 return 1; 2afc0: 81 e0 ldi r24, 0x01 ; 1 2afc2: 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); 2afc4: 18 0f add r17, r24 txbuff[i] = '\n'; 2afc6: e1 e0 ldi r30, 0x01 ; 1 2afc8: f0 e0 ldi r31, 0x00 ; 0 2afca: ec 0f add r30, r28 2afcc: fd 1f adc r31, r29 2afce: e1 0f add r30, r17 2afd0: f1 1d adc r31, r1 2afd2: 8a e0 ldi r24, 0x0A ; 10 2afd4: 80 83 st Z, r24 ++i; 2afd6: 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); 2afd8: 9e 01 movw r18, r28 2afda: 2f 5f subi r18, 0xFF ; 255 2afdc: 3f 4f sbci r19, 0xFF ; 255 2afde: 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--){ 2afe0: 59 01 movw r10, r18 2afe2: a1 0e add r10, r17 2afe4: b1 1c adc r11, r1 2afe6: ea 14 cp r14, r10 2afe8: fb 04 cpc r15, r11 2afea: 79 f0 breq .+30 ; 0x2b00a fputc(*buffer, uart2io); 2afec: f7 01 movw r30, r14 2afee: 81 91 ld r24, Z+ 2aff0: 7f 01 movw r14, r30 2aff2: 64 e7 ldi r22, 0x74 ; 116 2aff4: 72 e1 ldi r23, 0x12 ; 18 2aff6: 90 e0 ldi r25, 0x00 ; 0 2aff8: 0f 94 e9 a2 call 0x345d2 ; 0x345d2 2affc: f4 cf rjmp .-24 ; 0x2afe6 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); 2affe: bf 01 movw r22, r30 2b000: 6f 5f subi r22, 0xFF ; 255 2b002: 7f 4f sbci r23, 0xFF ; 255 2b004: 0f 94 03 4e call 0x29c06 ; 0x29c06 2b008: dc cf rjmp .-72 ; 0x2afc2 LogRequestMsg(txbuff, len); 2b00a: 61 2f mov r22, r17 2b00c: ce 01 movw r24, r28 2b00e: 01 96 adiw r24, 0x01 ; 1 2b010: 0f 94 99 56 call 0x2ad32 ; 0x2ad32 RecordUARTActivity(); 2b014: 0f 94 f0 55 call 0x2abe0 ; 0x2abe0 scopeState = nextState; } void ProtocolLogic::SendWriteRegister(uint8_t index, uint16_t value, ScopeState nextState) { SendWriteMsg(RequestMsg(RequestMsgCodes::Write, index, value)); scopeState = nextState; 2b018: d0 92 95 12 sts 0x1295, r13 ; 0x801295 } 2b01c: 67 96 adiw r28, 0x17 ; 23 2b01e: 0f b6 in r0, 0x3f ; 63 2b020: f8 94 cli 2b022: de bf out 0x3e, r29 ; 62 2b024: 0f be out 0x3f, r0 ; 63 2b026: cd bf out 0x3d, r28 ; 61 2b028: df 91 pop r29 2b02a: cf 91 pop r28 2b02c: 1f 91 pop r17 2b02e: 0f 91 pop r16 2b030: ff 90 pop r15 2b032: ef 90 pop r14 2b034: df 90 pop r13 2b036: bf 90 pop r11 2b038: af 90 pop r10 2b03a: 9f 90 pop r9 2b03c: 8f 90 pop r8 2b03e: 08 95 ret 0002b040 : regIndex = 0; SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; 2b040: 20 91 e0 12 lds r18, 0x12E0 ; 0x8012e0 2b044: 2f 5f subi r18, 0xFF ; 255 2b046: 20 93 e0 12 sts 0x12E0, r18 ; 0x8012e0 if (regIndex >= initRegs8Count) { 2b04a: 22 30 cpi r18, 0x02 ; 2 2b04c: 78 f4 brcc .+30 ; 0x2b06c return true; } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 2b04e: 30 e0 ldi r19, 0x00 ; 0 2b050: f9 01 movw r30, r18 2b052: eb 58 subi r30, 0x8B ; 139 2b054: fd 45 sbci r31, 0x5D ; 93 2b056: 84 91 lpm r24, Z 2b058: 22 52 subi r18, 0x22 ; 34 2b05a: 3d 4e sbci r19, 0xED ; 237 2b05c: f9 01 movw r30, r18 2b05e: 60 81 ld r22, Z 2b060: 70 e0 ldi r23, 0x00 ; 0 2b062: 49 e0 ldi r20, 0x09 ; 9 2b064: 0f 94 61 57 call 0x2aec2 ; 0x2aec2 } return false; 2b068: 80 e0 ldi r24, 0x00 ; 0 2b06a: 08 95 ret } bool __attribute__((noinline)) ProtocolLogic::ProcessWritingInitRegister() { ++regIndex; if (regIndex >= initRegs8Count) { return true; 2b06c: 81 e0 ldi r24, 0x01 ; 1 } else { SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } 2b06e: 08 95 ret 0002b070 : } /// 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){ 2b070: 2f 92 push r2 2b072: 3f 92 push r3 2b074: 4f 92 push r4 2b076: 5f 92 push r5 2b078: 6f 92 push r6 2b07a: 7f 92 push r7 2b07c: 8f 92 push r8 2b07e: 9f 92 push r9 2b080: af 92 push r10 2b082: bf 92 push r11 2b084: cf 92 push r12 2b086: df 92 push r13 2b088: ef 92 push r14 2b08a: ff 92 push r15 2b08c: 0f 93 push r16 2b08e: 1f 93 push r17 2b090: cf 93 push r28 2b092: df 93 push r29 2b094: 00 d0 rcall .+0 ; 0x2b096 2b096: 1f 92 push r1 2b098: 1f 92 push r1 2b09a: cd b7 in r28, 0x3d ; 61 2b09c: de b7 in r29, 0x3e ; 62 2b09e: 2b 01 movw r4, r22 2b0a0: 1a 01 movw r2, r20 2b0a2: f1 2c mov r15, r1 2b0a4: 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; 2b0a6: 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; 2b0a8: 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; 2b0aa: 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){ 2b0ac: 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); 2b0ae: 66 24 eor r6, r6 2b0b0: 63 94 inc r6 2b0b2: 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){ 2b0b4: 70 e0 ldi r23, 0x00 ; 0 2b0b6: 60 e0 ldi r22, 0x00 ; 0 2b0b8: 97 01 movw r18, r14 2b0ba: 22 5a subi r18, 0xA2 ; 162 2b0bc: 39 4f sbci r19, 0xF9 ; 249 2b0be: 3a 83 std Y+2, r19 ; 0x02 2b0c0: 29 83 std Y+1, r18 ; 0x01 2b0c2: 86 2e mov r8, r22 2b0c4: c9 80 ldd r12, Y+1 ; 0x01 2b0c6: da 80 ldd r13, Y+2 ; 0x02 2b0c8: c6 0e add r12, r22 2b0ca: d7 1e adc r13, r23 2b0cc: 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; 2b0ce: 00 e0 ldi r16, 0x00 ; 0 for (uint8_t i = 0; i < 12; ++i){ 2b0d0: 40 e0 ldi r20, 0x00 ; 0 2b0d2: 30 e0 ldi r19, 0x00 ; 0 2b0d4: 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; 2b0d6: ae ef ldi r26, 0xFE ; 254 2b0d8: a4 0f add r26, r20 2b0da: 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; 2b0dc: 44 23 and r20, r20 2b0de: 19 f0 breq .+6 ; 0x2b0e6 2b0e0: 4b 30 cpi r20, 0x0B ; 11 2b0e2: 09 f0 breq .+2 ; 0x2b0e6 2b0e4: 7d c0 rjmp .+250 ; 0x2b1e0 2b0e6: ae ef ldi r26, 0xFE ; 254 2b0e8: a2 0f add r26, r18 2b0ea: a8 30 cpi r26, 0x08 ; 8 2b0ec: 08 f4 brcc .+2 ; 0x2b0f0 2b0ee: 7a c0 rjmp .+244 ; 0x2b1e4 2b0f0: 2f 5f subi r18, 0xFF ; 255 2b0f2: 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){ 2b0f4: 2c 30 cpi r18, 0x0C ; 12 2b0f6: 31 05 cpc r19, r1 2b0f8: 89 f7 brne .-30 ; 0x2b0dc /// 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){ 2b0fa: 4f 5f subi r20, 0xFF ; 255 2b0fc: 20 e2 ldi r18, 0x20 ; 32 2b0fe: c2 0e add r12, r18 2b100: d1 1c adc r13, r1 2b102: 32 96 adiw r30, 0x02 ; 2 2b104: 4c 30 cpi r20, 0x0C ; 12 2b106: 29 f7 brne .-54 ; 0x2b0d2 // 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){ 2b108: 3c 81 ldd r19, Y+4 ; 0x04 2b10a: 30 17 cp r19, r16 2b10c: 18 f4 brcc .+6 ; 0x2b114 2b10e: 0c 83 std Y+4, r16 ; 0x04 2b110: 5d 83 std Y+5, r21 ; 0x05 2b112: 18 2d mov r17, r8 2b114: 6f 5f subi r22, 0xFF ; 255 2b116: 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){ 2b118: 64 31 cpi r22, 0x14 ; 20 2b11a: 71 05 cpc r23, r1 2b11c: 91 f6 brne .-92 ; 0x2b0c2 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){ 2b11e: 5f 5f subi r21, 0xFF ; 255 2b120: a0 e2 ldi r26, 0x20 ; 32 2b122: ea 0e add r14, r26 2b124: f1 1c adc r15, r1 2b126: 54 31 cpi r21, 0x14 ; 20 2b128: 29 f6 brne .-118 ; 0x2b0b4 // 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); 2b12a: ec 81 ldd r30, Y+4 ; 0x04 2b12c: 6e 2f mov r22, r30 2b12e: 70 e0 ldi r23, 0x00 ; 0 2b130: 90 e0 ldi r25, 0x00 ; 0 2b132: 80 e0 ldi r24, 0x00 ; 0 2b134: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2b138: 23 ec ldi r18, 0xC3 ; 195 2b13a: 35 ef ldi r19, 0xF5 ; 245 2b13c: 48 ea ldi r20, 0xA8 ; 168 2b13e: 5f e3 ldi r21, 0x3F ; 63 2b140: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 2b144: 9f 93 push r25 2b146: 8f 93 push r24 2b148: 7f 93 push r23 2b14a: 6f 93 push r22 2b14c: fd 81 ldd r31, Y+5 ; 0x05 2b14e: 6f 2f mov r22, r31 2b150: 70 e0 ldi r23, 0x00 ; 0 2b152: 90 e0 ldi r25, 0x00 ; 0 2b154: 80 e0 ldi r24, 0x00 ; 0 2b156: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2b15a: 20 e0 ldi r18, 0x00 ; 0 2b15c: 30 e0 ldi r19, 0x00 ; 0 2b15e: 40 eb ldi r20, 0xB0 ; 176 2b160: 50 e4 ldi r21, 0x40 ; 64 2b162: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2b166: 9f 93 push r25 2b168: 8f 93 push r24 2b16a: 7f 93 push r23 2b16c: 6f 93 push r22 2b16e: 61 2f mov r22, r17 2b170: 70 e0 ldi r23, 0x00 ; 0 2b172: 90 e0 ldi r25, 0x00 ; 0 2b174: 80 e0 ldi r24, 0x00 ; 0 2b176: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2b17a: 20 e0 ldi r18, 0x00 ; 0 2b17c: 30 e0 ldi r19, 0x00 ; 0 2b17e: 40 eb ldi r20, 0xB0 ; 176 2b180: 50 e4 ldi r21, 0x40 ; 64 2b182: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2b186: 9f 93 push r25 2b188: 8f 93 push r24 2b18a: 7f 93 push r23 2b18c: 6f 93 push r22 2b18e: 82 ec ldi r24, 0xC2 ; 194 2b190: 9d e9 ldi r25, 0x9D ; 157 2b192: 9f 93 push r25 2b194: 8f 93 push r24 2b196: 0f 94 43 a3 call 0x34686 ; 0x34686 *pc = max_c; 2b19a: f2 01 movw r30, r4 2b19c: 10 83 st Z, r17 *pr = max_r; 2b19e: 2d 81 ldd r18, Y+5 ; 0x05 2b1a0: f1 01 movw r30, r2 2b1a2: 20 83 st Z, r18 2b1a4: 0f b6 in r0, 0x3f ; 63 2b1a6: f8 94 cli 2b1a8: de bf out 0x3e, r29 ; 62 2b1aa: 0f be out 0x3f, r0 ; 63 2b1ac: cd bf out 0x3d, r28 ; 61 return max_match; } 2b1ae: 8c 81 ldd r24, Y+4 ; 0x04 2b1b0: 0f 90 pop r0 2b1b2: 0f 90 pop r0 2b1b4: 0f 90 pop r0 2b1b6: 0f 90 pop r0 2b1b8: 0f 90 pop r0 2b1ba: df 91 pop r29 2b1bc: cf 91 pop r28 2b1be: 1f 91 pop r17 2b1c0: 0f 91 pop r16 2b1c2: ff 90 pop r15 2b1c4: ef 90 pop r14 2b1c6: df 90 pop r13 2b1c8: cf 90 pop r12 2b1ca: bf 90 pop r11 2b1cc: af 90 pop r10 2b1ce: 9f 90 pop r9 2b1d0: 8f 90 pop r8 2b1d2: 7f 90 pop r7 2b1d4: 6f 90 pop r6 2b1d6: 5f 90 pop r5 2b1d8: 4f 90 pop r4 2b1da: 3f 90 pop r3 2b1dc: 2f 90 pop r2 2b1de: 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; 2b1e0: 22 23 and r18, r18 2b1e2: 11 f0 breq .+4 ; 0x2b1e8 2b1e4: 2b 30 cpi r18, 0x0B ; 11 2b1e6: 21 f4 brne .+8 ; 0x2b1f0 2b1e8: ab 81 ldd r26, Y+3 ; 0x03 2b1ea: a8 30 cpi r26, 0x08 ; 8 2b1ec: 08 f0 brcs .+2 ; 0x2b1f0 2b1ee: 80 cf rjmp .-256 ; 0x2b0f0 const uint16_t idx = (c + j) + 32 * ((uint16_t)r + i); const bool high_pix = pixels[idx] > thr; 2b1f0: 99 24 eor r9, r9 2b1f2: 93 94 inc r9 2b1f4: d6 01 movw r26, r12 2b1f6: a2 0f add r26, r18 2b1f8: b3 1f adc r27, r19 2b1fa: ac 91 ld r26, X 2b1fc: a1 31 cpi r26, 0x11 ; 17 2b1fe: 08 f4 brcc .+2 ; 0x2b202 2b200: 91 2c mov r9, r1 const bool high_pat = pattern[i] & (1 << j); 2b202: a0 80 ld r10, Z 2b204: b1 80 ldd r11, Z+1 ; 0x01 2b206: d3 01 movw r26, r6 2b208: 02 2e mov r0, r18 2b20a: 02 c0 rjmp .+4 ; 0x2b210 2b20c: aa 0f add r26, r26 2b20e: bb 1f adc r27, r27 2b210: 0a 94 dec r0 2b212: e2 f7 brpl .-8 ; 0x2b20c 2b214: aa 21 and r26, r10 2b216: bb 21 and r27, r11 2b218: bb 24 eor r11, r11 2b21a: b3 94 inc r11 2b21c: ab 2b or r26, r27 2b21e: 09 f4 brne .+2 ; 0x2b222 2b220: b1 2c mov r11, r1 if (high_pix == high_pat) 2b222: 9b 10 cpse r9, r11 2b224: 65 cf rjmp .-310 ; 0x2b0f0 match++; 2b226: 0f 5f subi r16, 0xFF ; 255 2b228: 63 cf rjmp .-314 ; 0x2b0f0 0002b22a : * \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) { 2b22a: 8f 92 push r8 2b22c: 9f 92 push r9 2b22e: af 92 push r10 2b230: bf 92 push r11 2b232: cf 92 push r12 2b234: df 92 push r13 2b236: ef 92 push r14 2b238: ff 92 push r15 2b23a: cf 93 push r28 2b23c: df 93 push r29 uint32_t totalBlocks; uint32_t volumeStartBlock = 0; fat32_boot_t* fbs; sdCard_ = dev; 2b23e: 24 e4 ldi r18, 0x44 ; 68 2b240: 36 e1 ldi r19, 0x16 ; 22 2b242: 30 93 44 0e sts 0x0E44, r19 ; 0x800e44 2b246: 20 93 43 0e sts 0x0E43, r18 ; 0x800e43 fatType_ = 0; 2b24a: 10 92 60 16 sts 0x1660, r1 ; 0x801660 allocSearchStart_ = 2; 2b24e: 42 e0 ldi r20, 0x02 ; 2 2b250: 50 e0 ldi r21, 0x00 ; 0 2b252: 60 e0 ldi r22, 0x00 ; 0 2b254: 70 e0 ldi r23, 0x00 ; 0 2b256: 40 93 49 16 sts 0x1649, r20 ; 0x801649 2b25a: 50 93 4a 16 sts 0x164A, r21 ; 0x80164a 2b25e: 60 93 4b 16 sts 0x164B, r22 ; 0x80164b 2b262: 70 93 4c 16 sts 0x164C, r23 ; 0x80164c cacheDirty_ = 0; // cacheFlush() will write block if true 2b266: 10 92 42 0e sts 0x0E42, r1 ; 0x800e42 cacheMirrorBlock_ = 0; 2b26a: 10 92 3e 0e sts 0x0E3E, r1 ; 0x800e3e 2b26e: 10 92 3f 0e sts 0x0E3F, r1 ; 0x800e3f 2b272: 10 92 40 0e sts 0x0E40, r1 ; 0x800e40 2b276: 10 92 41 0e sts 0x0E41, r1 ; 0x800e41 cacheBlockNumber_ = 0XFFFFFFFF; 2b27a: 4f ef ldi r20, 0xFF ; 255 2b27c: 5f ef ldi r21, 0xFF ; 255 2b27e: ba 01 movw r22, r20 2b280: 40 93 3a 0e sts 0x0E3A, r20 ; 0x800e3a 2b284: 50 93 3b 0e sts 0x0E3B, r21 ; 0x800e3b 2b288: 60 93 3c 0e sts 0x0E3C, r22 ; 0x800e3c 2b28c: 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) { 2b290: 88 23 and r24, r24 2b292: 09 f4 brne .+2 ; 0x2b296 2b294: 70 c0 rjmp .+224 ; 0x2b376 if (part > 4)goto fail; if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2b296: 40 e0 ldi r20, 0x00 ; 0 2b298: 60 e0 ldi r22, 0x00 ; 0 2b29a: 70 e0 ldi r23, 0x00 ; 0 2b29c: cb 01 movw r24, r22 2b29e: 0f 94 12 28 call 0x25024 ; 0x25024 2b2a2: 81 11 cpse r24, r1 2b2a4: 0d c0 rjmp .+26 ; 0x2b2c0 fatType_ = 32; } return true; fail: return false; 2b2a6: c0 e0 ldi r28, 0x00 ; 0 } 2b2a8: 8c 2f mov r24, r28 2b2aa: df 91 pop r29 2b2ac: cf 91 pop r28 2b2ae: ff 90 pop r15 2b2b0: ef 90 pop r14 2b2b2: df 90 pop r13 2b2b4: cf 90 pop r12 2b2b6: bf 90 pop r11 2b2b8: af 90 pop r10 2b2ba: 9f 90 pop r9 2b2bc: 8f 90 pop r8 2b2be: 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 || 2b2c0: 80 91 04 10 lds r24, 0x1004 ; 0x801004 2b2c4: 8f 77 andi r24, 0x7F ; 127 2b2c6: 79 f7 brne .-34 ; 0x2b2a6 2b2c8: 80 91 10 10 lds r24, 0x1010 ; 0x801010 2b2cc: 90 91 11 10 lds r25, 0x1011 ; 0x801011 2b2d0: a0 91 12 10 lds r26, 0x1012 ; 0x801012 2b2d4: b0 91 13 10 lds r27, 0x1013 ; 0x801013 2b2d8: 84 36 cpi r24, 0x64 ; 100 2b2da: 91 05 cpc r25, r1 2b2dc: a1 05 cpc r26, r1 2b2de: b1 05 cpc r27, r1 2b2e0: 10 f3 brcs .-60 ; 0x2b2a6 p->totalSectors < 100 || p->firstSector == 0) { 2b2e2: c0 90 0c 10 lds r12, 0x100C ; 0x80100c 2b2e6: d0 90 0d 10 lds r13, 0x100D ; 0x80100d 2b2ea: e0 90 0e 10 lds r14, 0x100E ; 0x80100e 2b2ee: 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 || 2b2f2: c1 14 cp r12, r1 2b2f4: d1 04 cpc r13, r1 2b2f6: e1 04 cpc r14, r1 2b2f8: f1 04 cpc r15, r1 2b2fa: a9 f2 breq .-86 ; 0x2b2a6 // not a valid partition goto fail; } volumeStartBlock = p->firstSector; } if (!cacheRawBlock(volumeStartBlock, CACHE_FOR_READ)) goto fail; 2b2fc: 40 e0 ldi r20, 0x00 ; 0 2b2fe: c7 01 movw r24, r14 2b300: b6 01 movw r22, r12 2b302: 0f 94 12 28 call 0x25024 ; 0x25024 2b306: c8 2f mov r28, r24 2b308: 88 23 and r24, r24 2b30a: 69 f2 breq .-102 ; 0x2b2a6 fbs = &cacheBuffer_.fbs32; if (fbs->bytesPerSector != 512 || 2b30c: 80 91 51 0e lds r24, 0x0E51 ; 0x800e51 2b310: 90 91 52 0e lds r25, 0x0E52 ; 0x800e52 2b314: 81 15 cp r24, r1 2b316: 92 40 sbci r25, 0x02 ; 2 2b318: 31 f6 brne .-116 ; 0x2b2a6 fbs->fatCount == 0 || 2b31a: 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 || 2b31e: aa 23 and r26, r26 2b320: 11 f2 breq .-124 ; 0x2b2a6 fbs->fatCount == 0 || fbs->reservedSectorCount == 0 || 2b322: 60 91 54 0e lds r22, 0x0E54 ; 0x800e54 2b326: 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 || 2b32a: 61 15 cp r22, r1 2b32c: 71 05 cpc r23, r1 2b32e: 09 f4 brne .+2 ; 0x2b332 2b330: ba cf rjmp .-140 ; 0x2b2a6 fbs->reservedSectorCount == 0 || fbs->sectorsPerCluster == 0) { 2b332: 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 || 2b336: 22 23 and r18, r18 2b338: 09 f4 brne .+2 ; 0x2b33c 2b33a: b5 cf rjmp .-150 ; 0x2b2a6 fbs->sectorsPerCluster == 0) { // not valid FAT volume goto fail; } fatCount_ = fbs->fatCount; 2b33c: a0 93 5b 16 sts 0x165B, r26 ; 0x80165b blocksPerCluster_ = fbs->sectorsPerCluster; 2b340: 20 93 4d 16 sts 0x164D, r18 ; 0x80164d // determine shift that is same as multiply by blocksPerCluster_ clusterSizeShift_ = 0; 2b344: 90 e0 ldi r25, 0x00 ; 0 2b346: 80 e0 ldi r24, 0x00 ; 0 while (blocksPerCluster_ != (1 << clusterSizeShift_)) { 2b348: 30 e0 ldi r19, 0x00 ; 0 2b34a: e1 e0 ldi r30, 0x01 ; 1 2b34c: f0 e0 ldi r31, 0x00 ; 0 2b34e: d8 2f mov r29, r24 2b350: af 01 movw r20, r30 2b352: 08 2e mov r0, r24 2b354: 02 c0 rjmp .+4 ; 0x2b35a 2b356: 44 0f add r20, r20 2b358: 55 1f adc r21, r21 2b35a: 0a 94 dec r0 2b35c: e2 f7 brpl .-8 ; 0x2b356 2b35e: 24 17 cp r18, r20 2b360: 35 07 cpc r19, r21 2b362: 69 f0 breq .+26 ; 0x2b37e 2b364: 41 e0 ldi r20, 0x01 ; 1 2b366: 48 0f add r20, r24 2b368: 01 96 adiw r24, 0x01 ; 1 // error if not power of 2 if (clusterSizeShift_++ > 7) goto fail; 2b36a: 89 30 cpi r24, 0x09 ; 9 2b36c: 91 05 cpc r25, r1 2b36e: 79 f7 brne .-34 ; 0x2b34e 2b370: 40 93 56 16 sts 0x1656, r20 ; 0x801656 2b374: 98 cf rjmp .-208 ; 0x2b2a6 * 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; 2b376: c1 2c mov r12, r1 2b378: d1 2c mov r13, r1 2b37a: 76 01 movw r14, r12 2b37c: bf cf rjmp .-130 ; 0x2b2fc 2b37e: 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 ? 2b382: 20 91 5c 0e lds r18, 0x0E5C ; 0x800e5c 2b386: 30 91 5d 0e lds r19, 0x0E5D ; 0x800e5d 2b38a: 50 e0 ldi r21, 0x00 ; 0 2b38c: 40 e0 ldi r20, 0x00 ; 0 2b38e: 21 15 cp r18, r1 2b390: 31 05 cpc r19, r1 2b392: 41 f4 brne .+16 ; 0x2b3a4 2b394: 20 91 6a 0e lds r18, 0x0E6A ; 0x800e6a 2b398: 30 91 6b 0e lds r19, 0x0E6B ; 0x800e6b 2b39c: 40 91 6c 0e lds r20, 0x0E6C ; 0x800e6c 2b3a0: 50 91 6d 0e lds r21, 0x0E6D ; 0x800e6d 2b3a4: 20 93 4e 16 sts 0x164E, r18 ; 0x80164e 2b3a8: 30 93 4f 16 sts 0x164F, r19 ; 0x80164f 2b3ac: 40 93 50 16 sts 0x1650, r20 ; 0x801650 2b3b0: 50 93 51 16 sts 0x1651, r21 ; 0x801651 fbs->sectorsPerFat16 : fbs->sectorsPerFat32; fatStartBlock_ = volumeStartBlock + fbs->reservedSectorCount; 2b3b4: 46 01 movw r8, r12 2b3b6: 57 01 movw r10, r14 2b3b8: 86 0e add r8, r22 2b3ba: 97 1e adc r9, r23 2b3bc: a1 1c adc r10, r1 2b3be: b1 1c adc r11, r1 2b3c0: 80 92 5c 16 sts 0x165C, r8 ; 0x80165c 2b3c4: 90 92 5d 16 sts 0x165D, r9 ; 0x80165d 2b3c8: a0 92 5e 16 sts 0x165E, r10 ; 0x80165e 2b3cc: b0 92 5f 16 sts 0x165F, r11 ; 0x80165f // count for FAT16 zero for FAT32 rootDirEntryCount_ = fbs->rootDirEntryCount; 2b3d0: e0 91 57 0e lds r30, 0x0E57 ; 0x800e57 2b3d4: f0 91 58 0e lds r31, 0x0E58 ; 0x800e58 2b3d8: f0 93 62 16 sts 0x1662, r31 ; 0x801662 2b3dc: e0 93 61 16 sts 0x1661, r30 ; 0x801661 // directory start for FAT16 dataStart for FAT32 rootDirStart_ = fatStartBlock_ + fbs->fatCount * blocksPerFat_; 2b3e0: b0 e0 ldi r27, 0x00 ; 0 2b3e2: 0f 94 16 a5 call 0x34a2c ; 0x34a2c <__muluhisi3> 2b3e6: dc 01 movw r26, r24 2b3e8: cb 01 movw r24, r22 2b3ea: 88 0d add r24, r8 2b3ec: 99 1d adc r25, r9 2b3ee: aa 1d adc r26, r10 2b3f0: bb 1d adc r27, r11 2b3f2: 80 93 63 16 sts 0x1663, r24 ; 0x801663 2b3f6: 90 93 64 16 sts 0x1664, r25 ; 0x801664 2b3fa: a0 93 65 16 sts 0x1665, r26 ; 0x801665 2b3fe: b0 93 66 16 sts 0x1666, r27 ; 0x801666 // data start for FAT16 and FAT32 dataStartBlock_ = rootDirStart_ + ((32 * fbs->rootDirEntryCount + 511)/512); 2b402: 25 e0 ldi r18, 0x05 ; 5 2b404: ee 0f add r30, r30 2b406: ff 1f adc r31, r31 2b408: 2a 95 dec r18 2b40a: e1 f7 brne .-8 ; 0x2b404 2b40c: e1 50 subi r30, 0x01 ; 1 2b40e: fe 4f sbci r31, 0xFE ; 254 2b410: ef 2f mov r30, r31 2b412: ff 27 eor r31, r31 2b414: e6 95 lsr r30 2b416: 8e 0f add r24, r30 2b418: 9f 1f adc r25, r31 2b41a: a1 1d adc r26, r1 2b41c: b1 1d adc r27, r1 2b41e: 80 93 57 16 sts 0x1657, r24 ; 0x801657 2b422: 90 93 58 16 sts 0x1658, r25 ; 0x801658 2b426: a0 93 59 16 sts 0x1659, r26 ; 0x801659 2b42a: b0 93 5a 16 sts 0x165A, r27 ; 0x80165a // total blocks for FAT16 or FAT32 totalBlocks = fbs->totalSectors16 ? 2b42e: 80 90 59 0e lds r8, 0x0E59 ; 0x800e59 2b432: 90 90 5a 0e lds r9, 0x0E5A ; 0x800e5a 2b436: b1 2c mov r11, r1 2b438: a1 2c mov r10, r1 2b43a: 81 14 cp r8, r1 2b43c: 91 04 cpc r9, r1 2b43e: 41 f4 brne .+16 ; 0x2b450 2b440: 80 90 66 0e lds r8, 0x0E66 ; 0x800e66 2b444: 90 90 67 0e lds r9, 0x0E67 ; 0x800e67 2b448: a0 90 68 0e lds r10, 0x0E68 ; 0x800e68 2b44c: b0 90 69 0e lds r11, 0x0E69 ; 0x800e69 fbs->totalSectors16 : fbs->totalSectors32; // total data blocks clusterCount_ = totalBlocks - (dataStartBlock_ - volumeStartBlock); 2b450: c8 1a sub r12, r24 2b452: d9 0a sbc r13, r25 2b454: ea 0a sbc r14, r26 2b456: fb 0a sbc r15, r27 2b458: c8 0c add r12, r8 2b45a: d9 1c adc r13, r9 2b45c: ea 1c adc r14, r10 2b45e: fb 1c adc r15, r11 // divide by cluster size to get cluster count clusterCount_ >>= clusterSizeShift_; 2b460: 04 c0 rjmp .+8 ; 0x2b46a 2b462: f6 94 lsr r15 2b464: e7 94 ror r14 2b466: d7 94 ror r13 2b468: c7 94 ror r12 2b46a: da 95 dec r29 2b46c: d2 f7 brpl .-12 ; 0x2b462 2b46e: c0 92 52 16 sts 0x1652, r12 ; 0x801652 2b472: d0 92 53 16 sts 0x1653, r13 ; 0x801653 2b476: e0 92 54 16 sts 0x1654, r14 ; 0x801654 2b47a: f0 92 55 16 sts 0x1655, r15 ; 0x801655 // FAT type is determined by cluster count if (clusterCount_ < 4085) { 2b47e: 85 ef ldi r24, 0xF5 ; 245 2b480: c8 16 cp r12, r24 2b482: 8f e0 ldi r24, 0x0F ; 15 2b484: d8 06 cpc r13, r24 2b486: e1 04 cpc r14, r1 2b488: f1 04 cpc r15, r1 2b48a: 20 f4 brcc .+8 ; 0x2b494 fatType_ = 12; 2b48c: 8c e0 ldi r24, 0x0C ; 12 2b48e: 80 93 60 16 sts 0x1660, r24 ; 0x801660 2b492: 09 cf rjmp .-494 ; 0x2b2a6 if (!FAT12_SUPPORT) goto fail; } else if (clusterCount_ < 65525) { fatType_ = 16; 2b494: 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) { 2b496: 25 ef ldi r18, 0xF5 ; 245 2b498: c2 16 cp r12, r18 2b49a: 2f ef ldi r18, 0xFF ; 255 2b49c: d2 06 cpc r13, r18 2b49e: e1 04 cpc r14, r1 2b4a0: f1 04 cpc r15, r1 2b4a2: 88 f0 brcs .+34 ; 0x2b4c6 fatType_ = 16; } else { rootDirStart_ = fbs->fat32RootCluster; 2b4a4: 80 91 72 0e lds r24, 0x0E72 ; 0x800e72 2b4a8: 90 91 73 0e lds r25, 0x0E73 ; 0x800e73 2b4ac: a0 91 74 0e lds r26, 0x0E74 ; 0x800e74 2b4b0: b0 91 75 0e lds r27, 0x0E75 ; 0x800e75 2b4b4: 80 93 63 16 sts 0x1663, r24 ; 0x801663 2b4b8: 90 93 64 16 sts 0x1664, r25 ; 0x801664 2b4bc: a0 93 65 16 sts 0x1665, r26 ; 0x801665 2b4c0: b0 93 66 16 sts 0x1666, r27 ; 0x801666 fatType_ = 32; 2b4c4: 80 e2 ldi r24, 0x20 ; 32 2b4c6: 80 93 60 16 sts 0x1660, r24 ; 0x801660 2b4ca: ee ce rjmp .-548 ; 0x2b2a8 0002b4cc : // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; return -1; } bool SdFile::gfEnsureBlock(){ 2b4cc: 0f 93 push r16 2b4ce: 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_ ){ 2b4d0: 60 91 84 16 lds r22, 0x1684 ; 0x801684 2b4d4: 70 91 85 16 lds r23, 0x1685 ; 0x801685 2b4d8: 80 91 86 16 lds r24, 0x1686 ; 0x801686 2b4dc: 90 91 87 16 lds r25, 0x1687 ; 0x801687 2b4e0: 00 91 3a 0e lds r16, 0x0E3A ; 0x800e3a 2b4e4: 10 91 3b 0e lds r17, 0x0E3B ; 0x800e3b 2b4e8: 20 91 3c 0e lds r18, 0x0E3C ; 0x800e3c 2b4ec: 30 91 3d 0e lds r19, 0x0E3D ; 0x800e3d 2b4f0: 60 17 cp r22, r16 2b4f2: 71 07 cpc r23, r17 2b4f4: 82 07 cpc r24, r18 2b4f6: 93 07 cpc r25, r19 2b4f8: 39 f1 breq .+78 ; 0x2b548 if ( ! vol_->cacheRawBlock(gfBlock, SdVolume::CACHE_FOR_READ)){ 2b4fa: 40 e0 ldi r20, 0x00 ; 0 2b4fc: 0f 94 12 28 call 0x25024 ; 0x25024 2b500: 88 23 and r24, r24 2b502: f9 f0 breq .+62 ; 0x2b542 return false; } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; 2b504: 20 91 88 16 lds r18, 0x1688 ; 0x801688 2b508: 30 91 89 16 lds r19, 0x1689 ; 0x801689 2b50c: 40 91 78 16 lds r20, 0x1678 ; 0x801678 2b510: 50 91 79 16 lds r21, 0x1679 ; 0x801679 2b514: 60 91 7a 16 lds r22, 0x167A ; 0x80167a 2b518: 70 91 7b 16 lds r23, 0x167B ; 0x80167b 2b51c: 42 1b sub r20, r18 2b51e: 53 0b sbc r21, r19 2b520: 61 09 sbc r22, r1 2b522: 71 09 sbc r23, r1 vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; 2b524: 41 30 cpi r20, 0x01 ; 1 2b526: 92 e0 ldi r25, 0x02 ; 2 2b528: 59 07 cpc r21, r25 2b52a: 61 05 cpc r22, r1 2b52c: 71 05 cpc r23, r1 2b52e: 20 f0 brcs .+8 ; 0x2b538 2b530: 40 e0 ldi r20, 0x00 ; 0 2b532: 52 e0 ldi r21, 0x02 ; 2 2b534: 60 e0 ldi r22, 0x00 ; 0 2b536: 70 e0 ldi r23, 0x00 ; 0 2b538: 4a 5b subi r20, 0xBA ; 186 2b53a: 51 4f sbci r21, 0xF1 ; 241 2b53c: 9a e0 ldi r25, 0x0A ; 10 2b53e: fa 01 movw r30, r20 2b540: 90 83 st Z, r25 } return true; } 2b542: 1f 91 pop r17 2b544: 0f 91 pop r16 2b546: 08 95 ret } // terminate with a '\n' const uint32_t terminateOfs = fileSize_ - gfOffset; vol_->cache()->data[ terminateOfs < 512 ? terminateOfs : 512 ] = '\n'; } return true; 2b548: 81 e0 ldi r24, 0x01 ; 1 2b54a: fb cf rjmp .-10 ; 0x2b542 0002b54c : break; } } void __attribute__((noinline)) MMU2::HelpUnloadToFinda() { extruder_move(-MMU2_RETRY_UNLOAD_TO_FINDA_LENGTH, MMU2_RETRY_UNLOAD_TO_FINDA_FEED_RATE); 2b54c: 20 e0 ldi r18, 0x00 ; 0 2b54e: 30 e0 ldi r19, 0x00 ; 0 2b550: 40 ea ldi r20, 0xA0 ; 160 2b552: 52 e4 ldi r21, 0x42 ; 66 2b554: 60 e0 ldi r22, 0x00 ; 0 2b556: 70 e0 ldi r23, 0x00 ; 0 2b558: 80 ea ldi r24, 0xA0 ; 160 2b55a: 92 ec ldi r25, 0xC2 ; 194 2b55c: 0d 94 62 4e jmp 0x29cc4 ; 0x29cc4 0002b560 : void MMU2::Home(uint8_t mode) { logic.Home(mode); } void MMU2::SaveHotendTemp(bool turn_off_nozzle) { if (mmu_print_saved & SavedState::Cooldown) { 2b560: 90 91 02 13 lds r25, 0x1302 ; 0x801302 2b564: 91 fd sbrc r25, 1 2b566: 17 c0 rjmp .+46 ; 0x2b596 return; } if (turn_off_nozzle && !(mmu_print_saved & SavedState::CooldownPending)) { 2b568: 88 23 and r24, r24 2b56a: a9 f0 breq .+42 ; 0x2b596 2b56c: 92 fd sbrc r25, 2 2b56e: 13 c0 rjmp .+38 ; 0x2b596 Disable_E0(); 2b570: 0f 94 60 4e call 0x29cc0 ; 0x29cc0 resume_hotend_temp = thermal_degTargetHotend(); 2b574: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 2b578: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 2b57c: 90 93 f7 12 sts 0x12F7, r25 ; 0x8012f7 2b580: 80 93 f6 12 sts 0x12F6, r24 ; 0x8012f6 mmu_print_saved |= SavedState::CooldownPending; 2b584: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b588: 84 60 ori r24, 0x04 ; 4 2b58a: 80 93 02 13 sts 0x1302, r24 ; 0x801302 LogEchoEvent_P(PSTR("Heater cooldown pending")); 2b58e: 8e ef ldi r24, 0xFE ; 254 2b590: 9e e9 ldi r25, 0x9E ; 158 2b592: 0d 94 86 4e jmp 0x29d0c ; 0x29d0c } } 2b596: 08 95 ret 0002b598 : ScreenClear(); } } void MMU2::ResumeUnpark() { if (mmu_print_saved & SavedState::ParkExtruder) { 2b598: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b59c: 80 ff sbrs r24, 0 2b59e: 45 c0 rjmp .+138 ; 0x2b62a LogEchoEvent_P(PSTR("Resuming XYZ")); 2b5a0: 86 e1 ldi r24, 0x16 ; 22 2b5a2: 9f e9 ldi r25, 0x9F ; 159 2b5a4: 0f 94 86 4e call 0x29d0c ; 0x29d0c // 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)); 2b5a8: 80 91 ee 12 lds r24, 0x12EE ; 0x8012ee 2b5ac: 90 91 ef 12 lds r25, 0x12EF ; 0x8012ef 2b5b0: a0 91 f0 12 lds r26, 0x12F0 ; 0x8012f0 2b5b4: 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; 2b5b8: 40 91 ea 12 lds r20, 0x12EA ; 0x8012ea 2b5bc: 50 91 eb 12 lds r21, 0x12EB ; 0x8012eb 2b5c0: 60 91 ec 12 lds r22, 0x12EC ; 0x8012ec 2b5c4: 70 91 ed 12 lds r23, 0x12ED ; 0x8012ed 2b5c8: 40 93 61 12 sts 0x1261, r20 ; 0x801261 2b5cc: 50 93 62 12 sts 0x1262, r21 ; 0x801262 2b5d0: 60 93 63 12 sts 0x1263, r22 ; 0x801263 2b5d4: 70 93 64 12 sts 0x1264, r23 ; 0x801264 current_position[Y_AXIS] = ry; 2b5d8: 80 93 65 12 sts 0x1265, r24 ; 0x801265 2b5dc: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2b5e0: a0 93 67 12 sts 0x1267, r26 ; 0x801267 2b5e4: b0 93 68 12 sts 0x1268, r27 ; 0x801268 planner_line_to_current_position_sync(feedRate_mm_s); 2b5e8: 60 e0 ldi r22, 0x00 ; 0 2b5ea: 70 e0 ldi r23, 0x00 ; 0 2b5ec: 88 e4 ldi r24, 0x48 ; 72 2b5ee: 92 e4 ldi r25, 0x42 ; 66 2b5f0: 0f 94 82 4e call 0x29d04 ; 0x29d04 } void motion_do_blocking_move_to_z(float z, float feedRate_mm_s) { current_position[Z_AXIS] = z; 2b5f4: 80 91 f2 12 lds r24, 0x12F2 ; 0x8012f2 2b5f8: 90 91 f3 12 lds r25, 0x12F3 ; 0x8012f3 2b5fc: a0 91 f4 12 lds r26, 0x12F4 ; 0x8012f4 2b600: b0 91 f5 12 lds r27, 0x12F5 ; 0x8012f5 2b604: 80 93 69 12 sts 0x1269, r24 ; 0x801269 2b608: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 2b60c: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 2b610: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c planner_line_to_current_position_sync(feedRate_mm_s); 2b614: 60 e0 ldi r22, 0x00 ; 0 2b616: 70 e0 ldi r23, 0x00 ; 0 2b618: 80 e7 ldi r24, 0x70 ; 112 2b61a: 91 e4 ldi r25, 0x41 ; 65 2b61c: 0f 94 82 4e call 0x29d04 ; 0x29d04 // 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); 2b620: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b624: 8e 7f andi r24, 0xFE ; 254 2b626: 80 93 02 13 sts 0x1302, r24 ; 0x801302 } } 2b62a: 08 95 ret 0002b62c : mmu_print_saved |= SavedState::CooldownPending; LogEchoEvent_P(PSTR("Heater cooldown pending")); } } void MMU2::SaveAndPark(bool move_axes) { 2b62c: 0f 93 push r16 2b62e: 1f 93 push r17 2b630: cf 93 push r28 if (mmu_print_saved == SavedState::None) { // First occurrence. Save current position, park print head, disable nozzle heater. 2b632: 90 91 02 13 lds r25, 0x1302 ; 0x801302 2b636: 91 11 cpse r25, r1 2b638: 72 c0 rjmp .+228 ; 0x2b71e 2b63a: c8 2f mov r28, r24 LogEchoEvent_P(PSTR("Saving and parking")); 2b63c: 8b ee ldi r24, 0xEB ; 235 2b63e: 9e e9 ldi r25, 0x9E ; 158 2b640: 0f 94 86 4e call 0x29d0c ; 0x29d0c Disable_E0(); 2b644: 0f 94 60 4e call 0x29cc0 ; 0x29cc0 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2b648: 0f 94 94 18 call 0x23128 ; 0x23128 /// 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; 2b64c: 80 91 73 12 lds r24, 0x1273 ; 0x801273 2b650: 81 11 cpse r24, r1 2b652: 02 c0 rjmp .+4 ; 0x2b658 2b654: 0e 94 f7 63 call 0xc7ee ; 0xc7ee // 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) { 2b658: cc 23 and r28, r28 2b65a: 09 f4 brne .+2 ; 0x2b65e 2b65c: 60 c0 rjmp .+192 ; 0x2b71e mmu_print_saved |= SavedState::ParkExtruder; 2b65e: 80 91 02 13 lds r24, 0x1302 ; 0x801302 2b662: 81 60 ori r24, 0x01 ; 1 2b664: 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]); 2b668: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2b66c: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2b670: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2b674: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2b678: 40 91 65 12 lds r20, 0x1265 ; 0x801265 2b67c: 50 91 66 12 lds r21, 0x1266 ; 0x801266 2b680: 60 91 67 12 lds r22, 0x1267 ; 0x801267 2b684: 70 91 68 12 lds r23, 0x1268 ; 0x801268 resume_position = planner_current_position(); // save current pos 2b688: 00 91 61 12 lds r16, 0x1261 ; 0x801261 2b68c: 10 91 62 12 lds r17, 0x1262 ; 0x801262 2b690: 20 91 63 12 lds r18, 0x1263 ; 0x801263 2b694: 30 91 64 12 lds r19, 0x1264 ; 0x801264 2b698: 00 93 ea 12 sts 0x12EA, r16 ; 0x8012ea 2b69c: 10 93 eb 12 sts 0x12EB, r17 ; 0x8012eb 2b6a0: 20 93 ec 12 sts 0x12EC, r18 ; 0x8012ec 2b6a4: 30 93 ed 12 sts 0x12ED, r19 ; 0x8012ed 2b6a8: 40 93 ee 12 sts 0x12EE, r20 ; 0x8012ee 2b6ac: 50 93 ef 12 sts 0x12EF, r21 ; 0x8012ef 2b6b0: 60 93 f0 12 sts 0x12F0, r22 ; 0x8012f0 2b6b4: 70 93 f1 12 sts 0x12F1, r23 ; 0x8012f1 2b6b8: 80 93 f2 12 sts 0x12F2, r24 ; 0x8012f2 2b6bc: 90 93 f3 12 sts 0x12F3, r25 ; 0x8012f3 2b6c0: a0 93 f4 12 sts 0x12F4, r26 ; 0x8012f4 2b6c4: 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); 2b6c8: 60 e0 ldi r22, 0x00 ; 0 2b6ca: 70 e0 ldi r23, 0x00 ; 0 2b6cc: 80 ea ldi r24, 0xA0 ; 160 2b6ce: 91 e4 ldi r25, 0x41 ; 65 2b6d0: 0e 94 e5 6c call 0xd9ca ; 0xd9ca void Disable_E0() { disable_e0(); } bool all_axes_homed() { return axis_known_position[X_AXIS] && axis_known_position[Y_AXIS]; 2b6d4: 80 91 39 06 lds r24, 0x0639 ; 0x800639 2b6d8: 88 23 and r24, r24 2b6da: 09 f1 breq .+66 ; 0x2b71e 2b6dc: 80 91 3a 06 lds r24, 0x063A ; 0x80063a 2b6e0: 88 23 and r24, r24 2b6e2: e9 f0 breq .+58 ; 0x2b71e 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; 2b6e4: 80 e0 ldi r24, 0x00 ; 0 2b6e6: 90 e0 ldi r25, 0x00 ; 0 2b6e8: aa ef ldi r26, 0xFA ; 250 2b6ea: b2 e4 ldi r27, 0x42 ; 66 2b6ec: 80 93 61 12 sts 0x1261, r24 ; 0x801261 2b6f0: 90 93 62 12 sts 0x1262, r25 ; 0x801262 2b6f4: a0 93 63 12 sts 0x1263, r26 ; 0x801263 2b6f8: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = MMU_ERR_Y_PAUSE_POS; 2b6fc: 10 92 65 12 sts 0x1265, r1 ; 0x801265 2b700: 10 92 66 12 sts 0x1266, r1 ; 0x801266 2b704: 10 92 67 12 sts 0x1267, r1 ; 0x801267 2b708: 10 92 68 12 sts 0x1268, r1 ; 0x801268 planner_line_to_current_position_sync(NOZZLE_PARK_XY_FEEDRATE); 2b70c: 60 e0 ldi r22, 0x00 ; 0 2b70e: 70 e0 ldi r23, 0x00 ; 0 2b710: 88 e4 ldi r24, 0x48 ; 72 2b712: 92 e4 ldi r25, 0x42 ; 66 if (all_axes_homed()) { nozzle_park(); } } } } 2b714: cf 91 pop r28 2b716: 1f 91 pop r17 2b718: 0f 91 pop r16 2b71a: 0d 94 82 4e jmp 0x29d04 ; 0x29d04 2b71e: cf 91 pop r28 2b720: 1f 91 pop r17 2b722: 0f 91 pop r16 2b724: 08 95 ret 0002b726 : /// 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){ 2b726: 2f 92 push r2 2b728: 3f 92 push r3 2b72a: 4f 92 push r4 2b72c: 5f 92 push r5 2b72e: 6f 92 push r6 2b730: 7f 92 push r7 2b732: 8f 92 push r8 2b734: 9f 92 push r9 2b736: af 92 push r10 2b738: bf 92 push r11 2b73a: cf 92 push r12 2b73c: df 92 push r13 2b73e: ef 92 push r14 2b740: ff 92 push r15 2b742: 0f 93 push r16 2b744: 1f 93 push r17 2b746: cf 93 push r28 2b748: df 93 push r29 2b74a: cd b7 in r28, 0x3d ; 61 2b74c: de b7 in r29, 0x3e ; 62 2b74e: cd 5b subi r28, 0xBD ; 189 2b750: d1 40 sbci r29, 0x01 ; 1 2b752: 0f b6 in r0, 0x3f ; 63 2b754: f8 94 cli 2b756: de bf out 0x3e, r29 ; 62 2b758: 0f be out 0x3f, r0 ; 63 2b75a: cd bf out 0x3d, r28 ; 61 2b75c: c3 57 subi r28, 0x73 ; 115 2b75e: de 4f sbci r29, 0xFE ; 254 2b760: 99 83 std Y+1, r25 ; 0x01 2b762: 88 83 st Y, r24 2b764: cd 58 subi r28, 0x8D ; 141 2b766: d1 40 sbci r29, 0x01 ; 1 2b768: c1 57 subi r28, 0x71 ; 113 2b76a: de 4f sbci r29, 0xFE ; 254 2b76c: 79 83 std Y+1, r23 ; 0x01 2b76e: 68 83 st Y, r22 2b770: cf 58 subi r28, 0x8F ; 143 2b772: d1 40 sbci r29, 0x01 ; 1 2b774: ce 56 subi r28, 0x6E ; 110 2b776: de 4f sbci r29, 0xFE ; 254 2b778: 59 83 std Y+1, r21 ; 0x01 2b77a: 48 83 st Y, r20 2b77c: c2 59 subi r28, 0x92 ; 146 2b77e: d1 40 sbci r29, 0x01 ; 1 2b780: 84 e1 ldi r24, 0x14 ; 20 2b782: cf 56 subi r28, 0x6F ; 111 2b784: de 4f sbci r29, 0xFE ; 254 2b786: 88 83 st Y, r24 2b788: c1 59 subi r28, 0x91 ; 145 2b78a: 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; 2b78c: ce 56 subi r28, 0x6E ; 110 2b78e: de 4f sbci r29, 0xFE ; 254 2b790: a8 81 ld r26, Y 2b792: b9 81 ldd r27, Y+1 ; 0x01 2b794: c2 59 subi r28, 0x92 ; 146 2b796: d1 40 sbci r29, 0x01 ; 1 2b798: 8d 91 ld r24, X+ 2b79a: 9d 91 ld r25, X+ 2b79c: 0d 90 ld r0, X+ 2b79e: bc 91 ld r27, X 2b7a0: a0 2d mov r26, r0 2b7a2: c6 56 subi r28, 0x66 ; 102 2b7a4: de 4f sbci r29, 0xFE ; 254 2b7a6: 88 83 st Y, r24 2b7a8: 99 83 std Y+1, r25 ; 0x01 2b7aa: aa 83 std Y+2, r26 ; 0x02 2b7ac: bb 83 std Y+3, r27 ; 0x03 2b7ae: ca 59 subi r28, 0x9A ; 154 2b7b0: d1 40 sbci r29, 0x01 ; 1 2b7b2: c1 57 subi r28, 0x71 ; 113 2b7b4: de 4f sbci r29, 0xFE ; 254 2b7b6: a8 81 ld r26, Y 2b7b8: b9 81 ldd r27, Y+1 ; 0x01 2b7ba: cf 58 subi r28, 0x8F ; 143 2b7bc: d1 40 sbci r29, 0x01 ; 1 2b7be: 8d 91 ld r24, X+ 2b7c0: 9d 91 ld r25, X+ 2b7c2: 0d 90 ld r0, X+ 2b7c4: bc 91 ld r27, X 2b7c6: a0 2d mov r26, r0 2b7c8: ca 54 subi r28, 0x4A ; 74 2b7ca: de 4f sbci r29, 0xFE ; 254 2b7cc: 88 83 st Y, r24 2b7ce: 99 83 std Y+1, r25 ; 0x01 2b7d0: aa 83 std Y+2, r26 ; 0x02 2b7d2: bb 83 std Y+3, r27 ; 0x03 2b7d4: c6 5b subi r28, 0xB6 ; 182 2b7d6: d1 40 sbci r29, 0x01 ; 1 2b7d8: c3 57 subi r28, 0x73 ; 115 2b7da: de 4f sbci r29, 0xFE ; 254 2b7dc: a8 81 ld r26, Y 2b7de: b9 81 ldd r27, Y+1 ; 0x01 2b7e0: cd 58 subi r28, 0x8D ; 141 2b7e2: d1 40 sbci r29, 0x01 ; 1 2b7e4: 8d 91 ld r24, X+ 2b7e6: 9d 91 ld r25, X+ 2b7e8: 0d 90 ld r0, X+ 2b7ea: bc 91 ld r27, X 2b7ec: a0 2d mov r26, r0 2b7ee: c6 54 subi r28, 0x46 ; 70 2b7f0: de 4f sbci r29, 0xFE ; 254 2b7f2: 88 83 st Y, r24 2b7f4: 99 83 std Y+1, r25 ; 0x01 2b7f6: aa 83 std Y+2, r26 ; 0x02 2b7f8: bb 83 std Y+3, r27 ; 0x03 2b7fa: ca 5b subi r28, 0xBA ; 186 2b7fc: d1 40 sbci r29, 0x01 ; 1 2b7fe: fe 01 movw r30, r28 2b800: e7 5f subi r30, 0xF7 ; 247 2b802: fe 4f sbci r31, 0xFE ; 254 2b804: c8 55 subi r28, 0x58 ; 88 2b806: de 4f sbci r29, 0xFE ; 254 2b808: f9 83 std Y+1, r31 ; 0x01 2b80a: e8 83 st Y, r30 2b80c: c8 5a subi r28, 0xA8 ; 168 2b80e: d1 40 sbci r29, 0x01 ; 1 2b810: ce 01 movw r24, r28 2b812: 8b 57 subi r24, 0x7B ; 123 2b814: 9f 4f sbci r25, 0xFF ; 255 2b816: ca 55 subi r28, 0x5A ; 90 2b818: de 4f sbci r29, 0xFE ; 254 2b81a: 99 83 std Y+1, r25 ; 0x01 2b81c: 88 83 st Y, r24 2b81e: c6 5a subi r28, 0xA6 ; 166 2b820: d1 40 sbci r29, 0x01 ; 1 2b822: de 01 movw r26, r28 2b824: 11 96 adiw r26, 0x01 ; 1 2b826: c8 56 subi r28, 0x68 ; 104 2b828: de 4f sbci r29, 0xFE ; 254 2b82a: b9 83 std Y+1, r27 ; 0x01 2b82c: a8 83 st Y, r26 2b82e: c8 59 subi r28, 0x98 ; 152 2b830: d1 40 sbci r29, 0x01 ; 1 2b832: 31 2c mov r3, r1 2b834: 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; 2b836: b1 01 movw r22, r2 2b838: 03 2c mov r0, r3 2b83a: 00 0c add r0, r0 2b83c: 88 0b sbc r24, r24 2b83e: 99 0b sbc r25, r25 2b840: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2b844: 2a e1 ldi r18, 0x1A ; 26 2b846: 38 ef ldi r19, 0xF8 ; 248 2b848: 42 e4 ldi r20, 0x42 ; 66 2b84a: 5e e3 ldi r21, 0x3E ; 62 2b84c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2b850: 6b 01 movw r12, r22 2b852: 7c 01 movw r14, r24 const float height = get_value(matrix_32x32, r * cos(angle) + x, r * sin(angle) + y) - target_z; 2b854: 0f 94 69 a9 call 0x352d2 ; 0x352d2 2b858: c2 56 subi r28, 0x62 ; 98 2b85a: de 4f sbci r29, 0xFE ; 254 2b85c: 68 83 st Y, r22 2b85e: 79 83 std Y+1, r23 ; 0x01 2b860: 8a 83 std Y+2, r24 ; 0x02 2b862: 9b 83 std Y+3, r25 ; 0x03 2b864: ce 59 subi r28, 0x9E ; 158 2b866: d1 40 sbci r29, 0x01 ; 1 2b868: c7 01 movw r24, r14 2b86a: b6 01 movw r22, r12 2b86c: 0f 94 a3 a6 call 0x34d46 ; 0x34d46 2b870: ce 55 subi r28, 0x5E ; 94 2b872: de 4f sbci r29, 0xFE ; 254 2b874: 68 83 st Y, r22 2b876: 79 83 std Y+1, r23 ; 0x01 2b878: 8a 83 std Y+2, r24 ; 0x02 2b87a: 9b 83 std Y+3, r25 ; 0x03 2b87c: c2 5a subi r28, 0xA2 ; 162 2b87e: d1 40 sbci r29, 0x01 ; 1 2b880: 9b 01 movw r18, r22 2b882: ac 01 movw r20, r24 2b884: c6 56 subi r28, 0x66 ; 102 2b886: de 4f sbci r29, 0xFE ; 254 2b888: 68 81 ld r22, Y 2b88a: 79 81 ldd r23, Y+1 ; 0x01 2b88c: 8a 81 ldd r24, Y+2 ; 0x02 2b88e: 9b 81 ldd r25, Y+3 ; 0x03 2b890: ca 59 subi r28, 0x9A ; 154 2b892: d1 40 sbci r29, 0x01 ; 1 2b894: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2b898: c6 54 subi r28, 0x46 ; 70 2b89a: de 4f sbci r29, 0xFE ; 254 2b89c: 28 81 ld r18, Y 2b89e: 39 81 ldd r19, Y+1 ; 0x01 2b8a0: 4a 81 ldd r20, Y+2 ; 0x02 2b8a2: 5b 81 ldd r21, Y+3 ; 0x03 2b8a4: ca 5b subi r28, 0xBA ; 186 2b8a6: d1 40 sbci r29, 0x01 ; 1 2b8a8: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2b8ac: 6b 01 movw r12, r22 2b8ae: 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) 2b8b0: 20 e0 ldi r18, 0x00 ; 0 2b8b2: 30 e0 ldi r19, 0x00 ; 0 2b8b4: a9 01 movw r20, r18 2b8b6: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2b8ba: 18 16 cp r1, r24 2b8bc: 0c f0 brlt .+2 ; 0x2b8c0 2b8be: 7a c2 rjmp .+1268 ; 0x2bdb4 // 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; 2b8c0: c2 56 subi r28, 0x62 ; 98 2b8c2: de 4f sbci r29, 0xFE ; 254 2b8c4: 28 81 ld r18, Y 2b8c6: 39 81 ldd r19, Y+1 ; 0x01 2b8c8: 4a 81 ldd r20, Y+2 ; 0x02 2b8ca: 5b 81 ldd r21, Y+3 ; 0x03 2b8cc: ce 59 subi r28, 0x9E ; 158 2b8ce: d1 40 sbci r29, 0x01 ; 1 2b8d0: c6 56 subi r28, 0x66 ; 102 2b8d2: de 4f sbci r29, 0xFE ; 254 2b8d4: 68 81 ld r22, Y 2b8d6: 79 81 ldd r23, Y+1 ; 0x01 2b8d8: 8a 81 ldd r24, Y+2 ; 0x02 2b8da: 9b 81 ldd r25, Y+3 ; 0x03 2b8dc: ca 59 subi r28, 0x9A ; 154 2b8de: d1 40 sbci r29, 0x01 ; 1 2b8e0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2b8e4: ca 54 subi r28, 0x4A ; 74 2b8e6: de 4f sbci r29, 0xFE ; 254 2b8e8: 28 81 ld r18, Y 2b8ea: 39 81 ldd r19, Y+1 ; 0x01 2b8ec: 4a 81 ldd r20, Y+2 ; 0x02 2b8ee: 5b 81 ldd r21, Y+3 ; 0x03 2b8f0: c6 5b subi r28, 0xB6 ; 182 2b8f2: d1 40 sbci r29, 0x01 ; 1 2b8f4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2b8f8: 4b 01 movw r8, r22 2b8fa: 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) 2b8fc: 20 e0 ldi r18, 0x00 ; 0 2b8fe: 30 e0 ldi r19, 0x00 ; 0 2b900: a9 01 movw r20, r18 2b902: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2b906: 18 16 cp r1, r24 2b908: 0c f0 brlt .+2 ; 0x2b90c 2b90a: 54 c2 rjmp .+1192 ; 0x2bdb4 2b90c: 20 e0 ldi r18, 0x00 ; 0 2b90e: 30 e0 ldi r19, 0x00 ; 0 2b910: 48 ef ldi r20, 0xF8 ; 248 2b912: 51 e4 ldi r21, 0x41 ; 65 2b914: c7 01 movw r24, r14 2b916: b6 01 movw r22, r12 2b918: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2b91c: 87 ff sbrs r24, 7 2b91e: 4a c2 rjmp .+1172 ; 0x2bdb4 2b920: 20 e0 ldi r18, 0x00 ; 0 2b922: 30 e0 ldi r19, 0x00 ; 0 2b924: 48 ef ldi r20, 0xF8 ; 248 2b926: 51 e4 ldi r21, 0x41 ; 65 2b928: c5 01 movw r24, r10 2b92a: b4 01 movw r22, r8 2b92c: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2b930: 87 ff sbrs r24, 7 2b932: 40 c2 rjmp .+1152 ; 0x2bdb4 return 0; /// calculate weights of nearby points const float wc1 = c - floor(c); 2b934: c7 01 movw r24, r14 2b936: b6 01 movw r22, r12 2b938: 0f 94 50 a7 call 0x34ea0 ; 0x34ea0 2b93c: 9b 01 movw r18, r22 2b93e: ac 01 movw r20, r24 2b940: c7 01 movw r24, r14 2b942: b6 01 movw r22, r12 2b944: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2b948: 2b 01 movw r4, r22 2b94a: 3c 01 movw r6, r24 const float wr1 = r - floor(r); 2b94c: c5 01 movw r24, r10 2b94e: b4 01 movw r22, r8 2b950: 0f 94 50 a7 call 0x34ea0 ; 0x34ea0 2b954: 9b 01 movw r18, r22 2b956: ac 01 movw r20, r24 2b958: c5 01 movw r24, r10 2b95a: b4 01 movw r22, r8 2b95c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2b960: cc 56 subi r28, 0x6C ; 108 2b962: de 4f sbci r29, 0xFE ; 254 2b964: 68 83 st Y, r22 2b966: 79 83 std Y+1, r23 ; 0x01 2b968: 8a 83 std Y+2, r24 ; 0x02 2b96a: 9b 83 std Y+3, r25 ; 0x03 2b96c: c4 59 subi r28, 0x94 ; 148 2b96e: d1 40 sbci r29, 0x01 ; 1 const float wc0 = 1 - wc1; 2b970: a3 01 movw r20, r6 2b972: 92 01 movw r18, r4 2b974: 60 e0 ldi r22, 0x00 ; 0 2b976: 70 e0 ldi r23, 0x00 ; 0 2b978: 80 e8 ldi r24, 0x80 ; 128 2b97a: 9f e3 ldi r25, 0x3F ; 63 2b97c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2b980: c2 55 subi r28, 0x52 ; 82 2b982: de 4f sbci r29, 0xFE ; 254 2b984: 68 83 st Y, r22 2b986: 79 83 std Y+1, r23 ; 0x01 2b988: 8a 83 std Y+2, r24 ; 0x02 2b98a: 9b 83 std Y+3, r25 ; 0x03 2b98c: ce 5a subi r28, 0xAE ; 174 2b98e: d1 40 sbci r29, 0x01 ; 1 const float wr0 = 1 - wr1; 2b990: cc 56 subi r28, 0x6C ; 108 2b992: de 4f sbci r29, 0xFE ; 254 2b994: 28 81 ld r18, Y 2b996: 39 81 ldd r19, Y+1 ; 0x01 2b998: 4a 81 ldd r20, Y+2 ; 0x02 2b99a: 5b 81 ldd r21, Y+3 ; 0x03 2b99c: c4 59 subi r28, 0x94 ; 148 2b99e: d1 40 sbci r29, 0x01 ; 1 2b9a0: 60 e0 ldi r22, 0x00 ; 0 2b9a2: 70 e0 ldi r23, 0x00 ; 0 2b9a4: 80 e8 ldi r24, 0x80 ; 128 2b9a6: 9f e3 ldi r25, 0x3F ; 63 2b9a8: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2b9ac: ce 54 subi r28, 0x4E ; 78 2b9ae: de 4f sbci r29, 0xFE ; 254 2b9b0: 68 83 st Y, r22 2b9b2: 79 83 std Y+1, r23 ; 0x01 2b9b4: 8a 83 std Y+2, r24 ; 0x02 2b9b6: 9b 83 std Y+3, r25 ; 0x03 2b9b8: c2 5b subi r28, 0xB2 ; 178 2b9ba: 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; 2b9bc: c7 01 movw r24, r14 2b9be: b6 01 movw r22, r12 2b9c0: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 2b9c4: 6b 01 movw r12, r22 const uint16_t c1 = c0 + 1; 2b9c6: fb 01 movw r30, r22 2b9c8: 31 96 adiw r30, 0x01 ; 1 2b9ca: c6 55 subi r28, 0x56 ; 86 2b9cc: de 4f sbci r29, 0xFE ; 254 2b9ce: f9 83 std Y+1, r31 ; 0x01 2b9d0: e8 83 st Y, r30 2b9d2: ca 5a subi r28, 0xAA ; 170 2b9d4: d1 40 sbci r29, 0x01 ; 1 const uint16_t r0 = r; 2b9d6: c5 01 movw r24, r10 2b9d8: b4 01 movw r22, r8 2b9da: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> const uint16_t r1 = r0 + 1; const uint16_t idx00 = c0 + 32 * r0; 2b9de: 8b 01 movw r16, r22 2b9e0: 95 e0 ldi r25, 0x05 ; 5 2b9e2: 00 0f add r16, r16 2b9e4: 11 1f adc r17, r17 2b9e6: 9a 95 dec r25 2b9e8: e1 f7 brne .-8 ; 0x2b9e2 const uint16_t idx01 = c0 + 32 * r1; 2b9ea: c8 01 movw r24, r16 2b9ec: 80 96 adiw r24, 0x20 ; 32 2b9ee: c4 55 subi r28, 0x54 ; 84 2b9f0: de 4f sbci r29, 0xFE ; 254 2b9f2: 99 83 std Y+1, r25 ; 0x01 2b9f4: 88 83 st Y, r24 2b9f6: cc 5a subi r28, 0xAC ; 172 2b9f8: 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]; 2b9fa: f8 01 movw r30, r16 2b9fc: ec 0d add r30, r12 2b9fe: fd 1d adc r31, r13 2ba00: e2 5a subi r30, 0xA2 ; 162 2ba02: f9 4f sbci r31, 0xF9 ; 249 2ba04: 60 81 ld r22, Z 2ba06: 70 e0 ldi r23, 0x00 ; 0 2ba08: 90 e0 ldi r25, 0x00 ; 0 2ba0a: 80 e0 ldi r24, 0x00 ; 0 2ba0c: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2ba10: 4b 01 movw r8, r22 2ba12: 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; 2ba14: ce 54 subi r28, 0x4E ; 78 2ba16: de 4f sbci r29, 0xFE ; 254 2ba18: 28 81 ld r18, Y 2ba1a: 39 81 ldd r19, Y+1 ; 0x01 2ba1c: 4a 81 ldd r20, Y+2 ; 0x02 2ba1e: 5b 81 ldd r21, Y+3 ; 0x03 2ba20: c2 5b subi r28, 0xB2 ; 178 2ba22: d1 40 sbci r29, 0x01 ; 1 2ba24: c2 55 subi r28, 0x52 ; 82 2ba26: de 4f sbci r29, 0xFE ; 254 2ba28: 68 81 ld r22, Y 2ba2a: 79 81 ldd r23, Y+1 ; 0x01 2ba2c: 8a 81 ldd r24, Y+2 ; 0x02 2ba2e: 9b 81 ldd r25, Y+3 ; 0x03 2ba30: ce 5a subi r28, 0xAE ; 174 2ba32: d1 40 sbci r29, 0x01 ; 1 2ba34: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2ba38: 9b 01 movw r18, r22 2ba3a: 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]; 2ba3c: c5 01 movw r24, r10 2ba3e: b4 01 movw r22, r8 2ba40: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2ba44: 4b 01 movw r8, r22 2ba46: 5c 01 movw r10, r24 2ba48: c4 55 subi r28, 0x54 ; 84 2ba4a: de 4f sbci r29, 0xFE ; 254 2ba4c: e8 81 ld r30, Y 2ba4e: f9 81 ldd r31, Y+1 ; 0x01 2ba50: cc 5a subi r28, 0xAC ; 172 2ba52: d1 40 sbci r29, 0x01 ; 1 2ba54: ec 0d add r30, r12 2ba56: fd 1d adc r31, r13 2ba58: e2 5a subi r30, 0xA2 ; 162 2ba5a: f9 4f sbci r31, 0xF9 ; 249 2ba5c: 60 81 ld r22, Z 2ba5e: 70 e0 ldi r23, 0x00 ; 0 2ba60: 90 e0 ldi r25, 0x00 ; 0 2ba62: 80 e0 ldi r24, 0x00 ; 0 2ba64: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2ba68: 6b 01 movw r12, r22 2ba6a: 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; 2ba6c: c2 55 subi r28, 0x52 ; 82 2ba6e: de 4f sbci r29, 0xFE ; 254 2ba70: 28 81 ld r18, Y 2ba72: 39 81 ldd r19, Y+1 ; 0x01 2ba74: 4a 81 ldd r20, Y+2 ; 0x02 2ba76: 5b 81 ldd r21, Y+3 ; 0x03 2ba78: ce 5a subi r28, 0xAE ; 174 2ba7a: d1 40 sbci r29, 0x01 ; 1 2ba7c: cc 56 subi r28, 0x6C ; 108 2ba7e: de 4f sbci r29, 0xFE ; 254 2ba80: 68 81 ld r22, Y 2ba82: 79 81 ldd r23, Y+1 ; 0x01 2ba84: 8a 81 ldd r24, Y+2 ; 0x02 2ba86: 9b 81 ldd r25, Y+3 ; 0x03 2ba88: c4 59 subi r28, 0x94 ; 148 2ba8a: d1 40 sbci r29, 0x01 ; 1 2ba8c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2ba90: 9b 01 movw r18, r22 2ba92: 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]; 2ba94: c7 01 movw r24, r14 2ba96: b6 01 movw r22, r12 2ba98: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2ba9c: 9b 01 movw r18, r22 2ba9e: ac 01 movw r20, r24 2baa0: c5 01 movw r24, r10 2baa2: b4 01 movw r22, r8 2baa4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2baa8: 6b 01 movw r12, r22 2baaa: 7c 01 movw r14, r24 2baac: c6 55 subi r28, 0x56 ; 86 2baae: de 4f sbci r29, 0xFE ; 254 2bab0: a8 81 ld r26, Y 2bab2: b9 81 ldd r27, Y+1 ; 0x01 2bab4: ca 5a subi r28, 0xAA ; 170 2bab6: d1 40 sbci r29, 0x01 ; 1 2bab8: 0a 0f add r16, r26 2baba: 1b 1f adc r17, r27 2babc: f8 01 movw r30, r16 2babe: e2 5a subi r30, 0xA2 ; 162 2bac0: f9 4f sbci r31, 0xF9 ; 249 2bac2: 60 81 ld r22, Z 2bac4: 70 e0 ldi r23, 0x00 ; 0 2bac6: 90 e0 ldi r25, 0x00 ; 0 2bac8: 80 e0 ldi r24, 0x00 ; 0 2baca: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2bace: 4b 01 movw r8, r22 2bad0: 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; 2bad2: ce 54 subi r28, 0x4E ; 78 2bad4: de 4f sbci r29, 0xFE ; 254 2bad6: 28 81 ld r18, Y 2bad8: 39 81 ldd r19, Y+1 ; 0x01 2bada: 4a 81 ldd r20, Y+2 ; 0x02 2badc: 5b 81 ldd r21, Y+3 ; 0x03 2bade: c2 5b subi r28, 0xB2 ; 178 2bae0: d1 40 sbci r29, 0x01 ; 1 2bae2: c3 01 movw r24, r6 2bae4: b2 01 movw r22, r4 2bae6: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2baea: 9b 01 movw r18, r22 2baec: 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]; 2baee: c5 01 movw r24, r10 2baf0: b4 01 movw r22, r8 2baf2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2baf6: 9b 01 movw r18, r22 2baf8: ac 01 movw r20, r24 2bafa: c7 01 movw r24, r14 2bafc: b6 01 movw r22, r12 2bafe: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2bb02: 6b 01 movw r12, r22 2bb04: 7c 01 movw r14, r24 2bb06: c6 55 subi r28, 0x56 ; 86 2bb08: de 4f sbci r29, 0xFE ; 254 2bb0a: e8 81 ld r30, Y 2bb0c: f9 81 ldd r31, Y+1 ; 0x01 2bb0e: ca 5a subi r28, 0xAA ; 170 2bb10: d1 40 sbci r29, 0x01 ; 1 2bb12: c4 55 subi r28, 0x54 ; 84 2bb14: de 4f sbci r29, 0xFE ; 254 2bb16: 88 81 ld r24, Y 2bb18: 99 81 ldd r25, Y+1 ; 0x01 2bb1a: cc 5a subi r28, 0xAC ; 172 2bb1c: d1 40 sbci r29, 0x01 ; 1 2bb1e: e8 0f add r30, r24 2bb20: f9 1f adc r31, r25 2bb22: e2 5a subi r30, 0xA2 ; 162 2bb24: f9 4f sbci r31, 0xF9 ; 249 2bb26: 60 81 ld r22, Z 2bb28: 70 e0 ldi r23, 0x00 ; 0 2bb2a: 90 e0 ldi r25, 0x00 ; 0 2bb2c: 80 e0 ldi r24, 0x00 ; 0 2bb2e: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2bb32: 4b 01 movw r8, r22 2bb34: 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; 2bb36: cc 56 subi r28, 0x6C ; 108 2bb38: de 4f sbci r29, 0xFE ; 254 2bb3a: 28 81 ld r18, Y 2bb3c: 39 81 ldd r19, Y+1 ; 0x01 2bb3e: 4a 81 ldd r20, Y+2 ; 0x02 2bb40: 5b 81 ldd r21, Y+3 ; 0x03 2bb42: c4 59 subi r28, 0x94 ; 148 2bb44: d1 40 sbci r29, 0x01 ; 1 2bb46: c3 01 movw r24, r6 2bb48: b2 01 movw r22, r4 2bb4a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2bb4e: 9b 01 movw r18, r22 2bb50: 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]; 2bb52: c5 01 movw r24, r10 2bb54: b4 01 movw r22, r8 2bb56: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2bb5a: 9b 01 movw r18, r22 2bb5c: ac 01 movw r20, r24 2bb5e: c7 01 movw r24, r14 2bb60: b6 01 movw r22, r12 2bb62: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__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; 2bb66: 20 e0 ldi r18, 0x00 ; 0 2bb68: 30 e0 ldi r19, 0x00 ; 0 2bb6a: 40 e0 ldi r20, 0x00 ; 0 2bb6c: 52 e4 ldi r21, 0x42 ; 66 2bb6e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2bb72: 6b 01 movw r12, r22 2bb74: 7c 01 movw r14, r24 // DBG(_n("%f "), point); shifts_x[p] = cos(angle) * height; 2bb76: ac 01 movw r20, r24 2bb78: 9b 01 movw r18, r22 2bb7a: ce 55 subi r28, 0x5E ; 94 2bb7c: de 4f sbci r29, 0xFE ; 254 2bb7e: 68 81 ld r22, Y 2bb80: 79 81 ldd r23, Y+1 ; 0x01 2bb82: 8a 81 ldd r24, Y+2 ; 0x02 2bb84: 9b 81 ldd r25, Y+3 ; 0x03 2bb86: c2 5a subi r28, 0xA2 ; 162 2bb88: d1 40 sbci r29, 0x01 ; 1 2bb8a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2bb8e: c8 55 subi r28, 0x58 ; 88 2bb90: de 4f sbci r29, 0xFE ; 254 2bb92: a8 81 ld r26, Y 2bb94: b9 81 ldd r27, Y+1 ; 0x01 2bb96: c8 5a subi r28, 0xA8 ; 168 2bb98: d1 40 sbci r29, 0x01 ; 1 2bb9a: 6d 93 st X+, r22 2bb9c: 7d 93 st X+, r23 2bb9e: 8d 93 st X+, r24 2bba0: 9d 93 st X+, r25 2bba2: c8 55 subi r28, 0x58 ; 88 2bba4: de 4f sbci r29, 0xFE ; 254 2bba6: b9 83 std Y+1, r27 ; 0x01 2bba8: a8 83 st Y, r26 2bbaa: c8 5a subi r28, 0xA8 ; 168 2bbac: d1 40 sbci r29, 0x01 ; 1 shifts_y[p] = sin(angle) * height; 2bbae: a7 01 movw r20, r14 2bbb0: 96 01 movw r18, r12 2bbb2: c2 56 subi r28, 0x62 ; 98 2bbb4: de 4f sbci r29, 0xFE ; 254 2bbb6: 68 81 ld r22, Y 2bbb8: 79 81 ldd r23, Y+1 ; 0x01 2bbba: 8a 81 ldd r24, Y+2 ; 0x02 2bbbc: 9b 81 ldd r25, Y+3 ; 0x03 2bbbe: ce 59 subi r28, 0x9E ; 158 2bbc0: d1 40 sbci r29, 0x01 ; 1 2bbc2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2bbc6: ca 55 subi r28, 0x5A ; 90 2bbc8: de 4f sbci r29, 0xFE ; 254 2bbca: e8 81 ld r30, Y 2bbcc: f9 81 ldd r31, Y+1 ; 0x01 2bbce: c6 5a subi r28, 0xA6 ; 166 2bbd0: d1 40 sbci r29, 0x01 ; 1 2bbd2: 61 93 st Z+, r22 2bbd4: 71 93 st Z+, r23 2bbd6: 81 93 st Z+, r24 2bbd8: 91 93 st Z+, r25 2bbda: ca 55 subi r28, 0x5A ; 90 2bbdc: de 4f sbci r29, 0xFE ; 254 2bbde: f9 83 std Y+1, r31 ; 0x01 2bbe0: e8 83 st Y, r30 2bbe2: c6 5a subi r28, 0xA6 ; 166 2bbe4: d1 40 sbci r29, 0x01 ; 1 shifts_r[p] = height; 2bbe6: c8 56 subi r28, 0x68 ; 104 2bbe8: de 4f sbci r29, 0xFE ; 254 2bbea: a8 81 ld r26, Y 2bbec: b9 81 ldd r27, Y+1 ; 0x01 2bbee: c8 59 subi r28, 0x98 ; 152 2bbf0: d1 40 sbci r29, 0x01 ; 1 2bbf2: cd 92 st X+, r12 2bbf4: dd 92 st X+, r13 2bbf6: ed 92 st X+, r14 2bbf8: fd 92 st X+, r15 2bbfa: c8 56 subi r28, 0x68 ; 104 2bbfc: de 4f sbci r29, 0xFE ; 254 2bbfe: b9 83 std Y+1, r27 ; 0x01 2bc00: a8 83 st Y, r26 2bc02: c8 59 subi r28, 0x98 ; 152 2bc04: d1 40 sbci r29, 0x01 ; 1 2bc06: bf ef ldi r27, 0xFF ; 255 2bc08: 2b 1a sub r2, r27 2bc0a: 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){ 2bc0c: e1 e2 ldi r30, 0x21 ; 33 2bc0e: 2e 16 cp r2, r30 2bc10: 31 04 cpc r3, r1 2bc12: 09 f0 breq .+2 ; 0x2bc16 2bc14: 10 ce rjmp .-992 ; 0x2b836 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); 2bc16: 40 e0 ldi r20, 0x00 ; 0 2bc18: 50 e0 ldi r21, 0x00 ; 0 2bc1a: 60 e0 ldi r22, 0x00 ; 0 2bc1c: 7d e3 ldi r23, 0x3D ; 61 2bc1e: ce 01 movw r24, r28 2bc20: 87 5f subi r24, 0xF7 ; 247 2bc22: 9e 4f sbci r25, 0xFE ; 254 2bc24: 0f 94 51 55 call 0x2aaa2 ; 0x2aaa2 2bc28: 9b 01 movw r18, r22 2bc2a: ac 01 movw r20, r24 2bc2c: c3 57 subi r28, 0x73 ; 115 2bc2e: de 4f sbci r29, 0xFE ; 254 2bc30: a8 81 ld r26, Y 2bc32: b9 81 ldd r27, Y+1 ; 0x01 2bc34: cd 58 subi r28, 0x8D ; 141 2bc36: d1 40 sbci r29, 0x01 ; 1 2bc38: 6d 91 ld r22, X+ 2bc3a: 7d 91 ld r23, X+ 2bc3c: 8d 91 ld r24, X+ 2bc3e: 9c 91 ld r25, X 2bc40: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2bc44: c3 57 subi r28, 0x73 ; 115 2bc46: de 4f sbci r29, 0xFE ; 254 2bc48: e8 81 ld r30, Y 2bc4a: f9 81 ldd r31, Y+1 ; 0x01 2bc4c: cd 58 subi r28, 0x8D ; 141 2bc4e: d1 40 sbci r29, 0x01 ; 1 2bc50: 60 83 st Z, r22 2bc52: 71 83 std Z+1, r23 ; 0x01 2bc54: 82 83 std Z+2, r24 ; 0x02 2bc56: 93 83 std Z+3, r25 ; 0x03 y += CLAMP_median(shifts_y, blocks, norm); 2bc58: 40 e0 ldi r20, 0x00 ; 0 2bc5a: 50 e0 ldi r21, 0x00 ; 0 2bc5c: 60 e0 ldi r22, 0x00 ; 0 2bc5e: 7d e3 ldi r23, 0x3D ; 61 2bc60: ce 01 movw r24, r28 2bc62: 8b 57 subi r24, 0x7B ; 123 2bc64: 9f 4f sbci r25, 0xFF ; 255 2bc66: 0f 94 51 55 call 0x2aaa2 ; 0x2aaa2 2bc6a: 9b 01 movw r18, r22 2bc6c: ac 01 movw r20, r24 2bc6e: c1 57 subi r28, 0x71 ; 113 2bc70: de 4f sbci r29, 0xFE ; 254 2bc72: a8 81 ld r26, Y 2bc74: b9 81 ldd r27, Y+1 ; 0x01 2bc76: cf 58 subi r28, 0x8F ; 143 2bc78: d1 40 sbci r29, 0x01 ; 1 2bc7a: 6d 91 ld r22, X+ 2bc7c: 7d 91 ld r23, X+ 2bc7e: 8d 91 ld r24, X+ 2bc80: 9c 91 ld r25, X 2bc82: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2bc86: c1 57 subi r28, 0x71 ; 113 2bc88: de 4f sbci r29, 0xFE ; 254 2bc8a: e8 81 ld r30, Y 2bc8c: f9 81 ldd r31, Y+1 ; 0x01 2bc8e: cf 58 subi r28, 0x8F ; 143 2bc90: d1 40 sbci r29, 0x01 ; 1 2bc92: 60 83 st Z, r22 2bc94: 71 83 std Z+1, r23 ; 0x01 2bc96: 82 83 std Z+2, r24 ; 0x02 2bc98: 93 83 std Z+3, r25 ; 0x03 r += CLAMP_median(shifts_r, blocks, norm * .5f); 2bc9a: 40 e0 ldi r20, 0x00 ; 0 2bc9c: 50 e0 ldi r21, 0x00 ; 0 2bc9e: 60 e8 ldi r22, 0x80 ; 128 2bca0: 7c e3 ldi r23, 0x3C ; 60 2bca2: ce 01 movw r24, r28 2bca4: 01 96 adiw r24, 0x01 ; 1 2bca6: 0f 94 51 55 call 0x2aaa2 ; 0x2aaa2 2bcaa: ce 56 subi r28, 0x6E ; 110 2bcac: de 4f sbci r29, 0xFE ; 254 2bcae: a8 81 ld r26, Y 2bcb0: b9 81 ldd r27, Y+1 ; 0x01 2bcb2: c2 59 subi r28, 0x92 ; 146 2bcb4: d1 40 sbci r29, 0x01 ; 1 2bcb6: 2d 91 ld r18, X+ 2bcb8: 3d 91 ld r19, X+ 2bcba: 4d 91 ld r20, X+ 2bcbc: 5c 91 ld r21, X 2bcbe: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2bcc2: 16 2f mov r17, r22 2bcc4: 07 2f mov r16, r23 2bcc6: f8 2e mov r15, r24 2bcc8: e9 2e mov r14, r25 r = MAX(2, r); 2bcca: 20 e0 ldi r18, 0x00 ; 0 2bccc: 30 e0 ldi r19, 0x00 ; 0 2bcce: 40 e0 ldi r20, 0x00 ; 0 2bcd0: 50 e4 ldi r21, 0x40 ; 64 2bcd2: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2bcd6: 18 16 cp r1, r24 2bcd8: 2c f0 brlt .+10 ; 0x2bce4 2bcda: 10 e0 ldi r17, 0x00 ; 0 2bcdc: 00 e0 ldi r16, 0x00 ; 0 2bcde: f1 2c mov r15, r1 2bce0: 80 e4 ldi r24, 0x40 ; 64 2bce2: e8 2e mov r14, r24 2bce4: a8 01 movw r20, r16 2bce6: 97 01 movw r18, r14 2bce8: 85 2f mov r24, r21 2bcea: 90 2f mov r25, r16 2bcec: a3 2f mov r26, r19 2bcee: be 2d mov r27, r14 2bcf0: ce 56 subi r28, 0x6E ; 110 2bcf2: de 4f sbci r29, 0xFE ; 254 2bcf4: e8 81 ld r30, Y 2bcf6: f9 81 ldd r31, Y+1 ; 0x01 2bcf8: c2 59 subi r28, 0x92 ; 146 2bcfa: d1 40 sbci r29, 0x01 ; 1 2bcfc: 80 83 st Z, r24 2bcfe: 91 83 std Z+1, r25 ; 0x01 2bd00: a2 83 std Z+2, r26 ; 0x02 2bd02: b3 83 std Z+3, r27 ; 0x03 2bd04: cf 56 subi r28, 0x6F ; 111 2bd06: de 4f sbci r29, 0xFE ; 254 2bd08: f8 81 ld r31, Y 2bd0a: c1 59 subi r28, 0x91 ; 145 2bd0c: d1 40 sbci r29, 0x01 ; 1 2bd0e: f1 50 subi r31, 0x01 ; 1 2bd10: cf 56 subi r28, 0x6F ; 111 2bd12: de 4f sbci r29, 0xFE ; 254 2bd14: f8 83 st Y, r31 2bd16: c1 59 subi r28, 0x91 ; 145 2bd18: 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){ 2bd1a: f1 11 cpse r31, r1 2bd1c: 37 cd rjmp .-1426 ; 0x2b78c r = MAX(2, r); } //@size=118 DBG(_n(" [%f, %f][%f] final circle\n"), x, y, r); 2bd1e: ef 92 push r14 2bd20: ff 92 push r15 2bd22: 0f 93 push r16 2bd24: 1f 93 push r17 2bd26: c1 57 subi r28, 0x71 ; 113 2bd28: de 4f sbci r29, 0xFE ; 254 2bd2a: a8 81 ld r26, Y 2bd2c: b9 81 ldd r27, Y+1 ; 0x01 2bd2e: cf 58 subi r28, 0x8F ; 143 2bd30: d1 40 sbci r29, 0x01 ; 1 2bd32: 13 96 adiw r26, 0x03 ; 3 2bd34: 8c 91 ld r24, X 2bd36: 13 97 sbiw r26, 0x03 ; 3 2bd38: 8f 93 push r24 2bd3a: 12 96 adiw r26, 0x02 ; 2 2bd3c: 8c 91 ld r24, X 2bd3e: 12 97 sbiw r26, 0x02 ; 2 2bd40: 8f 93 push r24 2bd42: 11 96 adiw r26, 0x01 ; 1 2bd44: 8c 91 ld r24, X 2bd46: 11 97 sbiw r26, 0x01 ; 1 2bd48: 8f 93 push r24 2bd4a: 8c 91 ld r24, X 2bd4c: 8f 93 push r24 2bd4e: c3 57 subi r28, 0x73 ; 115 2bd50: de 4f sbci r29, 0xFE ; 254 2bd52: e8 81 ld r30, Y 2bd54: f9 81 ldd r31, Y+1 ; 0x01 2bd56: cd 58 subi r28, 0x8D ; 141 2bd58: d1 40 sbci r29, 0x01 ; 1 2bd5a: 83 81 ldd r24, Z+3 ; 0x03 2bd5c: 8f 93 push r24 2bd5e: 82 81 ldd r24, Z+2 ; 0x02 2bd60: 8f 93 push r24 2bd62: 81 81 ldd r24, Z+1 ; 0x01 2bd64: 8f 93 push r24 2bd66: 80 81 ld r24, Z 2bd68: 8f 93 push r24 2bd6a: 86 ee ldi r24, 0xE6 ; 230 2bd6c: 9d e9 ldi r25, 0x9D ; 157 2bd6e: 9f 93 push r25 2bd70: 8f 93 push r24 2bd72: 0f 94 43 a3 call 0x34686 ; 0x34686 2bd76: 0f b6 in r0, 0x3f ; 63 2bd78: f8 94 cli 2bd7a: de bf out 0x3e, r29 ; 62 2bd7c: 0f be out 0x3f, r0 ; 63 2bd7e: cd bf out 0x3d, r28 ; 61 } 2bd80: c3 54 subi r28, 0x43 ; 67 2bd82: de 4f sbci r29, 0xFE ; 254 2bd84: 0f b6 in r0, 0x3f ; 63 2bd86: f8 94 cli 2bd88: de bf out 0x3e, r29 ; 62 2bd8a: 0f be out 0x3f, r0 ; 63 2bd8c: cd bf out 0x3d, r28 ; 61 2bd8e: df 91 pop r29 2bd90: cf 91 pop r28 2bd92: 1f 91 pop r17 2bd94: 0f 91 pop r16 2bd96: ff 90 pop r15 2bd98: ef 90 pop r14 2bd9a: df 90 pop r13 2bd9c: cf 90 pop r12 2bd9e: bf 90 pop r11 2bda0: af 90 pop r10 2bda2: 9f 90 pop r9 2bda4: 8f 90 pop r8 2bda6: 7f 90 pop r7 2bda8: 6f 90 pop r6 2bdaa: 5f 90 pop r5 2bdac: 4f 90 pop r4 2bdae: 3f 90 pop r3 2bdb0: 2f 90 pop r2 2bdb2: 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; 2bdb4: 60 e0 ldi r22, 0x00 ; 0 2bdb6: 70 e0 ldi r23, 0x00 ; 0 2bdb8: cb 01 movw r24, r22 2bdba: d5 ce rjmp .-598 ; 0x2bb66 0002bdbc : 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){ 2bdbc: ef 92 push r14 2bdbe: ff 92 push r15 2bdc0: 0f 93 push r16 2bdc2: 1f 93 push r17 2bdc4: cf 93 push r28 2bdc6: df 93 push r29 2bdc8: 1f 92 push r1 2bdca: 1f 92 push r1 2bdcc: cd b7 in r28, 0x3d ; 61 2bdce: de b7 in r29, 0x3e ; 62 2bdd0: f8 2e mov r15, r24 2bdd2: e6 2e mov r14, r22 if (steps == 0) return; uint16_t current_delay_us = MAX_DELAY; 2bdd4: 80 e1 ldi r24, 0x10 ; 16 2bdd6: 97 e2 ldi r25, 0x27 ; 39 2bdd8: 9a 83 std Y+2, r25 ; 0x02 2bdda: 89 83 std Y+1, r24 ; 0x01 const uint16_t half = steps / 2; 2bddc: 8a 01 movw r16, r20 2bdde: 16 95 lsr r17 2bde0: 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); 2bde2: 8f 2d mov r24, r15 2bde4: 0e 94 5e d3 call 0x1a6bc ; 0x1a6bc while (steps--){ 2bde8: 01 50 subi r16, 0x01 ; 1 2bdea: 11 09 sbc r17, r1 2bdec: 78 f0 brcs .+30 ; 0x2be0c accelerate_1_step(axes, acc, delay_us, min_delay_us); 2bdee: 28 ec ldi r18, 0xC8 ; 200 2bdf0: 30 e0 ldi r19, 0x00 ; 0 2bdf2: ae 01 movw r20, r28 2bdf4: 4f 5f subi r20, 0xFF ; 255 2bdf6: 5f 4f sbci r21, 0xFF ; 255 2bdf8: 68 ee ldi r22, 0xE8 ; 232 2bdfa: 73 e0 ldi r23, 0x03 ; 3 2bdfc: 8f 2d mov r24, r15 2bdfe: 0e 94 2d d2 call 0x1a45a ; 0x1a45a update_position_1_step(axes, dir); 2be02: 6e 2d mov r22, r14 2be04: 8f 2d mov r24, r15 2be06: 0e 94 77 d3 call 0x1a6ee ; 0x1a6ee 2be0a: ee cf rjmp .-36 ; 0x2bde8 } /// \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); 2be0c: 6e 2d mov r22, r14 2be0e: 8f 2d mov r24, r15 2be10: 0e 94 5e d3 call 0x1a6bc ; 0x1a6bc 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); } 2be14: 0f 90 pop r0 2be16: 0f 90 pop r0 2be18: df 91 pop r29 2be1a: cf 91 pop r28 2be1c: 1f 91 pop r17 2be1e: 0f 91 pop r16 2be20: ff 90 pop r15 2be22: ef 90 pop r14 2be24: 08 95 ret 0002be26 : /// 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) 2be26: 2f 92 push r2 2be28: 3f 92 push r3 2be2a: 4f 92 push r4 2be2c: 5f 92 push r5 2be2e: 6f 92 push r6 2be30: 7f 92 push r7 2be32: 8f 92 push r8 2be34: 9f 92 push r9 2be36: af 92 push r10 2be38: bf 92 push r11 2be3a: cf 92 push r12 2be3c: df 92 push r13 2be3e: ef 92 push r14 2be40: ff 92 push r15 2be42: 0f 93 push r16 2be44: 1f 93 push r17 2be46: cf 93 push r28 2be48: df 93 push r29 2be4a: cd b7 in r28, 0x3d ; 61 2be4c: de b7 in r29, 0x3e ; 62 2be4e: 6c 97 sbiw r28, 0x1c ; 28 2be50: 0f b6 in r0, 0x3f ; 63 2be52: f8 94 cli 2be54: de bf out 0x3e, r29 ; 62 2be56: 0f be out 0x3f, r0 ; 63 2be58: cd bf out 0x3d, r28 ; 61 2be5a: 6c 01 movw r12, r24 2be5c: 5b 01 movw r10, r22 2be5e: 4a 01 movw r8, r20 2be60: 19 01 movw r2, r18 2be62: 18 87 std Y+8, r17 ; 0x08 2be64: 0f 83 std Y+7, r16 ; 0x07 2be66: fa 82 std Y+2, r15 ; 0x02 2be68: 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; 2be6a: d7 01 movw r26, r14 2be6c: 8d 91 ld r24, X+ 2be6e: 9c 91 ld r25, X 2be70: 60 ed ldi r22, 0xD0 ; 208 2be72: 72 e0 ldi r23, 0x02 ; 2 2be74: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> 2be78: 9c 8f std Y+28, r25 ; 0x1c 2be7a: 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); 2be7c: 9f 93 push r25 2be7e: 8f 93 push r24 2be80: 3f 92 push r3 2be82: 2f 93 push r18 2be84: 1f 92 push r1 2be86: 84 e6 ldi r24, 0x64 ; 100 2be88: 8f 93 push r24 2be8a: 9f 92 push r9 2be8c: 8f 92 push r8 2be8e: bf 92 push r11 2be90: af 92 push r10 2be92: df 92 push r13 2be94: cf 92 push r12 2be96: 84 e6 ldi r24, 0x64 ; 100 2be98: 9d e9 ldi r25, 0x9D ; 157 2be9a: 9f 93 push r25 2be9c: 8f 93 push r24 2be9e: 0f 94 43 a3 call 0x34686 ; 0x34686 2bea2: 0f b6 in r0, 0x3f ; 63 2bea4: f8 94 cli 2bea6: de bf out 0x3e, r29 ; 62 2bea8: 0f be out 0x3f, r0 ; 63 2beaa: 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; 2beac: 22 27 eor r18, r18 2beae: 33 27 eor r19, r19 2beb0: 22 19 sub r18, r2 2beb2: 33 09 sbc r19, r3 2beb4: 3a 8f std Y+26, r19 ; 0x1a 2beb6: 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)); 2beb8: c4 01 movw r24, r8 2beba: 99 0c add r9, r9 2bebc: aa 0b sbc r26, r26 2bebe: bb 0b sbc r27, r27 2bec0: 89 87 std Y+9, r24 ; 0x09 2bec2: 9a 87 std Y+10, r25 ; 0x0a 2bec4: ab 87 std Y+11, r26 ; 0x0b 2bec6: 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)); 2bec8: 95 01 movw r18, r10 2beca: bb 0c add r11, r11 2becc: 44 0b sbc r20, r20 2bece: 55 0b sbc r21, r21 2bed0: 29 8b std Y+17, r18 ; 0x11 2bed2: 3a 8b std Y+18, r19 ; 0x12 2bed4: 4b 8b std Y+19, r20 ; 0x13 2bed6: 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)); 2bed8: c6 01 movw r24, r12 2beda: dd 0c add r13, r13 2bedc: aa 0b sbc r26, r26 2bede: bb 0b sbc r27, r27 2bee0: 8d 8b std Y+21, r24 ; 0x15 2bee2: 9e 8b std Y+22, r25 ; 0x16 2bee4: af 8b std Y+23, r26 ; 0x17 2bee6: b8 8f std Y+24, r27 ; 0x18 // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) { if (radius > 0) 2bee8: 12 14 cp r1, r2 2beea: 13 04 cpc r1, r3 2beec: 0c f0 brlt .+2 ; 0x2bef0 2beee: ba c0 rjmp .+372 ; 0x2c064 { dad = dad_max - (ad / k); 2bef0: 8b 8d ldd r24, Y+27 ; 0x1b 2bef2: 9c 8d ldd r25, Y+28 ; 0x1c 2bef4: 6c e3 ldi r22, 0x3C ; 60 2bef6: 70 e0 ldi r23, 0x00 ; 0 2bef8: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> 2befc: 10 e1 ldi r17, 0x10 ; 16 2befe: 16 1b sub r17, r22 r = (float)(((uint32_t)ad) * radius) / 720; 2bf00: 2b 8d ldd r18, Y+27 ; 0x1b 2bf02: 3c 8d ldd r19, Y+28 ; 0x1c 2bf04: d1 01 movw r26, r2 } else { dad = dad_max - ((719 - ad) / k); r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2bf06: 0f 94 a1 a5 call 0x34b42 ; 0x34b42 <__usmulhisi3> 2bf0a: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 2bf0e: 20 e0 ldi r18, 0x00 ; 0 2bf10: 30 e0 ldi r19, 0x00 ; 0 2bf12: 44 e3 ldi r20, 0x34 ; 52 2bf14: 54 e4 ldi r21, 0x44 ; 68 2bf16: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 2bf1a: 6b 01 movw r12, r22 2bf1c: 7c 01 movw r14, r24 } ar = radians(ad + rotation); 2bf1e: 6f 81 ldd r22, Y+7 ; 0x07 2bf20: 78 85 ldd r23, Y+8 ; 0x08 2bf22: eb 8d ldd r30, Y+27 ; 0x1b 2bf24: fc 8d ldd r31, Y+28 ; 0x1c 2bf26: 6e 0f add r22, r30 2bf28: 7f 1f adc r23, r31 2bf2a: 90 e0 ldi r25, 0x00 ; 0 2bf2c: 80 e0 ldi r24, 0x00 ; 0 2bf2e: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 2bf32: 25 e3 ldi r18, 0x35 ; 53 2bf34: 3a ef ldi r19, 0xFA ; 250 2bf36: 4e e8 ldi r20, 0x8E ; 142 2bf38: 5c e3 ldi r21, 0x3C ; 60 2bf3a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2bf3e: 4b 01 movw r8, r22 2bf40: 5c 01 movw r10, r24 int x = (int)(cx + (cos(ar) * r)); 2bf42: 0f 94 a3 a6 call 0x34d46 ; 0x34d46 2bf46: 6b 83 std Y+3, r22 ; 0x03 2bf48: 7c 83 std Y+4, r23 ; 0x04 2bf4a: 8d 83 std Y+5, r24 ; 0x05 2bf4c: 9e 83 std Y+6, r25 ; 0x06 int y = (int)(cy + (sin(ar) * r)); 2bf4e: c5 01 movw r24, r10 2bf50: b4 01 movw r22, r8 2bf52: 0f 94 69 a9 call 0x352d2 ; 0x352d2 2bf56: 2b 01 movw r4, r22 2bf58: 3c 01 movw r6, r24 int z = (int)(z0 - ((float)((int32_t)dz * ad) / 720)); 2bf5a: 69 85 ldd r22, Y+9 ; 0x09 2bf5c: 7a 85 ldd r23, Y+10 ; 0x0a 2bf5e: 8b 85 ldd r24, Y+11 ; 0x0b 2bf60: 9c 85 ldd r25, Y+12 ; 0x0c 2bf62: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2bf66: 4b 01 movw r8, r22 2bf68: 5c 01 movw r10, r24 2bf6a: 2b 8d ldd r18, Y+27 ; 0x1b 2bf6c: 3c 8d ldd r19, Y+28 ; 0x1c 2bf6e: a4 e6 ldi r26, 0x64 ; 100 2bf70: b0 e0 ldi r27, 0x00 ; 0 2bf72: 0f 94 21 a5 call 0x34a42 ; 0x34a42 <__umulhisi3> 2bf76: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2bf7a: 20 e0 ldi r18, 0x00 ; 0 2bf7c: 30 e0 ldi r19, 0x00 ; 0 2bf7e: 44 e3 ldi r20, 0x34 ; 52 2bf80: 54 e4 ldi r21, 0x44 ; 68 2bf82: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 2bf86: 9b 01 movw r18, r22 2bf88: ac 01 movw r20, r24 2bf8a: c5 01 movw r24, r10 2bf8c: b4 01 movw r22, r8 2bf8e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2bf92: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 2bf96: 6d 87 std Y+13, r22 ; 0x0d 2bf98: 7e 87 std Y+14, r23 ; 0x0e 2bf9a: 8f 87 std Y+15, r24 ; 0x0f 2bf9c: 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)); 2bf9e: 69 89 ldd r22, Y+17 ; 0x11 2bfa0: 7a 89 ldd r23, Y+18 ; 0x12 2bfa2: 8b 89 ldd r24, Y+19 ; 0x13 2bfa4: 9c 89 ldd r25, Y+20 ; 0x14 2bfa6: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2bfaa: 4b 01 movw r8, r22 2bfac: 5c 01 movw r10, r24 2bfae: a3 01 movw r20, r6 2bfb0: 92 01 movw r18, r4 2bfb2: c7 01 movw r24, r14 2bfb4: b6 01 movw r22, r12 2bfb6: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2bfba: 9b 01 movw r18, r22 2bfbc: ac 01 movw r20, r24 2bfbe: c5 01 movw r24, r10 2bfc0: b4 01 movw r22, r8 2bfc2: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2bfc6: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 2bfca: 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)); 2bfcc: 6d 89 ldd r22, Y+21 ; 0x15 2bfce: 7e 89 ldd r23, Y+22 ; 0x16 2bfd0: 8f 89 ldd r24, Y+23 ; 0x17 2bfd2: 98 8d ldd r25, Y+24 ; 0x18 2bfd4: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2bfd8: 2b 01 movw r4, r22 2bfda: 3c 01 movw r6, r24 2bfdc: a7 01 movw r20, r14 2bfde: 96 01 movw r18, r12 2bfe0: 6b 81 ldd r22, Y+3 ; 0x03 2bfe2: 7c 81 ldd r23, Y+4 ; 0x04 2bfe4: 8d 81 ldd r24, Y+5 ; 0x05 2bfe6: 9e 81 ldd r25, Y+6 ; 0x06 2bfe8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2bfec: 9b 01 movw r18, r22 2bfee: ac 01 movw r20, r24 2bff0: c3 01 movw r24, r6 2bff2: b2 01 movw r22, r4 2bff4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2bff8: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 2bffc: 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)) 2bffe: 01 e0 ldi r16, 0x01 ; 1 2c000: 20 e4 ldi r18, 0x40 ; 64 2c002: 31 e0 ldi r19, 0x01 ; 1 2c004: 4d 85 ldd r20, Y+13 ; 0x0d 2c006: 5e 85 ldd r21, Y+14 ; 0x0e 2c008: b4 01 movw r22, r8 2c00a: 0e 94 b7 d3 call 0x1a76e ; 0x1a76e 2c00e: 21 2f mov r18, r17 2c010: 30 e0 ldi r19, 0x00 ; 0 2c012: 88 23 and r24, r24 2c014: b9 f1 breq .+110 ; 0x2c084 2c016: 4b 8d ldd r20, Y+27 ; 0x1b 2c018: 5c 8d ldd r21, Y+28 ; 0x1c 2c01a: 42 0f add r20, r18 2c01c: 53 1f adc r21, r19 { ad += dad + 1; 2c01e: 4f 5f subi r20, 0xFF ; 255 2c020: 5f 4f sbci r21, 0xFF ; 255 2c022: 5c 8f std Y+28, r21 ; 0x1c 2c024: 4b 8f std Y+27, r20 ; 0x1b ret = true; break; } ad += dad; } if (pad) *pad = ad; 2c026: eb 8d ldd r30, Y+27 ; 0x1b 2c028: fc 8d ldd r31, Y+28 ; 0x1c 2c02a: a9 81 ldd r26, Y+1 ; 0x01 2c02c: ba 81 ldd r27, Y+2 ; 0x02 2c02e: ed 93 st X+, r30 2c030: fc 93 st X, r31 // if(ret){ // lcd_set_cursor(0, 4); // lcd_print(" "); // } return ret; } 2c032: 6c 96 adiw r28, 0x1c ; 28 2c034: 0f b6 in r0, 0x3f ; 63 2c036: f8 94 cli 2c038: de bf out 0x3e, r29 ; 62 2c03a: 0f be out 0x3f, r0 ; 63 2c03c: cd bf out 0x3d, r28 ; 61 2c03e: df 91 pop r29 2c040: cf 91 pop r28 2c042: 1f 91 pop r17 2c044: 0f 91 pop r16 2c046: ff 90 pop r15 2c048: ef 90 pop r14 2c04a: df 90 pop r13 2c04c: cf 90 pop r12 2c04e: bf 90 pop r11 2c050: af 90 pop r10 2c052: 9f 90 pop r9 2c054: 8f 90 pop r8 2c056: 7f 90 pop r7 2c058: 6f 90 pop r6 2c05a: 5f 90 pop r5 2c05c: 4f 90 pop r4 2c05e: 3f 90 pop r3 2c060: 2f 90 pop r2 2c062: 08 95 ret dad = dad_max - (ad / k); r = (float)(((uint32_t)ad) * radius) / 720; } else { dad = dad_max - ((719 - ad) / k); 2c064: 2f ec ldi r18, 0xCF ; 207 2c066: 32 e0 ldi r19, 0x02 ; 2 2c068: ab 8d ldd r26, Y+27 ; 0x1b 2c06a: bc 8d ldd r27, Y+28 ; 0x1c 2c06c: 2a 1b sub r18, r26 2c06e: 3b 0b sbc r19, r27 2c070: c9 01 movw r24, r18 2c072: 6c e3 ldi r22, 0x3C ; 60 2c074: 70 e0 ldi r23, 0x00 ; 0 2c076: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> 2c07a: 10 e1 ldi r17, 0x10 ; 16 2c07c: 16 1b sub r17, r22 r = (float)(((uint32_t)(719 - ad)) * (-radius)) / 720; 2c07e: a9 8d ldd r26, Y+25 ; 0x19 2c080: ba 8d ldd r27, Y+26 ; 0x1a 2c082: 41 cf rjmp .-382 ; 0x2bf06 // lcd_set_cursor(0, 4); // char text[10]; // snprintf(text, 10, "%4d", z0); // lcd_print(text); for (; ad < 720; ad++) 2c084: 2f 5f subi r18, 0xFF ; 255 2c086: 3f 4f sbci r19, 0xFF ; 255 2c088: ab 8d ldd r26, Y+27 ; 0x1b 2c08a: bc 8d ldd r27, Y+28 ; 0x1c 2c08c: a2 0f add r26, r18 2c08e: b3 1f adc r27, r19 2c090: bc 8f std Y+28, r27 ; 0x1c 2c092: ab 8f std Y+27, r26 ; 0x1b 2c094: a0 3d cpi r26, 0xD0 ; 208 2c096: b2 40 sbci r27, 0x02 ; 2 2c098: 08 f4 brcc .+2 ; 0x2c09c 2c09a: 26 cf rjmp .-436 ; 0x2bee8 2c09c: c4 cf rjmp .-120 ; 0x2c026 0002c09e : 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){ 2c09e: 2f 92 push r2 2c0a0: 3f 92 push r3 2c0a2: 4f 92 push r4 2c0a4: 5f 92 push r5 2c0a6: 6f 92 push r6 2c0a8: 7f 92 push r7 2c0aa: 8f 92 push r8 2c0ac: 9f 92 push r9 2c0ae: af 92 push r10 2c0b0: bf 92 push r11 2c0b2: cf 92 push r12 2c0b4: df 92 push r13 2c0b6: ef 92 push r14 2c0b8: ff 92 push r15 2c0ba: 0f 93 push r16 2c0bc: 1f 93 push r17 2c0be: cf 93 push r28 2c0c0: df 93 push r29 2c0c2: cd b7 in r28, 0x3d ; 61 2c0c4: de b7 in r29, 0x3e ; 62 2c0c6: ca 55 subi r28, 0x5A ; 90 2c0c8: d1 09 sbc r29, r1 2c0ca: 0f b6 in r0, 0x3f ; 63 2c0cc: f8 94 cli 2c0ce: de bf out 0x3e, r29 ; 62 2c0d0: 0f be out 0x3f, r0 ; 63 2c0d2: cd bf out 0x3d, r28 ; 61 2c0d4: 63 96 adiw r28, 0x13 ; 19 2c0d6: 9f af std Y+63, r25 ; 0x3f 2c0d8: 8e af std Y+62, r24 ; 0x3e 2c0da: 63 97 sbiw r28, 0x13 ; 19 2c0dc: 8b 01 movw r16, r22 2c0de: 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 2c0e0: 7e 01 movw r14, r28 2c0e2: 25 e4 ldi r18, 0x45 ; 69 2c0e4: e2 0e add r14, r18 2c0e6: f1 1c adc r15, r1 2c0e8: 80 e1 ldi r24, 0x10 ; 16 2c0ea: 97 e2 ldi r25, 0x27 ; 39 2c0ec: f7 01 movw r30, r14 2c0ee: 91 83 std Z+1, r25 ; 0x01 2c0f0: 80 83 st Z, r24 int16_t start_z; uint16_t steps_to_go; DBG(_n("Scan countdown: ")); 2c0f2: 81 eb ldi r24, 0xB1 ; 177 2c0f4: 9d e9 ldi r25, 0x9D ; 157 2c0f6: 9f 93 push r25 2c0f8: 8f 93 push r24 2c0fa: 0f 94 43 a3 call 0x34686 ; 0x34686 2c0fe: 2e e5 ldi r18, 0x5E ; 94 2c100: 36 e0 ldi r19, 0x06 ; 6 2c102: 61 96 adiw r28, 0x11 ; 17 2c104: 3f af std Y+63, r19 ; 0x3f 2c106: 2e af std Y+62, r18 ; 0x3e 2c108: 61 97 sbiw r28, 0x11 ; 17 2c10a: c8 01 movw r24, r16 2c10c: 80 5e subi r24, 0xE0 ; 224 2c10e: 93 40 sbci r25, 0x03 ; 3 2c110: 2b 96 adiw r28, 0x0b ; 11 2c112: 9f af std Y+63, r25 ; 0x3f 2c114: 8e af std Y+62, r24 ; 0x3e 2c116: 2b 97 sbiw r28, 0x0b ; 11 2c118: 0f 90 pop r0 2c11a: 0f 90 pop r0 2c11c: e0 e4 ldi r30, 0x40 ; 64 2c11e: f0 e0 ldi r31, 0x00 ; 0 2c120: 29 96 adiw r28, 0x09 ; 9 2c122: ff af std Y+63, r31 ; 0x3f 2c124: ee af std Y+62, r30 ; 0x3e 2c126: 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); 2c128: 63 96 adiw r28, 0x13 ; 19 2c12a: 2e ad ldd r18, Y+62 ; 0x3e 2c12c: 3f ad ldd r19, Y+63 ; 0x3f 2c12e: 63 97 sbiw r28, 0x13 ; 19 2c130: 20 5e subi r18, 0xE0 ; 224 2c132: 33 40 sbci r19, 0x03 ; 3 2c134: 69 96 adiw r28, 0x19 ; 25 2c136: 3f af std Y+63, r19 ; 0x3f 2c138: 2e af std Y+62, r18 ; 0x3e 2c13a: 69 97 sbiw r28, 0x19 ; 25 2c13c: 29 96 adiw r28, 0x09 ; 9 2c13e: 4e ac ldd r4, Y+62 ; 0x3e 2c140: 5f ac ldd r5, Y+63 ; 0x3f 2c142: 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){ 2c144: 31 2c mov r3, r1 go_manhattan((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, Z_ACCEL, Z_MIN_DELAY); 2c146: 63 96 adiw r28, 0x13 ; 19 2c148: 8e ad ldd r24, Y+62 ; 0x3e 2c14a: 9f ad ldd r25, Y+63 ; 0x3f 2c14c: 63 97 sbiw r28, 0x13 ; 19 2c14e: 80 52 subi r24, 0x20 ; 32 2c150: 9c 4f sbci r25, 0xFC ; 252 2c152: 6b 96 adiw r28, 0x1b ; 27 2c154: 9f af std Y+63, r25 ; 0x3f 2c156: 8e af std Y+62, r24 ; 0x3e 2c158: 6b 97 sbiw r28, 0x1b ; 27 2c15a: 60 90 54 06 lds r6, 0x0654 ; 0x800654 2c15e: 70 90 55 06 lds r7, 0x0655 ; 0x800655 2c162: 80 90 56 06 lds r8, 0x0656 ; 0x800656 2c166: 90 90 57 06 lds r9, 0x0657 ; 0x800657 2c16a: 6b 96 adiw r28, 0x1b ; 27 2c16c: ae ac ldd r10, Y+62 ; 0x3e 2c16e: bf ac ldd r11, Y+63 ; 0x3f 2c170: 6b 97 sbiw r28, 0x1b ; 27 2c172: 31 10 cpse r3, r1 2c174: 04 c0 rjmp .+8 ; 0x2c17e 2c176: 69 96 adiw r28, 0x19 ; 25 2c178: ae ac ldd r10, Y+62 ; 0x3e 2c17a: bf ac ldd r11, Y+63 ; 0x3f 2c17c: 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; 2c17e: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2c182: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 2c186: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 2c18a: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 2c18e: f5 01 movw r30, r10 2c190: e8 1b sub r30, r24 2c192: f9 0b sbc r31, r25 2c194: 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) 2c196: 71 f0 breq .+28 ; 0x2c1b4 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)); 2c198: af 01 movw r20, r30 2c19a: f7 ff sbrs r31, 7 2c19c: 04 c0 rjmp .+8 ; 0x2c1a6 2c19e: 44 27 eor r20, r20 2c1a0: 55 27 eor r21, r21 2c1a2: 4e 1b sub r20, r30 2c1a4: 5f 0b sbc r21, r31 2c1a6: 69 2f mov r22, r25 2c1a8: 66 1f adc r22, r22 2c1aa: 66 27 eor r22, r22 2c1ac: 66 1f adc r22, r22 2c1ae: 81 e0 ldi r24, 0x01 ; 1 2c1b0: 0f 94 de 5e call 0x2bdbc ; 0x2bdbc // DBG(_n("y %d -> %d, "), y, _Y); length = y - _Y; 2c1b4: 80 91 50 06 lds r24, 0x0650 ; 0x800650 2c1b8: 90 91 51 06 lds r25, 0x0651 ; 0x800651 2c1bc: a0 91 52 06 lds r26, 0x0652 ; 0x800652 2c1c0: b0 91 53 06 lds r27, 0x0653 ; 0x800653 2c1c4: 2b 96 adiw r28, 0x0b ; 11 2c1c6: 4e ad ldd r20, Y+62 ; 0x3e 2c1c8: 5f ad ldd r21, Y+63 ; 0x3f 2c1ca: 2b 97 sbiw r28, 0x0b ; 11 2c1cc: 48 1b sub r20, r24 2c1ce: 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)); 2c1d0: 57 fd sbrc r21, 7 2c1d2: b2 c0 rjmp .+356 ; 0x2c338 2c1d4: 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) 2c1d6: 41 15 cp r20, r1 2c1d8: 51 05 cpc r21, r1 2c1da: 09 f0 breq .+2 ; 0x2c1de 2c1dc: ae c0 rjmp .+348 ; 0x2c33a // 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; 2c1de: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c1e2: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c1e6: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c1ea: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c1ee: 68 1a sub r6, r24 2c1f0: 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)); 2c1f2: 77 fc sbrc r7, 7 2c1f4: ab c0 rjmp .+342 ; 0x2c34c 2c1f6: 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) 2c1f8: 61 14 cp r6, r1 2c1fa: 71 04 cpc r7, r1 2c1fc: 09 f0 breq .+2 ; 0x2c200 2c1fe: a7 c0 rjmp .+334 ; 0x2c34e 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); 2c200: 40 91 54 06 lds r20, 0x0654 ; 0x800654 2c204: 50 91 55 06 lds r21, 0x0655 ; 0x800655 2c208: 60 91 56 06 lds r22, 0x0656 ; 0x800656 2c20c: 70 91 57 06 lds r23, 0x0657 ; 0x800657 2c210: 00 e0 ldi r16, 0x00 ; 0 2c212: 28 ec ldi r18, 0xC8 ; 200 2c214: 30 e0 ldi r19, 0x00 ; 0 2c216: 2b 96 adiw r28, 0x0b ; 11 2c218: 6e ad ldd r22, Y+62 ; 0x3e 2c21a: 7f ad ldd r23, Y+63 ; 0x3f 2c21c: 2b 97 sbiw r28, 0x0b ; 11 2c21e: c5 01 movw r24, r10 2c220: 0e 94 b7 d3 call 0x1a76e ; 0x1a76e sm4_set_dir(X_AXIS, d); 2c224: 63 2d mov r22, r3 2c226: 80 e0 ldi r24, 0x00 ; 0 2c228: 0f 94 28 26 call 0x24c50 ; 0x24c50 //@size=242 DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive 2c22c: 5f 92 push r5 2c22e: 4f 92 push r4 2c230: 8d ea ldi r24, 0xAD ; 173 2c232: 9d e9 ldi r25, 0x9D ; 157 2c234: 9f 93 push r25 2c236: 8f 93 push r24 2c238: 0f 94 43 a3 call 0x34686 ; 0x34686 lcd_set_cursor(4,3); 2c23c: 63 e0 ldi r22, 0x03 ; 3 2c23e: 84 e0 ldi r24, 0x04 ; 4 2c240: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12 2c244: 5f 92 push r5 2c246: 4f 92 push r4 2c248: 8e e9 ldi r24, 0x9E ; 158 2c24a: 9d e9 ldi r25, 0x9D ; 157 2c24c: 9f 93 push r25 2c24e: 8f 93 push r24 2c250: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 2c254: 0f b6 in r0, 0x3f ; 63 2c256: f8 94 cli 2c258: de bf out 0x3e, r29 ; 62 2c25a: 0f be out 0x3f, r0 ; 63 2c25c: cd bf out 0x3d, r28 ; 61 2c25e: 21 e0 ldi r18, 0x01 ; 1 2c260: 30 e0 ldi r19, 0x00 ; 0 2c262: 31 10 cpse r3, r1 2c264: 02 c0 rjmp .+4 ; 0x2c26a 2c266: 2f ef ldi r18, 0xFF ; 255 2c268: 3f ef ldi r19, 0xFF ; 255 2c26a: 40 ec ldi r20, 0xC0 ; 192 2c26c: 42 03 mulsu r20, r18 2c26e: c0 01 movw r24, r0 2c270: 43 9f mul r20, r19 2c272: 90 0d add r25, r0 2c274: 11 24 eor r1, r1 2c276: 67 96 adiw r28, 0x17 ; 23 2c278: 9f af std Y+63, r25 ; 0x3f 2c27a: 8e af std Y+62, r24 ; 0x3e 2c27c: 67 97 sbiw r28, 0x17 ; 23 2c27e: 40 ee ldi r20, 0xE0 ; 224 2c280: 53 e0 ldi r21, 0x03 ; 3 2c282: 24 9f mul r18, r20 2c284: 40 01 movw r8, r0 2c286: 25 9f mul r18, r21 2c288: 90 0c add r9, r0 2c28a: 34 9f mul r19, r20 2c28c: 90 0c add r9, r0 2c28e: 11 24 eor r1, r1 2c290: 63 96 adiw r28, 0x13 ; 19 2c292: ee ad ldd r30, Y+62 ; 0x3e 2c294: ff ad ldd r31, Y+63 ; 0x3f 2c296: 63 97 sbiw r28, 0x13 ; 19 2c298: 8e 0e add r8, r30 2c29a: 9f 1e adc r9, r31 2c29c: 9e 01 movw r18, r28 2c29e: 2f 5f subi r18, 0xFF ; 255 2c2a0: 3f 4f sbci r19, 0xFF ; 255 2c2a2: 2d 96 adiw r28, 0x0d ; 13 2c2a4: 3f af std Y+63, r19 ; 0x3f 2c2a6: 2e af std Y+62, r18 ; 0x3e 2c2a8: 2d 97 sbiw r28, 0x0d ; 13 2c2aa: 61 96 adiw r28, 0x11 ; 17 2c2ac: 8e ad ldd r24, Y+62 ; 0x3e 2c2ae: 9f ad ldd r25, Y+63 ; 0x3f 2c2b0: 61 97 sbiw r28, 0x11 ; 17 2c2b2: 2f 96 adiw r28, 0x0f ; 15 2c2b4: 9f af std Y+63, r25 ; 0x3f 2c2b6: 8e af std Y+62, r24 ; 0x3e 2c2b8: 2f 97 sbiw r28, 0x0f ; 15 2c2ba: 71 2c mov r7, r1 2c2bc: 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; 2c2be: e0 e1 ldi r30, 0x10 ; 16 2c2c0: f7 e2 ldi r31, 0x27 ; 39 2c2c2: 27 96 adiw r28, 0x07 ; 7 2c2c4: ff af std Y+63, r31 ; 0x3f 2c2c6: ee af std Y+62, r30 ; 0x3e 2c2c8: 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); 2c2ca: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2c2ce: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 2c2d2: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 2c2d6: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 2c2da: 84 01 movw r16, r8 2c2dc: 08 1b sub r16, r24 2c2de: 19 0b sbc r17, r25 2c2e0: 17 ff sbrs r17, 7 2c2e2: 03 c0 rjmp .+6 ; 0x2c2ea 2c2e4: 11 95 neg r17 2c2e6: 01 95 neg r16 2c2e8: 11 09 sbc r17, r1 const int16_t half_x = length_x / 2; 2c2ea: 98 01 movw r18, r16 2c2ec: 35 95 asr r19 2c2ee: 27 95 ror r18 2c2f0: 65 96 adiw r28, 0x15 ; 21 2c2f2: 3f af std Y+63, r19 ; 0x3f 2c2f4: 2e af std Y+62, r18 ; 0x3e 2c2f6: 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; 2c2f8: 1c 9b sbis 0x03, 4 ; 3 2c2fa: 33 c0 rjmp .+102 ; 0x2c362 2c2fc: 45 e0 ldi r20, 0x05 ; 5 2c2fe: 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); 2c300: 65 96 adiw r28, 0x15 ; 21 2c302: ae ac ldd r10, Y+62 ; 0x3e 2c304: bf ac ldd r11, Y+63 ; 0x3f 2c306: 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); 2c308: 63 2d mov r22, r3 2c30a: 82 2d mov r24, r2 2c30c: 0e 94 5e d3 call 0x1a6bc ; 0x1a6bc while (steps--){ 2c310: 31 e0 ldi r19, 0x01 ; 1 2c312: a3 1a sub r10, r19 2c314: b1 08 sbc r11, r1 2c316: 40 f1 brcs .+80 ; 0x2c368 accelerate_1_step(axes, acc, delay_us, min_delay_us); 2c318: 28 ec ldi r18, 0xC8 ; 200 2c31a: 30 e0 ldi r19, 0x00 ; 0 2c31c: a7 01 movw r20, r14 2c31e: 68 ee ldi r22, 0xE8 ; 232 2c320: 73 e0 ldi r23, 0x03 ; 3 2c322: 82 2d mov r24, r2 2c324: 0e 94 2d d2 call 0x1a45a ; 0x1a45a update_position_1_step(axes, dir); 2c328: 63 2d mov r22, r3 2c32a: 82 2d mov r24, r2 2c32c: 0e 94 77 d3 call 0x1a6ee ; 0x1a6ee 2c330: ef cf rjmp .-34 ; 0x2c310 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){ 2c332: 33 24 eor r3, r3 2c334: 33 94 inc r3 2c336: 11 cf rjmp .-478 ; 0x2c15a 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)); 2c338: 62 e0 ldi r22, 0x02 ; 2 2c33a: 57 ff sbrs r21, 7 2c33c: 03 c0 rjmp .+6 ; 0x2c344 2c33e: 51 95 neg r21 2c340: 41 95 neg r20 2c342: 51 09 sbc r21, r1 2c344: 82 e0 ldi r24, 0x02 ; 2 2c346: 0f 94 de 5e call 0x2bdbc ; 0x2bdbc 2c34a: 49 cf rjmp .-366 ; 0x2c1de // 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)); 2c34c: 64 e0 ldi r22, 0x04 ; 4 2c34e: a3 01 movw r20, r6 2c350: 77 fe sbrs r7, 7 2c352: 03 c0 rjmp .+6 ; 0x2c35a 2c354: 51 95 neg r21 2c356: 41 95 neg r20 2c358: 51 09 sbc r21, r1 2c35a: 84 e0 ldi r24, 0x04 ; 4 2c35c: 0f 94 de 5e call 0x2bdbc ; 0x2bdbc 2c360: 4f cf rjmp .-354 ; 0x2c200 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; 2c362: 22 24 eor r2, r2 2c364: 23 94 inc r2 2c366: cc cf rjmp .-104 ; 0x2c300 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); 2c368: 65 96 adiw r28, 0x15 ; 21 2c36a: ee ad ldd r30, Y+62 ; 0x3e 2c36c: ff ad ldd r31, Y+63 ; 0x3f 2c36e: 65 97 sbiw r28, 0x15 ; 21 2c370: 0e 1b sub r16, r30 2c372: 1f 0b sbc r17, r31 2c374: 23 96 adiw r28, 0x03 ; 3 2c376: 1f af std Y+63, r17 ; 0x3f 2c378: 0e af std Y+62, r16 ; 0x3e 2c37a: 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); 2c37c: 63 2d mov r22, r3 2c37e: 82 2d mov r24, r2 2c380: 0e 94 5e d3 call 0x1a6bc ; 0x1a6bc while (go_and_stop_1_step(axes, dec, delay_us, steps)){ 2c384: 9e 01 movw r18, r28 2c386: 2f 5b subi r18, 0xBF ; 191 2c388: 3f 4f sbci r19, 0xFF ; 255 2c38a: a7 01 movw r20, r14 2c38c: 68 ee ldi r22, 0xE8 ; 232 2c38e: 73 e0 ldi r23, 0x03 ; 3 2c390: 82 2d mov r24, r2 2c392: 0e 94 d4 d2 call 0x1a5a8 ; 0x1a5a8 2c396: 88 23 and r24, r24 2c398: 29 f0 breq .+10 ; 0x2c3a4 update_position_1_step(axes, dir); 2c39a: 63 2d mov r22, r3 2c39c: 82 2d mov r24, r2 2c39e: 0e 94 77 d3 call 0x1a6ee ; 0x1a6ee 2c3a2: f0 cf rjmp .-32 ; 0x2c384 z_trig = min_z; /// move up to un-trigger (surpress hysteresis) sm4_set_dir(Z_AXIS, Z_PLUS); 2c3a4: 60 e0 ldi r22, 0x00 ; 0 2c3a6: 82 e0 ldi r24, 0x02 ; 2 2c3a8: 0f 94 28 26 call 0x24c50 ; 0x24c50 /// speed up from stop, go half the way current_delay_us = MAX_DELAY; 2c3ac: 20 e1 ldi r18, 0x10 ; 16 2c3ae: 37 e2 ldi r19, 0x27 ; 39 2c3b0: 27 96 adiw r28, 0x07 ; 7 2c3b2: 3f af std Y+63, r19 ; 0x3f 2c3b4: 2e af std Y+62, r18 ; 0x3e 2c3b6: 27 97 sbiw r28, 0x07 ; 7 for (start_z = _Z; _Z < (max_z + start_z) / 2; ++_Z_){ 2c3b8: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c3bc: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c3c0: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c3c4: 30 91 57 06 lds r19, 0x0657 ; 0x800657 2c3c8: 00 5a subi r16, 0xA0 ; 160 2c3ca: 16 4f sbci r17, 0xF6 ; 246 2c3cc: 17 ff sbrs r17, 7 2c3ce: 02 c0 rjmp .+4 ; 0x2c3d4 2c3d0: 0f 5f subi r16, 0xFF ; 255 2c3d2: 1f 4f sbci r17, 0xFF ; 255 2c3d4: 15 95 asr r17 2c3d6: 07 95 ror r16 2c3d8: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c3dc: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c3e0: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c3e4: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c3e8: 80 17 cp r24, r16 2c3ea: 91 07 cpc r25, r17 2c3ec: f4 f4 brge .+60 ; 0x2c42a if (!_PINDA){ 2c3ee: 1c 9b sbis 0x03, 4 ; 3 2c3f0: 1c c0 rjmp .+56 ; 0x2c42a break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); 2c3f2: 28 ec ldi r18, 0xC8 ; 200 2c3f4: 30 e0 ldi r19, 0x00 ; 0 2c3f6: a7 01 movw r20, r14 2c3f8: 68 ee ldi r22, 0xE8 ; 232 2c3fa: 73 e0 ldi r23, 0x03 ; 3 2c3fc: 84 e0 ldi r24, 0x04 ; 4 2c3fe: 0e 94 2d d2 call 0x1a45a ; 0x1a45a /// 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_){ 2c402: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c406: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c40a: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c40e: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c412: 01 96 adiw r24, 0x01 ; 1 2c414: a1 1d adc r26, r1 2c416: b1 1d adc r27, r1 2c418: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c41c: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c420: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c424: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c428: d7 cf rjmp .-82 ; 0x2c3d8 break; } accelerate_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, Z_MIN_DELAY); } if (_PINDA){ 2c42a: 1c 9b sbis 0x03, 4 ; 3 2c42c: 3f c0 rjmp .+126 ; 0x2c4ac steps_to_go = MAX(0, max_z - _Z); 2c42e: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c432: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c436: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c43a: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c43e: e0 e6 ldi r30, 0x60 ; 96 2c440: f9 e0 ldi r31, 0x09 ; 9 2c442: e8 1b sub r30, r24 2c444: f9 0b sbc r31, r25 2c446: cf 01 movw r24, r30 2c448: f7 ff sbrs r31, 7 2c44a: 02 c0 rjmp .+4 ; 0x2c450 2c44c: 90 e0 ldi r25, 0x00 ; 0 2c44e: 80 e0 ldi r24, 0x00 ; 0 2c450: 25 96 adiw r28, 0x05 ; 5 2c452: 9f af std Y+63, r25 ; 0x3f 2c454: 8e af std Y+62, r24 ; 0x3e 2c456: 25 97 sbiw r28, 0x05 ; 5 while (_PINDA && _Z < max_z){ 2c458: 1c 9b sbis 0x03, 4 ; 3 2c45a: 28 c0 rjmp .+80 ; 0x2c4ac 2c45c: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c460: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c464: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c468: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c46c: 80 36 cpi r24, 0x60 ; 96 2c46e: 99 40 sbci r25, 0x09 ; 9 2c470: ec f4 brge .+58 ; 0x2c4ac go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); 2c472: 9e 01 movw r18, r28 2c474: 2d 5b subi r18, 0xBD ; 189 2c476: 3f 4f sbci r19, 0xFF ; 255 2c478: a7 01 movw r20, r14 2c47a: 68 ee ldi r22, 0xE8 ; 232 2c47c: 73 e0 ldi r23, 0x03 ; 3 2c47e: 84 e0 ldi r24, 0x04 ; 4 2c480: 0e 94 d4 d2 call 0x1a5a8 ; 0x1a5a8 ++_Z_; 2c484: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c488: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c48c: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c490: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c494: 01 96 adiw r24, 0x01 ; 1 2c496: a1 1d adc r26, r1 2c498: b1 1d adc r27, r1 2c49a: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c49e: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c4a2: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c4a6: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c4aa: d6 cf rjmp .-84 ; 0x2c458 /// \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); 2c4ac: 60 e0 ldi r22, 0x00 ; 0 2c4ae: 84 e0 ldi r24, 0x04 ; 4 2c4b0: 0e 94 5e d3 call 0x1a6bc ; 0x1a6bc while (delay_us < MAX_DELAY){ 2c4b4: f7 01 movw r30, r14 2c4b6: 20 81 ld r18, Z 2c4b8: 31 81 ldd r19, Z+1 ; 0x01 2c4ba: 20 31 cpi r18, 0x10 ; 16 2c4bc: f7 e2 ldi r31, 0x27 ; 39 2c4be: 3f 07 cpc r19, r31 2c4c0: 58 f4 brcc .+22 ; 0x2c4d8 accelerate_1_step(axes, -dec, delay_us, delay_us); 2c4c2: a7 01 movw r20, r14 2c4c4: 68 e1 ldi r22, 0x18 ; 24 2c4c6: 7c ef ldi r23, 0xFC ; 252 2c4c8: 84 e0 ldi r24, 0x04 ; 4 2c4ca: 0e 94 2d d2 call 0x1a45a ; 0x1a45a update_position_1_step(axes, dir); 2c4ce: 60 e0 ldi r22, 0x00 ; 0 2c4d0: 84 e0 ldi r24, 0x04 ; 4 2c4d2: 0e 94 77 d3 call 0x1a6ee ; 0x1a6ee 2c4d6: ee cf rjmp .-36 ; 0x2c4b4 } } stop_smoothly(Z_AXIS_MASK, Z_PLUS_MASK, Z_ACCEL, current_delay_us); /// move down to trigger sm4_set_dir(Z_AXIS, Z_MINUS); 2c4d8: 61 e0 ldi r22, 0x01 ; 1 2c4da: 82 e0 ldi r24, 0x02 ; 2 2c4dc: 0f 94 28 26 call 0x24c50 ; 0x24c50 /// speed up current_delay_us = MAX_DELAY; 2c4e0: 20 e1 ldi r18, 0x10 ; 16 2c4e2: 37 e2 ldi r19, 0x27 ; 39 2c4e4: f7 01 movw r30, r14 2c4e6: 31 83 std Z+1, r19 ; 0x01 2c4e8: 20 83 st Z, r18 for (start_z = _Z; _Z > (min_z + start_z) / 2; --_Z_){ 2c4ea: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c4ee: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c4f2: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c4f6: 30 91 57 06 lds r19, 0x0657 ; 0x800657 2c4fa: 0c 0d add r16, r12 2c4fc: 1d 1d adc r17, r13 2c4fe: 17 ff sbrs r17, 7 2c500: 02 c0 rjmp .+4 ; 0x2c506 2c502: 0f 5f subi r16, 0xFF ; 255 2c504: 1f 4f sbci r17, 0xFF ; 255 2c506: 15 95 asr r17 2c508: 07 95 ror r16 2c50a: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c50e: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c512: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c516: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c51a: 08 17 cp r16, r24 2c51c: 19 07 cpc r17, r25 2c51e: 0c f0 brlt .+2 ; 0x2c522 2c520: d9 c0 rjmp .+434 ; 0x2c6d4 if (_PINDA){ 2c522: 1c 9b sbis 0x03, 4 ; 3 2c524: bb c0 rjmp .+374 ; 0x2c69c z_trig = _Z; 2c526: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c52a: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c52e: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c532: 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){ 2c536: 1c 99 sbic 0x03, 4 ; 3 2c538: 28 c0 rjmp .+80 ; 0x2c58a steps_to_go = MAX(0, _Z - min_z); 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: 8c 19 sub r24, r12 2c54c: 9d 09 sbc r25, r13 2c54e: 97 ff sbrs r25, 7 2c550: 02 c0 rjmp .+4 ; 0x2c556 2c552: 90 e0 ldi r25, 0x00 ; 0 2c554: 80 e0 ldi r24, 0x00 ; 0 2c556: 25 96 adiw r28, 0x05 ; 5 2c558: 9f af std Y+63, r25 ; 0x3f 2c55a: 8e af std Y+62, r24 ; 0x3e 2c55c: 25 97 sbiw r28, 0x05 ; 5 while (!_PINDA && _Z > min_z){ 2c55e: 1c 99 sbic 0x03, 4 ; 3 2c560: 0c c0 rjmp .+24 ; 0x2c57a 2c562: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c566: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c56a: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c56e: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c572: c8 16 cp r12, r24 2c574: d9 06 cpc r13, r25 2c576: 0c f4 brge .+2 ; 0x2c57a 2c578: af c0 rjmp .+350 ; 0x2c6d8 go_and_stop_1_step(Z_AXIS_MASK, Z_ACCEL, current_delay_us, steps_to_go); --_Z_; } z_trig = _Z; 2c57a: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2c57e: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2c582: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2c586: 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){ 2c58a: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c58e: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c592: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c596: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c59a: c8 16 cp r12, r24 2c59c: d9 06 cpc r13, r25 2c59e: 3c f4 brge .+14 ; 0x2c5ae 2c5a0: f7 01 movw r30, r14 2c5a2: 80 81 ld r24, Z 2c5a4: 91 81 ldd r25, Z+1 ; 0x01 2c5a6: 80 31 cpi r24, 0x10 ; 16 2c5a8: 97 42 sbci r25, 0x27 ; 39 2c5aa: 08 f4 brcc .+2 ; 0x2c5ae 2c5ac: b2 c0 rjmp .+356 ; 0x2c712 2c5ae: 0c 19 sub r16, r12 2c5b0: 1d 09 sbc r17, r13 accelerate_1_step(Z_AXIS_MASK, -Z_ACCEL, current_delay_us, Z_MIN_DELAY); --_Z_; } if (d == 0){ 2c5b2: 31 10 cpse r3, r1 2c5b4: ca c0 rjmp .+404 ; 0x2c74a line_buffer[c] = (uint16_t)(z_trig - min_z); 2c5b6: f3 01 movw r30, r6 2c5b8: ee 0f add r30, r30 2c5ba: ff 1f adc r31, r31 2c5bc: 21 e0 ldi r18, 0x01 ; 1 2c5be: 30 e0 ldi r19, 0x00 ; 0 2c5c0: 2c 0f add r18, r28 2c5c2: 3d 1f adc r19, r29 2c5c4: e2 0f add r30, r18 2c5c6: f3 1f adc r31, r19 2c5c8: 11 83 std Z+1, r17 ; 0x01 2c5ca: 00 83 st Z, r16 2c5cc: ff ef ldi r31, 0xFF ; 255 2c5ce: 6f 1a sub r6, r31 2c5d0: 7f 0a sbc r7, r31 2c5d2: 67 96 adiw r28, 0x17 ; 23 2c5d4: 2e ad ldd r18, Y+62 ; 0x3e 2c5d6: 3f ad ldd r19, Y+63 ; 0x3f 2c5d8: 67 97 sbiw r28, 0x17 ; 23 2c5da: 82 0e add r8, r18 2c5dc: 93 1e adc r9, r19 2c5de: 2d 96 adiw r28, 0x0d ; 13 2c5e0: 8e ad ldd r24, Y+62 ; 0x3e 2c5e2: 9f ad ldd r25, Y+63 ; 0x3f 2c5e4: 2d 97 sbiw r28, 0x0d ; 13 2c5e6: 02 97 sbiw r24, 0x02 ; 2 2c5e8: 2d 96 adiw r28, 0x0d ; 13 2c5ea: 9f af std Y+63, r25 ; 0x3f 2c5ec: 8e af std Y+62, r24 ; 0x3e 2c5ee: 2d 97 sbiw r28, 0x0d ; 13 2c5f0: 2f 96 adiw r28, 0x0f ; 15 2c5f2: ee ad ldd r30, Y+62 ; 0x3e 2c5f4: ff ad ldd r31, Y+63 ; 0x3f 2c5f6: 2f 97 sbiw r28, 0x0f ; 15 2c5f8: 31 97 sbiw r30, 0x01 ; 1 2c5fa: 2f 96 adiw r28, 0x0f ; 15 2c5fc: ff af std Y+63, r31 ; 0x3f 2c5fe: ee af std Y+62, r30 ; 0x3e 2c600: 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 2c602: f0 e2 ldi r31, 0x20 ; 32 2c604: 6f 16 cp r6, r31 2c606: 71 04 cpc r7, r1 2c608: 09 f0 breq .+2 ; 0x2c60c 2c60a: 59 ce rjmp .-846 ; 0x2c2be 2c60c: 21 e0 ldi r18, 0x01 ; 1 2c60e: 42 1a sub r4, r18 2c610: 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){ 2c612: 31 e0 ldi r19, 0x01 ; 1 2c614: 33 12 cpse r3, r19 2c616: 8d ce rjmp .-742 ; 0x2c332 2c618: 61 96 adiw r28, 0x11 ; 17 2c61a: 8e ad ldd r24, Y+62 ; 0x3e 2c61c: 9f ad ldd r25, Y+63 ; 0x3f 2c61e: 61 97 sbiw r28, 0x11 ; 17 2c620: 80 96 adiw r24, 0x20 ; 32 2c622: 61 96 adiw r28, 0x11 ; 17 2c624: 9f af std Y+63, r25 ; 0x3f 2c626: 8e af std Y+62, r24 ; 0x3e 2c628: 61 97 sbiw r28, 0x11 ; 17 2c62a: 2b 96 adiw r28, 0x0b ; 11 2c62c: ee ad ldd r30, Y+62 ; 0x3e 2c62e: ff ad ldd r31, Y+63 ; 0x3f 2c630: 2b 97 sbiw r28, 0x0b ; 11 2c632: e0 5c subi r30, 0xC0 ; 192 2c634: ff 4f sbci r31, 0xFF ; 255 2c636: 2b 96 adiw r28, 0x0b ; 11 2c638: ff af std Y+63, r31 ; 0x3f 2c63a: ee af std Y+62, r30 ; 0x3e 2c63c: 2b 97 sbiw r28, 0x0b ; 11 2c63e: 29 96 adiw r28, 0x09 ; 9 2c640: 2e ad ldd r18, Y+62 ; 0x3e 2c642: 3f ad ldd r19, Y+63 ; 0x3f 2c644: 29 97 sbiw r28, 0x09 ; 9 2c646: 22 50 subi r18, 0x02 ; 2 2c648: 31 09 sbc r19, r1 2c64a: 29 96 adiw r28, 0x09 ; 9 2c64c: 3f af std Y+63, r19 ; 0x3f 2c64e: 2e af std Y+62, r18 ; 0x3e 2c650: 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 2c652: 23 2b or r18, r19 2c654: 09 f0 breq .+2 ; 0x2c658 2c656: 72 cd rjmp .-1308 ; 0x2c13c 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); 2c658: 8c e9 ldi r24, 0x9C ; 156 2c65a: 9d e9 ldi r25, 0x9D ; 157 2c65c: 9f 93 push r25 2c65e: 8f 93 push r24 2c660: 0f 94 43 a3 call 0x34686 ; 0x34686 2c664: 0f 90 pop r0 2c666: 0f 90 pop r0 } 2c668: c6 5a subi r28, 0xA6 ; 166 2c66a: df 4f sbci r29, 0xFF ; 255 2c66c: 0f b6 in r0, 0x3f ; 63 2c66e: f8 94 cli 2c670: de bf out 0x3e, r29 ; 62 2c672: 0f be out 0x3f, r0 ; 63 2c674: cd bf out 0x3d, r28 ; 61 2c676: df 91 pop r29 2c678: cf 91 pop r28 2c67a: 1f 91 pop r17 2c67c: 0f 91 pop r16 2c67e: ff 90 pop r15 2c680: ef 90 pop r14 2c682: df 90 pop r13 2c684: cf 90 pop r12 2c686: bf 90 pop r11 2c688: af 90 pop r10 2c68a: 9f 90 pop r9 2c68c: 8f 90 pop r8 2c68e: 7f 90 pop r7 2c690: 6f 90 pop r6 2c692: 5f 90 pop r5 2c694: 4f 90 pop r4 2c696: 3f 90 pop r3 2c698: 2f 90 pop r2 2c69a: 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); 2c69c: 28 ec ldi r18, 0xC8 ; 200 2c69e: 30 e0 ldi r19, 0x00 ; 0 2c6a0: a7 01 movw r20, r14 2c6a2: 68 ee ldi r22, 0xE8 ; 232 2c6a4: 73 e0 ldi r23, 0x03 ; 3 2c6a6: 84 e0 ldi r24, 0x04 ; 4 2c6a8: 0e 94 2d d2 call 0x1a45a ; 0x1a45a /// 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_){ 2c6ac: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c6b0: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c6b4: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c6b8: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c6bc: 01 97 sbiw r24, 0x01 ; 1 2c6be: a1 09 sbc r26, r1 2c6c0: b1 09 sbc r27, r1 2c6c2: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c6c6: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c6ca: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c6ce: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c6d2: 1b cf rjmp .-458 ; 0x2c50a 2c6d4: 86 01 movw r16, r12 2c6d6: 2f cf rjmp .-418 ; 0x2c536 } /// 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); 2c6d8: 9e 01 movw r18, r28 2c6da: 2d 5b subi r18, 0xBD ; 189 2c6dc: 3f 4f sbci r19, 0xFF ; 255 2c6de: a7 01 movw r20, r14 2c6e0: 68 ee ldi r22, 0xE8 ; 232 2c6e2: 73 e0 ldi r23, 0x03 ; 3 2c6e4: 84 e0 ldi r24, 0x04 ; 4 2c6e6: 0e 94 d4 d2 call 0x1a5a8 ; 0x1a5a8 --_Z_; 2c6ea: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c6ee: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c6f2: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c6f6: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c6fa: 01 97 sbiw r24, 0x01 ; 1 2c6fc: a1 09 sbc r26, r1 2c6fe: b1 09 sbc r27, r1 2c700: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c704: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c708: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c70c: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c710: 26 cf rjmp .-436 ; 0x2c55e } 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); 2c712: 28 ec ldi r18, 0xC8 ; 200 2c714: 30 e0 ldi r19, 0x00 ; 0 2c716: a7 01 movw r20, r14 2c718: 68 e1 ldi r22, 0x18 ; 24 2c71a: 7c ef ldi r23, 0xFC ; 252 2c71c: 84 e0 ldi r24, 0x04 ; 4 2c71e: 0e 94 2d d2 call 0x1a45a ; 0x1a45a --_Z_; 2c722: 80 91 54 06 lds r24, 0x0654 ; 0x800654 2c726: 90 91 55 06 lds r25, 0x0655 ; 0x800655 2c72a: a0 91 56 06 lds r26, 0x0656 ; 0x800656 2c72e: b0 91 57 06 lds r27, 0x0657 ; 0x800657 2c732: 01 97 sbiw r24, 0x01 ; 1 2c734: a1 09 sbc r26, r1 2c736: b1 09 sbc r27, r1 2c738: 80 93 54 06 sts 0x0654, r24 ; 0x800654 2c73c: 90 93 55 06 sts 0x0655, r25 ; 0x800655 2c740: a0 93 56 06 sts 0x0656, r26 ; 0x800656 2c744: b0 93 57 06 sts 0x0657, r27 ; 0x800657 2c748: 20 cf rjmp .-448 ; 0x2c58a 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); 2c74a: 2d 96 adiw r28, 0x0d ; 13 2c74c: ee ad ldd r30, Y+62 ; 0x3e 2c74e: ff ad ldd r31, Y+63 ; 0x3f 2c750: 2d 97 sbiw r28, 0x0d ; 13 2c752: 86 ad ldd r24, Z+62 ; 0x3e 2c754: 97 ad ldd r25, Z+63 ; 0x3f 2c756: 01 2e mov r0, r17 2c758: 00 0c add r0, r0 2c75a: 22 0b sbc r18, r18 2c75c: 33 0b sbc r19, r19 2c75e: 08 0f add r16, r24 2c760: 19 1f adc r17, r25 2c762: 21 1d adc r18, r1 2c764: 31 1d adc r19, r1 2c766: 36 95 lsr r19 2c768: 27 95 ror r18 2c76a: 17 95 ror r17 2c76c: 07 95 ror r16 2c76e: 0f 3f cpi r16, 0xFF ; 255 2c770: 11 05 cpc r17, r1 2c772: 21 05 cpc r18, r1 2c774: 31 05 cpc r19, r1 2c776: 29 f0 breq .+10 ; 0x2c782 2c778: 20 f0 brcs .+8 ; 0x2c782 2c77a: 0f ef ldi r16, 0xFF ; 255 2c77c: 10 e0 ldi r17, 0x00 ; 0 2c77e: 20 e0 ldi r18, 0x00 ; 0 2c780: 30 e0 ldi r19, 0x00 ; 0 2c782: 2f 96 adiw r28, 0x0f ; 15 2c784: ee ad ldd r30, Y+62 ; 0x3e 2c786: ff ad ldd r31, Y+63 ; 0x3f 2c788: 2f 97 sbiw r28, 0x0f ; 15 2c78a: 07 8f std Z+31, r16 ; 0x1f 2c78c: 1f cf rjmp .-450 ; 0x2c5cc 0002c78e : 2c78e: ef 92 push r14 2c790: ff 92 push r15 2c792: 0f 93 push r16 2c794: 1f 93 push r17 2c796: cf 93 push r28 2c798: df 93 push r29 2c79a: cd b7 in r28, 0x3d ; 61 2c79c: de b7 in r29, 0x3e ; 62 2c79e: 2f 97 sbiw r28, 0x0f ; 15 2c7a0: 0f b6 in r0, 0x3f ; 63 2c7a2: f8 94 cli 2c7a4: de bf out 0x3e, r29 ; 62 2c7a6: 0f be out 0x3f, r0 ; 63 2c7a8: cd bf out 0x3d, r28 ; 61 2c7aa: 10 92 90 12 sts 0x1290, r1 ; 0x801290 2c7ae: 02 e9 ldi r16, 0x92 ; 146 2c7b0: 12 e1 ldi r17, 0x12 ; 18 2c7b2: ee 24 eor r14, r14 2c7b4: e3 94 inc r14 2c7b6: f1 2c mov r15, r1 2c7b8: d8 01 movw r26, r16 2c7ba: 11 96 adiw r26, 0x01 ; 1 2c7bc: fc 92 st X, r15 2c7be: ee 92 st -X, r14 2c7c0: 12 96 adiw r26, 0x02 ; 2 2c7c2: 1c 92 st X, r1 2c7c4: 12 97 sbiw r26, 0x02 ; 2 2c7c6: 82 e8 ldi r24, 0x82 ; 130 2c7c8: 13 96 adiw r26, 0x03 ; 3 2c7ca: 8c 93 st X, r24 2c7cc: 40 e0 ldi r20, 0x00 ; 0 2c7ce: 60 e0 ldi r22, 0x00 ; 0 2c7d0: 87 e9 ldi r24, 0x97 ; 151 2c7d2: 92 e1 ldi r25, 0x12 ; 18 2c7d4: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 2c7d8: 40 e0 ldi r20, 0x00 ; 0 2c7da: 60 e0 ldi r22, 0x00 ; 0 2c7dc: 8c e9 ldi r24, 0x9C ; 156 2c7de: 92 e1 ldi r25, 0x12 ; 18 2c7e0: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 2c7e4: f8 01 movw r30, r16 2c7e6: 17 86 std Z+15, r1 ; 0x0f 2c7e8: 10 8a std Z+16, r1 ; 0x10 2c7ea: 11 8a std Z+17, r1 ; 0x11 2c7ec: 12 8a std Z+18, r1 ; 0x12 2c7ee: 13 8a std Z+19, r1 ; 0x13 2c7f0: 8a e0 ldi r24, 0x0A ; 10 2c7f2: 84 8b std Z+20, r24 ; 0x14 2c7f4: 40 e0 ldi r20, 0x00 ; 0 2c7f6: 60 e0 ldi r22, 0x00 ; 0 2c7f8: ce 01 movw r24, r28 2c7fa: 01 96 adiw r24, 0x01 ; 1 2c7fc: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 2c800: 85 e0 ldi r24, 0x05 ; 5 2c802: fe 01 movw r30, r28 2c804: 31 96 adiw r30, 0x01 ; 1 2c806: de 01 movw r26, r28 2c808: 16 96 adiw r26, 0x06 ; 6 2c80a: 01 90 ld r0, Z+ 2c80c: 0d 92 st X+, r0 2c80e: 8a 95 dec r24 2c810: e1 f7 brne .-8 ; 0x2c80a 2c812: 85 e0 ldi r24, 0x05 ; 5 2c814: fe 01 movw r30, r28 2c816: 36 96 adiw r30, 0x06 ; 6 2c818: a7 ea ldi r26, 0xA7 ; 167 2c81a: b2 e1 ldi r27, 0x12 ; 18 2c81c: 01 90 ld r0, Z+ 2c81e: 0d 92 st X+, r0 2c820: 8a 95 dec r24 2c822: e1 f7 brne .-8 ; 0x2c81c 2c824: d8 01 movw r26, r16 2c826: 5a 96 adiw r26, 0x1a ; 26 2c828: 1c 92 st X, r1 2c82a: 5a 97 sbiw r26, 0x1a ; 26 2c82c: 5c 96 adiw r26, 0x1c ; 28 2c82e: 1c 92 st X, r1 2c830: 1e 92 st -X, r1 2c832: 5b 97 sbiw r26, 0x1b ; 27 2c834: 87 ea ldi r24, 0xA7 ; 167 2c836: 92 e1 ldi r25, 0x12 ; 18 2c838: 0f 94 42 4e call 0x29c84 ; 0x29c84 2c83c: f8 01 movw r30, r16 2c83e: 81 8f std Z+25, r24 ; 0x19 2c840: 15 8e std Z+29, r1 ; 0x1d 2c842: 16 8e std Z+30, r1 ; 0x1e 2c844: 40 e0 ldi r20, 0x00 ; 0 2c846: 60 e0 ldi r22, 0x00 ; 0 2c848: 81 eb ldi r24, 0xB1 ; 177 2c84a: 92 e1 ldi r25, 0x12 ; 18 2c84c: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 2c850: d8 01 movw r26, r16 2c852: 94 96 adiw r26, 0x24 ; 36 2c854: 1c 92 st X, r1 2c856: 40 e0 ldi r20, 0x00 ; 0 2c858: 60 e0 ldi r22, 0x00 ; 0 2c85a: ce 01 movw r24, r28 2c85c: 0b 96 adiw r24, 0x0b ; 11 2c85e: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 2c862: 85 e0 ldi r24, 0x05 ; 5 2c864: fe 01 movw r30, r28 2c866: 3b 96 adiw r30, 0x0b ; 11 2c868: de 01 movw r26, r28 2c86a: 11 96 adiw r26, 0x01 ; 1 2c86c: 01 90 ld r0, Z+ 2c86e: 0d 92 st X+, r0 2c870: 8a 95 dec r24 2c872: e1 f7 brne .-8 ; 0x2c86c 2c874: 85 e0 ldi r24, 0x05 ; 5 2c876: fe 01 movw r30, r28 2c878: 31 96 adiw r30, 0x01 ; 1 2c87a: a7 eb ldi r26, 0xB7 ; 183 2c87c: b2 e1 ldi r27, 0x12 ; 18 2c87e: 01 90 ld r0, Z+ 2c880: 0d 92 st X+, r0 2c882: 8a 95 dec r24 2c884: e1 f7 brne .-8 ; 0x2c87e 2c886: f8 01 movw r30, r16 2c888: 12 a6 std Z+42, r1 ; 0x2a 2c88a: 14 a6 std Z+44, r1 ; 0x2c 2c88c: 13 a6 std Z+43, r1 ; 0x2b 2c88e: 87 eb ldi r24, 0xB7 ; 183 2c890: 92 e1 ldi r25, 0x12 ; 18 2c892: 0f 94 42 4e call 0x29c84 ; 0x29c84 2c896: d8 01 movw r26, r16 2c898: 99 96 adiw r26, 0x29 ; 41 2c89a: 8c 93 st X, r24 2c89c: 99 97 sbiw r26, 0x29 ; 41 2c89e: dd 96 adiw r26, 0x3d ; 61 2c8a0: 1c 92 st X, r1 2c8a2: dd 97 sbiw r26, 0x3d ; 61 2c8a4: 81 e9 ldi r24, 0x91 ; 145 2c8a6: 92 e1 ldi r25, 0x12 ; 18 2c8a8: df 96 adiw r26, 0x3f ; 63 2c8aa: 9c 93 st X, r25 2c8ac: 8e 93 st -X, r24 2c8ae: de 97 sbiw r26, 0x3e ; 62 2c8b0: f0 92 d3 12 sts 0x12D3, r15 ; 0x8012d3 2c8b4: e0 92 d2 12 sts 0x12D2, r14 ; 0x8012d2 2c8b8: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 2c8bc: 1f ef ldi r17, 0xFF ; 255 2c8be: 10 93 d5 12 sts 0x12D5, r17 ; 0x8012d5 2c8c2: 0f 94 96 4e call 0x29d2c ; 0x29d2c 2c8c6: 80 93 d6 12 sts 0x12D6, r24 ; 0x8012d6 2c8ca: 10 92 d7 12 sts 0x12D7, r1 ; 0x8012d7 2c8ce: 10 92 d8 12 sts 0x12D8, r1 ; 0x8012d8 2c8d2: 10 92 d9 12 sts 0x12D9, r1 ; 0x8012d9 2c8d6: 10 92 db 12 sts 0x12DB, r1 ; 0x8012db 2c8da: 10 92 da 12 sts 0x12DA, r1 ; 0x8012da 2c8de: 10 92 dd 12 sts 0x12DD, r1 ; 0x8012dd 2c8e2: 10 92 dc 12 sts 0x12DC, r1 ; 0x8012dc 2c8e6: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 2c8ea: 10 92 e1 12 sts 0x12E1, r1 ; 0x8012e1 2c8ee: 10 92 e2 12 sts 0x12E2, r1 ; 0x8012e2 2c8f2: 10 92 e3 12 sts 0x12E3, r1 ; 0x8012e3 2c8f6: 83 e0 ldi r24, 0x03 ; 3 2c8f8: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 2c8fc: 10 92 e7 12 sts 0x12E7, r1 ; 0x8012e7 2c900: 85 e1 ldi r24, 0x15 ; 21 2c902: 80 93 de 12 sts 0x12DE, r24 ; 0x8012de 2c906: 84 e1 ldi r24, 0x14 ; 20 2c908: 80 93 df 12 sts 0x12DF, r24 ; 0x8012df 2c90c: 83 e6 ldi r24, 0x63 ; 99 2c90e: 80 93 e8 12 sts 0x12E8, r24 ; 0x8012e8 2c912: 80 93 e9 12 sts 0x12E9, r24 ; 0x8012e9 2c916: 10 92 ea 12 sts 0x12EA, r1 ; 0x8012ea 2c91a: 10 92 eb 12 sts 0x12EB, r1 ; 0x8012eb 2c91e: 10 92 ec 12 sts 0x12EC, r1 ; 0x8012ec 2c922: 10 92 ed 12 sts 0x12ED, r1 ; 0x8012ed 2c926: 10 92 ee 12 sts 0x12EE, r1 ; 0x8012ee 2c92a: 10 92 ef 12 sts 0x12EF, r1 ; 0x8012ef 2c92e: 10 92 f0 12 sts 0x12F0, r1 ; 0x8012f0 2c932: 10 92 f1 12 sts 0x12F1, r1 ; 0x8012f1 2c936: 10 92 f2 12 sts 0x12F2, r1 ; 0x8012f2 2c93a: 10 92 f3 12 sts 0x12F3, r1 ; 0x8012f3 2c93e: 10 92 f4 12 sts 0x12F4, r1 ; 0x8012f4 2c942: 10 92 f5 12 sts 0x12F5, r1 ; 0x8012f5 2c946: 10 92 f7 12 sts 0x12F7, r1 ; 0x8012f7 2c94a: 10 92 f6 12 sts 0x12F6, r1 ; 0x8012f6 2c94e: 10 92 f8 12 sts 0x12F8, r1 ; 0x8012f8 2c952: 8e e2 ldi r24, 0x2E ; 46 2c954: 90 e8 ldi r25, 0x80 ; 128 2c956: 90 93 fa 12 sts 0x12FA, r25 ; 0x8012fa 2c95a: 80 93 f9 12 sts 0x12F9, r24 ; 0x8012f9 2c95e: 10 93 fb 12 sts 0x12FB, r17 ; 0x8012fb 2c962: 10 93 fc 12 sts 0x12FC, r17 ; 0x8012fc 2c966: 10 92 fe 12 sts 0x12FE, r1 ; 0x8012fe 2c96a: 10 92 fd 12 sts 0x12FD, r1 ; 0x8012fd 2c96e: 10 93 ff 12 sts 0x12FF, r17 ; 0x8012ff 2c972: 82 e0 ldi r24, 0x02 ; 2 2c974: 80 93 00 13 sts 0x1300, r24 ; 0x801300 2c978: 10 92 01 13 sts 0x1301, r1 ; 0x801301 2c97c: 10 92 02 13 sts 0x1302, r1 ; 0x801302 2c980: 10 92 03 13 sts 0x1303, r1 ; 0x801303 2c984: 10 92 04 13 sts 0x1304, r1 ; 0x801304 2c988: 10 92 06 13 sts 0x1306, r1 ; 0x801306 2c98c: 10 92 05 13 sts 0x1305, r1 ; 0x801305 2c990: 10 92 08 13 sts 0x1308, r1 ; 0x801308 2c994: 10 92 07 13 sts 0x1307, r1 ; 0x801307 2c998: 0f 94 84 7c call 0x2f908 ; 0x2f908 2c99c: e5 ed ldi r30, 0xD5 ; 213 2c99e: f3 e1 ldi r31, 0x13 ; 19 2c9a0: 10 92 5d 14 sts 0x145D, r1 ; 0x80145d 2c9a4: 10 92 60 14 sts 0x1460, r1 ; 0x801460 2c9a8: 10 92 82 14 sts 0x1482, r1 ; 0x801482 2c9ac: 10 92 85 14 sts 0x1485, r1 ; 0x801485 2c9b0: 89 e1 ldi r24, 0x19 ; 25 2c9b2: 80 93 44 16 sts 0x1644, r24 ; 0x801644 2c9b6: 10 92 47 16 sts 0x1647, r1 ; 0x801647 2c9ba: 10 92 48 16 sts 0x1648, r1 ; 0x801648 2c9be: 10 92 60 16 sts 0x1660, r1 ; 0x801660 2c9c2: 10 92 67 16 sts 0x1667, r1 ; 0x801667 2c9c6: 10 92 6a 16 sts 0x166A, r1 ; 0x80166a 2c9ca: 10 92 e8 16 sts 0x16E8, r1 ; 0x8016e8 2c9ce: 10 92 ea 16 sts 0x16EA, r1 ; 0x8016ea 2c9d2: 10 92 e9 16 sts 0x16E9, r1 ; 0x8016e9 2c9d6: 10 92 79 15 sts 0x1579, r1 ; 0x801579 2c9da: 10 92 78 15 sts 0x1578, r1 ; 0x801578 2c9de: 10 92 e4 16 sts 0x16E4, r1 ; 0x8016e4 2c9e2: 10 92 e5 16 sts 0x16E5, r1 ; 0x8016e5 2c9e6: 10 92 e6 16 sts 0x16E6, r1 ; 0x8016e6 2c9ea: 10 92 e7 16 sts 0x16E7, r1 ; 0x8016e7 2c9ee: 10 92 eb 16 sts 0x16EB, r1 ; 0x8016eb 2c9f2: 10 92 ec 16 sts 0x16EC, r1 ; 0x8016ec 2c9f6: 10 92 ed 16 sts 0x16ED, r1 ; 0x8016ed 2c9fa: 10 92 ee 16 sts 0x16EE, r1 ; 0x8016ee 2c9fe: 12 82 std Z+2, r1 ; 0x02 2ca00: 13 82 std Z+3, r1 ; 0x03 2ca02: 10 82 st Z, r1 2ca04: 11 82 std Z+1, r1 ; 0x01 2ca06: 10 92 77 15 sts 0x1577, r1 ; 0x801577 2ca0a: 10 92 8a 16 sts 0x168A, r1 ; 0x80168a 2ca0e: e5 ea ldi r30, 0xA5 ; 165 2ca10: f4 e1 ldi r31, 0x14 ; 20 2ca12: 82 ed ldi r24, 0xD2 ; 210 2ca14: df 01 movw r26, r30 2ca16: 1d 92 st X+, r1 2ca18: 8a 95 dec r24 2ca1a: e9 f7 brne .-6 ; 0x2ca16 2ca1c: 10 92 26 14 sts 0x1426, r1 ; 0x801426 2ca20: 10 92 25 14 sts 0x1425, r1 ; 0x801425 2ca24: 10 92 24 14 sts 0x1424, r1 ; 0x801424 2ca28: 88 ee ldi r24, 0xE8 ; 232 2ca2a: 96 e1 ldi r25, 0x16 ; 22 2ca2c: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> 2ca30: ee ec ldi r30, 0xCE ; 206 2ca32: f3 e1 ldi r31, 0x13 ; 19 2ca34: 11 82 std Z+1, r1 ; 0x01 2ca36: 12 82 std Z+2, r1 ; 0x02 2ca38: 13 82 std Z+3, r1 ; 0x03 2ca3a: 14 82 std Z+4, r1 ; 0x04 2ca3c: 15 82 std Z+5, r1 ; 0x05 2ca3e: 16 82 std Z+6, r1 ; 0x06 2ca40: 10 83 st Z, r17 2ca42: e1 ef ldi r30, 0xF1 ; 241 2ca44: f6 e1 ldi r31, 0x16 ; 22 2ca46: 15 82 std Z+5, r1 ; 0x05 2ca48: 17 82 std Z+7, r1 ; 0x07 2ca4a: 16 82 std Z+6, r1 ; 0x06 2ca4c: 11 86 std Z+9, r1 ; 0x09 2ca4e: 13 86 std Z+11, r1 ; 0x0b 2ca50: 12 86 std Z+10, r1 ; 0x0a 2ca52: 0f 94 89 0b call 0x21712 ; 0x21712 2ca56: 60 93 07 17 sts 0x1707, r22 ; 0x801707 2ca5a: 70 93 08 17 sts 0x1708, r23 ; 0x801708 2ca5e: 80 93 09 17 sts 0x1709, r24 ; 0x801709 2ca62: 90 93 0a 17 sts 0x170A, r25 ; 0x80170a 2ca66: 2f 96 adiw r28, 0x0f ; 15 2ca68: 0f b6 in r0, 0x3f ; 63 2ca6a: f8 94 cli 2ca6c: de bf out 0x3e, r29 ; 62 2ca6e: 0f be out 0x3f, r0 ; 63 2ca70: cd bf out 0x3d, r28 ; 61 2ca72: df 91 pop r29 2ca74: cf 91 pop r28 2ca76: 1f 91 pop r17 2ca78: 0f 91 pop r16 2ca7a: ff 90 pop r15 2ca7c: ef 90 pop r14 2ca7e: 08 95 ret 0002ca80 : 2ca80: 42 e0 ldi r20, 0x02 ; 2 2ca82: 0e 94 97 7a call 0xf52e ; 0xf52e } void MarlinSerial::println(double n, int digits) { print(n, digits); println(); 2ca86: 0c 94 0d 7b jmp 0xf61a ; 0xf61a 0002ca8a : 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; 2ca8a: 80 91 e8 12 lds r24, 0x12E8 ; 0x8012e8 2ca8e: 83 36 cpi r24, 0x63 ; 99 2ca90: 09 f4 brne .+2 ; 0x2ca94 2ca92: 8f ef ldi r24, 0xFF ; 255 } 2ca94: 08 95 ret 0002ca96 : , tmcFailures(0) { } void MMU2::Status() { // Useful information to see during bootup and change state SERIAL_ECHOPGM("MMU is "); 2ca96: 82 ef ldi r24, 0xF2 ; 242 2ca98: 92 ea ldi r25, 0xA2 ; 162 2ca9a: 0e 94 15 7b call 0xf62a ; 0xf62a uint8_t status = eeprom_init_default_byte((uint8_t*)EEPROM_MMU_ENABLED, 0); 2ca9e: 60 e0 ldi r22, 0x00 ; 0 2caa0: 8c ea ldi r24, 0xAC ; 172 2caa2: 9c e0 ldi r25, 0x0C ; 12 2caa4: 0e 94 ae 78 call 0xf15c ; 0xf15c if (status == 1) { 2caa8: 81 30 cpi r24, 0x01 ; 1 2caaa: 21 f4 brne .+8 ; 0x2cab4 SERIAL_ECHOLNRPGM(_O(MSG_ON)); 2caac: 8e e5 ldi r24, 0x5E ; 94 2caae: 93 e6 ldi r25, 0x63 ; 99 } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); 2cab0: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c 2cab4: 88 e5 ldi r24, 0x58 ; 88 2cab6: 93 e6 ldi r25, 0x63 ; 99 2cab8: fb cf rjmp .-10 ; 0x2cab0 0002caba : print((unsigned long) b, base); } void MarlinSerial::print(int n, int base) { print((long) n, base); 2caba: bc 01 movw r22, r24 2cabc: 99 0f add r25, r25 2cabe: 88 0b sbc r24, r24 2cac0: 99 0b sbc r25, r25 2cac2: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 } void MarlinSerial::println(int n, int base) { print(n, base); println(); 2cac6: 0c 94 0d 7b jmp 0xf61a ; 0xf61a 0002caca : 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){ 2caca: cf 93 push r28 2cacc: c8 2f mov r28, r24 extruder = ex; 2cace: 80 93 e8 12 sts 0x12E8, r24 ; 0x8012e8 MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); 2cad2: 84 ee ldi r24, 0xE4 ; 228 2cad4: 92 ea ldi r25, 0xA2 ; 162 2cad6: 0e 94 15 7b call 0xf62a ; 0xf62a 2cada: 88 ed ldi r24, 0xD8 ; 216 2cadc: 92 ea ldi r25, 0xA2 ; 162 2cade: 0e 94 15 7b call 0xf62a ; 0xf62a 2cae2: 8e ec ldi r24, 0xCE ; 206 2cae4: 92 ea ldi r25, 0xA2 ; 162 2cae6: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN((int)ex); 2caea: 8c 2f mov r24, r28 2caec: 90 e0 ldi r25, 0x00 ; 0 } 2caee: cf 91 pop r28 } void MMU2::SetCurrentTool(uint8_t ex){ extruder = ex; MMU2_ECHO_MSGRPGM(PSTR("MMU2tool=")); SERIAL_ECHOLN((int)ex); 2caf0: 0d 94 5d 65 jmp 0x2caba ; 0x2caba 0002caf4 : return 0; } } //------------------------------------------------------------------------------ void Sd2Card::chipSelectHigh() { WRITE(SDSS, 1); 2caf4: 28 9a sbi 0x05, 0 ; 5 } 2caf6: 08 95 ret 0002caf8 : spiRate_ = sckRateID; return true; } //------------------------------------------------------------------------------ // wait for card to go not busy bool Sd2Card::waitNotBusy(uint16_t timeoutMillis) { 2caf8: 0f 93 push r16 2cafa: 1f 93 push r17 2cafc: cf 93 push r28 2cafe: df 93 push r29 2cb00: ec 01 movw r28, r24 uint16_t t0 = _millis(); 2cb02: 0f 94 89 0b call 0x21712 ; 0x21712 2cb06: 8b 01 movw r16, r22 while (spiRec() != 0XFF) { 2cb08: 0f 94 56 26 call 0x24cac ; 0x24cac 2cb0c: 8f 3f cpi r24, 0xFF ; 255 2cb0e: 69 f0 breq .+26 ; 0x2cb2a if (((uint16_t)_millis() - t0) >= timeoutMillis) goto fail; 2cb10: 0f 94 89 0b call 0x21712 ; 0x21712 2cb14: 60 1b sub r22, r16 2cb16: 71 0b sbc r23, r17 2cb18: 6c 17 cp r22, r28 2cb1a: 7d 07 cpc r23, r29 2cb1c: a8 f3 brcs .-22 ; 0x2cb08 } return true; fail: return false; 2cb1e: 80 e0 ldi r24, 0x00 ; 0 } 2cb20: df 91 pop r29 2cb22: cf 91 pop r28 2cb24: 1f 91 pop r17 2cb26: 0f 91 pop r16 2cb28: 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; 2cb2a: 81 e0 ldi r24, 0x01 ; 1 2cb2c: f9 cf rjmp .-14 ; 0x2cb20 0002cb2e : lastnr++; } void CardReader::closefile(bool store_location) { file.sync(); 2cb2e: 87 e6 ldi r24, 0x67 ; 103 2cb30: 96 e1 ldi r25, 0x16 ; 22 2cb32: 0f 94 40 2c call 0x25880 ; 0x25880 file.close(); 2cb36: 87 e6 ldi r24, 0x67 ; 103 2cb38: 96 e1 ldi r25, 0x16 ; 22 2cb3a: 0f 94 75 2c call 0x258ea ; 0x258ea saving = false; 2cb3e: e5 ed ldi r30, 0xD5 ; 213 2cb40: f3 e1 ldi r31, 0x13 ; 19 2cb42: 10 82 st Z, r1 logging = false; 2cb44: 11 82 std Z+1, r1 ; 0x01 // so one can unplug the printer and continue printing the next day. } } 2cb46: 08 95 ret 0002cb48 : //! 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) 2cb48: cf 92 push r12 2cb4a: df 92 push r13 2cb4c: ef 92 push r14 2cb4e: ff 92 push r15 2cb50: 0f 93 push r16 2cb52: 1f 93 push r17 2cb54: cf 93 push r28 2cb56: df 93 push r29 { if (saved_printing) return; 2cb58: 20 91 73 12 lds r18, 0x1273 ; 0x801273 2cb5c: 21 11 cpse r18, r1 2cb5e: d9 c0 rjmp .+434 ; 0x2cd12 2cb60: 09 2f mov r16, r25 2cb62: 18 2f mov r17, r24 2cb64: eb 01 movw r28, r22 cli(); 2cb66: f8 94 cli void save_print_file_state() { uint8_t nlines; uint16_t sdlen_cmdqueue; uint16_t sdlen_planner; if (card.sdprinting) { 2cb68: 80 91 d7 13 lds r24, 0x13D7 ; 0x8013d7 2cb6c: 88 23 and r24, r24 2cb6e: 09 f4 brne .+2 ; 0x2cb72 2cb70: d9 c0 rjmp .+434 ; 0x2cd24 saved_sdpos = sdpos_atomic; //atomic sd position of last command added in queue 2cb72: 80 91 49 12 lds r24, 0x1249 ; 0x801249 2cb76: 90 91 4a 12 lds r25, 0x124A ; 0x80124a 2cb7a: a0 91 4b 12 lds r26, 0x124B ; 0x80124b 2cb7e: b0 91 4c 12 lds r27, 0x124C ; 0x80124c 2cb82: 80 93 45 12 sts 0x1245, r24 ; 0x801245 2cb86: 90 93 46 12 sts 0x1246, r25 ; 0x801246 2cb8a: a0 93 47 12 sts 0x1247, r26 ; 0x801247 2cb8e: b0 93 48 12 sts 0x1248, r27 ; 0x801248 sdlen_planner = planner_calc_sd_length(); //length of sd commands in planner 2cb92: 0f 94 02 3a call 0x27404 ; 0x27404 saved_sdpos -= sdlen_planner; 2cb96: c0 90 45 12 lds r12, 0x1245 ; 0x801245 2cb9a: d0 90 46 12 lds r13, 0x1246 ; 0x801246 2cb9e: e0 90 47 12 lds r14, 0x1247 ; 0x801247 2cba2: f0 90 48 12 lds r15, 0x1248 ; 0x801248 2cba6: c8 1a sub r12, r24 2cba8: d9 0a sbc r13, r25 2cbaa: e1 08 sbc r14, r1 2cbac: f1 08 sbc r15, r1 2cbae: c0 92 45 12 sts 0x1245, r12 ; 0x801245 2cbb2: d0 92 46 12 sts 0x1246, r13 ; 0x801246 2cbb6: e0 92 47 12 sts 0x1247, r14 ; 0x801247 2cbba: f0 92 48 12 sts 0x1248, r15 ; 0x801248 sdlen_cmdqueue = cmdqueue_calc_sd_length(); //length of sd commands in cmdqueue 2cbbe: 0e 94 54 79 call 0xf2a8 ; 0xf2a8 saved_sdpos -= sdlen_cmdqueue; 2cbc2: c8 1a sub r12, r24 2cbc4: d9 0a sbc r13, r25 2cbc6: e1 08 sbc r14, r1 2cbc8: f1 08 sbc r15, r1 2cbca: c0 92 45 12 sts 0x1245, r12 ; 0x801245 2cbce: d0 92 46 12 sts 0x1246, r13 ; 0x801246 2cbd2: e0 92 47 12 sts 0x1247, r14 ; 0x801247 2cbd6: f0 92 48 12 sts 0x1248, r15 ; 0x801248 saved_printing_type = PowerPanic::PRINT_TYPE_SD; 2cbda: 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; 2cbde: 80 91 72 12 lds r24, 0x1272 ; 0x801272 2cbe2: f0 90 71 12 lds r15, 0x1271 ; 0x801271 2cbe6: 81 11 cpse r24, r1 2cbe8: 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)) 2cbea: 20 91 51 12 lds r18, 0x1251 ; 0x801251 2cbee: 30 91 52 12 lds r19, 0x1252 ; 0x801252 2cbf2: 21 15 cp r18, r1 2cbf4: 31 05 cpc r19, r1 2cbf6: 09 f4 brne .+2 ; 0x2cbfa 2cbf8: d1 c0 rjmp .+418 ; 0x2cd9c 2cbfa: 81 11 cpse r24, r1 2cbfc: cf c0 rjmp .+414 ; 0x2cd9c 2cbfe: 80 91 71 12 lds r24, 0x1271 ; 0x801271 2cc02: 81 11 cpse r24, r1 2cc04: cb c0 rjmp .+406 ; 0x2cd9c { memcpy(saved_start_position, current_block->gcode_start_position, sizeof(saved_start_position)); 2cc06: f9 01 movw r30, r18 2cc08: e8 5a subi r30, 0xA8 ; 168 2cc0a: ff 4f sbci r31, 0xFF ; 255 2cc0c: 80 e1 ldi r24, 0x10 ; 16 2cc0e: ae e7 ldi r26, 0x7E ; 126 2cc10: b2 e0 ldi r27, 0x02 ; 2 2cc12: 01 90 ld r0, Z+ 2cc14: 0d 92 st X+, r0 2cc16: 8a 95 dec r24 2cc18: e1 f7 brne .-8 ; 0x2cc12 saved_feedrate2 = current_block->gcode_feedrate; 2cc1a: f9 01 movw r30, r18 2cc1c: e6 59 subi r30, 0x96 ; 150 2cc1e: ff 4f sbci r31, 0xFF ; 255 2cc20: 80 81 ld r24, Z 2cc22: 91 81 ldd r25, Z+1 ; 0x01 2cc24: 90 93 50 12 sts 0x1250, r25 ; 0x801250 2cc28: 80 93 4f 12 sts 0x124F, r24 ; 0x80124f saved_segment_idx = current_block->segment_idx; 2cc2c: 28 59 subi r18, 0x98 ; 152 2cc2e: 3f 4f sbci r19, 0xFF ; 255 2cc30: f9 01 movw r30, r18 2cc32: 80 81 ld r24, Z 2cc34: 91 81 ldd r25, Z+1 ; 0x01 2cc36: 90 93 4e 12 sts 0x124E, r25 ; 0x80124e 2cc3a: 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 2cc3e: 0f 94 87 4c call 0x2990e ; 0x2990e memcpy(saved_pos, current_position, sizeof(saved_pos)); 2cc42: 80 e1 ldi r24, 0x10 ; 16 2cc44: e1 e6 ldi r30, 0x61 ; 97 2cc46: f2 e1 ldi r31, 0x12 ; 18 2cc48: a0 e9 ldi r26, 0x90 ; 144 2cc4a: b2 e0 ldi r27, 0x02 ; 2 2cc4c: 01 90 ld r0, Z+ 2cc4e: 0d 92 st X+, r0 2cc50: 8a 95 dec r24 2cc52: e1 f7 brne .-8 ; 0x2cc4c if (pos_invalid) saved_pos[X_AXIS] = X_COORD_INVALID; 2cc54: ff 20 and r15, r15 2cc56: 61 f0 breq .+24 ; 0x2cc70 2cc58: 80 e0 ldi r24, 0x00 ; 0 2cc5a: 90 e0 ldi r25, 0x00 ; 0 2cc5c: a0 e8 ldi r26, 0x80 ; 128 2cc5e: bf eb ldi r27, 0xBF ; 191 2cc60: 80 93 90 02 sts 0x0290, r24 ; 0x800290 2cc64: 90 93 91 02 sts 0x0291, r25 ; 0x800291 2cc68: a0 93 92 02 sts 0x0292, r26 ; 0x800292 2cc6c: b0 93 93 02 sts 0x0293, r27 ; 0x800293 saved_feedmultiply2 = feedmultiply; //save feedmultiply 2cc70: 80 91 8e 02 lds r24, 0x028E ; 0x80028e 2cc74: 90 91 8f 02 lds r25, 0x028F ; 0x80028f 2cc78: 90 93 60 12 sts 0x1260, r25 ; 0x801260 <_ZL19saved_feedmultiply2.lto_priv.495+0x1> 2cc7c: 80 93 5f 12 sts 0x125F, r24 ; 0x80125f <_ZL19saved_feedmultiply2.lto_priv.495> saved_extruder_temperature = (uint16_t)degTargetHotend(active_extruder); 2cc80: 80 91 5d 12 lds r24, 0x125D ; 0x80125d 2cc84: 90 91 5e 12 lds r25, 0x125E ; 0x80125e 2cc88: 90 93 5c 12 sts 0x125C, r25 ; 0x80125c 2cc8c: 80 93 5b 12 sts 0x125B, r24 ; 0x80125b saved_bed_temperature = (uint8_t)degTargetBed(); 2cc90: 80 91 59 12 lds r24, 0x1259 ; 0x801259 2cc94: 80 93 58 12 sts 0x1258, r24 ; 0x801258 saved_extruder_relative_mode = axis_relative_modes & E_AXIS_MASK; 2cc98: 80 91 57 12 lds r24, 0x1257 ; 0x801257 2cc9c: 83 fb bst r24, 3 2cc9e: 88 27 eor r24, r24 2cca0: 80 f9 bld r24, 0 2cca2: 80 93 56 12 sts 0x1256, r24 ; 0x801256 saved_fan_speed = fanSpeed; 2cca6: 80 91 55 12 lds r24, 0x1255 ; 0x801255 2ccaa: 80 93 54 12 sts 0x1254, r24 ; 0x801254 cmdqueue_reset(); //empty cmdqueue 2ccae: 0e 94 b5 83 call 0x1076a ; 0x1076a card.sdprinting = false; 2ccb2: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 // card.closefile(); saved_printing = true; 2ccb6: 81 e0 ldi r24, 0x01 ; 1 2ccb8: 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(); 2ccbc: 0f 94 de 18 call 0x231bc ; 0x231bc sei(); 2ccc0: 78 94 sei if ((z_move != 0) || (e_move != 0)) { // extruder or z move 2ccc2: 20 e0 ldi r18, 0x00 ; 0 2ccc4: 30 e0 ldi r19, 0x00 ; 0 2ccc6: a9 01 movw r20, r18 2ccc8: f8 01 movw r30, r16 2ccca: 6c 2f mov r22, r28 2cccc: 7d 2f mov r23, r29 2ccce: 8f 2f mov r24, r31 2ccd0: 90 2f mov r25, r16 2ccd2: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2ccd6: 88 23 and r24, r24 2ccd8: e1 f0 breq .+56 ; 0x2cd12 // move away from the print. if(e_move) { // First unretract (relative extrusion) if(!saved_extruder_relative_mode){ 2ccda: 80 91 56 12 lds r24, 0x1256 ; 0x801256 2ccde: 81 11 cpse r24, r1 2cce0: 05 c0 rjmp .+10 ; 0x2ccec enquecommand_P(MSG_M83); 2cce2: 61 e0 ldi r22, 0x01 ; 1 2cce4: 87 e5 ldi r24, 0x57 ; 87 2cce6: 9d e6 ldi r25, 0x6D ; 109 2cce8: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 // 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); 2ccec: 0f 93 push r16 2ccee: 1f 93 push r17 2ccf0: df 93 push r29 2ccf2: cf 93 push r28 2ccf4: 87 e4 ldi r24, 0x47 ; 71 2ccf6: 9d e6 ldi r25, 0x6D ; 109 2ccf8: 9f 93 push r25 2ccfa: 8f 93 push r24 2ccfc: 0e 94 28 8e call 0x11c50 ; 0x11c50 2cd00: 81 e0 ldi r24, 0x01 ; 1 2cd02: 80 93 53 12 sts 0x1253, r24 ; 0x801253 2cd06: 0f 90 pop r0 2cd08: 0f 90 pop r0 2cd0a: 0f 90 pop r0 2cd0c: 0f 90 pop r0 2cd0e: 0f 90 pop r0 2cd10: 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(); } } 2cd12: df 91 pop r29 2cd14: cf 91 pop r28 2cd16: 1f 91 pop r17 2cd18: 0f 91 pop r16 2cd1a: ff 90 pop r15 2cd1c: ef 90 pop r14 2cd1e: df 90 pop r13 2cd20: cf 90 pop r12 2cd22: 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 2cd24: 80 91 42 12 lds r24, 0x1242 ; 0x801242 2cd28: 88 23 and r24, r24 2cd2a: b1 f1 breq .+108 ; 0x2cd98 saved_sdpos = gcode_LastN; //start with line number of command added recently to cmd queue 2cd2c: 80 91 3e 12 lds r24, 0x123E ; 0x80123e 2cd30: 90 91 3f 12 lds r25, 0x123F ; 0x80123f 2cd34: a0 91 40 12 lds r26, 0x1240 ; 0x801240 2cd38: b0 91 41 12 lds r27, 0x1241 ; 0x801241 2cd3c: 80 93 45 12 sts 0x1245, r24 ; 0x801245 2cd40: 90 93 46 12 sts 0x1246, r25 ; 0x801246 2cd44: a0 93 47 12 sts 0x1247, r26 ; 0x801247 2cd48: 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 2cd4c: 0f 94 02 3a call 0x27404 ; 0x27404 saved_sdpos -= nlines; 2cd50: 40 91 45 12 lds r20, 0x1245 ; 0x801245 2cd54: 50 91 46 12 lds r21, 0x1246 ; 0x801246 2cd58: 60 91 47 12 lds r22, 0x1247 ; 0x801247 2cd5c: 70 91 48 12 lds r23, 0x1248 ; 0x801248 2cd60: 48 1b sub r20, r24 2cd62: 51 09 sbc r21, r1 2cd64: 61 09 sbc r22, r1 2cd66: 71 09 sbc r23, r1 saved_sdpos -= buflen; //number of blocks in cmd buffer 2cd68: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 2cd6c: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 2cd70: 09 2e mov r0, r25 2cd72: 00 0c add r0, r0 2cd74: aa 0b sbc r26, r26 2cd76: bb 0b sbc r27, r27 2cd78: 48 1b sub r20, r24 2cd7a: 59 0b sbc r21, r25 2cd7c: 6a 0b sbc r22, r26 2cd7e: 7b 0b sbc r23, r27 2cd80: 40 93 45 12 sts 0x1245, r20 ; 0x801245 2cd84: 50 93 46 12 sts 0x1246, r21 ; 0x801246 2cd88: 60 93 47 12 sts 0x1247, r22 ; 0x801247 2cd8c: 70 93 48 12 sts 0x1248, r23 ; 0x801248 saved_printing_type = PowerPanic::PRINT_TYPE_HOST; 2cd90: 81 e0 ldi r24, 0x01 ; 1 } else { saved_printing_type = PowerPanic::PRINT_TYPE_NONE; 2cd92: 80 93 79 02 sts 0x0279, r24 ; 0x800279 2cd96: 23 cf rjmp .-442 ; 0x2cbde 2cd98: 82 e0 ldi r24, 0x02 ; 2 2cd9a: fb cf rjmp .-10 ; 0x2cd92 saved_feedrate2 = current_block->gcode_feedrate; saved_segment_idx = current_block->segment_idx; } else { saved_start_position[0] = SAVED_START_POSITION_UNSET; 2cd9c: 80 e0 ldi r24, 0x00 ; 0 2cd9e: 90 e0 ldi r25, 0x00 ; 0 2cda0: a0 e8 ldi r26, 0x80 ; 128 2cda2: bf eb ldi r27, 0xBF ; 191 2cda4: 80 93 7e 02 sts 0x027E, r24 ; 0x80027e 2cda8: 90 93 7f 02 sts 0x027F, r25 ; 0x80027f 2cdac: a0 93 80 02 sts 0x0280, r26 ; 0x800280 2cdb0: b0 93 81 02 sts 0x0281, r27 ; 0x800281 saved_feedrate2 = feedrate; 2cdb4: 60 91 7a 02 lds r22, 0x027A ; 0x80027a 2cdb8: 70 91 7b 02 lds r23, 0x027B ; 0x80027b 2cdbc: 80 91 7c 02 lds r24, 0x027C ; 0x80027c 2cdc0: 90 91 7d 02 lds r25, 0x027D ; 0x80027d 2cdc4: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 2cdc8: 70 93 50 12 sts 0x1250, r23 ; 0x801250 2cdcc: 60 93 4f 12 sts 0x124F, r22 ; 0x80124f saved_segment_idx = 0; 2cdd0: 10 92 4e 12 sts 0x124E, r1 ; 0x80124e 2cdd4: 10 92 4d 12 sts 0x124D, r1 ; 0x80124d 2cdd8: 32 cf rjmp .-412 ; 0x2cc3e 0002cdda : // "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) { 2cdda: 80 91 3b 12 lds r24, 0x123B ; 0x80123b 2cdde: 81 11 cpse r24, r1 2cde0: 24 c0 rjmp .+72 ; 0x2ce2a Stopped = true; 2cde2: 81 e0 ldi r24, 0x01 ; 1 2cde4: 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); 2cde8: 61 e0 ldi r22, 0x01 ; 1 2cdea: 80 e0 ldi r24, 0x00 ; 0 2cdec: 0e 94 e1 dc call 0x1b9c2 ; 0x1b9c2 } // Report the error on the serial serialprintPGM(allow_recovery ? echomagic : errormagic); 2cdf0: 87 ec ldi r24, 0xC7 ; 199 2cdf2: 92 ea ldi r25, 0xA2 ; 162 2cdf4: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORLNRPGM(MSG_ERR_STOPPED); 2cdf8: 82 e1 ldi r24, 0x12 ; 18 2cdfa: 9d e6 ldi r25, 0x6D ; 109 2cdfc: 0e 94 0e 7d call 0xfa1c ; 0xfa1c // 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)); 2ce00: 8b e4 ldi r24, 0x4B ; 75 2ce02: 93 e6 ldi r25, 0x63 ; 99 2ce04: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2ce08: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 // 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); 2ce0c: 9f b7 in r25, 0x3f ; 63 2ce0e: f8 94 cli 2ce10: 80 91 02 01 lds r24, 0x0102 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2ce14: 84 60 ori r24, 0x04 ; 4 2ce16: 80 93 02 01 sts 0x0102, r24 ; 0x800102 <__TEXT_REGION_LENGTH__+0x7c2102> 2ce1a: 9f bf out 0x3f, r25 ; 63 // Always return to the status screen to ensure the NEW error is immediately shown. lcd_return_to_status(); 2ce1c: 0f 94 6e 05 call 0x20adc ; 0x20adc if(!allow_recovery) { // prevent menu access for all fatal errors menu_set_block(MENU_BLOCK_THERMAL_ERROR); 2ce20: 80 91 3a 12 lds r24, 0x123A ; 0x80123a 2ce24: 81 60 ori r24, 0x01 ; 1 2ce26: 80 93 3a 12 sts 0x123A, r24 ; 0x80123a } } } 2ce2a: 08 95 ret 0002ce2c : bool cmd_buffer_empty() { return (buflen == 0); } void enquecommand_front(const char *cmd, bool from_progmem) 2ce2c: 0f 93 push r16 2ce2e: 1f 93 push r17 2ce30: cf 93 push r28 2ce32: df 93 push r29 2ce34: ec 01 movw r28, r24 2ce36: 0f 94 3f a2 call 0x3447e ; 0x3447e <__strlen_P> 2ce3a: 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) 2ce3c: 80 36 cpi r24, 0x60 ; 96 2ce3e: 91 05 cpc r25, r1 2ce40: 08 f0 brcs .+2 ; 0x2ce44 2ce42: 85 c0 rjmp .+266 ; 0x2cf4e return false; // Remove the currently processed command from the queue. if (! cmdbuffer_front_already_processed) { 2ce44: 80 91 53 12 lds r24, 0x1253 ; 0x801253 2ce48: 81 11 cpse r24, r1 2ce4a: 05 c0 rjmp .+10 ; 0x2ce56 cmdqueue_pop_front(); 2ce4c: 0e 94 94 79 call 0xf328 ; 0xf328 cmdbuffer_front_already_processed = true; 2ce50: 81 e0 ldi r24, 0x01 ; 1 2ce52: 80 93 53 12 sts 0x1253, r24 ; 0x801253 } if (bufindr == bufindw && buflen > 0) 2ce56: 40 91 38 12 lds r20, 0x1238 ; 0x801238 2ce5a: 50 91 39 12 lds r21, 0x1239 ; 0x801239 2ce5e: 80 91 49 10 lds r24, 0x1049 ; 0x801049 <_ZL7bufindw.lto_priv.511> 2ce62: 90 91 4a 10 lds r25, 0x104A ; 0x80104a <_ZL7bufindw.lto_priv.511+0x1> 2ce66: 48 17 cp r20, r24 2ce68: 59 07 cpc r21, r25 2ce6a: 41 f4 brne .+16 ; 0x2ce7c 2ce6c: 20 91 3c 12 lds r18, 0x123C ; 0x80123c 2ce70: 30 91 3d 12 lds r19, 0x123D ; 0x80123d 2ce74: 12 16 cp r1, r18 2ce76: 13 06 cpc r1, r19 2ce78: 0c f4 brge .+2 ; 0x2ce7c 2ce7a: 69 c0 rjmp .+210 ; 0x2cf4e // 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; 2ce7c: 20 91 47 10 lds r18, 0x1047 ; 0x801047 2ce80: 30 91 48 10 lds r19, 0x1048 ; 0x801048 2ce84: 12 16 cp r1, r18 2ce86: 13 06 cpc r1, r19 2ce88: 0c f0 brlt .+2 ; 0x2ce8c 2ce8a: 41 c0 rjmp .+130 ; 0x2cf0e 2ce8c: 9c 01 movw r18, r24 2ce8e: 2f 59 subi r18, 0x9F ; 159 2ce90: 3f 4f sbci r19, 0xFF ; 255 if (bufindw < bufindr) { 2ce92: 84 17 cp r24, r20 2ce94: 95 07 cpc r25, r21 2ce96: e8 f5 brcc .+122 ; 0x2cf12 int bufindr_new = bufindr - len_asked - (1 + CMDHDRSIZE); 2ce98: 44 50 subi r20, 0x04 ; 4 2ce9a: 51 09 sbc r21, r1 2ce9c: 40 1b sub r20, r16 2ce9e: 51 0b sbc r21, r17 // Simple case. There is a contiguous space between the write buffer and the read buffer. if (endw <= bufindr_new) { 2cea0: 42 17 cp r20, r18 2cea2: 53 07 cpc r21, r19 2cea4: 0c f4 brge .+2 ; 0x2cea8 2cea6: 53 c0 rjmp .+166 ; 0x2cf4e } } 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); 2cea8: 50 93 39 12 sts 0x1239, r21 ; 0x801239 2ceac: 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; 2ceb0: 80 91 38 12 lds r24, 0x1238 ; 0x801238 2ceb4: 90 91 39 12 lds r25, 0x1239 ; 0x801239 2ceb8: fc 01 movw r30, r24 2ceba: e5 5b subi r30, 0xB5 ; 181 2cebc: ff 4e sbci r31, 0xEF ; 239 2cebe: 23 e0 ldi r18, 0x03 ; 3 2cec0: 20 83 st Z, r18 if (from_progmem) strcpy_P(cmdbuffer + bufindr + CMDHDRSIZE, cmd); 2cec2: be 01 movw r22, r28 2cec4: 82 5b subi r24, 0xB2 ; 178 2cec6: 9f 4e sbci r25, 0xEF ; 239 2cec8: 0f 94 38 a2 call 0x34470 ; 0x34470 else strcpy(cmdbuffer + bufindr + CMDHDRSIZE, cmd); ++ buflen; 2cecc: 80 91 3c 12 lds r24, 0x123C ; 0x80123c 2ced0: 90 91 3d 12 lds r25, 0x123D ; 0x80123d 2ced4: 01 96 adiw r24, 0x01 ; 1 2ced6: 90 93 3d 12 sts 0x123D, r25 ; 0x80123d 2ceda: 80 93 3c 12 sts 0x123C, r24 ; 0x80123c SERIAL_ECHO_START; 2cede: 84 ee ldi r24, 0xE4 ; 228 2cee0: 92 ea ldi r25, 0xA2 ; 162 2cee2: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(enqueingFront); 2cee6: 8e ea ldi r24, 0xAE ; 174 2cee8: 92 ea ldi r25, 0xA2 ; 162 2ceea: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHO(cmdbuffer + bufindr + CMDHDRSIZE); 2ceee: 80 91 38 12 lds r24, 0x1238 ; 0x801238 2cef2: 90 91 39 12 lds r25, 0x1239 ; 0x801239 2cef6: 82 5b subi r24, 0xB2 ; 178 2cef8: 9f 4e sbci r25, 0xEF ; 239 2cefa: 0e 94 0e 86 call 0x10c1c ; 0x10c1c SERIAL_ECHOLNPGM("\""); 2cefe: 8c ea ldi r24, 0xAC ; 172 2cf00: 92 ea ldi r25, 0xA2 ; 162 SERIAL_ECHOLNRPGM(bufferFull); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } } 2cf02: df 91 pop r29 2cf04: cf 91 pop r28 2cf06: 1f 91 pop r17 2cf08: 0f 91 pop r16 SERIAL_ECHORPGM(enqueingFront); if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2cf0a: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c // 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) 2cf0e: 9c 01 movw r18, r24 2cf10: c0 cf rjmp .-128 ; 0x2ce92 bufindr = bufindr_new; return true; } } else { // Otherwise the free space is split between the start and end. if (len_asked + (1 + CMDHDRSIZE) <= bufindr) { 2cf12: c8 01 movw r24, r16 2cf14: 04 96 adiw r24, 0x04 ; 4 2cf16: 48 17 cp r20, r24 2cf18: 59 07 cpc r21, r25 2cf1a: 28 f0 brcs .+10 ; 0x2cf26 // Could fit at the start. bufindr -= len_asked + (1 + CMDHDRSIZE); 2cf1c: 44 50 subi r20, 0x04 ; 4 2cf1e: 51 09 sbc r21, r1 2cf20: 40 1b sub r20, r16 2cf22: 51 0b sbc r21, r17 2cf24: c1 cf rjmp .-126 ; 0x2cea8 return true; } int bufindr_new = sizeof(cmdbuffer) - len_asked - (1 + CMDHDRSIZE); 2cf26: 89 ee ldi r24, 0xE9 ; 233 2cf28: 91 e0 ldi r25, 0x01 ; 1 2cf2a: bc 01 movw r22, r24 2cf2c: 60 1b sub r22, r16 2cf2e: 71 0b sbc r23, r17 2cf30: 8b 01 movw r16, r22 if (endw <= bufindr_new) { 2cf32: 62 17 cp r22, r18 2cf34: 73 07 cpc r23, r19 2cf36: 5c f0 brlt .+22 ; 0x2cf4e memset(cmdbuffer, 0, bufindr); 2cf38: 70 e0 ldi r23, 0x00 ; 0 2cf3a: 60 e0 ldi r22, 0x00 ; 0 2cf3c: 8b e4 ldi r24, 0x4B ; 75 2cf3e: 90 e1 ldi r25, 0x10 ; 16 2cf40: 0f 94 b3 aa call 0x35566 ; 0x35566 bufindr = bufindr_new; 2cf44: 10 93 39 12 sts 0x1239, r17 ; 0x801239 2cf48: 00 93 38 12 sts 0x1238, r16 ; 0x801238 2cf4c: b1 cf rjmp .-158 ; 0x2ceb0 SERIAL_ECHOLNPGM("\""); #ifdef CMDBUFFER_DEBUG cmdqueue_dump_to_serial(); #endif /* CMDBUFFER_DEBUG */ } else { SERIAL_ERROR_START; 2cf4e: 87 ec ldi r24, 0xC7 ; 199 2cf50: 92 ea ldi r25, 0xA2 ; 162 2cf52: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(enqueingFront); 2cf56: 8e ea ldi r24, 0xAE ; 174 2cf58: 92 ea ldi r25, 0xA2 ; 162 2cf5a: 0e 94 15 7b call 0xf62a ; 0xf62a if (from_progmem) SERIAL_PROTOCOLRPGM(cmd); 2cf5e: ce 01 movw r24, r28 2cf60: 0e 94 15 7b call 0xf62a ; 0xf62a else SERIAL_ECHO(cmd); SERIAL_ECHOLNRPGM(bufferFull); 2cf64: 85 e9 ldi r24, 0x95 ; 149 2cf66: 92 ea ldi r25, 0xA2 ; 162 2cf68: cc cf rjmp .-104 ; 0x2cf02 0002cf6a : } else { return false; } } bool SdFile::seekSetFilteredGcode(uint32_t pos){ 2cf6a: ab 01 movw r20, r22 2cf6c: bc 01 movw r22, r24 if(! seekSet(pos) )return false; 2cf6e: 87 e6 ldi r24, 0x67 ; 103 2cf70: 96 e1 ldi r25, 0x16 ; 22 2cf72: 0f 94 97 2a call 0x2552e ; 0x2552e 2cf76: 81 11 cpse r24, r1 2cf78: 02 c0 rjmp .+4 ; 0x2cf7e 2cf7a: 80 e0 ldi r24, 0x00 ; 0 2cf7c: 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() ) 2cf7e: 87 e6 ldi r24, 0x67 ; 103 2cf80: 96 e1 ldi r25, 0x16 ; 22 2cf82: 0f 94 1e 2a call 0x2543c ; 0x2543c 2cf86: 88 23 and r24, r24 2cf88: c1 f3 breq .-16 ; 0x2cf7a 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; 2cf8a: 20 91 88 16 lds r18, 0x1688 ; 0x801688 2cf8e: 30 91 89 16 lds r19, 0x1689 ; 0x801689 2cf92: 2a 5b subi r18, 0xBA ; 186 2cf94: 31 4f sbci r19, 0xF1 ; 241 2cf96: 30 93 83 16 sts 0x1683, r19 ; 0x801683 2cf9a: 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; } 2cf9e: 08 95 ret 0002cfa0 : SERIAL_PROTOCOLLNPGM("An error while writing to the SD Card."); } } void CardReader::checkautostart(bool force) 2cfa0: 8f 92 push r8 2cfa2: 9f 92 push r9 2cfa4: af 92 push r10 2cfa6: bf 92 push r11 2cfa8: cf 92 push r12 2cfaa: df 92 push r13 2cfac: ef 92 push r14 2cfae: ff 92 push r15 2cfb0: 0f 93 push r16 2cfb2: 1f 93 push r17 2cfb4: cf 93 push r28 2cfb6: df 93 push r29 2cfb8: cd b7 in r28, 0x3d ; 61 2cfba: de b7 in r29, 0x3e ; 62 2cfbc: ee 97 sbiw r28, 0x3e ; 62 2cfbe: 0f b6 in r0, 0x3f ; 63 2cfc0: f8 94 cli 2cfc2: de bf out 0x3e, r29 ; 62 2cfc4: 0f be out 0x3f, r0 ; 63 2cfc6: cd bf out 0x3d, r28 ; 61 if(!mounted) //fail return; } char autoname[30]; sprintf_P(autoname, PSTR("auto%i.g"), lastnr); 2cfc8: 80 91 25 14 lds r24, 0x1425 ; 0x801425 2cfcc: 8f 93 push r24 2cfce: 80 91 24 14 lds r24, 0x1424 ; 0x801424 2cfd2: 8f 93 push r24 2cfd4: 80 e5 ldi r24, 0x50 ; 80 2cfd6: 92 ea ldi r25, 0xA2 ; 162 2cfd8: 9f 93 push r25 2cfda: 8f 93 push r24 2cfdc: 8e 01 movw r16, r28 2cfde: 0f 5d subi r16, 0xDF ; 223 2cfe0: 1f 4f sbci r17, 0xFF ; 255 2cfe2: 1f 93 push r17 2cfe4: 0f 93 push r16 2cfe6: 0f 94 98 a3 call 0x34730 ; 0x34730 2cfea: 0f 90 pop r0 2cfec: 0f 90 pop r0 2cfee: 0f 90 pop r0 2cff0: 0f 90 pop r0 2cff2: 0f 90 pop r0 2cff4: 0f 90 pop r0 for(int8_t i=0;i<(int8_t)strlen(autoname);i++) 2cff6: f1 2c mov r15, r1 2cff8: f8 01 movw r30, r16 2cffa: 01 90 ld r0, Z+ 2cffc: 00 20 and r0, r0 2cffe: e9 f7 brne .-6 ; 0x2cffa 2d000: 31 97 sbiw r30, 0x01 ; 1 2d002: e0 1b sub r30, r16 2d004: f1 0b sbc r31, r17 2d006: fe 16 cp r15, r30 2d008: 84 f4 brge .+32 ; 0x2d02a autoname[i]=tolower(autoname[i]); 2d00a: 68 01 movw r12, r16 2d00c: cf 0c add r12, r15 2d00e: d1 1c adc r13, r1 2d010: f7 fc sbrc r15, 7 2d012: da 94 dec r13 2d014: f6 01 movw r30, r12 2d016: 80 81 ld r24, Z 2d018: 08 2e mov r0, r24 2d01a: 00 0c add r0, r0 2d01c: 99 0b sbc r25, r25 2d01e: 0f 94 95 aa call 0x3552a ; 0x3552a 2d022: f6 01 movw r30, r12 2d024: 80 83 st Z, r24 2d026: f3 94 inc r15 2d028: e7 cf rjmp .-50 ; 0x2cff8 dir_t p; root.rewind(); 2d02a: 8d e5 ldi r24, 0x5D ; 93 2d02c: 94 e1 ldi r25, 0x14 ; 20 2d02e: 0e 94 f7 79 call 0xf3ee ; 0xf3ee bool found=false; 2d032: a1 2c mov r10, r1 2d034: ce 01 movw r24, r28 2d036: 01 96 adiw r24, 0x01 ; 1 2d038: 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); 2d03a: 8b e0 ldi r24, 0x0B ; 11 2d03c: c8 2e mov r12, r24 2d03e: 8d e6 ldi r24, 0x6D ; 109 2d040: 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; 2d042: 80 91 60 14 lds r24, 0x1460 ; 0x801460 2d046: 82 30 cpi r24, 0x02 ; 2 2d048: 08 f4 brcc .+2 ; 0x2d04c 2d04a: 50 c0 rjmp .+160 ; 0x2d0ec 2d04c: 80 91 65 14 lds r24, 0x1465 ; 0x801465 2d050: 90 91 66 14 lds r25, 0x1466 ; 0x801466 2d054: a0 91 67 14 lds r26, 0x1467 ; 0x801467 2d058: b0 91 68 14 lds r27, 0x1468 ; 0x801468 2d05c: 8f 71 andi r24, 0x1F ; 31 2d05e: 99 27 eor r25, r25 2d060: aa 27 eor r26, r26 2d062: bb 27 eor r27, r27 2d064: 89 2b or r24, r25 2d066: 8a 2b or r24, r26 2d068: 8b 2b or r24, r27 2d06a: 09 f0 breq .+2 ; 0x2d06e 2d06c: 3f c0 rjmp .+126 ; 0x2d0ec 2d06e: 50 e0 ldi r21, 0x00 ; 0 2d070: 40 e0 ldi r20, 0x00 ; 0 2d072: b7 01 movw r22, r14 2d074: 8d e5 ldi r24, 0x5D ; 93 2d076: 94 e1 ldi r25, 0x14 ; 20 2d078: 0f 94 d4 2d call 0x25ba8 ; 0x25ba8 dir_t p; root.rewind(); bool found=false; while (root.readDir(p, NULL) > 0) 2d07c: 18 16 cp r1, r24 2d07e: b4 f5 brge .+108 ; 0x2d0ec { for(int8_t i=0;i<(int8_t)strlen((char*)p.name);i++) 2d080: b1 2c mov r11, r1 2d082: f7 01 movw r30, r14 2d084: 01 90 ld r0, Z+ 2d086: 00 20 and r0, r0 2d088: e9 f7 brne .-6 ; 0x2d084 2d08a: 31 97 sbiw r30, 0x01 ; 1 2d08c: ee 19 sub r30, r14 2d08e: ff 09 sbc r31, r15 2d090: be 16 cp r11, r30 2d092: 74 f4 brge .+28 ; 0x2d0b0 p.name[i]=tolower(p.name[i]); 2d094: 47 01 movw r8, r14 2d096: 8b 0c add r8, r11 2d098: 91 1c adc r9, r1 2d09a: b7 fc sbrc r11, 7 2d09c: 9a 94 dec r9 2d09e: f4 01 movw r30, r8 2d0a0: 80 81 ld r24, Z 2d0a2: 90 e0 ldi r25, 0x00 ; 0 2d0a4: 0f 94 95 aa call 0x3552a ; 0x3552a 2d0a8: f4 01 movw r30, r8 2d0aa: 80 83 st Z, r24 2d0ac: b3 94 inc r11 2d0ae: e9 cf rjmp .-46 ; 0x2d082 //Serial.print((char*)p.name); //Serial.print(" "); //Serial.println(autoname); if(p.name[9]!='~') //skip safety copies 2d0b0: 8a 85 ldd r24, Y+10 ; 0x0a 2d0b2: 8e 37 cpi r24, 0x7E ; 126 2d0b4: 31 f2 breq .-116 ; 0x2d042 if(strncmp((char*)p.name,autoname,5)==0) 2d0b6: 45 e0 ldi r20, 0x05 ; 5 2d0b8: 50 e0 ldi r21, 0x00 ; 0 2d0ba: b8 01 movw r22, r16 2d0bc: c7 01 movw r24, r14 2d0be: 0f 94 f3 aa call 0x355e6 ; 0x355e6 2d0c2: 89 2b or r24, r25 2d0c4: 09 f0 breq .+2 ; 0x2d0c8 2d0c6: bd cf rjmp .-134 ; 0x2d042 { // M23: Select SD file enquecommandf_P(MSG_M23, autoname); 2d0c8: 1f 93 push r17 2d0ca: 0f 93 push r16 2d0cc: df 92 push r13 2d0ce: cf 92 push r12 2d0d0: 0e 94 28 8e call 0x11c50 ; 0x11c50 // M24: Start/resume SD print enquecommand_P(MSG_M24); 2d0d4: 61 e0 ldi r22, 0x01 ; 1 2d0d6: 87 e0 ldi r24, 0x07 ; 7 2d0d8: 9d e6 ldi r25, 0x6D ; 109 2d0da: 0e 94 62 8d call 0x11ac4 ; 0x11ac4 2d0de: 0f 90 pop r0 2d0e0: 0f 90 pop r0 2d0e2: 0f 90 pop r0 2d0e4: 0f 90 pop r0 found=true; 2d0e6: aa 24 eor r10, r10 2d0e8: a3 94 inc r10 2d0ea: ab cf rjmp .-170 ; 0x2d042 } } if(!found) lastnr=-1; 2d0ec: 8f ef ldi r24, 0xFF ; 255 2d0ee: 9f ef ldi r25, 0xFF ; 255 // M24: Start/resume SD print enquecommand_P(MSG_M24); found=true; } } if(!found) 2d0f0: aa 20 and r10, r10 2d0f2: 29 f0 breq .+10 ; 0x2d0fe lastnr=-1; else lastnr++; 2d0f4: 80 91 24 14 lds r24, 0x1424 ; 0x801424 2d0f8: 90 91 25 14 lds r25, 0x1425 ; 0x801425 2d0fc: 01 96 adiw r24, 0x01 ; 1 2d0fe: 90 93 25 14 sts 0x1425, r25 ; 0x801425 2d102: 80 93 24 14 sts 0x1424, r24 ; 0x801424 } 2d106: ee 96 adiw r28, 0x3e ; 62 2d108: 0f b6 in r0, 0x3f ; 63 2d10a: f8 94 cli 2d10c: de bf out 0x3e, r29 ; 62 2d10e: 0f be out 0x3f, r0 ; 63 2d110: cd bf out 0x3d, r28 ; 61 2d112: df 91 pop r29 2d114: cf 91 pop r28 2d116: 1f 91 pop r17 2d118: 0f 91 pop r16 2d11a: ff 90 pop r15 2d11c: ef 90 pop r14 2d11e: df 90 pop r13 2d120: cf 90 pop r12 2d122: bf 90 pop r11 2d124: af 90 pop r10 2d126: 9f 90 pop r9 2d128: 8f 90 pop r8 2d12a: 08 95 ret 0002d12c : * \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) { 2d12c: 8f 92 push r8 2d12e: 9f 92 push r9 2d130: af 92 push r10 2d132: bf 92 push r11 2d134: cf 92 push r12 2d136: df 92 push r13 2d138: ef 92 push r14 2d13a: ff 92 push r15 2d13c: 0f 93 push r16 2d13e: 1f 93 push r17 2d140: cf 93 push r28 2d142: df 93 push r29 2d144: 00 d0 rcall .+0 ; 0x2d146 2d146: 1f 92 push r1 2d148: cd b7 in r28, 0x3d ; 61 2d14a: de b7 in r29, 0x3e ; 62 2d14c: fc 01 movw r30, r24 uint32_t newPos; // error if not a normal file or read-only if (!isFile() || !(flags_ & O_WRITE)) goto fail; 2d14e: 83 81 ldd r24, Z+3 ; 0x03 2d150: 81 30 cpi r24, 0x01 ; 1 2d152: 11 f0 breq .+4 ; 0x2d158 // set file to correct position return seekSet(newPos); fail: return false; 2d154: 80 e0 ldi r24, 0x00 ; 0 2d156: 60 c0 rjmp .+192 ; 0x2d218 * \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; 2d158: 81 81 ldd r24, Z+1 ; 0x01 2d15a: 81 ff sbrs r24, 1 2d15c: fb cf rjmp .-10 ; 0x2d154 // 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; 2d15e: 81 89 ldd r24, Z+17 ; 0x11 2d160: 92 89 ldd r25, Z+18 ; 0x12 2d162: a3 89 ldd r26, Z+19 ; 0x13 2d164: b4 89 ldd r27, Z+20 ; 0x14 2d166: 89 2b or r24, r25 2d168: 8a 2b or r24, r26 2d16a: 8b 2b or r24, r27 2d16c: 09 f4 brne .+2 ; 0x2d170 2d16e: 6e c0 rjmp .+220 ; 0x2d24c 2d170: 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; 2d172: 40 e0 ldi r20, 0x00 ; 0 2d174: 50 e0 ldi r21, 0x00 ; 0 2d176: ba 01 movw r22, r20 2d178: cf 01 movw r24, r30 2d17a: 0f 94 97 2a call 0x2552e ; 0x2552e 2d17e: 88 23 and r24, r24 2d180: 49 f3 breq .-46 ; 0x2d154 if (length == 0) { // free all clusters if (!vol_->freeChain(firstCluster_)) goto fail; 2d182: f7 01 movw r30, r14 2d184: c1 8c ldd r12, Z+25 ; 0x19 2d186: d2 8c ldd r13, Z+26 ; 0x1a 2d188: 85 88 ldd r8, Z+21 ; 0x15 2d18a: 96 88 ldd r9, Z+22 ; 0x16 2d18c: a7 88 ldd r10, Z+23 ; 0x17 2d18e: 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; 2d190: 82 e0 ldi r24, 0x02 ; 2 2d192: 90 e0 ldi r25, 0x00 ; 0 2d194: a0 e0 ldi r26, 0x00 ; 0 2d196: b0 e0 ldi r27, 0x00 ; 0 2d198: f6 01 movw r30, r12 2d19a: 80 83 st Z, r24 2d19c: 91 83 std Z+1, r25 ; 0x01 2d19e: a2 83 std Z+2, r26 ; 0x02 2d1a0: b3 83 std Z+3, r27 ; 0x03 do { if (!fatGet(cluster, &next)) goto fail; 2d1a2: 9e 01 movw r18, r28 2d1a4: 2f 5f subi r18, 0xFF ; 255 2d1a6: 3f 4f sbci r19, 0xFF ; 255 2d1a8: b5 01 movw r22, r10 2d1aa: a4 01 movw r20, r8 2d1ac: c6 01 movw r24, r12 2d1ae: 0f 94 e1 28 call 0x251c2 ; 0x251c2 2d1b2: 88 23 and r24, r24 2d1b4: 79 f2 breq .-98 ; 0x2d154 // free cluster if (!fatPut(cluster, 0)) goto fail; 2d1b6: 00 e0 ldi r16, 0x00 ; 0 2d1b8: 10 e0 ldi r17, 0x00 ; 0 2d1ba: 98 01 movw r18, r16 2d1bc: b5 01 movw r22, r10 2d1be: a4 01 movw r20, r8 2d1c0: c6 01 movw r24, r12 2d1c2: 0f 94 4f 28 call 0x2509e ; 0x2509e 2d1c6: 88 23 and r24, r24 2d1c8: 29 f2 breq .-118 ; 0x2d154 cluster = next; 2d1ca: 89 80 ldd r8, Y+1 ; 0x01 2d1cc: 9a 80 ldd r9, Y+2 ; 0x02 2d1ce: ab 80 ldd r10, Y+3 ; 0x03 2d1d0: 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; 2d1d2: f6 01 movw r30, r12 2d1d4: 87 89 ldd r24, Z+23 ; 0x17 2d1d6: 80 31 cpi r24, 0x10 ; 16 2d1d8: 81 f5 brne .+96 ; 0x2d23a 2d1da: f8 ef ldi r31, 0xF8 ; 248 2d1dc: 8f 16 cp r8, r31 2d1de: ff ef ldi r31, 0xFF ; 255 2d1e0: 9f 06 cpc r9, r31 2d1e2: a1 04 cpc r10, r1 2d1e4: b1 04 cpc r11, r1 2d1e6: e8 f2 brcs .-70 ; 0x2d1a2 firstCluster_ = 0; 2d1e8: f7 01 movw r30, r14 2d1ea: 15 8a std Z+21, r1 ; 0x15 2d1ec: 16 8a std Z+22, r1 ; 0x16 2d1ee: 17 8a std Z+23, r1 ; 0x17 2d1f0: 10 8e std Z+24, r1 ; 0x18 // current cluster is end of chain if (!vol_->fatPutEOC(curCluster_)) goto fail; } } fileSize_ = length; 2d1f2: 11 8a std Z+17, r1 ; 0x11 2d1f4: 12 8a std Z+18, r1 ; 0x12 2d1f6: 13 8a std Z+19, r1 ; 0x13 2d1f8: 14 8a std Z+20, r1 ; 0x14 // need to update directory entry flags_ |= F_FILE_DIR_DIRTY; 2d1fa: 81 81 ldd r24, Z+1 ; 0x01 2d1fc: 80 68 ori r24, 0x80 ; 128 2d1fe: 81 83 std Z+1, r24 ; 0x01 if (!sync()) goto fail; 2d200: c7 01 movw r24, r14 2d202: 0f 94 40 2c call 0x25880 ; 0x25880 2d206: 88 23 and r24, r24 2d208: 09 f4 brne .+2 ; 0x2d20c 2d20a: a4 cf rjmp .-184 ; 0x2d154 // set file to correct position return seekSet(newPos); 2d20c: 40 e0 ldi r20, 0x00 ; 0 2d20e: 50 e0 ldi r21, 0x00 ; 0 2d210: ba 01 movw r22, r20 2d212: c7 01 movw r24, r14 2d214: 0f 94 97 2a call 0x2552e ; 0x2552e fail: return false; } 2d218: 0f 90 pop r0 2d21a: 0f 90 pop r0 2d21c: 0f 90 pop r0 2d21e: 0f 90 pop r0 2d220: df 91 pop r29 2d222: cf 91 pop r28 2d224: 1f 91 pop r17 2d226: 0f 91 pop r16 2d228: ff 90 pop r15 2d22a: ef 90 pop r14 2d22c: df 90 pop r13 2d22e: cf 90 pop r12 2d230: bf 90 pop r11 2d232: af 90 pop r10 2d234: 9f 90 pop r9 2d236: 8f 90 pop r8 2d238: 08 95 ret return cluster >= FAT32EOC_MIN; 2d23a: 88 ef ldi r24, 0xF8 ; 248 2d23c: 88 16 cp r8, r24 2d23e: 8f ef ldi r24, 0xFF ; 255 2d240: 98 06 cpc r9, r24 2d242: a8 06 cpc r10, r24 2d244: 8f e0 ldi r24, 0x0F ; 15 2d246: b8 06 cpc r11, r24 2d248: 78 f6 brcc .-98 ; 0x2d1e8 2d24a: ab cf rjmp .-170 ; 0x2d1a2 // 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; 2d24c: 81 e0 ldi r24, 0x01 ; 1 2d24e: e4 cf rjmp .-56 ; 0x2d218 0002d250 : +* 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) { 2d250: 2f 92 push r2 2d252: 3f 92 push r3 2d254: 4f 92 push r4 2d256: 5f 92 push r5 2d258: 6f 92 push r6 2d25a: 7f 92 push r7 2d25c: 8f 92 push r8 2d25e: 9f 92 push r9 2d260: af 92 push r10 2d262: bf 92 push r11 2d264: cf 92 push r12 2d266: df 92 push r13 2d268: ef 92 push r14 2d26a: ff 92 push r15 2d26c: 0f 93 push r16 2d26e: 1f 93 push r17 2d270: cf 93 push r28 2d272: df 93 push r29 2d274: cd b7 in r28, 0x3d ; 61 2d276: de b7 in r29, 0x3e ; 62 2d278: c6 57 subi r28, 0x76 ; 118 2d27a: d1 09 sbc r29, r1 2d27c: 0f b6 in r0, 0x3f ; 63 2d27e: f8 94 cli 2d280: de bf out 0x3e, r29 ; 62 2d282: 0f be out 0x3f, r0 ; 63 2d284: cd bf out 0x3d, r28 ; 61 2d286: 4c 01 movw r8, r24 2d288: 6b 01 movw r12, r22 2d28a: 3a 01 movw r6, r20 2d28c: e5 96 adiw r28, 0x35 ; 53 2d28e: 2f af std Y+63, r18 ; 0x3f 2d290: e5 97 sbiw r28, 0x35 ; 53 2d292: 50 2e mov r5, r16 cnt++; break; } } } // while readDir } 2d294: 2d b6 in r2, 0x3d ; 61 2d296: 3e b6 in r3, 0x3e ; 62 2d298: 10 2f mov r17, r16 2d29a: 11 70 andi r17, 0x01 ; 1 static uint8_t recursionCnt = 0; // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} 2d29c: 80 91 45 0e lds r24, 0x0E45 ; 0x800e45 2d2a0: 8f 5f subi r24, 0xFF ; 255 2d2a2: 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()) { 2d2a6: fb 01 movw r30, r22 2d2a8: 80 85 ldd r24, Z+8 ; 0x08 2d2aa: 91 85 ldd r25, Z+9 ; 0x09 2d2ac: a2 85 ldd r26, Z+10 ; 0x0a 2d2ae: b3 85 ldd r27, Z+11 ; 0x0b 2d2b0: 80 93 ea 13 sts 0x13EA, r24 ; 0x8013ea 2d2b4: 90 93 eb 13 sts 0x13EB, r25 ; 0x8013eb 2d2b8: a0 93 ec 13 sts 0x13EC, r26 ; 0x8013ec 2d2bc: b0 93 ed 13 sts 0x13ED, r27 ; 0x8013ed _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} } recursionCntIncrementer; dir_t p; uint8_t cnt = 0; 2d2c0: 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); 2d2c2: 5e 01 movw r10, r28 2d2c4: f7 e6 ldi r31, 0x67 ; 103 2d2c6: af 0e add r10, r31 2d2c8: 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; 2d2ca: f6 01 movw r30, r12 2d2cc: 83 81 ldd r24, Z+3 ; 0x03 2d2ce: 82 30 cpi r24, 0x02 ; 2 2d2d0: 08 f4 brcc .+2 ; 0x2d2d4 2d2d2: c0 c1 rjmp .+896 ; 0x2d654 2d2d4: 80 85 ldd r24, Z+8 ; 0x08 2d2d6: 91 85 ldd r25, Z+9 ; 0x09 2d2d8: a2 85 ldd r26, Z+10 ; 0x0a 2d2da: b3 85 ldd r27, Z+11 ; 0x0b 2d2dc: 8f 71 andi r24, 0x1F ; 31 2d2de: 99 27 eor r25, r25 2d2e0: aa 27 eor r26, r26 2d2e2: bb 27 eor r27, r27 2d2e4: 89 2b or r24, r25 2d2e6: 8a 2b or r24, r26 2d2e8: 8b 2b or r24, r27 2d2ea: 09 f0 breq .+2 ; 0x2d2ee 2d2ec: b3 c1 rjmp .+870 ; 0x2d654 //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'; 2d2ee: 10 92 ee 13 sts 0x13EE, r1 ; 0x8013ee 2d2f2: 4e ee ldi r20, 0xEE ; 238 2d2f4: 53 e1 ldi r21, 0x13 ; 19 2d2f6: be 01 movw r22, r28 2d2f8: 69 5b subi r22, 0xB9 ; 185 2d2fa: 7f 4f sbci r23, 0xFF ; 255 2d2fc: c6 01 movw r24, r12 2d2fe: 0f 94 d4 2d call 0x25ba8 ; 0x25ba8 } 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()) { 2d302: 18 16 cp r1, r24 2d304: 0c f0 brlt .+2 ; 0x2d308 2d306: a6 c1 rjmp .+844 ; 0x2d654 if (recursionCnt > MAX_DIR_DEPTH) 2d308: 80 91 45 0e lds r24, 0x0E45 ; 0x800e45 2d30c: 87 30 cpi r24, 0x07 ; 7 2d30e: 08 f0 brcs .+2 ; 0x2d312 2d310: a1 c1 rjmp .+834 ; 0x2d654 return; uint8_t pn0 = p.name[0]; 2d312: 28 96 adiw r28, 0x08 ; 8 2d314: 8f ad ldd r24, Y+63 ; 0x3f 2d316: 28 97 sbiw r28, 0x08 ; 8 if (pn0 == DIR_NAME_FREE) break; 2d318: 88 23 and r24, r24 2d31a: 09 f4 brne .+2 ; 0x2d31e 2d31c: 9b c1 rjmp .+822 ; 0x2d654 if (pn0 == DIR_NAME_DELETED || pn0 == '.') continue; 2d31e: 85 3e cpi r24, 0xE5 ; 229 2d320: 09 f4 brne .+2 ; 0x2d324 2d322: 39 c1 rjmp .+626 ; 0x2d596 2d324: 8e 32 cpi r24, 0x2E ; 46 2d326: 09 f4 brne .+2 ; 0x2d32a 2d328: 36 c1 rjmp .+620 ; 0x2d596 if (longFilename[0] == '.') continue; 2d32a: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d32e: 8e 32 cpi r24, 0x2E ; 46 2d330: 09 f4 brne .+2 ; 0x2d334 2d332: 31 c1 rjmp .+610 ; 0x2d596 2d334: 63 96 adiw r28, 0x13 ; 19 2d336: 8f ad ldd r24, Y+63 ; 0x3f 2d338: 63 97 sbiw r28, 0x13 ; 19 if (!DIR_IS_FILE_OR_SUBDIR(&p) || (p.attributes & DIR_ATT_HIDDEN)) continue; 2d33a: 98 2f mov r25, r24 2d33c: 9a 70 andi r25, 0x0A ; 10 2d33e: 09 f0 breq .+2 ; 0x2d342 2d340: 2a c1 rjmp .+596 ; 0x2d596 2d342: 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; 2d344: 91 e0 ldi r25, 0x01 ; 1 2d346: 80 31 cpi r24, 0x10 ; 16 2d348: 19 f0 breq .+6 ; 0x2d350 2d34a: 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 2d34c: 80 31 cpi r24, 0x10 ; 16 2d34e: 31 f4 brne .+12 ; 0x2d35c 2d350: e5 96 adiw r28, 0x35 ; 53 2d352: ff ad ldd r31, Y+63 ; 0x3f 2d354: e5 97 sbiw r28, 0x35 ; 53 2d356: ff 23 and r31, r31 2d358: 09 f4 brne .+2 ; 0x2d35c 2d35a: 94 c0 rjmp .+296 ; 0x2d484 if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); } else { filenameIsDir = DIR_IS_SUBDIR(&p); 2d35c: 90 93 23 14 sts 0x1423, r25 ; 0x801423 if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; 2d360: 80 31 cpi r24, 0x10 ; 16 2d362: 61 f0 breq .+24 ; 0x2d37c 2d364: 60 96 adiw r28, 0x10 ; 16 2d366: 8f ad ldd r24, Y+63 ; 0x3f 2d368: 60 97 sbiw r28, 0x10 ; 16 2d36a: 87 34 cpi r24, 0x47 ; 71 2d36c: 09 f0 breq .+2 ; 0x2d370 2d36e: 13 c1 rjmp .+550 ; 0x2d596 2d370: 61 96 adiw r28, 0x11 ; 17 2d372: 8f ad ldd r24, Y+63 ; 0x3f 2d374: 61 97 sbiw r28, 0x11 ; 17 2d376: 8e 37 cpi r24, 0x7E ; 126 2d378: 09 f4 brne .+2 ; 0x2d37c 2d37a: 0d c1 rjmp .+538 ; 0x2d596 switch (lsAction) { 2d37c: e5 96 adiw r28, 0x35 ; 53 2d37e: ff ad ldd r31, Y+63 ; 0x3f 2d380: e5 97 sbiw r28, 0x35 ; 53 2d382: f1 30 cpi r31, 0x01 ; 1 2d384: 09 f4 brne .+2 ; 0x2d388 2d386: 1b c1 rjmp .+566 ; 0x2d5be 2d388: f2 30 cpi r31, 0x02 ; 2 2d38a: 09 f4 brne .+2 ; 0x2d38e 2d38c: 25 c1 rjmp .+586 ; 0x2d5d8 case LS_Count: nrFiles++; break; case LS_SerialPrint: createFilename(filename, p); 2d38e: be 01 movw r22, r28 2d390: 69 5b subi r22, 0xB9 ; 185 2d392: 7f 4f sbci r23, 0xFF ; 255 2d394: 89 ed ldi r24, 0xD9 ; 217 2d396: 93 e1 ldi r25, 0x13 ; 19 2d398: 0e 94 e1 79 call 0xf3c2 ; 0xf3c2 2d39c: c4 01 movw r24, r8 2d39e: 0e 94 0e 86 call 0x10c1c ; 0x10c1c 2d3a2: 89 ed ldi r24, 0xD9 ; 217 2d3a4: 93 e1 ldi r25, 0x13 ; 19 2d3a6: 0e 94 0e 86 call 0x10c1c ; 0x10c1c SERIAL_PROTOCOL(prepend); SERIAL_PROTOCOL(filename); MYSERIAL.write(' '); 2d3aa: 80 e2 ldi r24, 0x20 ; 32 2d3ac: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2d3b0: a7 96 adiw r28, 0x27 ; 39 2d3b2: 6c ad ldd r22, Y+60 ; 0x3c 2d3b4: 7d ad ldd r23, Y+61 ; 0x3d 2d3b6: 8e ad ldd r24, Y+62 ; 0x3e 2d3b8: 9f ad ldd r25, Y+63 ; 0x3f 2d3ba: a7 97 sbiw r28, 0x27 ; 39 2d3bc: 4a e0 ldi r20, 0x0A ; 10 2d3be: 0e 94 16 7a call 0xf42c ; 0xf42c SERIAL_PROTOCOL(p.fileSize); if (lsParams.timestamp) 2d3c2: 51 fe sbrs r5, 1 2d3c4: 45 c0 rjmp .+138 ; 0x2d450 { crmodDate = p.lastWriteDate; 2d3c6: a1 96 adiw r28, 0x21 ; 33 2d3c8: 2e ad ldd r18, Y+62 ; 0x3e 2d3ca: 3f ad ldd r19, Y+63 ; 0x3f 2d3cc: a1 97 sbiw r28, 0x21 ; 33 2d3ce: 30 93 e9 13 sts 0x13E9, r19 ; 0x8013e9 2d3d2: 20 93 e8 13 sts 0x13E8, r18 ; 0x8013e8 crmodTime = p.lastWriteTime; 2d3d6: 6f 96 adiw r28, 0x1f ; 31 2d3d8: 4e ad ldd r20, Y+62 ; 0x3e 2d3da: 5f ad ldd r21, Y+63 ; 0x3f 2d3dc: 6f 97 sbiw r28, 0x1f ; 31 2d3de: 50 93 e7 13 sts 0x13E7, r21 ; 0x8013e7 2d3e2: 40 93 e6 13 sts 0x13E6, r20 ; 0x8013e6 if( crmodDate < p.creationDate || ( crmodDate == p.creationDate && crmodTime < p.creationTime ) ){ 2d3e6: 69 96 adiw r28, 0x19 ; 25 2d3e8: 8e ad ldd r24, Y+62 ; 0x3e 2d3ea: 9f ad ldd r25, Y+63 ; 0x3f 2d3ec: 69 97 sbiw r28, 0x19 ; 25 2d3ee: 28 17 cp r18, r24 2d3f0: 39 07 cpc r19, r25 2d3f2: 50 f0 brcs .+20 ; 0x2d408 2d3f4: 28 17 cp r18, r24 2d3f6: 39 07 cpc r19, r25 2d3f8: 99 f4 brne .+38 ; 0x2d420 2d3fa: 67 96 adiw r28, 0x17 ; 23 2d3fc: 2e ad ldd r18, Y+62 ; 0x3e 2d3fe: 3f ad ldd r19, Y+63 ; 0x3f 2d400: 67 97 sbiw r28, 0x17 ; 23 2d402: 42 17 cp r20, r18 2d404: 53 07 cpc r21, r19 2d406: 60 f4 brcc .+24 ; 0x2d420 crmodDate = p.creationDate; 2d408: 90 93 e9 13 sts 0x13E9, r25 ; 0x8013e9 2d40c: 80 93 e8 13 sts 0x13E8, r24 ; 0x8013e8 crmodTime = p.creationTime; 2d410: 67 96 adiw r28, 0x17 ; 23 2d412: 8e ad ldd r24, Y+62 ; 0x3e 2d414: 9f ad ldd r25, Y+63 ; 0x3f 2d416: 67 97 sbiw r28, 0x17 ; 23 2d418: 90 93 e7 13 sts 0x13E7, r25 ; 0x8013e7 2d41c: 80 93 e6 13 sts 0x13E6, r24 ; 0x8013e6 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); 2d420: 80 91 e9 13 lds r24, 0x13E9 ; 0x8013e9 2d424: 8f 93 push r24 2d426: 80 91 e8 13 lds r24, 0x13E8 ; 0x8013e8 2d42a: 8f 93 push r24 2d42c: 80 91 e7 13 lds r24, 0x13E7 ; 0x8013e7 2d430: 8f 93 push r24 2d432: 80 91 e6 13 lds r24, 0x13E6 ; 0x8013e6 2d436: 8f 93 push r24 2d438: 2d e2 ldi r18, 0x2D ; 45 2d43a: 32 ea ldi r19, 0xA2 ; 162 2d43c: 3f 93 push r19 2d43e: 2f 93 push r18 2d440: 0f 94 43 a3 call 0x34686 ; 0x34686 2d444: 0f 90 pop r0 2d446: 0f 90 pop r0 2d448: 0f 90 pop r0 2d44a: 0f 90 pop r0 2d44c: 0f 90 pop r0 2d44e: 0f 90 pop r0 } if (lsParams.LFN) 2d450: 11 23 and r17, r17 2d452: 99 f0 breq .+38 ; 0x2d47a printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2d454: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d458: 88 23 and r24, r24 2d45a: 09 f4 brne .+2 ; 0x2d45e 2d45c: ba c0 rjmp .+372 ; 0x2d5d2 2d45e: 8e ee ldi r24, 0xEE ; 238 2d460: 93 e1 ldi r25, 0x13 ; 19 2d462: 9f 93 push r25 2d464: 8f 93 push r24 2d466: e7 e2 ldi r30, 0x27 ; 39 2d468: f2 ea ldi r31, 0xA2 ; 162 2d46a: ff 93 push r31 2d46c: ef 93 push r30 2d46e: 0f 94 43 a3 call 0x34686 ; 0x34686 2d472: 0f 90 pop r0 2d474: 0f 90 pop r0 2d476: 0f 90 pop r0 2d478: 0f 90 pop r0 SERIAL_PROTOCOLLN(); 2d47a: 0e 94 0d 7b call 0xf61a ; 0xf61a manage_heater(); 2d47e: 0f 94 a8 37 call 0x26f50 ; 0x26f50 2d482: 89 c0 rjmp .+274 ; 0x2d596 } lsDive(path, dir, NULL, lsAction, lsParams); // close() is done automatically by destructor of SdFile if (lsParams.LFN) puts_P(PSTR("DIR_EXIT")); 2d484: 2d b7 in r18, 0x3d ; 61 2d486: 3e b7 in r19, 0x3e ; 62 2d488: e7 96 adiw r28, 0x37 ; 55 2d48a: 3f af std Y+63, r19 ; 0x3f 2d48c: 2e af std Y+62, r18 ; 0x3e 2d48e: 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); 2d490: be 01 movw r22, r28 2d492: 69 5b subi r22, 0xB9 ; 185 2d494: 7f 4f sbci r23, 0xFF ; 255 2d496: c5 01 movw r24, r10 2d498: 0e 94 e1 79 call 0xf3c2 ; 0xf3c2 // Allocate enough stack space for the full path to a folder, trailing slash, and nul bool prepend_is_empty = (prepend[0] == '\0'); 2d49c: f4 01 movw r30, r8 2d49e: 80 81 ld r24, Z int len = (prepend_is_empty ? 1 : strlen(prepend)) + strlen(lfilename) + 1 + 1; 2d4a0: 88 23 and r24, r24 2d4a2: 09 f4 brne .+2 ; 0x2d4a6 2d4a4: 86 c0 rjmp .+268 ; 0x2d5b2 2d4a6: 01 90 ld r0, Z+ 2d4a8: 00 20 and r0, r0 2d4aa: e9 f7 brne .-6 ; 0x2d4a6 2d4ac: 31 97 sbiw r30, 0x01 ; 1 2d4ae: e8 19 sub r30, r8 2d4b0: f9 09 sbc r31, r9 2d4b2: d5 01 movw r26, r10 2d4b4: 0d 90 ld r0, X+ 2d4b6: 00 20 and r0, r0 2d4b8: e9 f7 brne .-6 ; 0x2d4b4 2d4ba: ea 19 sub r30, r10 2d4bc: fb 09 sbc r31, r11 char path[len]; 2d4be: ea 0f add r30, r26 2d4c0: fb 1f adc r31, r27 2d4c2: 31 96 adiw r30, 0x01 ; 1 2d4c4: 2d b7 in r18, 0x3d ; 61 2d4c6: 3e b7 in r19, 0x3e ; 62 2d4c8: 2e 1b sub r18, r30 2d4ca: 3f 0b sbc r19, r31 2d4cc: 0f b6 in r0, 0x3f ; 63 2d4ce: f8 94 cli 2d4d0: 3e bf out 0x3e, r19 ; 62 2d4d2: 0f be out 0x3f, r0 ; 63 2d4d4: 2d bf out 0x3d, r18 ; 61 2d4d6: ed b7 in r30, 0x3d ; 61 2d4d8: fe b7 in r31, 0x3e ; 62 2d4da: 31 96 adiw r30, 0x01 ; 1 2d4dc: 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 2d4de: 60 ef ldi r22, 0xF0 ; 240 2d4e0: 72 e0 ldi r23, 0x02 ; 2 2d4e2: 81 11 cpse r24, r1 2d4e4: b4 01 movw r22, r8 2d4e6: c7 01 movw r24, r14 2d4e8: 0f 94 ec aa call 0x355d8 ; 0x355d8 strcat(path, lfilename); // FILENAME_LENGTH-1 characters maximum 2d4ec: b5 01 movw r22, r10 2d4ee: c7 01 movw r24, r14 2d4f0: 0f 94 cd aa call 0x3559a ; 0x3559a strcat(path, "/"); // 1 character 2d4f4: 60 ef ldi r22, 0xF0 ; 240 2d4f6: 72 e0 ldi r23, 0x02 ; 2 2d4f8: c7 01 movw r24, r14 2d4fa: 0f 94 cd aa call 0x3559a ; 0x3559a // Serial.print(path); // Get a new directory object using the full path // and dive recursively into it. if (lsParams.LFN) 2d4fe: 11 23 and r17, r17 2d500: a9 f0 breq .+42 ; 0x2d52c printf_P(PSTR("DIR_ENTER: %s \"%s\"\n"), path, longFilename[0] ? longFilename : lfilename); 2d502: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d506: 81 11 cpse r24, r1 2d508: 57 c0 rjmp .+174 ; 0x2d5b8 2d50a: c5 01 movw r24, r10 2d50c: 9f 93 push r25 2d50e: 8f 93 push r24 2d510: ff 92 push r15 2d512: ef 92 push r14 2d514: 2c e3 ldi r18, 0x3C ; 60 2d516: 32 ea ldi r19, 0xA2 ; 162 2d518: 3f 93 push r19 2d51a: 2f 93 push r18 2d51c: 0f 94 43 a3 call 0x34686 ; 0x34686 2d520: 0f 90 pop r0 2d522: 0f 90 pop r0 2d524: 0f 90 pop r0 2d526: 0f 90 pop r0 2d528: 0f 90 pop r0 2d52a: 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) {} 2d52c: 1c a2 std Y+36, r1 ; 0x24 2d52e: 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); 2d530: 21 e0 ldi r18, 0x01 ; 1 2d532: a5 01 movw r20, r10 2d534: b6 01 movw r22, r12 2d536: ce 01 movw r24, r28 2d538: 84 96 adiw r24, 0x24 ; 36 2d53a: 0f 94 63 54 call 0x2a8c6 ; 0x2a8c6 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); 2d53e: 83 e2 ldi r24, 0x23 ; 35 2d540: fe 01 movw r30, r28 2d542: b4 96 adiw r30, 0x24 ; 36 2d544: de 01 movw r26, r28 2d546: 11 96 adiw r26, 0x01 ; 1 2d548: 01 90 ld r0, Z+ 2d54a: 0d 92 st X+, r0 2d54c: 8a 95 dec r24 2d54e: e1 f7 brne .-8 ; 0x2d548 2d550: 10 fb bst r17, 0 2d552: 50 f8 bld r5, 0 2d554: 05 2d mov r16, r5 2d556: 20 e0 ldi r18, 0x00 ; 0 2d558: 50 e0 ldi r21, 0x00 ; 0 2d55a: 40 e0 ldi r20, 0x00 ; 0 2d55c: be 01 movw r22, r28 2d55e: 6f 5f subi r22, 0xFF ; 255 2d560: 7f 4f sbci r23, 0xFF ; 255 2d562: c7 01 movw r24, r14 2d564: 0f 94 28 69 call 0x2d250 ; 0x2d250 2d568: ce 01 movw r24, r28 2d56a: 01 96 adiw r24, 0x01 ; 1 2d56c: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 // close() is done automatically by destructor of SdFile if (lsParams.LFN) 2d570: 11 23 and r17, r17 2d572: 21 f0 breq .+8 ; 0x2d57c puts_P(PSTR("DIR_EXIT")); 2d574: 83 e3 ldi r24, 0x33 ; 51 2d576: 92 ea ldi r25, 0xA2 ; 162 2d578: 0f 94 6a a3 call 0x346d4 ; 0x346d4 2d57c: ce 01 movw r24, r28 2d57e: 84 96 adiw r24, 0x24 ; 36 2d580: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 2d584: e7 96 adiw r28, 0x37 ; 55 2d586: ee ad ldd r30, Y+62 ; 0x3e 2d588: ff ad ldd r31, Y+63 ; 0x3f 2d58a: e7 97 sbiw r28, 0x37 ; 55 2d58c: 0f b6 in r0, 0x3f ; 63 2d58e: f8 94 cli 2d590: fe bf out 0x3e, r31 ; 62 2d592: 0f be out 0x3f, r0 ; 63 2d594: 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()) { 2d596: f6 01 movw r30, r12 2d598: 80 85 ldd r24, Z+8 ; 0x08 2d59a: 91 85 ldd r25, Z+9 ; 0x09 2d59c: a2 85 ldd r26, Z+10 ; 0x0a 2d59e: b3 85 ldd r27, Z+11 ; 0x0b 2d5a0: 80 93 ea 13 sts 0x13EA, r24 ; 0x8013ea 2d5a4: 90 93 eb 13 sts 0x13EB, r25 ; 0x8013eb 2d5a8: a0 93 ec 13 sts 0x13EC, r26 ; 0x8013ec 2d5ac: b0 93 ed 13 sts 0x13ED, r27 ; 0x8013ed 2d5b0: 8c ce rjmp .-744 ; 0x2d2ca // 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; 2d5b2: e1 e0 ldi r30, 0x01 ; 1 2d5b4: f0 e0 ldi r31, 0x00 ; 0 2d5b6: 7d cf rjmp .-262 ; 0x2d4b2 // 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); 2d5b8: 8e ee ldi r24, 0xEE ; 238 2d5ba: 93 e1 ldi r25, 0x13 ; 19 2d5bc: a7 cf rjmp .-178 ; 0x2d50c else { filenameIsDir = DIR_IS_SUBDIR(&p); if (!filenameIsDir && (p.name[8] != 'G' || p.name[9] == '~')) continue; switch (lsAction) { case LS_Count: nrFiles++; 2d5be: 80 91 ef 16 lds r24, 0x16EF ; 0x8016ef 2d5c2: 90 91 f0 16 lds r25, 0x16F0 ; 0x8016f0 2d5c6: 01 96 adiw r24, 0x01 ; 1 2d5c8: 90 93 f0 16 sts 0x16F0, r25 ; 0x8016f0 2d5cc: 80 93 ef 16 sts 0x16EF, r24 ; 0x8016ef 2d5d0: e2 cf rjmp .-60 ; 0x2d596 } printf_P(PSTR(" %#lx"), ((uint32_t)crmodDate << 16) | crmodTime); } if (lsParams.LFN) printf_P(PSTR(" \"%s\""), LONGEST_FILENAME); 2d5d2: 89 ed ldi r24, 0xD9 ; 217 2d5d4: 93 e1 ldi r25, 0x13 ; 19 2d5d6: 45 cf rjmp .-374 ; 0x2d462 manage_heater(); break; case LS_GetFilename: //SERIAL_ECHOPGM("File: "); createFilename(filename, p); 2d5d8: be 01 movw r22, r28 2d5da: 69 5b subi r22, 0xB9 ; 185 2d5dc: 7f 4f sbci r23, 0xFF ; 255 2d5de: 89 ed ldi r24, 0xD9 ; 217 2d5e0: 93 e1 ldi r25, 0x13 ; 19 2d5e2: 0e 94 e1 79 call 0xf3c2 ; 0xf3c2 SERIAL_ECHOPGM("Creation date: "); MYSERIAL.println(p.creationDate); SERIAL_ECHOPGM("Access date: "); MYSERIAL.println(p.lastAccessDate); SERIAL_ECHOLNPGM("");*/ crmodDate = p.lastWriteDate; 2d5e6: a1 96 adiw r28, 0x21 ; 33 2d5e8: 2e ad ldd r18, Y+62 ; 0x3e 2d5ea: 3f ad ldd r19, Y+63 ; 0x3f 2d5ec: a1 97 sbiw r28, 0x21 ; 33 2d5ee: 30 93 e9 13 sts 0x13E9, r19 ; 0x8013e9 2d5f2: 20 93 e8 13 sts 0x13E8, r18 ; 0x8013e8 crmodTime = p.lastWriteTime; 2d5f6: 6f 96 adiw r28, 0x1f ; 31 2d5f8: 4e ad ldd r20, Y+62 ; 0x3e 2d5fa: 5f ad ldd r21, Y+63 ; 0x3f 2d5fc: 6f 97 sbiw r28, 0x1f ; 31 2d5fe: 50 93 e7 13 sts 0x13E7, r21 ; 0x8013e7 2d602: 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 ) ){ 2d606: 69 96 adiw r28, 0x19 ; 25 2d608: 8e ad ldd r24, Y+62 ; 0x3e 2d60a: 9f ad ldd r25, Y+63 ; 0x3f 2d60c: 69 97 sbiw r28, 0x19 ; 25 2d60e: 28 17 cp r18, r24 2d610: 39 07 cpc r19, r25 2d612: 50 f0 brcs .+20 ; 0x2d628 2d614: 28 17 cp r18, r24 2d616: 39 07 cpc r19, r25 2d618: 99 f4 brne .+38 ; 0x2d640 2d61a: 67 96 adiw r28, 0x17 ; 23 2d61c: 2e ad ldd r18, Y+62 ; 0x3e 2d61e: 3f ad ldd r19, Y+63 ; 0x3f 2d620: 67 97 sbiw r28, 0x17 ; 23 2d622: 42 17 cp r20, r18 2d624: 53 07 cpc r21, r19 2d626: 60 f4 brcc .+24 ; 0x2d640 crmodDate = p.creationDate; 2d628: 90 93 e9 13 sts 0x13E9, r25 ; 0x8013e9 2d62c: 80 93 e8 13 sts 0x13E8, r24 ; 0x8013e8 crmodTime = p.creationTime; 2d630: 67 96 adiw r28, 0x17 ; 23 2d632: 8e ad ldd r24, Y+62 ; 0x3e 2d634: 9f ad ldd r25, Y+63 ; 0x3f 2d636: 67 97 sbiw r28, 0x17 ; 23 2d638: 90 93 e7 13 sts 0x13E7, r25 ; 0x8013e7 2d63c: 80 93 e6 13 sts 0x13E6, r24 ; 0x8013e6 } //writeDate = p.lastAccessDate; if (match != NULL) { 2d640: 61 14 cp r6, r1 2d642: 71 04 cpc r7, r1 2d644: 59 f1 breq .+86 ; 0x2d69c if (strcasecmp(match, filename) == 0) return; 2d646: 69 ed ldi r22, 0xD9 ; 217 2d648: 73 e1 ldi r23, 0x13 ; 19 2d64a: c3 01 movw r24, r6 2d64c: 0f 94 ba aa call 0x35574 ; 0x35574 2d650: 89 2b or r24, r25 2d652: 59 f5 brne .+86 ; 0x2d6aa // RAII incrementer for the recursionCnt class _incrementer { public: _incrementer() {recursionCnt++;} ~_incrementer() {recursionCnt--;} 2d654: 80 91 45 0e lds r24, 0x0E45 ; 0x800e45 2d658: 81 50 subi r24, 0x01 ; 1 2d65a: 80 93 45 0e sts 0x0E45, r24 ; 0x800e45 cnt++; break; } } } // while readDir } 2d65e: 0f b6 in r0, 0x3f ; 63 2d660: f8 94 cli 2d662: 3e be out 0x3e, r3 ; 62 2d664: 0f be out 0x3f, r0 ; 63 2d666: 2d be out 0x3d, r2 ; 61 2d668: ca 58 subi r28, 0x8A ; 138 2d66a: df 4f sbci r29, 0xFF ; 255 2d66c: 0f b6 in r0, 0x3f ; 63 2d66e: f8 94 cli 2d670: de bf out 0x3e, r29 ; 62 2d672: 0f be out 0x3f, r0 ; 63 2d674: cd bf out 0x3d, r28 ; 61 2d676: df 91 pop r29 2d678: cf 91 pop r28 2d67a: 1f 91 pop r17 2d67c: 0f 91 pop r16 2d67e: ff 90 pop r15 2d680: ef 90 pop r14 2d682: df 90 pop r13 2d684: cf 90 pop r12 2d686: bf 90 pop r11 2d688: af 90 pop r10 2d68a: 9f 90 pop r9 2d68c: 8f 90 pop r8 2d68e: 7f 90 pop r7 2d690: 6f 90 pop r6 2d692: 5f 90 pop r5 2d694: 4f 90 pop r4 2d696: 3f 90 pop r3 2d698: 2f 90 pop r2 2d69a: 08 95 ret } //writeDate = p.lastAccessDate; if (match != NULL) { if (strcasecmp(match, filename) == 0) return; } else if (cnt == nrFiles) return; 2d69c: 80 91 ef 16 lds r24, 0x16EF ; 0x8016ef 2d6a0: 90 91 f0 16 lds r25, 0x16F0 ; 0x8016f0 2d6a4: 48 16 cp r4, r24 2d6a6: 19 06 cpc r1, r25 2d6a8: a9 f2 breq .-86 ; 0x2d654 cnt++; 2d6aa: 43 94 inc r4 2d6ac: 74 cf rjmp .-280 ; 0x2d596 0002d6ae : } } void CardReader::getfilename(uint16_t nr, const char * const match/*=NULL*/) 2d6ae: cf 92 push r12 2d6b0: df 92 push r13 2d6b2: ef 92 push r14 2d6b4: ff 92 push r15 2d6b6: 0f 93 push r16 2d6b8: cf 93 push r28 2d6ba: df 93 push r29 2d6bc: cd b7 in r28, 0x3d ; 61 2d6be: de b7 in r29, 0x3e ; 62 2d6c0: a3 97 sbiw r28, 0x23 ; 35 2d6c2: 0f b6 in r0, 0x3f ; 63 2d6c4: f8 94 cli 2d6c6: de bf out 0x3e, r29 ; 62 2d6c8: 0f be out 0x3f, r0 ; 63 2d6ca: cd bf out 0x3d, r28 ; 61 2d6cc: 6c 01 movw r12, r24 { curDir=&workDir; 2d6ce: 80 e8 ldi r24, 0x80 ; 128 2d6d0: e8 2e mov r14, r24 2d6d2: 84 e1 ldi r24, 0x14 ; 20 2d6d4: f8 2e mov r15, r24 2d6d6: 82 e8 ldi r24, 0x82 ; 130 2d6d8: 94 e1 ldi r25, 0x14 ; 20 2d6da: d7 01 movw r26, r14 2d6dc: 8d 93 st X+, r24 2d6de: 9c 93 st X, r25 nrFiles=nr; 2d6e0: 10 92 f0 16 sts 0x16F0, r1 ; 0x8016f0 2d6e4: 10 92 ef 16 sts 0x16EF, r1 ; 0x8016ef curDir->rewind(); 2d6e8: 0e 94 f7 79 call 0xf3ee ; 0xf3ee }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2d6ec: 00 e0 ldi r16, 0x00 ; 0 2d6ee: 0e 7f andi r16, 0xFE ; 254 2d6f0: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir,match, LS_GetFilename); 2d6f2: d7 01 movw r26, r14 2d6f4: ed 91 ld r30, X+ 2d6f6: fc 91 ld r31, X 2d6f8: 83 e2 ldi r24, 0x23 ; 35 2d6fa: de 01 movw r26, r28 2d6fc: 11 96 adiw r26, 0x01 ; 1 2d6fe: 01 90 ld r0, Z+ 2d700: 0d 92 st X+, r0 2d702: 8a 95 dec r24 2d704: e1 f7 brne .-8 ; 0x2d6fe 2d706: 22 e0 ldi r18, 0x02 ; 2 2d708: a6 01 movw r20, r12 2d70a: be 01 movw r22, r28 2d70c: 6f 5f subi r22, 0xFF ; 255 2d70e: 7f 4f sbci r23, 0xFF ; 255 2d710: 8f ed ldi r24, 0xDF ; 223 2d712: 92 e0 ldi r25, 0x02 ; 2 2d714: 0f 94 28 69 call 0x2d250 ; 0x2d250 2d718: ce 01 movw r24, r28 2d71a: 01 96 adiw r24, 0x01 ; 1 2d71c: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 } 2d720: a3 96 adiw r28, 0x23 ; 35 2d722: 0f b6 in r0, 0x3f ; 63 2d724: f8 94 cli 2d726: de bf out 0x3e, r29 ; 62 2d728: 0f be out 0x3f, r0 ; 63 2d72a: cd bf out 0x3d, r28 ; 61 2d72c: df 91 pop r29 2d72e: cf 91 pop r28 2d730: 0f 91 pop r16 2d732: ff 90 pop r15 2d734: ef 90 pop r14 2d736: df 90 pop r13 2d738: cf 90 pop r12 2d73a: 08 95 ret 0002d73c : void CardReader::getfilename_simple(uint16_t entry, const char * const match/*=NULL*/) 2d73c: ef 92 push r14 2d73e: ff 92 push r15 2d740: 0f 93 push r16 2d742: cf 93 push r28 2d744: df 93 push r29 2d746: cd b7 in r28, 0x3d ; 61 2d748: de b7 in r29, 0x3e ; 62 2d74a: a3 97 sbiw r28, 0x23 ; 35 2d74c: 0f b6 in r0, 0x3f ; 63 2d74e: f8 94 cli 2d750: de bf out 0x3e, r29 ; 62 2d752: 0f be out 0x3f, r0 ; 63 2d754: cd bf out 0x3d, r28 ; 61 { curDir = &workDir; 2d756: 20 e8 ldi r18, 0x80 ; 128 2d758: e2 2e mov r14, r18 2d75a: 24 e1 ldi r18, 0x14 ; 20 2d75c: f2 2e mov r15, r18 2d75e: 22 e8 ldi r18, 0x82 ; 130 2d760: 34 e1 ldi r19, 0x14 ; 20 2d762: d7 01 movw r26, r14 2d764: 2d 93 st X+, r18 2d766: 3c 93 st X, r19 nrFiles = 0; 2d768: 10 92 f0 16 sts 0x16F0, r1 ; 0x8016f0 2d76c: 10 92 ef 16 sts 0x16EF, r1 ; 0x8016ef curDir->seekSet((uint32_t)entry << 5); 2d770: b0 e0 ldi r27, 0x00 ; 0 2d772: a0 e0 ldi r26, 0x00 ; 0 2d774: ac 01 movw r20, r24 2d776: bd 01 movw r22, r26 2d778: e5 e0 ldi r30, 0x05 ; 5 2d77a: 44 0f add r20, r20 2d77c: 55 1f adc r21, r21 2d77e: 66 1f adc r22, r22 2d780: 77 1f adc r23, r23 2d782: ea 95 dec r30 2d784: d1 f7 brne .-12 ; 0x2d77a 2d786: c9 01 movw r24, r18 2d788: 0f 94 97 2a call 0x2552e ; 0x2552e 2d78c: 00 e0 ldi r16, 0x00 ; 0 2d78e: 0e 7f andi r16, 0xFE ; 254 2d790: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2d792: d7 01 movw r26, r14 2d794: ed 91 ld r30, X+ 2d796: fc 91 ld r31, X 2d798: 83 e2 ldi r24, 0x23 ; 35 2d79a: de 01 movw r26, r28 2d79c: 11 96 adiw r26, 0x01 ; 1 2d79e: 01 90 ld r0, Z+ 2d7a0: 0d 92 st X+, r0 2d7a2: 8a 95 dec r24 2d7a4: e1 f7 brne .-8 ; 0x2d79e 2d7a6: 22 e0 ldi r18, 0x02 ; 2 2d7a8: 50 e0 ldi r21, 0x00 ; 0 2d7aa: 40 e0 ldi r20, 0x00 ; 0 2d7ac: be 01 movw r22, r28 2d7ae: 6f 5f subi r22, 0xFF ; 255 2d7b0: 7f 4f sbci r23, 0xFF ; 255 2d7b2: 8f ed ldi r24, 0xDF ; 223 2d7b4: 92 e0 ldi r25, 0x02 ; 2 2d7b6: 0f 94 28 69 call 0x2d250 ; 0x2d250 2d7ba: ce 01 movw r24, r28 2d7bc: 01 96 adiw r24, 0x01 ; 1 2d7be: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 } 2d7c2: a3 96 adiw r28, 0x23 ; 35 2d7c4: 0f b6 in r0, 0x3f ; 63 2d7c6: f8 94 cli 2d7c8: de bf out 0x3e, r29 ; 62 2d7ca: 0f be out 0x3f, r0 ; 63 2d7cc: cd bf out 0x3d, r28 ; 61 2d7ce: df 91 pop r29 2d7d0: cf 91 pop r28 2d7d2: 0f 91 pop r16 2d7d4: ff 90 pop r15 2d7d6: ef 90 pop r14 2d7d8: 08 95 ret 0002d7da : nrFiles = 1; curDir->seekSet(position); lsDive("", *curDir, match, LS_GetFilename); } uint16_t CardReader::getnrfilenames() 2d7da: cf 92 push r12 2d7dc: df 92 push r13 2d7de: ef 92 push r14 2d7e0: ff 92 push r15 2d7e2: 0f 93 push r16 2d7e4: cf 93 push r28 2d7e6: df 93 push r29 2d7e8: cd b7 in r28, 0x3d ; 61 2d7ea: de b7 in r29, 0x3e ; 62 2d7ec: a3 97 sbiw r28, 0x23 ; 35 2d7ee: 0f b6 in r0, 0x3f ; 63 2d7f0: f8 94 cli 2d7f2: de bf out 0x3e, r29 ; 62 2d7f4: 0f be out 0x3f, r0 ; 63 2d7f6: cd bf out 0x3d, r28 ; 61 { curDir=&workDir; 2d7f8: 80 e8 ldi r24, 0x80 ; 128 2d7fa: c8 2e mov r12, r24 2d7fc: 84 e1 ldi r24, 0x14 ; 20 2d7fe: d8 2e mov r13, r24 2d800: 82 e8 ldi r24, 0x82 ; 130 2d802: 94 e1 ldi r25, 0x14 ; 20 2d804: d6 01 movw r26, r12 2d806: 8d 93 st X+, r24 2d808: 9c 93 st X, r25 nrFiles=0; 2d80a: 2f ee ldi r18, 0xEF ; 239 2d80c: e2 2e mov r14, r18 2d80e: 26 e1 ldi r18, 0x16 ; 22 2d810: f2 2e mov r15, r18 2d812: f7 01 movw r30, r14 2d814: 11 82 std Z+1, r1 ; 0x01 2d816: 10 82 st Z, r1 curDir->rewind(); 2d818: 0e 94 f7 79 call 0xf3ee ; 0xf3ee 2d81c: 00 e0 ldi r16, 0x00 ; 0 2d81e: 0e 7f andi r16, 0xFE ; 254 2d820: 0d 7f andi r16, 0xFD ; 253 lsDive("",*curDir, NULL, LS_Count); 2d822: d6 01 movw r26, r12 2d824: ed 91 ld r30, X+ 2d826: fc 91 ld r31, X 2d828: 83 e2 ldi r24, 0x23 ; 35 2d82a: de 01 movw r26, r28 2d82c: 11 96 adiw r26, 0x01 ; 1 2d82e: 01 90 ld r0, Z+ 2d830: 0d 92 st X+, r0 2d832: 8a 95 dec r24 2d834: e1 f7 brne .-8 ; 0x2d82e 2d836: 21 e0 ldi r18, 0x01 ; 1 2d838: 50 e0 ldi r21, 0x00 ; 0 2d83a: 40 e0 ldi r20, 0x00 ; 0 2d83c: be 01 movw r22, r28 2d83e: 6f 5f subi r22, 0xFF ; 255 2d840: 7f 4f sbci r23, 0xFF ; 255 2d842: 8f ed ldi r24, 0xDF ; 223 2d844: 92 e0 ldi r25, 0x02 ; 2 2d846: 0f 94 28 69 call 0x2d250 ; 0x2d250 2d84a: ce 01 movw r24, r28 2d84c: 01 96 adiw r24, 0x01 ; 1 2d84e: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 //SERIAL_ECHOLN(nrFiles); return nrFiles; } 2d852: f7 01 movw r30, r14 2d854: 80 81 ld r24, Z 2d856: 91 81 ldd r25, Z+1 ; 0x01 2d858: a3 96 adiw r28, 0x23 ; 35 2d85a: 0f b6 in r0, 0x3f ; 63 2d85c: f8 94 cli 2d85e: de bf out 0x3e, r29 ; 62 2d860: 0f be out 0x3f, r0 ; 63 2d862: cd bf out 0x3d, r28 ; 61 2d864: df 91 pop r29 2d866: cf 91 pop r28 2d868: 0f 91 pop r16 2d86a: ff 90 pop r15 2d86c: ef 90 pop r14 2d86e: df 90 pop r13 2d870: cf 90 pop r12 2d872: 08 95 ret 0002d874 : file.getFilename(t); else t[0]=0; } void CardReader::printAbsFilenameFast() 2d874: cf 93 push r28 2d876: df 93 push r29 } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2d878: 8f e2 ldi r24, 0x2F ; 47 2d87a: 0e 94 02 7a call 0xf404 ; 0xf404 { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2d87e: c0 e0 ldi r28, 0x00 ; 0 { SERIAL_PROTOCOL(dir_names[i]); 2d880: d9 e0 ldi r29, 0x09 ; 9 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2d882: 80 91 77 15 lds r24, 0x1577 ; 0x801577 2d886: c8 17 cp r28, r24 2d888: 60 f4 brcc .+24 ; 0x2d8a2 { SERIAL_PROTOCOL(dir_names[i]); 2d88a: cd 9f mul r28, r29 2d88c: c0 01 movw r24, r0 2d88e: 11 24 eor r1, r1 2d890: 89 5d subi r24, 0xD9 ; 217 2d892: 9b 4e sbci r25, 0xEB ; 235 2d894: 0e 94 0e 86 call 0x10c1c ; 0x10c1c 2d898: 8f e2 ldi r24, 0x2F ; 47 2d89a: 0e 94 02 7a call 0xf404 ; 0xf404 } void CardReader::printAbsFilenameFast() { SERIAL_PROTOCOL('/'); for (uint8_t i = 0; i < getWorkDirDepth(); i++) 2d89e: cf 5f subi r28, 0xFF ; 255 2d8a0: f0 cf rjmp .-32 ; 0x2d882 { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2d8a2: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2d8a6: 81 11 cpse r24, r1 2d8a8: 06 c0 rjmp .+12 ; 0x2d8b6 2d8aa: 89 ed ldi r24, 0xD9 ; 217 2d8ac: 93 e1 ldi r25, 0x13 ; 19 } 2d8ae: df 91 pop r29 2d8b0: cf 91 pop r28 2d8b2: 0c 94 0e 86 jmp 0x10c1c ; 0x10c1c for (uint8_t i = 0; i < getWorkDirDepth(); i++) { SERIAL_PROTOCOL(dir_names[i]); SERIAL_PROTOCOL('/'); } SERIAL_PROTOCOL(LONGEST_FILENAME); 2d8b6: 8e ee ldi r24, 0xEE ; 238 2d8b8: 93 e1 ldi r25, 0x13 ; 19 2d8ba: f9 cf rjmp .-14 ; 0x2d8ae 0002d8bc : 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) { 2d8bc: cf 92 push r12 2d8be: df 92 push r13 2d8c0: ef 92 push r14 2d8c2: ff 92 push r15 2d8c4: 6b 01 movw r12, r22 2d8c6: 7c 01 movw r14, r24 eeprom_write_dword_notify(__p, eeprom_read_dword(__p) + add); 2d8c8: 88 ea ldi r24, 0xA8 ; 168 2d8ca: 9c e0 ldi r25, 0x0C ; 12 2d8cc: 0f 94 89 a4 call 0x34912 ; 0x34912 2d8d0: ab 01 movw r20, r22 2d8d2: bc 01 movw r22, r24 2d8d4: 4c 0d add r20, r12 2d8d6: 5d 1d adc r21, r13 2d8d8: 6e 1d adc r22, r14 2d8da: 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); 2d8dc: 88 ea ldi r24, 0xA8 ; 168 2d8de: 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); } 2d8e0: ff 90 pop r15 2d8e2: ef 90 pop r14 2d8e4: df 90 pop r13 2d8e6: 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); 2d8e8: 0d 94 d7 a4 jmp 0x349ae ; 0x349ae 0002d8ec : return def; } return val; } uint32_t __attribute__((noinline)) eeprom_init_default_dword(uint32_t *__p, uint32_t def) { 2d8ec: cf 93 push r28 2d8ee: df 93 push r29 2d8f0: ec 01 movw r28, r24 uint32_t val = eeprom_read_dword(__p); 2d8f2: 0f 94 89 a4 call 0x34912 ; 0x34912 if (val == EEPROM_EMPTY_VALUE32) { 2d8f6: 6f 3f cpi r22, 0xFF ; 255 2d8f8: 2f ef ldi r18, 0xFF ; 255 2d8fa: 72 07 cpc r23, r18 2d8fc: 82 07 cpc r24, r18 2d8fe: 92 07 cpc r25, r18 2d900: 49 f4 brne .+18 ; 0x2d914 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); 2d902: 40 e0 ldi r20, 0x00 ; 0 2d904: 50 e0 ldi r21, 0x00 ; 0 2d906: ba 01 movw r22, r20 2d908: ce 01 movw r24, r28 2d90a: 0f 94 d7 a4 call 0x349ae ; 0x349ae 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; 2d90e: 60 e0 ldi r22, 0x00 ; 0 2d910: 70 e0 ldi r23, 0x00 ; 0 2d912: cb 01 movw r24, r22 } return val; } 2d914: df 91 pop r29 2d916: cf 91 pop r28 2d918: 08 95 ret 0002d91a : : "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(){ 2d91a: 0f 93 push r16 2d91c: 1f 93 push r17 2d91e: cf 93 push r28 2d920: df 93 push r29 if( ! gfEnsureBlock() ){ 2d922: 0f 94 66 5a call 0x2b4cc ; 0x2b4cc 2d926: 88 23 and r24, r24 2d928: 39 f1 breq .+78 ; 0x2d978 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; 2d92a: 20 91 82 16 lds r18, 0x1682 ; 0x801682 2d92e: 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; 2d932: 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; 2d934: 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 == ';' ){ 2d936: 88 81 ld r24, Y 2d938: 8b 33 cpi r24, 0x3B ; 59 2d93a: 51 f5 brne .+84 ; 0x2d990 // 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); 2d93c: fe 01 movw r30, r28 0002d93e : 2d93e: 61 91 ld r22, Z+ 2d940: 6a 30 cpi r22, 0x0A ; 10 2d942: e9 f7 brne .-6 ; 0x2d93e 2d944: ef 01 movw r28, r30 // found a newline, prepare the next block if block cache end reached if( rdPtr - blockBuffBegin > 512 ){ 2d946: cf 01 movw r24, r30 2d948: 86 54 subi r24, 0x46 ; 70 2d94a: 9e 40 sbci r25, 0x0E ; 14 2d94c: 81 30 cpi r24, 0x01 ; 1 2d94e: 92 40 sbci r25, 0x02 ; 2 2d950: e4 f0 brlt .+56 ; 0x2d98a // at the end of block cache, fill new data in gfUpdateCurrentPosition( rdPtr - start - 1 ); 2d952: ce 01 movw r24, r28 2d954: 82 1b sub r24, r18 2d956: 93 0b sbc r25, r19 2d958: 01 97 sbiw r24, 0x01 ; 1 2d95a: 0f 94 42 55 call 0x2aa84 ; 0x2aa84 if( ! gfComputeNextFileBlock() )goto eof_or_fail; 2d95e: 87 e6 ldi r24, 0x67 ; 103 2d960: 96 e1 ldi r25, 0x16 ; 22 2d962: 0f 94 1e 2a call 0x2543c ; 0x2543c 2d966: 88 23 and r24, r24 2d968: 39 f0 breq .+14 ; 0x2d978 if( ! gfEnsureBlock() )goto eof_or_fail; // fetch it into RAM 2d96a: 0f 94 66 5a call 0x2b4cc ; 0x2b4cc rdPtr = start = blockBuffBegin; 2d96e: 26 e4 ldi r18, 0x46 ; 70 2d970: 3e e0 ldi r19, 0x0E ; 14 2d972: 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 2d974: 81 11 cpse r24, r1 2d976: e2 cf rjmp .-60 ; 0x2d93c } eof_or_fail: // make the rdptr point to a safe location - end of file gfReadPtr = gfBlockBuffBegin() + 512; 2d978: 86 e4 ldi r24, 0x46 ; 70 2d97a: 90 e1 ldi r25, 0x10 ; 16 2d97c: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2d980: 80 93 82 16 sts 0x1682, r24 ; 0x801682 return -1; 2d984: cf ef ldi r28, 0xFF ; 255 2d986: df ef ldi r29, 0xFF ; 255 2d988: 34 c0 rjmp .+104 ; 0x2d9f2 2d98a: 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){ 2d98c: c1 f5 brne .+112 ; 0x2d9fe // 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 2d98e: 21 97 sbiw r28, 0x01 ; 1 } } } emit_char: { gfUpdateCurrentPosition( rdPtr - start + 1 ); 2d990: ce 01 movw r24, r28 2d992: 82 1b sub r24, r18 2d994: 93 0b sbc r25, r19 2d996: 01 96 adiw r24, 0x01 ; 1 2d998: 0f 94 42 55 call 0x2aa84 ; 0x2aa84 int16_t rv = *rdPtr++; 2d99c: ce 01 movw r24, r28 2d99e: 01 96 adiw r24, 0x01 ; 1 2d9a0: c8 81 ld r28, Y 2d9a2: d0 e0 ldi r29, 0x00 ; 0 if( curPosition_ >= fileSize_ ){ 2d9a4: 00 91 6f 16 lds r16, 0x166F ; 0x80166f 2d9a8: 10 91 70 16 lds r17, 0x1670 ; 0x801670 2d9ac: 20 91 71 16 lds r18, 0x1671 ; 0x801671 2d9b0: 30 91 72 16 lds r19, 0x1672 ; 0x801672 2d9b4: 40 91 78 16 lds r20, 0x1678 ; 0x801678 2d9b8: 50 91 79 16 lds r21, 0x1679 ; 0x801679 2d9bc: 60 91 7a 16 lds r22, 0x167A ; 0x80167a 2d9c0: 70 91 7b 16 lds r23, 0x167B ; 0x80167b 2d9c4: 04 17 cp r16, r20 2d9c6: 15 07 cpc r17, r21 2d9c8: 26 07 cpc r18, r22 2d9ca: 37 07 cpc r19, r23 2d9cc: a8 f6 brcc .-86 ; 0x2d978 // past the end of file goto eof_or_fail; } else if( rdPtr - blockBuffBegin >= 512 ){ 2d9ce: 9c 01 movw r18, r24 2d9d0: 26 54 subi r18, 0x46 ; 70 2d9d2: 3e 40 sbci r19, 0x0E ; 14 2d9d4: 21 15 cp r18, r1 2d9d6: 32 40 sbci r19, 0x02 ; 2 2d9d8: 44 f0 brlt .+16 ; 0x2d9ea // past the end of current bufferred block - prepare the next one... if( ! gfComputeNextFileBlock() )goto eof_or_fail; 2d9da: 87 e6 ldi r24, 0x67 ; 103 2d9dc: 96 e1 ldi r25, 0x16 ; 22 2d9de: 0f 94 1e 2a call 0x2543c ; 0x2543c 2d9e2: 88 23 and r24, r24 2d9e4: 49 f2 breq .-110 ; 0x2d978 // don't need to force fetch the block here, it will get loaded on the next call rdPtr = blockBuffBegin; 2d9e6: 86 e4 ldi r24, 0x46 ; 70 2d9e8: 9e e0 ldi r25, 0x0E ; 14 } // save the current read ptr for the next run gfReadPtr = rdPtr; 2d9ea: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2d9ee: 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; } 2d9f2: ce 01 movw r24, r28 2d9f4: df 91 pop r29 2d9f6: cf 91 pop r28 2d9f8: 1f 91 pop r17 2d9fa: 0f 91 pop r16 2d9fc: 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 == ';' ){ 2d9fe: 88 81 ld r24, Y 2da00: 8b 33 cpi r24, 0x3B ; 59 2da02: 09 f4 brne .+2 ; 0x2da06 2da04: 98 cf rjmp .-208 ; 0x2d936 2da06: c3 cf rjmp .-122 ; 0x2d98e 0002da08 : } return 0; } static uint8_t twi_start(uint8_t address, uint8_t reg) 2da08: cf 93 push r28 2da0a: df 93 push r29 2da0c: d8 2f mov r29, r24 { // send start condition TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 2da0e: 84 ea ldi r24, 0xA4 ; 164 2da10: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 2da14: 88 e0 ldi r24, 0x08 ; 8 2da16: 0f 94 f3 0b call 0x217e6 ; 0x217e6 2da1a: 81 11 cpse r24, r1 2da1c: 16 c0 rjmp .+44 ; 0x2da4a return 1; // send address TWDR = TW_WRITE | (address << 1); 2da1e: 8a ee ldi r24, 0xEA ; 234 2da20: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2da24: c4 e8 ldi r28, 0x84 ; 132 2da26: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2da2a: 88 e1 ldi r24, 0x18 ; 24 2da2c: 0f 94 f3 0b call 0x217e6 ; 0x217e6 2da30: 81 11 cpse r24, r1 2da32: 0f c0 rjmp .+30 ; 0x2da52 return 2; // send register TWDR = reg; 2da34: d0 93 bb 00 sts 0x00BB, r29 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2da38: c0 93 bc 00 sts 0x00BC, r28 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_DATA_ACK)) 2da3c: 88 e2 ldi r24, 0x28 ; 40 2da3e: 0f 94 f3 0b call 0x217e6 ; 0x217e6 2da42: 88 23 and r24, r24 2da44: 19 f0 breq .+6 ; 0x2da4c return 3; 2da46: 83 e0 ldi r24, 0x03 ; 3 2da48: 01 c0 rjmp .+2 ; 0x2da4c static uint8_t twi_start(uint8_t address, uint8_t reg) { // send start condition TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); if(twi_wait(TW_START)) return 1; 2da4a: 81 e0 ldi r24, 0x01 ; 1 TWCR = _BV(TWEN) | _BV(TWINT); if(twi_wait(TW_MT_DATA_ACK)) return 3; return 0; } 2da4c: df 91 pop r29 2da4e: cf 91 pop r28 2da50: 08 95 ret // send address TWDR = TW_WRITE | (address << 1); TWCR = _BV(TWEN) | _BV(TWINT); if(twi_wait(TW_MT_SLA_ACK)) return 2; 2da52: 82 e0 ldi r24, 0x02 ; 2 2da54: fb cf rjmp .-10 ; 0x2da4c 0002da56 : ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } return ret; } void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } 2da56: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2da58: f8 94 cli 2da5a: 10 92 03 17 sts 0x1703, r1 ; 0x801703 2da5e: 10 92 02 17 sts 0x1702, r1 ; 0x801702 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2da62: 8f bf out 0x3f, r24 ; 63 } 2da64: 08 95 ret 0002da66 : 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); 2da66: 87 e6 ldi r24, 0x67 ; 103 2da68: 9f e0 ldi r25, 0x0F ; 15 2da6a: 0f 94 81 a4 call 0x34902 ; 0x34902 2da6e: 91 e0 ldi r25, 0x01 ; 1 2da70: 81 11 cpse r24, r1 2da72: 01 c0 rjmp .+2 ; 0x2da76 2da74: 90 e0 ldi r25, 0x00 ; 0 if ((state != State::disabled) != enabled) { 2da76: 81 e0 ldi r24, 0x01 ; 1 2da78: 20 91 f1 16 lds r18, 0x16F1 ; 0x8016f1 2da7c: 21 11 cpse r18, r1 2da7e: 01 c0 rjmp .+2 ; 0x2da82 2da80: 80 e0 ldi r24, 0x00 ; 0 2da82: 98 13 cpse r25, r24 state = enabled ? State::initializing : State::disabled; 2da84: 90 93 f1 16 sts 0x16F1, r25 ; 0x8016f1 } autoLoadEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_AUTOLOAD_ENABLED); 2da88: 87 e0 ldi r24, 0x07 ; 7 2da8a: 9f e0 ldi r25, 0x0F ; 15 2da8c: 0f 94 81 a4 call 0x34902 ; 0x34902 2da90: 91 e0 ldi r25, 0x01 ; 1 2da92: 81 11 cpse r24, r1 2da94: 01 c0 rjmp .+2 ; 0x2da98 2da96: 90 e0 ldi r25, 0x00 ; 0 2da98: 90 93 f2 16 sts 0x16F2, r25 ; 0x8016f2 runoutEnabled = eeprom_read_byte((uint8_t *)EEPROM_FSENS_RUNOUT_ENABLED); 2da9c: 85 ed ldi r24, 0xD5 ; 213 2da9e: 9e e0 ldi r25, 0x0E ; 14 2daa0: 0f 94 81 a4 call 0x34902 ; 0x34902 2daa4: 91 e0 ldi r25, 0x01 ; 1 2daa6: 81 11 cpse r24, r1 2daa8: 01 c0 rjmp .+2 ; 0x2daac 2daaa: 90 e0 ldi r25, 0x00 ; 0 2daac: 90 93 f3 16 sts 0x16F3, r25 ; 0x8016f3 sensorActionOnError = (SensorActionOnError)eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_ACTION_NA); 2dab0: 87 e4 ldi r24, 0x47 ; 71 2dab2: 9d e0 ldi r25, 0x0D ; 13 2dab4: 0f 94 81 a4 call 0x34902 ; 0x34902 if (sensorActionOnError == SensorActionOnError::_Undef) { 2dab8: 8f 3f cpi r24, 0xFF ; 255 2daba: c9 f0 breq .+50 ; 0x2daee 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); 2dabc: 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)); 2dac0: 8d ea ldi r24, 0xAD ; 173 2dac2: 9c e0 ldi r25, 0x0C ; 12 2dac4: 0f 94 81 a4 call 0x34902 ; 0x34902 2dac8: 91 e0 ldi r25, 0x01 ; 1 2daca: 81 11 cpse r24, r1 2dacc: 01 c0 rjmp .+2 ; 0x2dad0 2dace: 90 e0 ldi r25, 0x00 ; 0 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2dad0: 90 93 ff 16 sts 0x16FF, r25 ; 0x8016ff oldPos = pat9125_y; 2dad4: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 2dad8: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 2dadc: 90 93 01 17 sts 0x1701, r25 ; 0x801701 2dae0: 80 93 00 17 sts 0x1700, r24 ; 0x801700 resetStepCount(); 2dae4: 0f 94 2b 6d call 0x2da56 ; 0x2da56 jamErrCnt = 0; 2dae8: 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)); } 2daec: 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; 2daee: 10 92 f9 16 sts 0x16F9, r1 ; 0x8016f9 2daf2: e6 cf rjmp .-52 ; 0x2dac0 0002daf4 : #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) { 2daf4: 80 91 f1 16 lds r24, 0x16F1 ; 0x8016f1 2daf8: 83 30 cpi r24, 0x03 ; 3 2dafa: 21 f4 brne .+8 ; 0x2db04 } void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; 2dafc: 10 92 f1 16 sts 0x16F1, r1 ; 0x8016f1 filter = 0; 2db00: 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 2db04: 0f 94 33 6d call 0x2da66 ; 0x2da66 int16_t stepCount; int16_t chunkSteps; uint8_t jamErrCnt; constexpr void calcChunkSteps(float u) { chunkSteps = (int16_t)(1.25 * u); //[mm] 2db08: 20 e0 ldi r18, 0x00 ; 0 2db0a: 30 e0 ldi r19, 0x00 ; 0 2db0c: 40 ea ldi r20, 0xA0 ; 160 2db0e: 5f e3 ldi r21, 0x3F ; 63 2db10: 60 91 77 0d lds r22, 0x0D77 ; 0x800d77 2db14: 70 91 78 0d lds r23, 0x0D78 ; 0x800d78 2db18: 80 91 79 0d lds r24, 0x0D79 ; 0x800d79 2db1c: 90 91 7a 0d lds r25, 0x0D7A ; 0x800d7a 2db20: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2db24: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 2db28: 70 93 05 17 sts 0x1705, r23 ; 0x801705 2db2c: 60 93 04 17 sts 0x1704, r22 ; 0x801704 void twi_init(void) { // activate internal pullups for SDA SET_INPUT(SDA_PIN); 2db30: 51 98 cbi 0x0a, 1 ; 10 WRITE(SDA_PIN, 1); 2db32: 59 9a sbi 0x0b, 1 ; 11 // start with the SDA pulled low WRITE(SCL_PIN, 0); 2db34: 58 98 cbi 0x0b, 0 ; 11 SET_OUTPUT(SCL_PIN); 2db36: 50 9a sbi 0x0a, 0 ; 10 2db38: 8a e0 ldi r24, 0x0A ; 10 // clock 10 cycles to make sure that the sensor is not stuck in a register read. for (uint8_t i = 0; i < 10; i++) { WRITE(SCL_PIN, 1); 2db3a: 58 9a sbi 0x0b, 0 ; 11 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 2db3c: 95 e0 ldi r25, 0x05 ; 5 2db3e: 9a 95 dec r25 2db40: f1 f7 brne .-4 ; 0x2db3e 2db42: 00 00 nop _delay_us((1000000 / TWI_FREQ) / 2); WRITE(SCL_PIN, 0); 2db44: 58 98 cbi 0x0b, 0 ; 11 2db46: 95 e0 ldi r25, 0x05 ; 5 2db48: 9a 95 dec r25 2db4a: f1 f7 brne .-4 ; 0x2db48 2db4c: 00 00 nop 2db4e: 81 50 subi r24, 0x01 ; 1 // start with the SDA pulled low WRITE(SCL_PIN, 0); SET_OUTPUT(SCL_PIN); // clock 10 cycles to make sure that the sensor is not stuck in a register read. for (uint8_t i = 0; i < 10; i++) { 2db50: a1 f7 brne .-24 ; 0x2db3a WRITE(SCL_PIN, 0); _delay_us((1000000 / TWI_FREQ) / 2); } // activate internal pullups for SCL SET_INPUT(SCL_PIN); 2db52: 50 98 cbi 0x0a, 0 ; 10 WRITE(SCL_PIN, 1); 2db54: 58 9a sbi 0x0b, 0 ; 11 // initialize twi prescaler and bit rate TWSR &= ~(_BV(TWPS0) | _BV(TWPS1)); 2db56: 80 91 b9 00 lds r24, 0x00B9 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> 2db5a: 8c 7f andi r24, 0xFC ; 252 2db5c: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 <__TEXT_REGION_LENGTH__+0x7c20b9> TWBR = ((F_CPU / TWI_FREQ) - 16) / 2; 2db60: 8c e0 ldi r24, 0x0C ; 12 2db62: 80 93 b8 00 sts 0x00B8, r24 ; 0x8000b8 <__TEXT_REGION_LENGTH__+0x7c20b8> uint8_t twi_check(uint8_t address) { // send start condition TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTA); 2db66: 84 ea ldi r24, 0xA4 ; 164 2db68: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_START)) 2db6c: 88 e0 ldi r24, 0x08 ; 8 2db6e: 0f 94 f3 0b call 0x217e6 ; 0x217e6 2db72: 81 11 cpse r24, r1 2db74: 67 c0 rjmp .+206 ; 0x2dc44 return 1; // send address TWDR = TW_WRITE | (address << 1); 2db76: 8a ee ldi r24, 0xEA ; 234 2db78: 80 93 bb 00 sts 0x00BB, r24 ; 0x8000bb <__TEXT_REGION_LENGTH__+0x7c20bb> TWCR = _BV(TWEN) | _BV(TWINT); 2db7c: 84 e8 ldi r24, 0x84 ; 132 2db7e: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> if(twi_wait(TW_MT_SLA_ACK)) 2db82: 88 e1 ldi r24, 0x18 ; 24 2db84: 0f 94 f3 0b call 0x217e6 ; 0x217e6 2db88: 81 11 cpse r24, r1 2db8a: 5c c0 rjmp .+184 ; 0x2dc44 } static void twi_stop() { TWCR = _BV(TWEN) | _BV(TWINT) | _BV(TWSTO); 2db8c: 84 e9 ldi r24, 0x94 ; 148 2db8e: 80 93 bc 00 sts 0x00BC, r24 ; 0x8000bc <__TEXT_REGION_LENGTH__+0x7c20bc> { if (!pat9125_probe()) return 0; // Switch to bank0, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0); 2db92: 60 e0 ldi r22, 0x00 ; 0 2db94: 8f e7 ldi r24, 0x7F ; 127 2db96: 0f 94 d2 4c call 0x299a4 ; 0x299a4 // Verify that the sensor responds with its correct product ID. pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2db9a: 80 e0 ldi r24, 0x00 ; 0 2db9c: 0f 94 ed 4c call 0x299da ; 0x299da 2dba0: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2dba4: 81 e0 ldi r24, 0x01 ; 1 2dba6: 0f 94 ed 4c call 0x299da ; 0x299da 2dbaa: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2dbae: 90 91 66 0d lds r25, 0x0D66 ; 0x800d66 2dbb2: 91 33 cpi r25, 0x31 ; 49 2dbb4: b1 f5 brne .+108 ; 0x2dc22 2dbb6: 81 39 cpi r24, 0x91 ; 145 2dbb8: a1 f5 brne .+104 ; 0x2dc22 } #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); 2dbba: 67 e9 ldi r22, 0x97 ; 151 2dbbc: 86 e0 ldi r24, 0x06 ; 6 2dbbe: 0f 94 d2 4c call 0x299a4 ; 0x299a4 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); 2dbc2: 8f e9 ldi r24, 0x9F ; 159 2dbc4: 9f e0 ldi r25, 0x0F ; 15 2dbc6: 01 97 sbiw r24, 0x01 ; 1 2dbc8: f1 f7 brne .-4 ; 0x2dbc6 2dbca: 00 c0 rjmp .+0 ; 0x2dbcc 2dbcc: 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)) 2dbce: 86 e1 ldi r24, 0x16 ; 22 2dbd0: 92 ea ldi r25, 0xA2 ; 162 2dbd2: 0f 94 1a 4d call 0x29a34 ; 0x29a34 2dbd6: 88 23 and r24, r24 2dbd8: a9 f1 breq .+106 ; 0x2dc44 2dbda: 8f e3 ldi r24, 0x3F ; 63 2dbdc: 9c e9 ldi r25, 0x9C ; 156 2dbde: 01 97 sbiw r24, 0x01 ; 1 2dbe0: f1 f7 brne .-4 ; 0x2dbde 2dbe2: 00 c0 rjmp .+0 ; 0x2dbe4 2dbe4: 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); 2dbe6: 61 e0 ldi r22, 0x01 ; 1 2dbe8: 8f e7 ldi r24, 0x7F ; 127 2dbea: 0f 94 d2 4c call 0x299a4 ; 0x299a4 //Write init sequence in bank1. MUST ALREADY BE IN bank1. if (!pat9125_wr_seq(pat9125_init_bank1)) 2dbee: 83 ee ldi r24, 0xE3 ; 227 2dbf0: 91 ea ldi r25, 0xA1 ; 161 2dbf2: 0f 94 1a 4d call 0x29a34 ; 0x29a34 2dbf6: 88 23 and r24, r24 2dbf8: 29 f1 breq .+74 ; 0x2dc44 return 0; // Switch to bank0, not allowed to perform pat9125_wr_reg_verify on this register. pat9125_wr_reg(PAT9125_BANK_SELECTION, 0x00); 2dbfa: 60 e0 ldi r22, 0x00 ; 0 2dbfc: 8f e7 ldi r24, 0x7F ; 127 2dbfe: 0f 94 d2 4c call 0x299a4 ; 0x299a4 // Enable write protect. pat9125_wr_reg(PAT9125_WP, 0x00); //prevents writing to registers over 0x09 2dc02: 60 e0 ldi r22, 0x00 ; 0 2dc04: 89 e0 ldi r24, 0x09 ; 9 2dc06: 0f 94 d2 4c call 0x299a4 ; 0x299a4 pat9125_PID1 = pat9125_rd_reg(PAT9125_PID1); 2dc0a: 80 e0 ldi r24, 0x00 ; 0 2dc0c: 0f 94 ed 4c call 0x299da ; 0x299da 2dc10: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2dc14: 81 e0 ldi r24, 0x01 ; 1 2dc16: 0f 94 ed 4c call 0x299da ; 0x299da 2dc1a: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 deinit(); triggerError(); ; // } #ifdef IR_SENSOR_PIN else if (!READ(IR_SENSOR_PIN)) { 2dc1e: 89 b1 in r24, 0x09 ; 9 2dc20: 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); 2dc22: 80 e0 ldi r24, 0x00 ; 0 2dc24: 0f 94 ed 4c call 0x299da ; 0x299da 2dc28: 80 93 66 0d sts 0x0D66, r24 ; 0x800d66 pat9125_PID2 = pat9125_rd_reg(PAT9125_PID2); 2dc2c: 81 e0 ldi r24, 0x01 ; 1 2dc2e: 0f 94 ed 4c call 0x299da ; 0x299da 2dc32: 80 93 65 0d sts 0x0D65, r24 ; 0x800d65 if ((pat9125_PID1 != 0x31) || (pat9125_PID2 != 0x91)) 2dc36: 90 91 66 0d lds r25, 0x0D66 ; 0x800d66 2dc3a: 91 33 cpi r25, 0x31 ; 49 2dc3c: 19 f4 brne .+6 ; 0x2dc44 2dc3e: 81 39 cpi r24, 0x91 ; 145 2dc40: 09 f4 brne .+2 ; 0x2dc44 2dc42: bb cf rjmp .-138 ; 0x2dbba void PAT9125_sensor::deinit() { // puts_P(PSTR("fsensor::deinit()")); ; // state = State::disabled; filter = 0; 2dc44: 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; 2dc48: 83 e0 ldi r24, 0x03 ; 3 2dc4a: 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 } 2dc4e: 08 95 ret 0002dc50 : 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() { 2dc50: cf 93 push r28 2dc52: df 93 push r29 if (jamDetection) { 2dc54: 80 91 ff 16 lds r24, 0x16FF ; 0x8016ff 2dc58: 88 23 and r24, r24 2dc5a: 09 f4 brne .+2 ; 0x2dc5e 2dc5c: 60 c0 rjmp .+192 ; 0x2dd1e setJamDetectionEnabled(eeprom_read_byte((uint8_t *)EEPROM_FSENSOR_JAM_DETECTION)); } int16_t PAT9125_sensor::getStepCount() { int16_t ret; ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = stepCount; } 2dc5e: 8f b7 in r24, 0x3f ; 63 return 1; } static __inline__ uint8_t __iCliRetVal(void) { cli(); 2dc60: f8 94 cli 2dc62: c0 91 02 17 lds r28, 0x1702 ; 0x801702 2dc66: d0 91 03 17 lds r29, 0x1703 ; 0x801703 (void)__s; } static __inline__ void __iRestore(const uint8_t *__s) { SREG = *__s; 2dc6a: 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 2dc6c: ce 01 movw r24, r28 2dc6e: d7 ff sbrs r29, 7 2dc70: 04 c0 rjmp .+8 ; 0x2dc7a 2dc72: 88 27 eor r24, r24 2dc74: 99 27 eor r25, r25 2dc76: 8c 1b sub r24, r28 2dc78: 9d 0b sbc r25, r29 2dc7a: 20 91 04 17 lds r18, 0x1704 ; 0x801704 2dc7e: 30 91 05 17 lds r19, 0x1705 ; 0x801705 2dc82: 82 17 cp r24, r18 2dc84: 93 07 cpc r25, r19 2dc86: 4c f1 brlt .+82 ; 0x2dcda resetStepCount(); 2dc88: 0f 94 2b 6d call 0x2da56 ; 0x2da56 if (!pat9125_update()) { // get up to date data. reinit on error. 2dc8c: 0f 94 38 4d call 0x29a70 ; 0x29a70 2dc90: 81 11 cpse r24, r1 2dc92: 02 c0 rjmp .+4 ; 0x2dc98 init(); // try to reinit. 2dc94: 0f 94 7a 6d call 0x2daf4 ; 0x2daf4 } bool fsDir = (pat9125_y - oldPos) > 0; 2dc98: 20 91 38 0e lds r18, 0x0E38 ; 0x800e38 2dc9c: 30 91 39 0e lds r19, 0x0E39 ; 0x800e39 2dca0: 80 91 06 17 lds r24, 0x1706 ; 0x801706 2dca4: 40 91 00 17 lds r20, 0x1700 ; 0x801700 2dca8: 50 91 01 17 lds r21, 0x1701 ; 0x801701 2dcac: b9 01 movw r22, r18 2dcae: 64 1b sub r22, r20 2dcb0: 75 0b sbc r23, r21 2dcb2: 41 e0 ldi r20, 0x01 ; 1 2dcb4: 16 16 cp r1, r22 2dcb6: 17 06 cpc r1, r23 2dcb8: 0c f0 brlt .+2 ; 0x2dcbc 2dcba: 40 e0 ldi r20, 0x00 ; 0 bool stDir = _stepCount > 0; 2dcbc: 91 e0 ldi r25, 0x01 ; 1 2dcbe: 1c 16 cp r1, r28 2dcc0: 1d 06 cpc r1, r29 2dcc2: 0c f0 brlt .+2 ; 0x2dcc6 2dcc4: 90 e0 ldi r25, 0x00 ; 0 if (fsDir != stDir) { 2dcc6: 49 17 cp r20, r25 2dcc8: 09 f4 brne .+2 ; 0x2dccc 2dcca: 61 c0 rjmp .+194 ; 0x2dd8e jamErrCnt++; 2dccc: 8f 5f subi r24, 0xFF ; 255 } else if (jamErrCnt) { jamErrCnt--; 2dcce: 80 93 06 17 sts 0x1706, r24 ; 0x801706 } oldPos = pat9125_y; 2dcd2: 30 93 01 17 sts 0x1701, r19 ; 0x801701 2dcd6: 20 93 00 17 sts 0x1700, r18 ; 0x801700 } if (jamErrCnt > 10) { 2dcda: 80 91 06 17 lds r24, 0x1706 ; 0x801706 2dcde: 8b 30 cpi r24, 0x0B ; 11 2dce0: f0 f0 brcs .+60 ; 0x2dd1e jamErrCnt = 0; 2dce2: 10 92 06 17 sts 0x1706, r1 ; 0x801706 void PAT9125_sensor::resetStepCount() { ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { stepCount = 0; } } void PAT9125_sensor::filJam() { runoutEnabled = false; 2dce6: 10 92 f3 16 sts 0x16F3, r1 ; 0x8016f3 autoLoadEnabled = false; 2dcea: 10 92 f2 16 sts 0x16F2, r1 ; 0x8016f2 jamDetection = false; 2dcee: 10 92 ff 16 sts 0x16FF, r1 ; 0x8016ff stop_and_save_print_to_ram(0, 0); 2dcf2: 60 e0 ldi r22, 0x00 ; 0 2dcf4: 70 e0 ldi r23, 0x00 ; 0 2dcf6: cb 01 movw r24, r22 2dcf8: 0f 94 a4 65 call 0x2cb48 ; 0x2cb48 restore_print_from_ram_and_continue(0); 2dcfc: 60 e0 ldi r22, 0x00 ; 0 2dcfe: 70 e0 ldi r23, 0x00 ; 0 2dd00: cb 01 movw r24, r22 2dd02: 0e 94 09 67 call 0xce12 ; 0xce12 eeprom_increment_byte((uint8_t *)EEPROM_FERROR_COUNT); 2dd06: 85 e6 ldi r24, 0x65 ; 101 2dd08: 9f e0 ldi r25, 0x0F ; 15 2dd0a: 0e 94 cd 78 call 0xf19a ; 0xf19a eeprom_increment_word((uint16_t *)EEPROM_FERROR_COUNT_TOT); 2dd0e: 81 e0 ldi r24, 0x01 ; 1 2dd10: 9f e0 ldi r25, 0x0F ; 15 2dd12: 0e 94 c0 78 call 0xf180 ; 0xf180 enquecommand_front_P(MSG_M600); 2dd16: 82 e0 ldi r24, 0x02 ; 2 2dd18: 9d e6 ldi r25, 0x6D ; 109 2dd1a: 0f 94 16 67 call 0x2ce2c ; 0x2ce2c jamErrCnt = 0; filJam(); } } if (pollingTimer.expired_cont(pollingPeriod)) { 2dd1e: 6a e0 ldi r22, 0x0A ; 10 2dd20: 70 e0 ldi r23, 0x00 ; 0 2dd22: 8a ef ldi r24, 0xFA ; 250 2dd24: 96 e1 ldi r25, 0x16 ; 22 2dd26: 0f 94 e0 0b call 0x217c0 ; 0x217c0 ::expired_cont(unsigned short)> 2dd2a: c8 2f mov r28, r24 2dd2c: 88 23 and r24, r24 2dd2e: 39 f1 breq .+78 ; 0x2dd7e pollingTimer.start(); 2dd30: 8a ef ldi r24, 0xFA ; 250 2dd32: 96 e1 ldi r25, 0x16 ; 22 2dd34: 0f 94 e7 0b call 0x217ce ; 0x217ce ::start()> if (!pat9125_update()) { 2dd38: 0f 94 38 4d call 0x29a70 ; 0x29a70 2dd3c: 81 11 cpse r24, r1 2dd3e: 02 c0 rjmp .+4 ; 0x2dd44 init(); // try to reinit. 2dd40: 0f 94 7a 6d call 0x2daf4 ; 0x2daf4 } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); 2dd44: 80 91 64 0d lds r24, 0x0D64 ; 0x800d64 2dd48: 81 31 cpi r24, 0x11 ; 17 2dd4a: 30 f0 brcs .+12 ; 0x2dd58 2dd4c: c1 e0 ldi r28, 0x01 ; 1 2dd4e: 80 91 63 0d lds r24, 0x0D63 ; 0x800d63 2dd52: 82 33 cpi r24, 0x32 ; 50 2dd54: 08 f4 brcc .+2 ; 0x2dd58 2dd56: c0 e0 ldi r28, 0x00 ; 0 2dd58: 80 91 fd 16 lds r24, 0x16FD ; 0x8016fd if (present != filterFilPresent) { 2dd5c: 20 91 fe 16 lds r18, 0x16FE ; 0x8016fe 2dd60: 30 e0 ldi r19, 0x00 ; 0 2dd62: c2 17 cp r28, r18 2dd64: 13 06 cpc r1, r19 2dd66: c1 f0 breq .+48 ; 0x2dd98 filter++; 2dd68: 8f 5f subi r24, 0xFF ; 255 } else if (filter) { filter--; 2dd6a: 80 93 fd 16 sts 0x16FD, r24 ; 0x8016fd } if (filter >= filterCnt) { 2dd6e: 80 91 fd 16 lds r24, 0x16FD ; 0x8016fd 2dd72: 85 30 cpi r24, 0x05 ; 5 2dd74: 20 f0 brcs .+8 ; 0x2dd7e filter = 0; 2dd76: 10 92 fd 16 sts 0x16FD, r1 ; 0x8016fd filterFilPresent = present; 2dd7a: c0 93 fe 16 sts 0x16FE, r28 ; 0x8016fe } } return (filter == 0); // return stability 2dd7e: 81 e0 ldi r24, 0x01 ; 1 2dd80: 90 91 fd 16 lds r25, 0x16FD ; 0x8016fd 2dd84: 91 11 cpse r25, r1 2dd86: 80 e0 ldi r24, 0x00 ; 0 } 2dd88: df 91 pop r29 2dd8a: cf 91 pop r28 2dd8c: 08 95 ret } bool fsDir = (pat9125_y - oldPos) > 0; bool stDir = _stepCount > 0; if (fsDir != stDir) { jamErrCnt++; } else if (jamErrCnt) { 2dd8e: 88 23 and r24, r24 2dd90: 09 f4 brne .+2 ; 0x2dd94 2dd92: 9f cf rjmp .-194 ; 0x2dcd2 jamErrCnt--; 2dd94: 81 50 subi r24, 0x01 ; 1 2dd96: 9b cf rjmp .-202 ; 0x2dcce } bool present = (pat9125_s < 17) || (pat9125_s >= 17 && pat9125_b >= 50); if (present != filterFilPresent) { filter++; } else if (filter) { 2dd98: 88 23 and r24, r24 2dd9a: 49 f3 breq .-46 ; 0x2dd6e filter--; 2dd9c: 81 50 subi r24, 0x01 ; 1 2dd9e: e5 cf rjmp .-54 ; 0x2dd6a 0002dda0 : * 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() { 2dda0: 2f 92 push r2 2dda2: 3f 92 push r3 2dda4: 4f 92 push r4 2dda6: 5f 92 push r5 2dda8: 6f 92 push r6 2ddaa: 7f 92 push r7 2ddac: 8f 92 push r8 2ddae: 9f 92 push r9 2ddb0: af 92 push r10 2ddb2: bf 92 push r11 2ddb4: cf 92 push r12 2ddb6: df 92 push r13 2ddb8: ef 92 push r14 2ddba: ff 92 push r15 2ddbc: 0f 93 push r16 2ddbe: 1f 93 push r17 2ddc0: cf 93 push r28 2ddc2: df 93 push r29 2ddc4: cd b7 in r28, 0x3d ; 61 2ddc6: de b7 in r29, 0x3e ; 62 2ddc8: ed 97 sbiw r28, 0x3d ; 61 2ddca: 0f b6 in r0, 0x3f ; 63 2ddcc: f8 94 cli 2ddce: de bf out 0x3e, r29 ; 62 2ddd0: 0f be out 0x3f, r0 ; 63 2ddd2: cd bf out 0x3d, r28 ; 61 KEEPALIVE_STATE(NOT_BUSY); } void CardReader::flush_presort() { sort_count = 0; 2ddd4: 10 92 79 15 sts 0x1579, r1 ; 0x801579 2ddd8: 10 92 78 15 sts 0x1578, r1 ; 0x801578 lastSortedFilePosition = 0; 2dddc: 10 92 43 16 sts 0x1643, r1 ; 0x801643 2dde0: 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 2dde4: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2dde8: 80 fd sbrc r24, 0 2ddea: f7 c0 rjmp .+494 ; 0x2dfda uint8_t sdSort = eeprom_read_byte((uint8_t*)EEPROM_SD_SORT); 2ddec: 89 e0 ldi r24, 0x09 ; 9 2ddee: 9f e0 ldi r25, 0x0F ; 15 2ddf0: 0f 94 81 a4 call 0x34902 ; 0x34902 2ddf4: 38 2e mov r3, r24 KEEPALIVE_STATE(IN_HANDLER); 2ddf6: 82 e0 ldi r24, 0x02 ; 2 2ddf8: 80 93 78 02 sts 0x0278, r24 ; 0x800278 // If there are files, sort up to the limit uint16_t fileCnt = getnrfilenames(); 2ddfc: 0f 94 ed 6b call 0x2d7da ; 0x2d7da 2de00: 6c 01 movw r12, r24 if (fileCnt > 0) { 2de02: 00 97 sbiw r24, 0x00 ; 0 2de04: 09 f4 brne .+2 ; 0x2de08 2de06: e6 c0 rjmp .+460 ; 0x2dfd4 // Never sort more than the max allowed // If you use folders to organize, 20 may be enough if (fileCnt > SDSORT_LIMIT) { 2de08: 85 36 cpi r24, 0x65 ; 101 2de0a: 91 05 cpc r25, r1 2de0c: 80 f0 brcs .+32 ; 0x2de2e if ((sdSort != SD_SORT_NONE) && !farm_mode) { 2de0e: 32 e0 ldi r19, 0x02 ; 2 2de10: 33 16 cp r3, r19 2de12: 51 f0 breq .+20 ; 0x2de28 2de14: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 2de18: 81 11 cpse r24, r1 2de1a: 06 c0 rjmp .+12 ; 0x2de28 lcd_show_fullscreen_message_and_wait_P(_T(MSG_FILE_CNT)); 2de1c: 88 ef ldi r24, 0xF8 ; 248 2de1e: 92 e6 ldi r25, 0x62 ; 98 2de20: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2de24: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa } fileCnt = SDSORT_LIMIT; 2de28: f4 e6 ldi r31, 0x64 ; 100 2de2a: cf 2e mov r12, r31 2de2c: d1 2c mov r13, r1 } sort_count = fileCnt; 2de2e: d0 92 79 15 sts 0x1579, r13 ; 0x801579 2de32: c0 92 78 15 sts 0x1578, r12 ; 0x801578 2de36: 6a e7 ldi r22, 0x7A ; 122 2de38: 66 2e mov r6, r22 2de3a: 65 e1 ldi r22, 0x15 ; 21 2de3c: 76 2e mov r7, r22 // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2de3e: f1 2c mov r15, r1 2de40: e1 2c mov r14, r1 lsDive("", *curDir, match, LS_GetFilename); } void CardReader::getfilename_next(uint32_t position, const char * const match/*=NULL*/) { curDir = &workDir; 2de42: 72 e8 ldi r23, 0x82 ; 130 2de44: a7 2e mov r10, r23 2de46: 74 e1 ldi r23, 0x14 ; 20 2de48: b7 2e mov r11, r23 nrFiles = 1; 2de4a: 88 24 eor r8, r8 2de4c: 83 94 inc r8 2de4e: 91 2c mov r9, r1 sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { if (!IS_SD_INSERTED) return; 2de50: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2de54: 80 fd sbrc r24, 0 2de56: c1 c0 rjmp .+386 ; 0x2dfda manage_heater(); 2de58: 0f 94 a8 37 call 0x26f50 ; 0x26f50 if (i == 0) 2de5c: e1 14 cp r14, r1 2de5e: f1 04 cpc r15, r1 2de60: 09 f0 breq .+2 ; 0x2de64 2de62: d4 c0 rjmp .+424 ; 0x2e00c getfilename(0); 2de64: 90 e0 ldi r25, 0x00 ; 0 2de66: 80 e0 ldi r24, 0x00 ; 0 2de68: 0f 94 57 6b call 0x2d6ae ; 0x2d6ae else getfilename_next(position); sort_entries[i] = position >> 5; 2de6c: 80 91 ea 13 lds r24, 0x13EA ; 0x8013ea 2de70: 90 91 eb 13 lds r25, 0x13EB ; 0x8013eb 2de74: a0 91 ec 13 lds r26, 0x13EC ; 0x8013ec 2de78: b0 91 ed 13 lds r27, 0x13ED ; 0x8013ed 2de7c: 55 e0 ldi r21, 0x05 ; 5 2de7e: b6 95 lsr r27 2de80: a7 95 ror r26 2de82: 97 95 ror r25 2de84: 87 95 ror r24 2de86: 5a 95 dec r21 2de88: d1 f7 brne .-12 ; 0x2de7e 2de8a: f3 01 movw r30, r6 2de8c: 81 93 st Z+, r24 2de8e: 91 93 st Z+, r25 2de90: 3f 01 movw r6, r30 } sort_count = fileCnt; // Init sort order. for (uint16_t i = 0; i < fileCnt; i++) { 2de92: ff ef ldi r31, 0xFF ; 255 2de94: ef 1a sub r14, r31 2de96: ff 0a sbc r15, r31 2de98: ce 14 cp r12, r14 2de9a: df 04 cpc r13, r15 2de9c: c9 f6 brne .-78 ; 0x2de50 else getfilename_next(position); sort_entries[i] = position >> 5; } if ((fileCnt > 1) && (sdSort != SD_SORT_NONE) && !farm_mode) { 2de9e: 21 e0 ldi r18, 0x01 ; 1 2dea0: e2 16 cp r14, r18 2dea2: f1 04 cpc r15, r1 2dea4: 09 f4 brne .+2 ; 0x2dea8 2dea6: 96 c0 rjmp .+300 ; 0x2dfd4 2dea8: 32 e0 ldi r19, 0x02 ; 2 2deaa: 33 16 cp r3, r19 2deac: 09 f4 brne .+2 ; 0x2deb0 2deae: 92 c0 rjmp .+292 ; 0x2dfd4 2deb0: 20 91 60 0d lds r18, 0x0D60 ; 0x800d60 2deb4: 21 11 cpse r18, r1 2deb6: 8e c0 rjmp .+284 ; 0x2dfd4 #ifdef SORTING_SPEEDTEST LongTimer sortingSpeedtestTimer; sortingSpeedtestTimer.start(); #endif //SORTING_SPEEDTEST lastSortedFilePosition = position >> 5; 2deb8: 90 93 43 16 sts 0x1643, r25 ; 0x801643 2debc: 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)); 2dec0: 88 ee ldi r24, 0xE8 ; 232 2dec2: 92 e6 ldi r25, 0x62 ; 98 2dec4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2dec8: ee 9c mul r14, r14 2deca: 90 01 movw r18, r0 2decc: ef 9c mul r14, r15 2dece: 30 0d add r19, r0 2ded0: 30 0d add r19, r0 2ded2: 11 24 eor r1, r1 2ded4: bc 01 movw r22, r24 2ded6: c9 01 movw r24, r18 2ded8: 96 95 lsr r25 2deda: 87 95 ror r24 2dedc: 0e 94 62 72 call 0xe4c4 ; 0xe4c4 2dee0: 3c e7 ldi r19, 0x7C ; 124 2dee2: a3 2e mov r10, r19 2dee4: 35 e1 ldi r19, 0x15 ; 21 2dee6: 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; 2dee8: 91 2c mov r9, r1 2deea: 81 2c mov r8, r1 menu_progressbar_init(fileCnt * fileCnt / 2, _T(MSG_SORTING_FILES)); for (uint16_t i = 1; i < fileCnt; ++i){ 2deec: cc 24 eor r12, r12 2deee: c3 94 inc r12 2def0: d1 2c mov r13, r1 // if (!IS_SD_INSERTED) return; menu_progressbar_update(counter); 2def2: c4 01 movw r24, r8 2def4: 0e 94 98 71 call 0xe330 ; 0xe330 counter += i; 2def8: 8c 0c add r8, r12 2defa: 9d 1c adc r9, r13 /// pop the position const uint16_t o1 = sort_entries[i]; 2defc: f5 01 movw r30, r10 2defe: 01 90 ld r0, Z+ 2df00: f0 81 ld r31, Z 2df02: e0 2d mov r30, r0 2df04: f9 af std Y+57, r31 ; 0x39 2df06: e8 af std Y+56, r30 ; 0x38 getfilename_simple(o1); 2df08: cf 01 movw r24, r30 2df0a: 0f 94 9e 6b call 0x2d73c ; 0x2d73c strcpy(name1, LONGEST_FILENAME); // save (or getfilename below will trounce it) 2df0e: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2df12: 69 ed ldi r22, 0xD9 ; 217 2df14: 73 e1 ldi r23, 0x13 ; 19 2df16: 88 23 and r24, r24 2df18: 11 f0 breq .+4 ; 0x2df1e 2df1a: 6e ee ldi r22, 0xEE ; 238 2df1c: 73 e1 ldi r23, 0x13 ; 19 2df1e: ce 01 movw r24, r28 2df20: 01 96 adiw r24, 0x01 ; 1 2df22: 0f 94 ec aa call 0x355d8 ; 0x355d8 crmod_date_bckp = crmodDate; 2df26: 60 90 e8 13 lds r6, 0x13E8 ; 0x8013e8 2df2a: 70 90 e9 13 lds r7, 0x13E9 ; 0x8013e9 crmod_time_bckp = crmodTime; 2df2e: 20 91 e6 13 lds r18, 0x13E6 ; 0x8013e6 2df32: 30 91 e7 13 lds r19, 0x13E7 ; 0x8013e7 2df36: 3b af std Y+59, r19 ; 0x3b 2df38: 2a af std Y+58, r18 ; 0x3a #if HAS_FOLDER_SORTING bool dir1 = filenameIsDir; 2df3a: 20 90 23 14 lds r2, 0x1423 ; 0x801423 2df3e: bf aa std Y+55, r11 ; 0x37 2df40: ae aa std Y+54, r10 ; 0x36 2df42: 86 01 movw r16, r12 #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ if (!IS_SD_INSERTED) return; 2df44: 80 91 03 01 lds r24, 0x0103 ; 0x800103 <__TEXT_REGION_LENGTH__+0x7c2103> 2df48: 80 fd sbrc r24, 0 2df4a: 47 c0 rjmp .+142 ; 0x2dfda printf_P(PSTR("%2u "), sort_entries[z]); } MYSERIAL.println(); #endif manage_heater(); 2df4c: 0f 94 a8 37 call 0x26f50 ; 0x26f50 const uint16_t o2 = sort_entries[j - 1]; 2df50: c8 01 movw r24, r16 2df52: 01 97 sbiw r24, 0x01 ; 1 2df54: 9d af std Y+61, r25 ; 0x3d 2df56: 8c af std Y+60, r24 ; 0x3c 2df58: ee a9 ldd r30, Y+54 ; 0x36 2df5a: ff a9 ldd r31, Y+55 ; 0x37 2df5c: 52 90 ld r5, -Z 2df5e: 42 90 ld r4, -Z 2df60: ff ab std Y+55, r31 ; 0x37 2df62: ee ab std Y+54, r30 ; 0x36 getfilename_simple(o2); 2df64: c2 01 movw r24, r4 2df66: 0f 94 9e 6b call 0x2d73c ; 0x2d73c char *name2 = LONGEST_FILENAME; // use the string in-place 2df6a: 80 91 ee 13 lds r24, 0x13EE ; 0x8013ee 2df6e: 69 ed ldi r22, 0xD9 ; 217 2df70: 73 e1 ldi r23, 0x13 ; 19 2df72: 88 23 and r24, r24 2df74: 11 f0 breq .+4 ; 0x2df7a 2df76: 6e ee ldi r22, 0xEE ; 238 2df78: 73 e1 ldi r23, 0x13 ; 19 // Sort the current pair according to settings. if ( 2df7a: 31 10 cpse r3, r1 2df7c: 8a c0 rjmp .+276 ; 0x2e092 2df7e: 80 91 23 14 lds r24, 0x1423 ; 0x801423 2df82: 28 12 cpse r2, r24 2df84: 83 c0 rjmp .+262 ; 0x2e08c #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2df86: 80 91 e8 13 lds r24, 0x13E8 ; 0x8013e8 2df8a: 90 91 e9 13 lds r25, 0x13E9 ; 0x8013e9 2df8e: 68 16 cp r6, r24 2df90: 79 06 cpc r7, r25 2df92: 09 f0 breq .+2 ; 0x2df96 2df94: 6c c0 rjmp .+216 ; 0x2e06e 2df96: 80 91 e6 13 lds r24, 0x13E6 ; 0x8013e6 2df9a: 90 91 e7 13 lds r25, 0x13E7 ; 0x8013e7 2df9e: 2a ad ldd r18, Y+58 ; 0x3a 2dfa0: 3b ad ldd r19, Y+59 ; 0x3b 2dfa2: 82 17 cp r24, r18 2dfa4: 93 07 cpc r25, r19 2dfa6: 08 f0 brcs .+2 ; 0x2dfaa 2dfa8: 66 c0 rjmp .+204 ; 0x2e076 #endif sort_entries[j] = o2; } } /// place the position sort_entries[j] = o1; 2dfaa: 00 0f add r16, r16 2dfac: 11 1f adc r17, r17 2dfae: f8 01 movw r30, r16 2dfb0: e6 58 subi r30, 0x86 ; 134 2dfb2: fa 4e sbci r31, 0xEA ; 234 2dfb4: 28 ad ldd r18, Y+56 ; 0x38 2dfb6: 39 ad ldd r19, Y+57 ; 0x39 2dfb8: 31 83 std Z+1, r19 ; 0x01 2dfba: 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){ 2dfbc: 3f ef ldi r19, 0xFF ; 255 2dfbe: c3 1a sub r12, r19 2dfc0: d3 0a sbc r13, r19 2dfc2: 82 e0 ldi r24, 0x02 ; 2 2dfc4: a8 0e add r10, r24 2dfc6: b1 1c adc r11, r1 2dfc8: ec 14 cp r14, r12 2dfca: fd 04 cpc r15, r13 2dfcc: 09 f0 breq .+2 ; 0x2dfd0 2dfce: 91 cf rjmp .-222 ; 0x2def2 for (uint16_t z = 0; z < fileCnt; z++) printf_P(PSTR("%2u "), sort_entries[z]); SERIAL_PROTOCOLLN(); #endif menu_progressbar_finish(); 2dfd0: 0e 94 b9 71 call 0xe372 ; 0xe372 } } KEEPALIVE_STATE(NOT_BUSY); 2dfd4: 81 e0 ldi r24, 0x01 ; 1 2dfd6: 80 93 78 02 sts 0x0278, r24 ; 0x800278 } 2dfda: ed 96 adiw r28, 0x3d ; 61 2dfdc: 0f b6 in r0, 0x3f ; 63 2dfde: f8 94 cli 2dfe0: de bf out 0x3e, r29 ; 62 2dfe2: 0f be out 0x3f, r0 ; 63 2dfe4: cd bf out 0x3d, r28 ; 61 2dfe6: df 91 pop r29 2dfe8: cf 91 pop r28 2dfea: 1f 91 pop r17 2dfec: 0f 91 pop r16 2dfee: ff 90 pop r15 2dff0: ef 90 pop r14 2dff2: df 90 pop r13 2dff4: cf 90 pop r12 2dff6: bf 90 pop r11 2dff8: af 90 pop r10 2dffa: 9f 90 pop r9 2dffc: 8f 90 pop r8 2dffe: 7f 90 pop r7 2e000: 6f 90 pop r6 2e002: 5f 90 pop r5 2e004: 4f 90 pop r4 2e006: 3f 90 pop r3 2e008: 2f 90 pop r2 2e00a: 08 95 ret if (!IS_SD_INSERTED) return; manage_heater(); if (i == 0) getfilename(0); else getfilename_next(position); 2e00c: 40 91 ea 13 lds r20, 0x13EA ; 0x8013ea 2e010: 50 91 eb 13 lds r21, 0x13EB ; 0x8013eb 2e014: 60 91 ec 13 lds r22, 0x13EC ; 0x8013ec 2e018: 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; 2e01c: b0 92 81 14 sts 0x1481, r11 ; 0x801481 2e020: a0 92 80 14 sts 0x1480, r10 ; 0x801480 nrFiles = 1; 2e024: 90 92 f0 16 sts 0x16F0, r9 ; 0x8016f0 2e028: 80 92 ef 16 sts 0x16EF, r8 ; 0x8016ef curDir->seekSet(position); 2e02c: 82 e8 ldi r24, 0x82 ; 130 2e02e: 94 e1 ldi r25, 0x14 ; 20 2e030: 0f 94 97 2a call 0x2552e ; 0x2552e 2e034: 1e 7f andi r17, 0xFE ; 254 2e036: 1d 7f andi r17, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2e038: e0 91 80 14 lds r30, 0x1480 ; 0x801480 2e03c: f0 91 81 14 lds r31, 0x1481 ; 0x801481 2e040: 83 e2 ldi r24, 0x23 ; 35 2e042: de 01 movw r26, r28 2e044: 11 96 adiw r26, 0x01 ; 1 2e046: 01 90 ld r0, Z+ 2e048: 0d 92 st X+, r0 2e04a: 8a 95 dec r24 2e04c: e1 f7 brne .-8 ; 0x2e046 2e04e: 01 2f mov r16, r17 2e050: 22 e0 ldi r18, 0x02 ; 2 2e052: 50 e0 ldi r21, 0x00 ; 0 2e054: 40 e0 ldi r20, 0x00 ; 0 2e056: be 01 movw r22, r28 2e058: 6f 5f subi r22, 0xFF ; 255 2e05a: 7f 4f sbci r23, 0xFF ; 255 2e05c: 8f ed ldi r24, 0xDF ; 223 2e05e: 92 e0 ldi r25, 0x02 ; 2 2e060: 0f 94 28 69 call 0x2d250 ; 0x2d250 2e064: ce 01 movw r24, r28 2e066: 01 96 adiw r24, 0x01 ; 1 2e068: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 2e06c: ff ce rjmp .-514 ; 0x2de6c 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)) 2e06e: 86 15 cp r24, r6 2e070: 97 05 cpc r25, r7 2e072: 08 f4 brcc .+2 ; 0x2e076 2e074: 9a cf rjmp .-204 ; 0x2dfaa break; } else { #ifdef SORTING_DUMP puts_P(PSTR("shift")); #endif sort_entries[j] = o2; 2e076: ee a9 ldd r30, Y+54 ; 0x36 2e078: ff a9 ldd r31, Y+55 ; 0x37 2e07a: 53 82 std Z+3, r5 ; 0x03 2e07c: 42 82 std Z+2, r4 ; 0x02 2e07e: 0c ad ldd r16, Y+60 ; 0x3c 2e080: 1d ad ldd r17, Y+61 ; 0x3d bool dir1 = filenameIsDir; #endif /// find proper place uint16_t j = i; for (; j > 0; --j){ 2e082: 01 15 cp r16, r1 2e084: 11 05 cpc r17, r1 2e086: 09 f0 breq .+2 ; 0x2e08a 2e088: 5d cf rjmp .-326 ; 0x2df44 2e08a: 8f cf rjmp .-226 ; 0x2dfaa 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)) 2e08c: 22 20 and r2, r2 2e08e: 99 f3 breq .-26 ; 0x2e076 2e090: 8c cf rjmp .-232 ; 0x2dfaa 2e092: 31 e0 ldi r19, 0x01 ; 1 2e094: 33 12 cpse r3, r19 2e096: ef cf rjmp .-34 ; 0x2e076 getfilename_simple(o2); char *name2 = LONGEST_FILENAME; // use the string in-place // Sort the current pair according to settings. if ( 2e098: 80 91 23 14 lds r24, 0x1423 ; 0x801423 2e09c: 28 12 cpse r2, r24 2e09e: 07 c0 rjmp .+14 ; 0x2e0ae #if HAS_FOLDER_SORTING (sdSort == SD_SORT_TIME && _SORT_CMP_TIME_DIR(FOLDER_SORTING)) || (sdSort == SD_SORT_ALPHA && !_SORT_CMP_DIR(FOLDER_SORTING)) 2e0a0: ce 01 movw r24, r28 2e0a2: 01 96 adiw r24, 0x01 ; 1 2e0a4: 0f 94 ba aa call 0x35574 ; 0x35574 2e0a8: 97 fd sbrc r25, 7 2e0aa: e5 cf rjmp .-54 ; 0x2e076 2e0ac: 7e cf rjmp .-260 ; 0x2dfaa 2e0ae: 21 10 cpse r2, r1 2e0b0: e2 cf rjmp .-60 ; 0x2e076 2e0b2: 7b cf rjmp .-266 ; 0x2dfaa 0002e0b4 : lsDive("",*curDir, NULL, LS_Count); //SERIAL_ECHOLN(nrFiles); return nrFiles; } bool CardReader::chdir(const char * relpath, bool doPresort) 2e0b4: cf 92 push r12 2e0b6: df 92 push r13 2e0b8: ef 92 push r14 2e0ba: ff 92 push r15 2e0bc: 0f 93 push r16 2e0be: 1f 93 push r17 2e0c0: cf 93 push r28 2e0c2: df 93 push r29 2e0c4: cd b7 in r28, 0x3d ; 61 2e0c6: de b7 in r29, 0x3e ; 62 2e0c8: a3 97 sbiw r28, 0x23 ; 35 2e0ca: 0f b6 in r0, 0x3f ; 63 2e0cc: f8 94 cli 2e0ce: de bf out 0x3e, r29 ; 62 2e0d0: 0f be out 0x3f, r0 ; 63 2e0d2: cd bf out 0x3d, r28 ; 61 2e0d4: 7c 01 movw r14, r24 2e0d6: 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) {} 2e0d8: 19 82 std Y+1, r1 ; 0x01 2e0da: 1c 82 std Y+4, r1 ; 0x04 { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2e0dc: 80 91 85 14 lds r24, 0x1485 ; 0x801485 parent=&workDir; 2e0e0: 92 e8 ldi r25, 0x82 ; 130 2e0e2: c9 2e mov r12, r25 2e0e4: 94 e1 ldi r25, 0x14 ; 20 2e0e6: d9 2e mov r13, r25 bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; if(workDir.isOpen()) 2e0e8: 81 11 cpse r24, r1 2e0ea: 04 c0 rjmp .+8 ; 0x2e0f4 } bool CardReader::chdir(const char * relpath, bool doPresort) { SdFile newfile; SdFile *parent=&root; 2e0ec: 8d e5 ldi r24, 0x5D ; 93 2e0ee: c8 2e mov r12, r24 2e0f0: 84 e1 ldi r24, 0x14 ; 20 2e0f2: 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); 2e0f4: 21 e0 ldi r18, 0x01 ; 1 2e0f6: a7 01 movw r20, r14 2e0f8: b6 01 movw r22, r12 2e0fa: ce 01 movw r24, r28 2e0fc: 01 96 adiw r24, 0x01 ; 1 2e0fe: 0f 94 63 54 call 0x2a8c6 ; 0x2a8c6 2e102: 18 2f mov r17, r24 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) 2e104: 88 23 and r24, r24 2e106: 21 f1 breq .+72 ; 0x2e150 2e108: 80 91 77 15 lds r24, 0x1577 ; 0x801577 2e10c: 85 30 cpi r24, 0x05 ; 5 2e10e: 00 f5 brcc .+64 ; 0x2e150 SERIAL_ECHOLN(relpath); return 0; } else { strcpy(dir_names[workDirDepth], relpath); 2e110: 29 e0 ldi r18, 0x09 ; 9 2e112: 82 9f mul r24, r18 2e114: c0 01 movw r24, r0 2e116: 11 24 eor r1, r1 2e118: b7 01 movw r22, r14 2e11a: 89 5d subi r24, 0xD9 ; 217 2e11c: 9b 4e sbci r25, 0xEB ; 235 2e11e: 0f 94 ec aa call 0x355d8 ; 0x355d8 puts(relpath); 2e122: c7 01 movw r24, r14 2e124: 0f 94 10 ab call 0x35620 ; 0x35620 if (workDirDepth < MAX_DIR_DEPTH) { 2e128: 80 91 77 15 lds r24, 0x1577 ; 0x801577 2e12c: 86 30 cpi r24, 0x06 ; 6 2e12e: 80 f1 brcs .+96 ; 0x2e190 for (uint8_t d = ++workDirDepth; d--;) workDirParents[d+1] = workDirParents[d]; workDirParents[0]=*parent; } workDir=newfile; 2e130: 83 e2 ldi r24, 0x23 ; 35 2e132: fe 01 movw r30, r28 2e134: 31 96 adiw r30, 0x01 ; 1 2e136: a2 e8 ldi r26, 0x82 ; 130 2e138: b4 e1 ldi r27, 0x14 ; 20 2e13a: 01 90 ld r0, Z+ 2e13c: 0d 92 st X+, r0 2e13e: 8a 95 dec r24 2e140: e1 f7 brne .-8 ; 0x2e13a #ifdef SDCARD_SORT_ALPHA if (doPresort) 2e142: 00 23 and r16, r16 2e144: 09 f4 brne .+2 ; 0x2e148 2e146: 4c c0 rjmp .+152 ; 0x2e1e0 presort(); 2e148: 0f 94 d0 6e call 0x2dda0 ; 0x2dda0 else presort_flag = true; #endif return 1; 2e14c: 10 2f mov r17, r16 2e14e: 0c c0 rjmp .+24 ; 0x2e168 if(workDir.isOpen()) parent=&workDir; if(!newfile.open(*parent,relpath, O_READ) || ((workDirDepth + 1) >= MAX_DIR_DEPTH)) { SERIAL_ECHO_START; 2e150: 84 ee ldi r24, 0xE4 ; 228 2e152: 92 ea ldi r25, 0xA2 ; 162 2e154: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(_n("Cannot enter subdir: "));////MSG_SD_CANT_ENTER_SUBDIR 2e158: 8c ee ldi r24, 0xEC ; 236 2e15a: 9c e6 ldi r25, 0x6C ; 108 2e15c: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN(relpath); 2e160: c7 01 movw r24, r14 2e162: 0e 94 1a 86 call 0x10c34 ; 0x10c34 return 0; 2e166: 10 e0 ldi r17, 0x00 ; 0 2e168: ce 01 movw r24, r28 2e16a: 01 96 adiw r24, 0x01 ; 1 2e16c: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 else presort_flag = true; #endif return 1; } } 2e170: 81 2f mov r24, r17 2e172: a3 96 adiw r28, 0x23 ; 35 2e174: 0f b6 in r0, 0x3f ; 63 2e176: f8 94 cli 2e178: de bf out 0x3e, r29 ; 62 2e17a: 0f be out 0x3f, r0 ; 63 2e17c: cd bf out 0x3d, r28 ; 61 2e17e: df 91 pop r29 2e180: cf 91 pop r28 2e182: 1f 91 pop r17 2e184: 0f 91 pop r16 2e186: ff 90 pop r15 2e188: ef 90 pop r14 2e18a: df 90 pop r13 2e18c: cf 90 pop r12 2e18e: 08 95 ret { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2e190: 8f 5f subi r24, 0xFF ; 255 2e192: 80 93 77 15 sts 0x1577, r24 ; 0x801577 workDirParents[d+1] = workDirParents[d]; 2e196: 93 e2 ldi r25, 0x23 ; 35 { strcpy(dir_names[workDirDepth], relpath); puts(relpath); if (workDirDepth < MAX_DIR_DEPTH) { for (uint8_t d = ++workDirDepth; d--;) 2e198: 81 50 subi r24, 0x01 ; 1 2e19a: c8 f0 brcs .+50 ; 0x2e1ce workDirParents[d+1] = workDirParents[d]; 2e19c: 28 2f mov r18, r24 2e19e: 30 e0 ldi r19, 0x00 ; 0 2e1a0: a9 01 movw r20, r18 2e1a2: 4f 5f subi r20, 0xFF ; 255 2e1a4: 5f 4f sbci r21, 0xFF ; 255 2e1a6: 94 9f mul r25, r20 2e1a8: d0 01 movw r26, r0 2e1aa: 95 9f mul r25, r21 2e1ac: b0 0d add r27, r0 2e1ae: 11 24 eor r1, r1 2e1b0: ab 55 subi r26, 0x5B ; 91 2e1b2: bb 4e sbci r27, 0xEB ; 235 2e1b4: 92 9f mul r25, r18 2e1b6: f0 01 movw r30, r0 2e1b8: 93 9f mul r25, r19 2e1ba: f0 0d add r31, r0 2e1bc: 11 24 eor r1, r1 2e1be: eb 55 subi r30, 0x5B ; 91 2e1c0: fb 4e sbci r31, 0xEB ; 235 2e1c2: 29 2f mov r18, r25 2e1c4: 01 90 ld r0, Z+ 2e1c6: 0d 92 st X+, r0 2e1c8: 2a 95 dec r18 2e1ca: e1 f7 brne .-8 ; 0x2e1c4 2e1cc: e5 cf rjmp .-54 ; 0x2e198 workDirParents[0]=*parent; 2e1ce: 83 e2 ldi r24, 0x23 ; 35 2e1d0: f6 01 movw r30, r12 2e1d2: a5 ea ldi r26, 0xA5 ; 165 2e1d4: b4 e1 ldi r27, 0x14 ; 20 2e1d6: 01 90 ld r0, Z+ 2e1d8: 0d 92 st X+, r0 2e1da: 8a 95 dec r24 2e1dc: e1 f7 brne .-8 ; 0x2e1d6 2e1de: a8 cf rjmp .-176 ; 0x2e130 #ifdef SDCARD_SORT_ALPHA if (doPresort) presort(); else presort_flag = true; 2e1e0: 81 e0 ldi r24, 0x01 ; 1 2e1e2: 80 93 26 14 sts 0x1426, r24 ; 0x801426 2e1e6: c0 cf rjmp .-128 ; 0x2e168 0002e1e8 : } } void __attribute__((noinline)) CardReader::cdroot(bool doPresort) { workDir=root; 2e1e8: 93 e2 ldi r25, 0x23 ; 35 2e1ea: ed e5 ldi r30, 0x5D ; 93 2e1ec: f4 e1 ldi r31, 0x14 ; 20 2e1ee: a2 e8 ldi r26, 0x82 ; 130 2e1f0: b4 e1 ldi r27, 0x14 ; 20 2e1f2: 01 90 ld r0, Z+ 2e1f4: 0d 92 st X+, r0 2e1f6: 9a 95 dec r25 2e1f8: e1 f7 brne .-8 ; 0x2e1f2 workDirDepth = 0; 2e1fa: 10 92 77 15 sts 0x1577, r1 ; 0x801577 curDir=&workDir; 2e1fe: 22 e8 ldi r18, 0x82 ; 130 2e200: 34 e1 ldi r19, 0x14 ; 20 2e202: 30 93 81 14 sts 0x1481, r19 ; 0x801481 2e206: 20 93 80 14 sts 0x1480, r18 ; 0x801480 #ifdef SDCARD_SORT_ALPHA if (doPresort) 2e20a: 81 11 cpse r24, r1 presort(); 2e20c: 0d 94 d0 6e jmp 0x2dda0 ; 0x2dda0 else presort_flag = true; 2e210: 81 e0 ldi r24, 0x01 ; 1 2e212: 80 93 26 14 sts 0x1426, r24 ; 0x801426 #endif } 2e216: 08 95 ret 0002e218 : * * @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) 2e218: 8f 92 push r8 2e21a: 9f 92 push r9 2e21c: af 92 push r10 2e21e: bf 92 push r11 2e220: cf 92 push r12 2e222: df 92 push r13 2e224: ef 92 push r14 2e226: ff 92 push r15 2e228: 0f 93 push r16 2e22a: 1f 93 push r17 2e22c: cf 93 push r28 2e22e: df 93 push r29 2e230: cd b7 in r28, 0x3d ; 61 2e232: de b7 in r29, 0x3e ; 62 2e234: 2d 97 sbiw r28, 0x0d ; 13 2e236: 0f b6 in r0, 0x3f ; 63 2e238: f8 94 cli 2e23a: de bf out 0x3e, r29 ; 62 2e23c: 0f be out 0x3f, r0 ; 63 2e23e: cd bf out 0x3d, r28 ; 61 { curDir=&root; 2e240: 2d e5 ldi r18, 0x5D ; 93 2e242: 34 e1 ldi r19, 0x14 ; 20 2e244: 30 93 81 14 sts 0x1481, r19 ; 0x801481 2e248: 20 93 80 14 sts 0x1480, r18 ; 0x801480 if (!fileName) 2e24c: dc 01 movw r26, r24 2e24e: ed 91 ld r30, X+ 2e250: fc 91 ld r31, X 2e252: 30 97 sbiw r30, 0x00 ; 0 2e254: a1 f4 brne .+40 ; 0x2e27e } else //relative path { curDir = &workDir; } return 1; 2e256: 81 e0 ldi r24, 0x01 ; 1 } 2e258: 2d 96 adiw r28, 0x0d ; 13 2e25a: 0f b6 in r0, 0x3f ; 63 2e25c: f8 94 cli 2e25e: de bf out 0x3e, r29 ; 62 2e260: 0f be out 0x3f, r0 ; 63 2e262: cd bf out 0x3d, r28 ; 61 2e264: df 91 pop r29 2e266: cf 91 pop r28 2e268: 1f 91 pop r17 2e26a: 0f 91 pop r16 2e26c: ff 90 pop r15 2e26e: ef 90 pop r14 2e270: df 90 pop r13 2e272: cf 90 pop r12 2e274: bf 90 pop r11 2e276: af 90 pop r10 2e278: 9f 90 pop r9 2e27a: 8f 90 pop r8 2e27c: 08 95 ret curDir=&root; if (!fileName) return 1; const char *dirname_start, *dirname_end; if (fileName[0] == '/') // absolute path 2e27e: 20 81 ld r18, Z 2e280: 2f 32 cpi r18, 0x2F ; 47 2e282: 09 f0 breq .+2 ; 0x2e286 2e284: 47 c0 rjmp .+142 ; 0x2e314 2e286: 6c 01 movw r12, r24 { cdroot(false); 2e288: 80 e0 ldi r24, 0x00 ; 0 2e28a: 0f 94 f4 70 call 0x2e1e8 ; 0x2e1e8 dirname_start = fileName + 1; 2e28e: f6 01 movw r30, r12 2e290: 00 81 ld r16, Z 2e292: 11 81 ldd r17, Z+1 ; 0x01 2e294: 0f 5f subi r16, 0xFF ; 255 2e296: 1f 4f sbci r17, 0xFF ; 255 strncpy(subdirname, dirname_start, len); subdirname[len] = 0; if (!chdir(subdirname, false)) return 0; curDir = &workDir; 2e298: 92 e8 ldi r25, 0x82 ; 130 2e29a: 89 2e mov r8, r25 2e29c: 94 e1 ldi r25, 0x14 ; 20 2e29e: 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) 2e2a0: d8 01 movw r26, r16 2e2a2: 8c 91 ld r24, X 2e2a4: 88 23 and r24, r24 2e2a6: b9 f2 breq .-82 ; 0x2e256 { dirname_end = strchr(dirname_start, '/'); 2e2a8: 6f e2 ldi r22, 0x2F ; 47 2e2aa: 70 e0 ldi r23, 0x00 ; 0 2e2ac: c8 01 movw r24, r16 2e2ae: 0f 94 d8 aa call 0x355b0 ; 0x355b0 2e2b2: 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) 2e2b4: 00 97 sbiw r24, 0x00 ; 0 2e2b6: 51 f1 breq .+84 ; 0x2e30c 2e2b8: 08 17 cp r16, r24 2e2ba: 19 07 cpc r17, r25 2e2bc: 38 f5 brcc .+78 ; 0x2e30c { 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); 2e2be: 7c 01 movw r14, r24 2e2c0: e0 1a sub r14, r16 2e2c2: f1 0a sbc r15, r17 2e2c4: bd e0 ldi r27, 0x0D ; 13 2e2c6: eb 16 cp r14, r27 2e2c8: f1 04 cpc r15, r1 2e2ca: 18 f0 brcs .+6 ; 0x2e2d2 2e2cc: 8c e0 ldi r24, 0x0C ; 12 2e2ce: e8 2e mov r14, r24 2e2d0: f1 2c mov r15, r1 strncpy(subdirname, dirname_start, len); 2e2d2: a7 01 movw r20, r14 2e2d4: b8 01 movw r22, r16 2e2d6: ce 01 movw r24, r28 2e2d8: 01 96 adiw r24, 0x01 ; 1 2e2da: 0f 94 01 ab call 0x35602 ; 0x35602 subdirname[len] = 0; 2e2de: e1 e0 ldi r30, 0x01 ; 1 2e2e0: f0 e0 ldi r31, 0x00 ; 0 2e2e2: ec 0f add r30, r28 2e2e4: fd 1f adc r31, r29 2e2e6: ee 0d add r30, r14 2e2e8: ff 1d adc r31, r15 2e2ea: 10 82 st Z, r1 if (!chdir(subdirname, false)) 2e2ec: 60 e0 ldi r22, 0x00 ; 0 2e2ee: ce 01 movw r24, r28 2e2f0: 01 96 adiw r24, 0x01 ; 1 2e2f2: 0f 94 5a 70 call 0x2e0b4 ; 0x2e0b4 2e2f6: 88 23 and r24, r24 2e2f8: 09 f4 brne .+2 ; 0x2e2fc 2e2fa: ae cf rjmp .-164 ; 0x2e258 return 0; curDir = &workDir; 2e2fc: 90 92 81 14 sts 0x1481, r9 ; 0x801481 2e300: 80 92 80 14 sts 0x1480, r8 ; 0x801480 dirname_start = dirname_end + 1; 2e304: 85 01 movw r16, r10 2e306: 0f 5f subi r16, 0xFF ; 255 2e308: 1f 4f sbci r17, 0xFF ; 255 2e30a: ca cf rjmp .-108 ; 0x2e2a0 } else // the reminder after all /fsa/fdsa/ is the filename { fileName = dirname_start; 2e30c: f6 01 movw r30, r12 2e30e: 11 83 std Z+1, r17 ; 0x01 2e310: 00 83 st Z, r16 2e312: a1 cf rjmp .-190 ; 0x2e256 } } else //relative path { curDir = &workDir; 2e314: 82 e8 ldi r24, 0x82 ; 130 2e316: 94 e1 ldi r25, 0x14 ; 20 2e318: 90 93 81 14 sts 0x1481, r25 ; 0x801481 2e31c: 80 93 80 14 sts 0x1480, r24 ; 0x801480 2e320: 9a cf rjmp .-204 ; 0x2e256 0002e322 : 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*/){ 2e322: bf 92 push r11 2e324: cf 92 push r12 2e326: df 92 push r13 2e328: ef 92 push r14 2e32a: ff 92 push r15 2e32c: 0f 93 push r16 2e32e: 1f 93 push r17 2e330: cf 93 push r28 2e332: df 93 push r29 2e334: 1f 92 push r1 2e336: 1f 92 push r1 2e338: cd b7 in r28, 0x3d ; 61 2e33a: de b7 in r29, 0x3e ; 62 if(!mounted) 2e33c: 20 91 d8 13 lds r18, 0x13D8 ; 0x8013d8 2e340: 22 23 and r18, r18 2e342: 09 f4 brne .+2 ; 0x2e346 2e344: ef c0 rjmp .+478 ; 0x2e524 2e346: 7c 01 movw r14, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2e348: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 2e34c: 88 23 and r24, r24 2e34e: 09 f4 brne .+2 ; 0x2e352 2e350: 04 c1 rjmp .+520 ; 0x2e55a if(!replace_current){ 2e352: 61 11 cpse r22, r1 2e354: f6 c0 rjmp .+492 ; 0x2e542 if((int)file_subcall_ctr>(int)SD_PROCEDURE_DEPTH-1){ 2e356: d0 90 8a 16 lds r13, 0x168A ; 0x80168a 2e35a: dd 20 and r13, r13 2e35c: 21 f0 breq .+8 ; 0x2e366 // 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); 2e35e: 8e ea ldi r24, 0xAE ; 174 2e360: 91 ea ldi r25, 0xA1 ; 161 2e362: 0e 94 74 83 call 0x106e8 ; 0x106e8 return; } SERIAL_ECHO_START; 2e366: 84 ee ldi r24, 0xE4 ; 228 2e368: 92 ea ldi r25, 0xA2 ; 162 2e36a: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(ofSubroutineCallTgt); 2e36e: 85 e9 ldi r24, 0x95 ; 149 2e370: 91 ea ldi r25, 0xA1 ; 161 2e372: 0e 94 15 7b call 0xf62a ; 0xf62a 2e376: c7 01 movw r24, r14 2e378: 0e 94 0e 86 call 0x10c1c ; 0x10c1c SERIAL_ECHO(name); SERIAL_ECHORPGM(ofParent); 2e37c: 8a e8 ldi r24, 0x8A ; 138 2e37e: 91 ea ldi r25, 0xA1 ; 161 2e380: 0e 94 15 7b call 0xf62a ; 0xf62a //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); 2e384: 00 91 8a 16 lds r16, 0x168A ; 0x80168a 2e388: 25 e5 ldi r18, 0x55 ; 85 2e38a: 02 9f mul r16, r18 2e38c: 80 01 movw r16, r0 2e38e: 11 24 eor r1, r1 } void CardReader::getAbsFilename(char *t) { uint8_t cnt=0; *t='/';t++;cnt++; 2e390: 01 57 subi r16, 0x71 ; 113 2e392: 19 4e sbci r17, 0xE9 ; 233 2e394: 8f e2 ldi r24, 0x2F ; 47 2e396: f8 01 movw r30, r16 2e398: 81 93 st Z+, r24 2e39a: 8f 01 movw r16, r30 2e39c: cc 24 eor r12, r12 2e39e: c3 94 inc r12 for(uint8_t i=0;i 2e3a8: d8 16 cp r13, r24 2e3aa: b0 f4 brcc .+44 ; 0x2e3d8 { workDirParents[i].getFilename(t); //SDBaseFile.getfilename! 2e3ac: db 9c mul r13, r11 2e3ae: c0 01 movw r24, r0 2e3b0: 11 24 eor r1, r1 2e3b2: b8 01 movw r22, r16 2e3b4: 8b 55 subi r24, 0x5B ; 91 2e3b6: 9b 4e sbci r25, 0xEB ; 235 2e3b8: 0f 94 7e 2c call 0x258fc ; 0x258fc 2e3bc: c8 01 movw r24, r16 2e3be: 8c 01 movw r16, r24 2e3c0: 01 96 adiw r24, 0x01 ; 1 while(*t!=0 && cnt< MAXPATHNAMELENGTH) 2e3c2: f8 01 movw r30, r16 2e3c4: 20 81 ld r18, Z 2e3c6: 22 23 and r18, r18 2e3c8: 29 f0 breq .+10 ; 0x2e3d4 2e3ca: f4 e5 ldi r31, 0x54 ; 84 2e3cc: fc 15 cp r31, r12 2e3ce: 10 f0 brcs .+4 ; 0x2e3d4 {t++;cnt++;} //crawl counter forward. 2e3d0: c3 94 inc r12 2e3d2: f5 cf rjmp .-22 ; 0x2e3be 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) 2e3d8: 27 e4 ldi r18, 0x47 ; 71 2e3da: 2c 15 cp r18, r12 2e3dc: 08 f4 brcc .+2 ; 0x2e3e0 2e3de: ae c0 rjmp .+348 ; 0x2e53c file.getFilename(t); 2e3e0: b8 01 movw r22, r16 2e3e2: 87 e6 ldi r24, 0x67 ; 103 2e3e4: 96 e1 ldi r25, 0x16 ; 22 2e3e6: 0f 94 7e 2c call 0x258fc ; 0x258fc SERIAL_ECHORPGM(ofParent); //store current filename and position getAbsFilename(filenames[file_subcall_ctr]); SERIAL_ECHO(filenames[file_subcall_ctr]); 2e3ea: 80 91 8a 16 lds r24, 0x168A ; 0x80168a 2e3ee: f5 e5 ldi r31, 0x55 ; 85 2e3f0: 8f 9f mul r24, r31 2e3f2: c0 01 movw r24, r0 2e3f4: 11 24 eor r1, r1 2e3f6: 81 57 subi r24, 0x71 ; 113 2e3f8: 99 4e sbci r25, 0xE9 ; 233 2e3fa: 0e 94 0e 86 call 0x10c1c ; 0x10c1c SERIAL_ECHORPGM(ofPos); 2e3fe: 84 e8 ldi r24, 0x84 ; 132 2e400: 91 ea ldi r25, 0xA1 ; 161 2e402: 0e 94 15 7b call 0xf62a ; 0xf62a } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2e406: 60 91 eb 16 lds r22, 0x16EB ; 0x8016eb 2e40a: 70 91 ec 16 lds r23, 0x16EC ; 0x8016ec 2e40e: 80 91 ed 16 lds r24, 0x16ED ; 0x8016ed 2e412: 90 91 ee 16 lds r25, 0x16EE ; 0x8016ee 2e416: 4a e0 ldi r20, 0x0A ; 10 2e418: 0e 94 16 7a call 0xf42c ; 0xf42c } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2e41c: 0e 94 0d 7b call 0xf61a ; 0xf61a SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; 2e420: 80 91 8a 16 lds r24, 0x168A ; 0x80168a 2e424: 24 e0 ldi r18, 0x04 ; 4 2e426: 82 9f mul r24, r18 2e428: f0 01 movw r30, r0 2e42a: 11 24 eor r1, r1 2e42c: e5 57 subi r30, 0x75 ; 117 2e42e: f9 4e sbci r31, 0xE9 ; 233 2e430: 40 91 eb 16 lds r20, 0x16EB ; 0x8016eb 2e434: 50 91 ec 16 lds r21, 0x16EC ; 0x8016ec 2e438: 60 91 ed 16 lds r22, 0x16ED ; 0x8016ed 2e43c: 70 91 ee 16 lds r23, 0x16EE ; 0x8016ee 2e440: 40 83 st Z, r20 2e442: 51 83 std Z+1, r21 ; 0x01 2e444: 62 83 std Z+2, r22 ; 0x02 2e446: 73 83 std Z+3, r23 ; 0x03 file_subcall_ctr++; 2e448: 8f 5f subi r24, 0xFF ; 255 2e44a: 80 93 8a 16 sts 0x168A, r24 ; 0x80168a } else { SERIAL_ECHO_START; SERIAL_ECHORPGM(ofNowDoingFile); SERIAL_ECHOLN(name); } file.close(); 2e44e: 87 e6 ldi r24, 0x67 ; 103 2e450: 96 e1 ldi r25, 0x16 ; 22 2e452: 0f 94 75 2c call 0x258ea ; 0x258ea 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; 2e456: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 const char *fname=name; 2e45a: fa 82 std Y+2, r15 ; 0x02 2e45c: e9 82 std Y+1, r14 ; 0x01 if (!diveSubfolder(fname)) 2e45e: ce 01 movw r24, r28 2e460: 01 96 adiw r24, 0x01 ; 1 2e462: 0f 94 0c 71 call 0x2e218 ; 0x2e218 2e466: 88 23 and r24, r24 2e468: 09 f4 brne .+2 ; 0x2e46c 2e46a: 5c c0 rjmp .+184 ; 0x2e524 */ 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) ){ 2e46c: 49 81 ldd r20, Y+1 ; 0x01 2e46e: 5a 81 ldd r21, Y+2 ; 0x02 2e470: 60 91 80 14 lds r22, 0x1480 ; 0x801480 2e474: 70 91 81 14 lds r23, 0x1481 ; 0x801481 2e478: 21 e0 ldi r18, 0x01 ; 1 2e47a: 87 e6 ldi r24, 0x67 ; 103 2e47c: 96 e1 ldi r25, 0x16 ; 22 2e47e: 0f 94 63 54 call 0x2a8c6 ; 0x2a8c6 2e482: 88 23 and r24, r24 2e484: 09 f4 brne .+2 ; 0x2e488 2e486: 77 c0 rjmp .+238 ; 0x2e576 // compute the block to start with if( ! gfComputeNextFileBlock() ) 2e488: 87 e6 ldi r24, 0x67 ; 103 2e48a: 96 e1 ldi r25, 0x16 ; 22 2e48c: 0f 94 1e 2a call 0x2543c ; 0x2543c 2e490: 88 23 and r24, r24 2e492: 09 f4 brne .+2 ; 0x2e496 2e494: 70 c0 rjmp .+224 ; 0x2e576 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; 2e496: 80 91 88 16 lds r24, 0x1688 ; 0x801688 2e49a: 90 91 89 16 lds r25, 0x1689 ; 0x801689 2e49e: 8a 5b subi r24, 0xBA ; 186 2e4a0: 91 4f sbci r25, 0xF1 ; 241 2e4a2: 90 93 83 16 sts 0x1683, r25 ; 0x801683 2e4a6: 80 93 82 16 sts 0x1682, r24 ; 0x801682 return; if (file.openFilteredGcode(curDir, fname)) { getfilename(0, fname); 2e4aa: 89 81 ldd r24, Y+1 ; 0x01 2e4ac: 9a 81 ldd r25, Y+2 ; 0x02 2e4ae: 0f 94 57 6b call 0x2d6ae ; 0x2d6ae filesize = file.fileSize(); 2e4b2: 80 91 78 16 lds r24, 0x1678 ; 0x801678 2e4b6: 90 91 79 16 lds r25, 0x1679 ; 0x801679 2e4ba: a0 91 7a 16 lds r26, 0x167A ; 0x80167a 2e4be: b0 91 7b 16 lds r27, 0x167B ; 0x80167b 2e4c2: 80 93 e4 16 sts 0x16E4, r24 ; 0x8016e4 2e4c6: 90 93 e5 16 sts 0x16E5, r25 ; 0x8016e5 2e4ca: a0 93 e6 16 sts 0x16E6, r26 ; 0x8016e6 2e4ce: b0 93 e7 16 sts 0x16E7, r27 ; 0x8016e7 SERIAL_PROTOCOLRPGM(ofFileOpened);////MSG_SD_FILE_OPENED 2e4d2: 84 e5 ldi r24, 0x54 ; 84 2e4d4: 91 ea ldi r25, 0xA1 ; 161 2e4d6: 0e 94 15 7b call 0xf62a ; 0xf62a printAbsFilenameFast(); 2e4da: 0f 94 3a 6c call 0x2d874 ; 0x2d874 SERIAL_PROTOCOLRPGM(ofSize);////MSG_SD_SIZE 2e4de: 8c e4 ldi r24, 0x4C ; 76 2e4e0: 91 ea ldi r25, 0xA1 ; 161 2e4e2: 0e 94 15 7b call 0xf62a ; 0xf62a } void MarlinSerial::print(unsigned long n, int base) { if (base == 0) write(n); else printNumber(n, base); 2e4e6: 60 91 e4 16 lds r22, 0x16E4 ; 0x8016e4 2e4ea: 70 91 e5 16 lds r23, 0x16E5 ; 0x8016e5 2e4ee: 80 91 e6 16 lds r24, 0x16E6 ; 0x8016e6 2e4f2: 90 91 e7 16 lds r25, 0x16E7 ; 0x8016e7 2e4f6: 4a e0 ldi r20, 0x0A ; 10 2e4f8: 0e 94 16 7a call 0xf42c ; 0xf42c } void MarlinSerial::println(unsigned long n, int base) { print(n, base); println(); 2e4fc: 0e 94 0d 7b call 0xf61a ; 0xf61a SERIAL_PROTOCOLLN(filesize); sdpos = 0; 2e500: 10 92 eb 16 sts 0x16EB, r1 ; 0x8016eb 2e504: 10 92 ec 16 sts 0x16EC, r1 ; 0x8016ec 2e508: 10 92 ed 16 sts 0x16ED, r1 ; 0x8016ed 2e50c: 10 92 ee 16 sts 0x16EE, r1 ; 0x8016ee SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2e510: 8e e3 ldi r24, 0x3E ; 62 2e512: 91 ea ldi r25, 0xA1 ; 161 2e514: 0e 94 0e 7d call 0xfa1c ; 0xfa1c lcd_setstatuspgm(ofFileSelected); 2e518: 8e e3 ldi r24, 0x3E ; 62 2e51a: 91 ea ldi r25, 0xA1 ; 161 2e51c: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 scrollstuff = 0; 2e520: 10 92 62 0d sts 0x0D62, r1 ; 0x800d62 } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } 2e524: 0f 90 pop r0 2e526: 0f 90 pop r0 2e528: df 91 pop r29 2e52a: cf 91 pop r28 2e52c: 1f 91 pop r17 2e52e: 0f 91 pop r16 2e530: ff 90 pop r15 2e532: ef 90 pop r14 2e534: df 90 pop r13 2e536: cf 90 pop r12 2e538: bf 90 pop r11 2e53a: 08 95 ret {t++;cnt++;} //crawl counter forward. } if(cnt < MAXPATHNAMELENGTH - FILENAME_LENGTH) file.getFilename(t); else t[0]=0; 2e53c: f8 01 movw r30, r16 2e53e: 10 82 st Z, r1 2e540: 54 cf rjmp .-344 ; 0x2e3ea SERIAL_ECHORPGM(ofPos); SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; } else { SERIAL_ECHO_START; 2e542: 84 ee ldi r24, 0xE4 ; 228 2e544: 92 ea ldi r25, 0xA2 ; 162 2e546: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(ofNowDoingFile); 2e54a: 83 e7 ldi r24, 0x73 ; 115 2e54c: 91 ea ldi r25, 0xA1 ; 161 2e54e: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN(name); 2e552: c7 01 movw r24, r14 2e554: 0e 94 1a 86 call 0x10c34 ; 0x10c34 2e558: 7a cf rjmp .-268 ; 0x2e44e } file.close(); } else { //opening fresh file file_subcall_ctr=0; //resetting procedure depth in case user cancels print while in procedure 2e55a: 10 92 8a 16 sts 0x168A, r1 ; 0x80168a SERIAL_ECHO_START; 2e55e: 84 ee ldi r24, 0xE4 ; 228 2e560: 92 ea ldi r25, 0xA2 ; 162 2e562: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(ofNowFreshFile); 2e566: 82 e6 ldi r24, 0x62 ; 98 2e568: 91 ea ldi r25, 0xA1 ; 161 2e56a: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN(name); 2e56e: c7 01 movw r24, r14 2e570: 0e 94 1a 86 call 0x10c34 ; 0x10c34 2e574: 70 cf rjmp .-288 ; 0x2e456 SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } else { SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2e576: 88 ed ldi r24, 0xD8 ; 216 2e578: 9c e6 ldi r25, 0x6C ; 108 2e57a: 0e 94 15 7b call 0xf62a ; 0xf62a 2e57e: 89 81 ldd r24, Y+1 ; 0x01 2e580: 9a 81 ldd r25, Y+2 ; 0x02 2e582: 0e 94 0e 86 call 0x10c1c ; 0x10c1c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2e586: 8e e2 ldi r24, 0x2E ; 46 2e588: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2e58c: 0e 94 0d 7b call 0xf61a ; 0xf61a 2e590: c9 cf rjmp .-110 ; 0x2e524 0002e592 : void CardReader::printingHasFinished() { st_synchronize(); 2e592: 0f 94 94 18 call 0x23128 ; 0x23128 file.close(); 2e596: 87 e6 ldi r24, 0x67 ; 103 2e598: 96 e1 ldi r25, 0x16 ; 22 2e59a: 0f 94 75 2c call 0x258ea ; 0x258ea if(file_subcall_ctr>0) //heading up to a parent file that called current as a procedure. 2e59e: 80 91 8a 16 lds r24, 0x168A ; 0x80168a 2e5a2: 88 23 and r24, r24 2e5a4: 69 f1 breq .+90 ; 0x2e600 { file_subcall_ctr--; 2e5a6: 81 50 subi r24, 0x01 ; 1 2e5a8: 80 93 8a 16 sts 0x168A, r24 ; 0x80168a openFileReadFilteredGcode(filenames[file_subcall_ctr],true); 2e5ac: 25 e5 ldi r18, 0x55 ; 85 2e5ae: 82 9f mul r24, r18 2e5b0: c0 01 movw r24, r0 2e5b2: 11 24 eor r1, r1 2e5b4: 61 e0 ldi r22, 0x01 ; 1 2e5b6: 81 57 subi r24, 0x71 ; 113 2e5b8: 99 4e sbci r25, 0xE9 ; 233 2e5ba: 0f 94 91 71 call 0x2e322 ; 0x2e322 setIndex(filespos[file_subcall_ctr]); 2e5be: e0 91 8a 16 lds r30, 0x168A ; 0x80168a 2e5c2: 84 e0 ldi r24, 0x04 ; 4 2e5c4: e8 9f mul r30, r24 2e5c6: f0 01 movw r30, r0 2e5c8: 11 24 eor r1, r1 2e5ca: e5 57 subi r30, 0x75 ; 117 2e5cc: f9 4e sbci r31, 0xE9 ; 233 2e5ce: 60 81 ld r22, Z 2e5d0: 71 81 ldd r23, Z+1 ; 0x01 2e5d2: 82 81 ldd r24, Z+2 ; 0x02 2e5d4: 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);}; 2e5d6: 60 93 eb 16 sts 0x16EB, r22 ; 0x8016eb 2e5da: 70 93 ec 16 sts 0x16EC, r23 ; 0x8016ec 2e5de: 80 93 ed 16 sts 0x16ED, r24 ; 0x8016ed 2e5e2: 90 93 ee 16 sts 0x16EE, r25 ; 0x8016ee 2e5e6: 0f 94 b5 67 call 0x2cf6a ; 0x2cf6a SERIAL_ECHOLNRPGM(_n("SD card released"));////MSG_SD_CARD_RELEASED } void CardReader::startFileprint() { if(mounted) 2e5ea: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 2e5ee: 88 23 and r24, r24 2e5f0: 71 f0 breq .+28 ; 0x2e60e { sdprinting = true; 2e5f2: 81 e0 ldi r24, 0x01 ; 1 2e5f4: 80 93 d7 13 sts 0x13D7, r24 ; 0x8013d7 2e5f8: 85 e0 ldi r24, 0x05 ; 5 2e5fa: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.384> 2e5fe: 08 95 ret setIndex(filespos[file_subcall_ctr]); startFileprint(); } else { sdprinting = false; 2e600: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 2e604: 83 e0 ldi r24, 0x03 ; 3 2e606: 80 93 61 0d sts 0x0D61, r24 ; 0x800d61 <_ZL13printer_state.lto_priv.384> SetPrinterState(PrinterState::SDPrintingFinished); //set printer state to show LCD menu after finished SD print if(SD_FINISHED_STEPPERRELEASE) { finishAndDisableSteppers(); 2e60a: 0c 94 ce 84 jmp 0x1099c ; 0x1099c autotempShutdown(); #ifdef SDCARD_SORT_ALPHA //presort(); #endif } } 2e60e: 08 95 ret 0002e610 : root.rewind(); lsDive("",root, NULL, LS_SerialPrint, params); } void CardReader::mount(bool doPresort/* = true*/) 2e610: cf 92 push r12 2e612: df 92 push r13 2e614: ef 92 push r14 2e616: ff 92 push r15 2e618: 0f 93 push r16 2e61a: 1f 93 push r17 2e61c: cf 93 push r28 2e61e: df 93 push r29 2e620: 08 2f mov r16, r24 { mounted = false; 2e622: 10 92 d8 13 sts 0x13D8, r1 ; 0x8013d8 if(root.isOpen()) 2e626: 80 91 60 14 lds r24, 0x1460 ; 0x801460 2e62a: 88 23 and r24, r24 2e62c: 21 f0 breq .+8 ; 0x2e636 root.close(); 2e62e: 8d e5 ldi r24, 0x5D ; 93 2e630: 94 e1 ldi r25, 0x14 ; 20 2e632: 0f 94 75 2c call 0x258ea ; 0x258ea * \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; 2e636: 10 92 47 16 sts 0x1647, r1 ; 0x801647 2e63a: 10 92 44 16 sts 0x1644, r1 ; 0x801644 // 16-bit init start time allows over a minute uint16_t t0 = (uint16_t)_millis(); 2e63e: 0f 94 89 0b call 0x21712 ; 0x21712 2e642: eb 01 movw r28, r22 uint32_t arg; // set pin modes chipSelectHigh(); 2e644: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 SET_OUTPUT(SDSS); 2e648: 20 9a sbi 0x04, 0 ; 4 SET_INPUT(MISO); 2e64a: 23 98 cbi 0x04, 3 ; 4 SET_OUTPUT(MOSI); 2e64c: 22 9a sbi 0x04, 2 ; 4 SET_OUTPUT(SCK); 2e64e: 21 9a sbi 0x04, 1 ; 4 #ifndef SOFTWARE_SPI // SS must be in output mode even it is not chip select SET_OUTPUT(SS); 2e650: 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); 2e652: 28 9a sbi 0x05, 0 ; 5 #endif // SET_SPI_SS_HIGH // set SCK rate for initialization commands spiRate_ = SPI_SD_INIT_RATE; 2e654: 85 e0 ldi r24, 0x05 ; 5 2e656: 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); 2e65a: 82 e5 ldi r24, 0x52 ; 82 2e65c: 8c bd out 0x2c, r24 ; 44 SPSR = spiRate & 1 || spiRate == 6 ? 0 : 1 << SPI2X; 2e65e: 1d bc out 0x2d, r1 ; 45 2e660: 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); 2e662: 8f ef ldi r24, 0xFF ; 255 2e664: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 2e668: 11 50 subi r17, 0x01 ; 1 2e66a: d9 f7 brne .-10 ; 0x2e662 WRITE(MISO, 1); // temporarily enable the MISO line pullup 2e66c: 2b 9a sbi 0x05, 3 ; 5 // command to go idle in SPI mode while ((status_ = cardCommand(CMD0, 0)) != R1_IDLE_STATE) { 2e66e: 20 e0 ldi r18, 0x00 ; 0 2e670: 30 e0 ldi r19, 0x00 ; 0 2e672: a9 01 movw r20, r18 2e674: 60 e0 ldi r22, 0x00 ; 0 2e676: 84 e4 ldi r24, 0x44 ; 68 2e678: 96 e1 ldi r25, 0x16 ; 22 2e67a: 0f 94 5d 26 call 0x24cba ; 0x24cba 2e67e: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e682: 81 30 cpi r24, 0x01 ; 1 2e684: 61 f0 breq .+24 ; 0x2e69e if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 2e686: 0f 94 89 0b call 0x21712 ; 0x21712 2e68a: 6c 1b sub r22, r28 2e68c: 7d 0b sbc r23, r29 2e68e: 61 3d cpi r22, 0xD1 ; 209 2e690: 77 40 sbci r23, 0x07 ; 7 2e692: 68 f3 brcs .-38 ; 0x2e66e WRITE(MISO, 0); // disable the MISO line pullup 2e694: 2b 98 cbi 0x05, 3 ; 5 2e696: 81 e0 ldi r24, 0x01 ; 1 2e698: 80 93 44 16 sts 0x1644, r24 ; 0x801644 2e69c: 22 c0 rjmp .+68 ; 0x2e6e2 error(SD_CARD_ERROR_CMD0); goto fail; } } WRITE(MISO, 0); // disable the MISO line pullup 2e69e: 2b 98 cbi 0x05, 3 ; 5 // send 0xFF until 0xFF received to give card some clock cycles t0 = (uint16_t)_millis(); 2e6a0: 0f 94 89 0b call 0x21712 ; 0x21712 2e6a4: eb 01 movw r28, r22 SERIAL_ECHOLNRPGM(PSTR("Sending 0xFF")); 2e6a6: 81 e3 ldi r24, 0x31 ; 49 2e6a8: 91 ea ldi r25, 0xA1 ; 161 2e6aa: 0e 94 0e 7d call 0xfa1c ; 0xfa1c spiSend(0XFF); 2e6ae: 8f ef ldi r24, 0xFF ; 255 2e6b0: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 while ((status_ = spiRec()) != 0xFF) 2e6b4: 0f 94 56 26 call 0x24cac ; 0x24cac 2e6b8: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e6bc: 8f 3f cpi r24, 0xFF ; 255 2e6be: 59 f1 breq .+86 ; 0x2e716 { spiSend(0XFF); 2e6c0: 8f ef ldi r24, 0xFF ; 255 2e6c2: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 if (((uint16_t)_millis() - t0) > SD_CARD_ERROR_FF_TIMEOUT) 2e6c6: 0f 94 89 0b call 0x21712 ; 0x21712 2e6ca: 6c 1b sub r22, r28 2e6cc: 7d 0b sbc r23, r29 2e6ce: 62 32 cpi r22, 0x22 ; 34 2e6d0: 71 05 cpc r23, r1 2e6d2: 80 f3 brcs .-32 ; 0x2e6b4 2e6d4: 82 e0 ldi r24, 0x02 ; 2 2e6d6: 80 93 44 16 sts 0x1644, r24 ; 0x801644 { error(SD_CARD_ERROR_CMD8); SERIAL_ECHOLNRPGM(PSTR("No 0xFF received")); 2e6da: 80 e2 ldi r24, 0x20 ; 32 2e6dc: 91 ea ldi r25, 0xA1 ; 161 2e6de: 0e 94 0e 7d call 0xfa1c ; 0xfa1c #else // SOFTWARE_SPI return true; #endif // SOFTWARE_SPI fail: chipSelectHigh(); 2e6e2: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 #else if (!card.init(SPI_FULL_SPEED) ) #endif { SERIAL_ECHO_START; 2e6e6: 84 ee ldi r24, 0xE4 ; 228 2e6e8: 92 ea ldi r25, 0xA2 ; 162 2e6ea: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL 2e6ee: 8b ec ldi r24, 0xCB ; 203 2e6f0: 9c e6 ldi r25, 0x6C ; 108 } else { mounted = true; SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 2e6f2: 0e 94 0e 7d call 0xfa1c ; 0xfa1c } if (mounted) 2e6f6: 80 91 d8 13 lds r24, 0x13D8 ; 0x8013d8 2e6fa: 88 23 and r24, r24 2e6fc: 09 f4 brne .+2 ; 0x2e700 2e6fe: 9a c0 rjmp .+308 ; 0x2e834 { cdroot(doPresort); 2e700: 80 2f mov r24, r16 } } 2e702: df 91 pop r29 2e704: cf 91 pop r28 2e706: 1f 91 pop r17 2e708: 0f 91 pop r16 2e70a: ff 90 pop r15 2e70c: ef 90 pop r14 2e70e: df 90 pop r13 2e710: cf 90 pop r12 SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK } if (mounted) { cdroot(doPresort); 2e712: 0d 94 f4 70 jmp 0x2e1e8 ; 0x2e1e8 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 2e716: 2a ea ldi r18, 0xAA ; 170 2e718: 31 e0 ldi r19, 0x01 ; 1 2e71a: 40 e0 ldi r20, 0x00 ; 0 2e71c: 50 e0 ldi r21, 0x00 ; 0 2e71e: 68 e0 ldi r22, 0x08 ; 8 2e720: 84 e4 ldi r24, 0x44 ; 68 2e722: 96 e1 ldi r25, 0x16 ; 22 2e724: 0f 94 5d 26 call 0x24cba ; 0x24cba 2e728: 82 ff sbrs r24, 2 2e72a: 2b c0 rjmp .+86 ; 0x2e782 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;} 2e72c: 81 e0 ldi r24, 0x01 ; 1 2e72e: 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; 2e732: 80 91 47 16 lds r24, 0x1647 ; 0x801647 2e736: c1 2c mov r12, r1 2e738: d1 2c mov r13, r1 2e73a: 76 01 movw r14, r12 2e73c: 82 30 cpi r24, 0x02 ; 2 2e73e: 29 f4 brne .+10 ; 0x2e74a 2e740: c1 2c mov r12, r1 2e742: d1 2c mov r13, r1 2e744: e1 2c mov r14, r1 2e746: 80 e4 ldi r24, 0x40 ; 64 2e748: 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); 2e74a: 20 e0 ldi r18, 0x00 ; 0 2e74c: 30 e0 ldi r19, 0x00 ; 0 2e74e: a9 01 movw r20, r18 2e750: 67 e3 ldi r22, 0x37 ; 55 2e752: 84 e4 ldi r24, 0x44 ; 68 2e754: 96 e1 ldi r25, 0x16 ; 22 2e756: 0f 94 5d 26 call 0x24cba ; 0x24cba return cardCommand(cmd, arg); 2e75a: a7 01 movw r20, r14 2e75c: 96 01 movw r18, r12 2e75e: 69 e2 ldi r22, 0x29 ; 41 2e760: 84 e4 ldi r24, 0x44 ; 68 2e762: 96 e1 ldi r25, 0x16 ; 22 2e764: 0f 94 5d 26 call 0x24cba ; 0x24cba while ((status_ = cardAcmd(ACMD41, arg)) != R1_READY_STATE) { 2e768: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e76c: 88 23 and r24, r24 2e76e: b1 f0 breq .+44 ; 0x2e79c // check for timeout if (((uint16_t)_millis() - t0) > SD_INIT_TIMEOUT) { 2e770: 0f 94 89 0b call 0x21712 ; 0x21712 2e774: 6c 1b sub r22, r28 2e776: 7d 0b sbc r23, r29 2e778: 61 3d cpi r22, 0xD1 ; 209 2e77a: 77 40 sbci r23, 0x07 ; 7 2e77c: 30 f3 brcs .-52 ; 0x2e74a bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2e77e: 8a e0 ldi r24, 0x0A ; 10 2e780: 8b cf rjmp .-234 ; 0x2e698 goto fail; } } // check SD version if ((cardCommand(CMD8, 0x1AA) & R1_ILLEGAL_COMMAND)) { 2e782: 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(); 2e784: 0f 94 56 26 call 0x24cac ; 0x24cac 2e788: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2e78c: 11 50 subi r17, 0x01 ; 1 2e78e: d1 f7 brne .-12 ; 0x2e784 if (status_ != 0XAA) { 2e790: 8a 3a cpi r24, 0xAA ; 170 2e792: 11 f0 breq .+4 ; 0x2e798 2e794: 82 e0 ldi r24, 0x02 ; 2 2e796: 80 cf rjmp .-256 ; 0x2e698 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;} 2e798: 82 e0 ldi r24, 0x02 ; 2 2e79a: c9 cf rjmp .-110 ; 0x2e72e error(SD_CARD_ERROR_ACMD41); goto fail; } } // if SD2 read OCR register to check for SDHC card if (type() == SD_CARD_TYPE_SD2) { 2e79c: 80 91 47 16 lds r24, 0x1647 ; 0x801647 2e7a0: 82 30 cpi r24, 0x02 ; 2 2e7a2: d1 f4 brne .+52 ; 0x2e7d8 if (cardCommand(CMD58, 0)) { 2e7a4: 20 e0 ldi r18, 0x00 ; 0 2e7a6: 30 e0 ldi r19, 0x00 ; 0 2e7a8: a9 01 movw r20, r18 2e7aa: 6a e3 ldi r22, 0x3A ; 58 2e7ac: 84 e4 ldi r24, 0x44 ; 68 2e7ae: 96 e1 ldi r25, 0x16 ; 22 2e7b0: 0f 94 5d 26 call 0x24cba ; 0x24cba 2e7b4: 88 23 and r24, r24 2e7b6: 11 f0 breq .+4 ; 0x2e7bc bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2e7b8: 88 e0 ldi r24, 0x08 ; 8 2e7ba: 6e cf rjmp .-292 ; 0x2e698 error(SD_CARD_ERROR_CMD58); goto fail; } if ((spiRec() & 0XC0) == 0XC0) type(SD_CARD_TYPE_SDHC); 2e7bc: 0f 94 56 26 call 0x24cac ; 0x24cac 2e7c0: 80 7c andi r24, 0xC0 ; 192 2e7c2: 80 3c cpi r24, 0xC0 ; 192 2e7c4: 19 f4 brne .+6 ; 0x2e7cc 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;} 2e7c6: 83 e0 ldi r24, 0x03 ; 3 2e7c8: 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(); 2e7cc: 0f 94 56 26 call 0x24cac ; 0x24cac 2e7d0: 0f 94 56 26 call 0x24cac ; 0x24cac 2e7d4: 0f 94 56 26 call 0x24cac ; 0x24cac } chipSelectHigh(); 2e7d8: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 bool Sd2Card::setSckRate(uint8_t sckRateID) { if (sckRateID > 6) { error(SD_CARD_ERROR_SCK_RATE); return false; } spiRate_ = sckRateID; 2e7dc: 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);} 2e7e0: 81 e0 ldi r24, 0x01 ; 1 2e7e2: 0f 94 15 59 call 0x2b22a ; 0x2b22a 2e7e6: 81 11 cpse r24, r1 2e7e8: 0c c0 rjmp .+24 ; 0x2e802 2e7ea: 80 e0 ldi r24, 0x00 ; 0 2e7ec: 0f 94 15 59 call 0x2b22a ; 0x2b22a #endif { SERIAL_ECHO_START; SERIAL_ECHOLNRPGM(_n("SD init fail"));////MSG_SD_INIT_FAIL } else if (!volume.init(&card)) 2e7f0: 81 11 cpse r24, r1 2e7f2: 07 c0 rjmp .+14 ; 0x2e802 { SERIAL_ERROR_START; 2e7f4: 87 ec ldi r24, 0xC7 ; 199 2e7f6: 92 ea ldi r25, 0xA2 ; 162 2e7f8: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORLNRPGM(_n("volume.init failed"));////MSG_SD_VOL_INIT_FAIL 2e7fc: 88 eb ldi r24, 0xB8 ; 184 2e7fe: 9c e6 ldi r25, 0x6C ; 108 2e800: 78 cf rjmp .-272 ; 0x2e6f2 } else if (!root.openRoot(&volume)) 2e802: 69 e4 ldi r22, 0x49 ; 73 2e804: 76 e1 ldi r23, 0x16 ; 22 2e806: 8d e5 ldi r24, 0x5D ; 93 2e808: 94 e1 ldi r25, 0x14 ; 20 2e80a: 0f 94 ce 29 call 0x2539c ; 0x2539c 2e80e: 81 11 cpse r24, r1 2e810: 07 c0 rjmp .+14 ; 0x2e820 { SERIAL_ERROR_START; 2e812: 87 ec ldi r24, 0xC7 ; 199 2e814: 92 ea ldi r25, 0xA2 ; 162 2e816: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ERRORLNRPGM(_n("openRoot failed"));////MSG_SD_OPENROOT_FAIL 2e81a: 88 ea ldi r24, 0xA8 ; 168 2e81c: 9c e6 ldi r25, 0x6C ; 108 2e81e: 69 cf rjmp .-302 ; 0x2e6f2 } else { mounted = true; 2e820: 81 e0 ldi r24, 0x01 ; 1 2e822: 80 93 d8 13 sts 0x13D8, r24 ; 0x8013d8 SERIAL_ECHO_START; 2e826: 84 ee ldi r24, 0xE4 ; 228 2e828: 92 ea ldi r25, 0xA2 ; 162 2e82a: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLNRPGM(_n("SD card ok"));////MSG_SD_CARD_OK 2e82e: 8d e9 ldi r24, 0x9D ; 157 2e830: 9c e6 ldi r25, 0x6C ; 108 2e832: 5f cf rjmp .-322 ; 0x2e6f2 if (mounted) { cdroot(doPresort); } } 2e834: df 91 pop r29 2e836: cf 91 pop r28 2e838: 1f 91 pop r17 2e83a: 0f 91 pop r16 2e83c: ff 90 pop r15 2e83e: ef 90 pop r14 2e840: df 90 pop r13 2e842: cf 90 pop r12 2e844: 08 95 ret 0002e846 : ms = 0; } } } static void wait_for_heater(long codenum, uint8_t extruder) { 2e846: 4f 92 push r4 2e848: 5f 92 push r5 2e84a: 6f 92 push r6 2e84c: 7f 92 push r7 2e84e: 8f 92 push r8 2e850: 9f 92 push r9 2e852: af 92 push r10 2e854: bf 92 push r11 2e856: cf 92 push r12 2e858: df 92 push r13 2e85a: ef 92 push r14 2e85c: ff 92 push r15 2e85e: 4b 01 movw r8, r22 2e860: 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]; 2e862: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 2e866: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 2e86a: 07 2e mov r0, r23 2e86c: 00 0c add r0, r0 2e86e: 88 0b sbc r24, r24 2e870: 99 0b sbc r25, r25 2e872: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> if (!degTargetHotend(extruder)) 2e876: 20 e0 ldi r18, 0x00 ; 0 2e878: 30 e0 ldi r19, 0x00 ; 0 2e87a: a9 01 movw r20, r18 2e87c: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2e880: 88 23 and r24, r24 2e882: d1 f0 breq .+52 ; 0x2e8b8 #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; 2e884: 10 92 5f 0d sts 0x0D5F, r1 ; 0x800d5f <_ZL13cancel_heatup.lto_priv.389> if (!degTargetHotend(extruder)) return; #ifdef TEMP_RESIDENCY_TIME long residencyStart; residencyStart = -1; 2e888: cc 24 eor r12, r12 2e88a: ca 94 dec r12 2e88c: dc 2c mov r13, r12 2e88e: 76 01 movw r14, r12 #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); if (residencyStart > -1) { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 2e890: 98 ee ldi r25, 0xE8 ; 232 2e892: 49 2e mov r4, r25 2e894: 93 e0 ldi r25, 0x03 ; 3 2e896: 59 2e mov r5, r25 2e898: 61 2c mov r6, r1 2e89a: 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) || 2e89c: 80 91 5f 0d lds r24, 0x0D5F ; 0x800d5f <_ZL13cancel_heatup.lto_priv.389> 2e8a0: 81 11 cpse r24, r1 2e8a2: 0a c0 rjmp .+20 ; 0x2e8b8 2e8a4: 2f ef ldi r18, 0xFF ; 255 2e8a6: c2 16 cp r12, r18 2e8a8: d2 06 cpc r13, r18 2e8aa: e2 06 cpc r14, r18 2e8ac: f2 06 cpc r15, r18 2e8ae: 89 f4 brne .+34 ; 0x2e8d2 (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) { 2e8b0: 80 91 5e 0d lds r24, 0x0D5E ; 0x800d5e 2e8b4: 82 30 cpi r24, 0x02 ; 2 2e8b6: b9 f4 brne .+46 ; 0x2e8e6 { residencyStart = _millis(); } #endif //TEMP_RESIDENCY_TIME } } 2e8b8: ff 90 pop r15 2e8ba: ef 90 pop r14 2e8bc: df 90 pop r13 2e8be: cf 90 pop r12 2e8c0: bf 90 pop r11 2e8c2: af 90 pop r10 2e8c4: 9f 90 pop r9 2e8c6: 8f 90 pop r8 2e8c8: 7f 90 pop r7 2e8ca: 6f 90 pop r6 2e8cc: 5f 90 pop r5 2e8ce: 4f 90 pop r4 2e8d0: 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) || 2e8d2: f7 fc sbrc r15, 7 2e8d4: f1 cf rjmp .-30 ; 0x2e8b8 (residencyStart >= 0 && (((unsigned int)(_millis() - residencyStart)) < (TEMP_RESIDENCY_TIME * 1000UL))))) { 2e8d6: 0f 94 89 0b call 0x21712 ; 0x21712 2e8da: 6c 19 sub r22, r12 2e8dc: 7d 09 sbc r23, r13 2e8de: 68 3b cpi r22, 0xB8 ; 184 2e8e0: 7b 40 sbci r23, 0x0B ; 11 2e8e2: 30 f3 brcs .-52 ; 0x2e8b0 2e8e4: e9 cf rjmp .-46 ; 0x2e8b8 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) 2e8e6: 0f 94 89 0b call 0x21712 ; 0x21712 2e8ea: 68 19 sub r22, r8 2e8ec: 79 09 sbc r23, r9 2e8ee: 8a 09 sbc r24, r10 2e8f0: 9b 09 sbc r25, r11 2e8f2: 69 3e cpi r22, 0xE9 ; 233 2e8f4: 73 40 sbci r23, 0x03 ; 3 2e8f6: 81 05 cpc r24, r1 2e8f8: 91 05 cpc r25, r1 2e8fa: 08 f4 brcc .+2 ; 0x2e8fe 2e8fc: 42 c0 rjmp .+132 ; 0x2e982 { //Print Temp Reading and remaining time every 1 second while heating up/cooling down if (!farm_mode) { 2e8fe: 80 91 60 0d lds r24, 0x0D60 ; 0x800d60 2e902: 81 11 cpse r24, r1 2e904: 3a c0 rjmp .+116 ; 0x2e97a SERIAL_PROTOCOLPGM("T:"); 2e906: 8d e1 ldi r24, 0x1D ; 29 2e908: 91 ea ldi r25, 0xA1 ; 161 2e90a: 0e 94 15 7b call 0xf62a ; 0xf62a else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 2e90e: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2e912: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2e916: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2e91a: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2e91e: 41 e0 ldi r20, 0x01 ; 1 2e920: 0e 94 97 7a call 0xf52e ; 0xf52e SERIAL_PROTOCOL_F(degHotend(extruder), 1); SERIAL_PROTOCOLPGM(" E:"); 2e924: 89 e1 ldi r24, 0x19 ; 25 2e926: 91 ea ldi r25, 0xA1 ; 161 2e928: 0e 94 15 7b call 0xf62a ; 0xf62a 2e92c: 60 e0 ldi r22, 0x00 ; 0 2e92e: 70 e0 ldi r23, 0x00 ; 0 2e930: cb 01 movw r24, r22 2e932: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 SERIAL_PROTOCOL((int)extruder); #ifdef TEMP_RESIDENCY_TIME SERIAL_PROTOCOLPGM(" W:"); 2e936: 85 e1 ldi r24, 0x15 ; 21 2e938: 91 ea ldi r25, 0xA1 ; 161 2e93a: 0e 94 15 7b call 0xf62a ; 0xf62a if (residencyStart > -1) 2e93e: f7 fc sbrc r15, 7 2e940: 52 c0 rjmp .+164 ; 0x2e9e6 { codenum = ((TEMP_RESIDENCY_TIME * 1000UL) - (_millis() - residencyStart)) / 1000UL; 2e942: 0f 94 89 0b call 0x21712 ; 0x21712 2e946: 46 01 movw r8, r12 2e948: 57 01 movw r10, r14 2e94a: 58 eb ldi r21, 0xB8 ; 184 2e94c: 85 0e add r8, r21 2e94e: 5b e0 ldi r21, 0x0B ; 11 2e950: 95 1e adc r9, r21 2e952: a1 1c adc r10, r1 2e954: b1 1c adc r11, r1 2e956: a5 01 movw r20, r10 2e958: 94 01 movw r18, r8 2e95a: 26 1b sub r18, r22 2e95c: 37 0b sbc r19, r23 2e95e: 48 0b sbc r20, r24 2e960: 59 0b sbc r21, r25 2e962: ca 01 movw r24, r20 2e964: b9 01 movw r22, r18 2e966: a3 01 movw r20, r6 2e968: 92 01 movw r18, r4 2e96a: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 2e96e: ca 01 movw r24, r20 2e970: b9 01 movw r22, r18 2e972: 0e 94 7b 7a call 0xf4f6 ; 0xf4f6 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2e976: 0e 94 0d 7b call 0xf61a ; 0xf61a } } #else SERIAL_PROTOCOLLN(); #endif codenum = _millis(); 2e97a: 0f 94 89 0b call 0x21712 ; 0x21712 2e97e: 4b 01 movw r8, r22 2e980: 5c 01 movw r10, r24 } delay_keep_alive(0); //do not disable steppers 2e982: 90 e0 ldi r25, 0x00 ; 0 2e984: 80 e0 ldi r24, 0x00 ; 0 2e986: 0e 94 07 8d call 0x11a0e ; 0x11a0e #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))) || 2e98a: 3f ef ldi r19, 0xFF ; 255 2e98c: c3 16 cp r12, r19 2e98e: d3 06 cpc r13, r19 2e990: e3 06 cpc r14, r19 2e992: f3 06 cpc r15, r19 2e994: 09 f0 breq .+2 ; 0x2e998 2e996: 46 c0 rjmp .+140 ; 0x2ea24 } 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))) || 2e998: 80 91 59 0d lds r24, 0x0D59 ; 0x800d59 <_ZL16target_direction.lto_priv.487> 2e99c: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 2e9a0: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 2e9a4: 88 23 and r24, r24 2e9a6: 19 f1 breq .+70 ; 0x2e9ee 2e9a8: 07 2e mov r0, r23 2e9aa: 00 0c add r0, r0 2e9ac: 88 0b sbc r24, r24 2e9ae: 99 0b sbc r25, r25 2e9b0: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2e9b4: 20 e0 ldi r18, 0x00 ; 0 2e9b6: 30 e0 ldi r19, 0x00 ; 0 2e9b8: 40 e8 ldi r20, 0x80 ; 128 2e9ba: 5f e3 ldi r21, 0x3F ; 63 2e9bc: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2e9c0: 9b 01 movw r18, r22 2e9c2: ac 01 movw r20, r24 2e9c4: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2e9c8: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2e9cc: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2e9d0: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2e9d4: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2e9d8: 87 fd sbrc r24, 7 2e9da: 60 cf rjmp .-320 ; 0x2e89c (residencyStart == -1 && !target_direction && (degHotend(extruder) <= (degTargetHotend(extruder) + TEMP_WINDOW))) || (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) { residencyStart = _millis(); 2e9dc: 0f 94 89 0b call 0x21712 ; 0x21712 2e9e0: 6b 01 movw r12, r22 2e9e2: 7c 01 movw r14, r24 2e9e4: 5b cf rjmp .-330 ; 0x2e89c } void MarlinSerial::print(long n, int base) { if (base == 0) { write(n); 2e9e6: 8f e3 ldi r24, 0x3F ; 63 2e9e8: 0e 94 02 7a call 0xf404 ; 0xf404 2e9ec: c4 cf rjmp .-120 ; 0x2e976 2e9ee: 07 2e mov r0, r23 2e9f0: 00 0c add r0, r0 2e9f2: 88 0b sbc r24, r24 2e9f4: 99 0b sbc r25, r25 2e9f6: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__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))) || 2e9fa: 20 e0 ldi r18, 0x00 ; 0 2e9fc: 30 e0 ldi r19, 0x00 ; 0 2e9fe: 40 e8 ldi r20, 0x80 ; 128 2ea00: 5f e3 ldi r21, 0x3F ; 63 2ea02: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2ea06: 9b 01 movw r18, r22 2ea08: ac 01 movw r20, r24 2ea0a: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2ea0e: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2ea12: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2ea16: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2ea1a: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2ea1e: 18 16 cp r1, r24 2ea20: ec f6 brge .-70 ; 0x2e9dc 2ea22: 3c cf rjmp .-392 ; 0x2e89c 2ea24: f7 fc sbrc r15, 7 2ea26: 3a cf rjmp .-396 ; 0x2e89c 2ea28: 60 91 5d 12 lds r22, 0x125D ; 0x80125d 2ea2c: 70 91 5e 12 lds r23, 0x125E ; 0x80125e 2ea30: 07 2e mov r0, r23 2ea32: 00 0c add r0, r0 2ea34: 88 0b sbc r24, r24 2ea36: 99 0b sbc r25, r25 2ea38: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2ea3c: 9b 01 movw r18, r22 2ea3e: ac 01 movw r20, r24 (residencyStart > -1 && fabs(degHotend(extruder) - degTargetHotend(extruder)) > TEMP_HYSTERESIS)) 2ea40: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 2ea44: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 2ea48: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 2ea4c: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 2ea50: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2ea54: 9f 77 andi r25, 0x7F ; 127 2ea56: 20 e0 ldi r18, 0x00 ; 0 2ea58: 30 e0 ldi r19, 0x00 ; 0 2ea5a: 40 ea ldi r20, 0xA0 ; 160 2ea5c: 50 e4 ldi r21, 0x40 ; 64 2ea5e: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2ea62: 18 16 cp r1, r24 2ea64: 0c f0 brlt .+2 ; 0x2ea68 2ea66: 1a cf rjmp .-460 ; 0x2e89c 2ea68: b9 cf rjmp .-142 ; 0x2e9dc 0002ea6a : // 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) { 2ea6a: 1f 93 push r17 2ea6c: cf 93 push r28 2ea6e: df 93 push r29 2ea70: ec 01 movw r28, r24 2ea72: 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()) { 2ea74: 80 91 d4 12 lds r24, 0x12D4 ; 0x8012d4 2ea78: 83 30 cpi r24, 0x03 ; 3 2ea7a: 09 f4 brne .+2 ; 0x2ea7e 2ea7c: 4e c0 rjmp .+156 ; 0x2eb1a 2ea7e: 8c 31 cpi r24, 0x1C ; 28 2ea80: 09 f4 brne .+2 ; 0x2ea84 2ea82: 52 c0 rjmp .+164 ; 0x2eb28 break; default: break; } if (ec != lastErrorCode) { // deduplicate: only report changes in error codes into the log 2ea84: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 2ea88: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 2ea8c: 8c 17 cp r24, r28 2ea8e: 9d 07 cpc r25, r29 2ea90: 79 f1 breq .+94 ; 0x2eaf0 lastErrorCode = ec; 2ea92: d0 93 fa 12 sts 0x12FA, r29 ; 0x8012fa 2ea96: c0 93 f9 12 sts 0x12F9, r28 ; 0x8012f9 lastErrorSource = res; 2ea9a: 10 93 fb 12 sts 0x12FB, r17 ; 0x8012fb LogErrorEvent_P(_O(PrusaErrorTitle(PrusaErrorCodeIndex(ec)))); 2ea9e: ce 01 movw r24, r28 2eaa0: 0f 94 9d 4e call 0x29d3a ; 0x29d3a 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); 2eaa4: e8 2f mov r30, r24 2eaa6: f0 e0 ldi r31, 0x00 ; 0 2eaa8: ee 0f add r30, r30 2eaaa: ff 1f adc r31, r31 2eaac: ea 5c subi r30, 0xCA ; 202 2eaae: ff 45 sbci r31, 0x5F ; 95 2eab0: 85 91 lpm r24, Z+ 2eab2: 94 91 lpm r25, Z 2eab4: 02 96 adiw r24, 0x02 ; 2 2eab6: 0f 94 86 4e call 0x29d0c ; 0x29d0c if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { 2eaba: c1 30 cpi r28, 0x01 ; 1 2eabc: d1 05 cpc r29, r1 2eabe: c1 f0 breq .+48 ; 0x2eaf0 2eac0: cc 30 cpi r28, 0x0C ; 12 2eac2: 80 e8 ldi r24, 0x80 ; 128 2eac4: d8 07 cpc r29, r24 2eac6: a1 f0 breq .+40 ; 0x2eaf0 2eac8: c9 32 cpi r28, 0x29 ; 41 2eaca: 80 e8 ldi r24, 0x80 ; 128 2eacc: d8 07 cpc r29, r24 2eace: 81 f0 breq .+32 ; 0x2eaf0 IncrementMMUFails(); 2ead0: 0f 94 b4 4d call 0x29b68 ; 0x29b68 | (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 2ead4: ce 01 movw r24, r28 2ead6: 88 27 eor r24, r24 2ead8: 9e 77 andi r25, 0x7E ; 126 2eada: 89 2b or r24, r25 2eadc: 49 f0 breq .+18 ; 0x2eaf0 /// Set toolchange counter to zero inline void ClearToolChangeCounter() { toolchange_counter = 0; }; inline uint16_t TMCFailures() const { return tmcFailures; } inline void IncrementTMCFailures() { ++tmcFailures; } 2eade: 80 91 07 13 lds r24, 0x1307 ; 0x801307 2eae2: 90 91 08 13 lds r25, 0x1308 ; 0x801308 2eae6: 01 96 adiw r24, 0x01 ; 1 2eae8: 90 93 08 13 sts 0x1308, r25 ; 0x801308 2eaec: 80 93 07 13 sts 0x1307, r24 ; 0x801307 return true; } } bool MMU2::RetryIfPossible(ErrorCode ec) { if (logic.RetryAttempts()) { 2eaf0: 80 91 e6 12 lds r24, 0x12E6 ; 0x8012e6 2eaf4: 88 23 and r24, r24 2eaf6: d9 f0 breq .+54 ; 0x2eb2e return Buttons::NoButton; } void SetButtonResponse(ButtonOperations rsp) { buttonSelectedOperation = rsp; 2eaf8: 11 e0 ldi r17, 0x01 ; 1 2eafa: 10 93 44 0d sts 0x0D44, r17 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> SetButtonResponse(ButtonOperations::Retry); // check, that Retry is actually allowed on that operation if (ButtonAvailable(ec) != Buttons::NoButton) { 2eafe: ce 01 movw r24, r28 2eb00: 0f 94 28 51 call 0x2a250 ; 0x2a250 2eb04: 8f 3f cpi r24, 0xFF ; 255 2eb06: 99 f0 breq .+38 ; 0x2eb2e void ResetCommunicationTimeoutAttempts(); constexpr bool InAutoRetry() const { return inAutoRetry; } void SetInAutoRetry(bool iar) { inAutoRetry = iar; 2eb08: 10 93 e7 12 sts 0x12E7, r17 ; 0x8012e7 logic.SetInAutoRetry(true); SERIAL_ECHOLNPGM("RetryButtonPressed"); 2eb0c: 83 e2 ldi r24, 0x23 ; 35 2eb0e: 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"); } 2eb10: df 91 pop r29 2eb12: cf 91 pop r28 2eb14: 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"); 2eb16: 0c 94 0e 7d jmp 0xfa1c ; 0xfa1c // 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; 2eb1a: 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(); 2eb1e: 0f 94 87 4c call 0x2990e ; 0x2990e // 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; 2eb22: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 2eb26: ae cf rjmp .-164 ; 0x2ea84 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; 2eb28: 10 92 03 13 sts 0x1303, r1 ; 0x801303 2eb2c: f8 cf rjmp .-16 ; 0x2eb1e 2eb2e: 10 92 e7 12 sts 0x12E7, r1 ; 0x8012e7 bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 2eb32: 80 91 43 0d lds r24, 0x0D43 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.449> 2eb36: 81 11 cpse r24, r1 2eb38: 06 c0 rjmp .+12 ; 0x2eb46 2eb3a: 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"); } 2eb3c: df 91 pop r29 2eb3e: cf 91 pop r28 2eb40: 1f 91 pop r17 2eb42: 0d 94 ee 4f jmp 0x29fdc ; 0x29fdc 2eb46: df 91 pop r29 2eb48: cf 91 pop r28 2eb4a: 1f 91 pop r17 2eb4c: 08 95 ret 0002eb4e : * \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) { 2eb4e: 2f 92 push r2 2eb50: 3f 92 push r3 2eb52: 4f 92 push r4 2eb54: 5f 92 push r5 2eb56: 6f 92 push r6 2eb58: 7f 92 push r7 2eb5a: 8f 92 push r8 2eb5c: 9f 92 push r9 2eb5e: af 92 push r10 2eb60: bf 92 push r11 2eb62: cf 92 push r12 2eb64: df 92 push r13 2eb66: ef 92 push r14 2eb68: ff 92 push r15 2eb6a: 0f 93 push r16 2eb6c: 1f 93 push r17 2eb6e: cf 93 push r28 2eb70: df 93 push r29 2eb72: 00 d0 rcall .+0 ; 0x2eb74 2eb74: 1f 92 push r1 2eb76: cd b7 in r28, 0x3d ; 61 2eb78: de b7 in r29, 0x3e ; 62 2eb7a: 5c 01 movw r10, r24 2eb7c: 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; 2eb7e: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 2eb82: 81 30 cpi r24, 0x01 ; 1 2eb84: 09 f0 breq .+2 ; 0x2eb88 2eb86: de c0 rjmp .+444 ; 0x2ed44 2eb88: 80 91 68 16 lds r24, 0x1668 ; 0x801668 2eb8c: 81 ff sbrs r24, 1 2eb8e: da c0 rjmp .+436 ; 0x2ed44 // seek to end of file if append flag if ((flags_ & O_APPEND) && curPosition_ != fileSize_) { 2eb90: 82 fd sbrc r24, 2 2eb92: bc c0 rjmp .+376 ; 0x2ed0c * \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) { 2eb94: 74 01 movw r14, r8 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2eb96: 21 2c mov r2, r1 2eb98: 32 e0 ldi r19, 0x02 ; 2 2eb9a: 33 2e mov r3, r19 2eb9c: 00 91 6f 16 lds r16, 0x166F ; 0x80166f 2eba0: 10 91 70 16 lds r17, 0x1670 ; 0x801670 2eba4: 20 91 71 16 lds r18, 0x1671 ; 0x801671 2eba8: 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) { 2ebac: e1 14 cp r14, r1 2ebae: f1 04 cpc r15, r1 2ebb0: 09 f4 brne .+2 ; 0x2ebb4 2ebb2: 30 c1 rjmp .+608 ; 0x2ee14 uint8_t blockOfCluster = vol_->blockOfCluster(curPosition_); 2ebb4: 80 91 80 16 lds r24, 0x1680 ; 0x801680 2ebb8: 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);} 2ebbc: dc 01 movw r26, r24 2ebbe: 14 96 adiw r26, 0x04 ; 4 2ebc0: 7c 90 ld r7, X 2ebc2: 7a 94 dec r7 2ebc4: b9 01 movw r22, r18 2ebc6: a8 01 movw r20, r16 2ebc8: 29 e0 ldi r18, 0x09 ; 9 2ebca: 76 95 lsr r23 2ebcc: 67 95 ror r22 2ebce: 57 95 ror r21 2ebd0: 47 95 ror r20 2ebd2: 2a 95 dec r18 2ebd4: d1 f7 brne .-12 ; 0x2ebca 2ebd6: 74 22 and r7, r20 uint16_t blockOffset = curPosition_ & 0X1FF; 2ebd8: 11 70 andi r17, 0x01 ; 1 if (blockOfCluster == 0 && blockOffset == 0) { 2ebda: 71 10 cpse r7, r1 2ebdc: 25 c0 rjmp .+74 ; 0x2ec28 2ebde: 01 15 cp r16, r1 2ebe0: 11 05 cpc r17, r1 2ebe2: 11 f5 brne .+68 ; 0x2ec28 2ebe4: 40 91 6b 16 lds r20, 0x166B ; 0x80166b 2ebe8: 50 91 6c 16 lds r21, 0x166C ; 0x80166c 2ebec: 60 91 6d 16 lds r22, 0x166D ; 0x80166d 2ebf0: 70 91 6e 16 lds r23, 0x166E ; 0x80166e // start of new cluster if (curCluster_ == 0) { 2ebf4: 41 15 cp r20, r1 2ebf6: 51 05 cpc r21, r1 2ebf8: 61 05 cpc r22, r1 2ebfa: 71 05 cpc r23, r1 2ebfc: 09 f0 breq .+2 ; 0x2ec00 2ebfe: a8 c0 rjmp .+336 ; 0x2ed50 if (firstCluster_ == 0) { 2ec00: 80 91 7c 16 lds r24, 0x167C ; 0x80167c 2ec04: 90 91 7d 16 lds r25, 0x167D ; 0x80167d 2ec08: a0 91 7e 16 lds r26, 0x167E ; 0x80167e 2ec0c: b0 91 7f 16 lds r27, 0x167F ; 0x80167f 2ec10: 00 97 sbiw r24, 0x00 ; 0 2ec12: a1 05 cpc r26, r1 2ec14: b1 05 cpc r27, r1 2ec16: 09 f0 breq .+2 ; 0x2ec1a 2ec18: b4 c0 rjmp .+360 ; 0x2ed82 } 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; 2ec1a: 87 e6 ldi r24, 0x67 ; 103 2ec1c: 96 e1 ldi r25, 0x16 ; 22 2ec1e: 0f 94 2b 2b call 0x25656 ; 0x25656 2ec22: 88 23 and r24, r24 2ec24: 09 f4 brne .+2 ; 0x2ec28 2ec26: 8e c0 rjmp .+284 ; 0x2ed44 curCluster_ = next; } } } // max space in block uint16_t n = 512 - blockOffset; 2ec28: c1 01 movw r24, r2 2ec2a: 80 1b sub r24, r16 2ec2c: 91 0b sbc r25, r17 2ec2e: 67 01 movw r12, r14 2ec30: 8e 15 cp r24, r14 2ec32: 9f 05 cpc r25, r15 2ec34: 08 f4 brcc .+2 ; 0x2ec38 2ec36: 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; 2ec38: e0 91 80 16 lds r30, 0x1680 ; 0x801680 2ec3c: f0 91 81 16 lds r31, 0x1681 ; 0x801681 uint32_t clusterStartBlock(uint32_t cluster) const { return dataStartBlock_ + ((cluster - 2) << clusterSizeShift_);} 2ec40: 80 91 6b 16 lds r24, 0x166B ; 0x80166b 2ec44: 90 91 6c 16 lds r25, 0x166C ; 0x80166c 2ec48: a0 91 6d 16 lds r26, 0x166D ; 0x80166d 2ec4c: b0 91 6e 16 lds r27, 0x166E ; 0x80166e 2ec50: 02 97 sbiw r24, 0x02 ; 2 2ec52: a1 09 sbc r26, r1 2ec54: b1 09 sbc r27, r1 2ec56: 25 85 ldd r18, Z+13 ; 0x0d 2ec58: 04 c0 rjmp .+8 ; 0x2ec62 2ec5a: 88 0f add r24, r24 2ec5c: 99 1f adc r25, r25 2ec5e: aa 1f adc r26, r26 2ec60: bb 1f adc r27, r27 2ec62: 2a 95 dec r18 2ec64: d2 f7 brpl .-12 ; 0x2ec5a 2ec66: 46 85 ldd r20, Z+14 ; 0x0e 2ec68: 57 85 ldd r21, Z+15 ; 0x0f 2ec6a: 60 89 ldd r22, Z+16 ; 0x10 2ec6c: 71 89 ldd r23, Z+17 ; 0x11 2ec6e: 84 0f add r24, r20 2ec70: 95 1f adc r25, r21 2ec72: a6 1f adc r26, r22 2ec74: b7 1f adc r27, r23 2ec76: 9c 01 movw r18, r24 2ec78: ad 01 movw r20, r26 2ec7a: 27 0d add r18, r7 2ec7c: 31 1d adc r19, r1 2ec7e: 41 1d adc r20, r1 2ec80: 51 1d adc r21, r1 2ec82: 29 01 movw r4, r18 2ec84: 3a 01 movw r6, r20 if (n == 512) { 2ec86: c1 14 cp r12, r1 2ec88: 32 e0 ldi r19, 0x02 ; 2 2ec8a: d3 06 cpc r13, r19 2ec8c: 09 f0 breq .+2 ; 0x2ec90 2ec8e: 8a c0 rjmp .+276 ; 0x2eda4 // full block - don't need to use cache if (vol_->cacheBlockNumber() == block) { 2ec90: 80 91 3a 0e lds r24, 0x0E3A ; 0x800e3a 2ec94: 90 91 3b 0e lds r25, 0x0E3B ; 0x800e3b 2ec98: a0 91 3c 0e lds r26, 0x0E3C ; 0x800e3c 2ec9c: b0 91 3d 0e lds r27, 0x0E3D ; 0x800e3d 2eca0: 48 16 cp r4, r24 2eca2: 59 06 cpc r5, r25 2eca4: 6a 06 cpc r6, r26 2eca6: 7b 06 cpc r7, r27 2eca8: 69 f4 brne .+26 ; 0x2ecc4 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; 2ecaa: 10 92 42 0e sts 0x0E42, r1 ; 0x800e42 cacheBlockNumber_ = blockNumber; 2ecae: 8f ef ldi r24, 0xFF ; 255 2ecb0: 9f ef ldi r25, 0xFF ; 255 2ecb2: dc 01 movw r26, r24 2ecb4: 80 93 3a 0e sts 0x0E3A, r24 ; 0x800e3a 2ecb8: 90 93 3b 0e sts 0x0E3B, r25 ; 0x800e3b 2ecbc: a0 93 3c 0e sts 0x0E3C, r26 ; 0x800e3c 2ecc0: 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); 2ecc4: 95 01 movw r18, r10 2ecc6: b3 01 movw r22, r6 2ecc8: a2 01 movw r20, r4 2ecca: 80 91 43 0e lds r24, 0x0E43 ; 0x800e43 2ecce: 90 91 44 0e lds r25, 0x0E44 ; 0x800e44 2ecd2: 0f 94 b6 26 call 0x24d6c ; 0x24d6c // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; 2ecd6: 88 23 and r24, r24 2ecd8: a9 f1 breq .+106 ; 0x2ed44 if (!vol_->cacheRawBlock(block, SdVolume::CACHE_FOR_WRITE)) goto fail; } uint8_t* dst = vol_->cache()->data + blockOffset; memcpy(dst, src, n); } curPosition_ += n; 2ecda: 80 91 6f 16 lds r24, 0x166F ; 0x80166f 2ecde: 90 91 70 16 lds r25, 0x1670 ; 0x801670 2ece2: a0 91 71 16 lds r26, 0x1671 ; 0x801671 2ece6: b0 91 72 16 lds r27, 0x1672 ; 0x801672 2ecea: 8c 0d add r24, r12 2ecec: 9d 1d adc r25, r13 2ecee: a1 1d adc r26, r1 2ecf0: b1 1d adc r27, r1 2ecf2: 80 93 6f 16 sts 0x166F, r24 ; 0x80166f 2ecf6: 90 93 70 16 sts 0x1670, r25 ; 0x801670 2ecfa: a0 93 71 16 sts 0x1671, r26 ; 0x801671 2ecfe: b0 93 72 16 sts 0x1672, r27 ; 0x801672 src += n; 2ed02: ac 0c add r10, r12 2ed04: bd 1c adc r11, r13 nToWrite -= n; 2ed06: ec 18 sub r14, r12 2ed08: fd 08 sbc r15, r13 2ed0a: 48 cf rjmp .-368 ; 0x2eb9c // 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_) { 2ed0c: 40 91 78 16 lds r20, 0x1678 ; 0x801678 2ed10: 50 91 79 16 lds r21, 0x1679 ; 0x801679 2ed14: 60 91 7a 16 lds r22, 0x167A ; 0x80167a 2ed18: 70 91 7b 16 lds r23, 0x167B ; 0x80167b 2ed1c: 80 91 6f 16 lds r24, 0x166F ; 0x80166f 2ed20: 90 91 70 16 lds r25, 0x1670 ; 0x801670 2ed24: a0 91 71 16 lds r26, 0x1671 ; 0x801671 2ed28: b0 91 72 16 lds r27, 0x1672 ; 0x801672 2ed2c: 48 17 cp r20, r24 2ed2e: 59 07 cpc r21, r25 2ed30: 6a 07 cpc r22, r26 2ed32: 7b 07 cpc r23, r27 2ed34: 09 f4 brne .+2 ; 0x2ed38 2ed36: 2e cf rjmp .-420 ; 0x2eb94 } /** 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);} 2ed38: 87 e6 ldi r24, 0x67 ; 103 2ed3a: 96 e1 ldi r25, 0x16 ; 22 2ed3c: 0f 94 97 2a call 0x2552e ; 0x2552e if (!seekEnd()) goto fail; 2ed40: 81 11 cpse r24, r1 2ed42: 28 cf rjmp .-432 ; 0x2eb94 } return nbyte; fail: // return for write error writeError = true; 2ed44: 81 e0 ldi r24, 0x01 ; 1 2ed46: 80 93 67 16 sts 0x1667, r24 ; 0x801667 return -1; 2ed4a: 8f ef ldi r24, 0xFF ; 255 2ed4c: 9f ef ldi r25, 0xFF ; 255 2ed4e: 81 c0 rjmp .+258 ; 0x2ee52 } else { curCluster_ = firstCluster_; } } else { uint32_t next; if (!vol_->fatGet(curCluster_, &next)) goto fail; 2ed50: 9e 01 movw r18, r28 2ed52: 2f 5f subi r18, 0xFF ; 255 2ed54: 3f 4f sbci r19, 0xFF ; 255 2ed56: 0f 94 e1 28 call 0x251c2 ; 0x251c2 2ed5a: 88 23 and r24, r24 2ed5c: 99 f3 breq .-26 ; 0x2ed44 if (vol_->isEOC(next)) { 2ed5e: 89 81 ldd r24, Y+1 ; 0x01 2ed60: 9a 81 ldd r25, Y+2 ; 0x02 2ed62: ab 81 ldd r26, Y+3 ; 0x03 2ed64: 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; 2ed66: e0 91 80 16 lds r30, 0x1680 ; 0x801680 2ed6a: f0 91 81 16 lds r31, 0x1681 ; 0x801681 2ed6e: 27 89 ldd r18, Z+23 ; 0x17 2ed70: 20 31 cpi r18, 0x10 ; 16 2ed72: 81 f4 brne .+32 ; 0x2ed94 2ed74: 88 3f cpi r24, 0xF8 ; 248 2ed76: ef ef ldi r30, 0xFF ; 255 2ed78: 9e 07 cpc r25, r30 2ed7a: a1 05 cpc r26, r1 2ed7c: b1 05 cpc r27, r1 2ed7e: 08 f0 brcs .+2 ; 0x2ed82 2ed80: 4c cf rjmp .-360 ; 0x2ec1a // add cluster if at end of chain if (!addCluster()) goto fail; } else { curCluster_ = next; 2ed82: 80 93 6b 16 sts 0x166B, r24 ; 0x80166b 2ed86: 90 93 6c 16 sts 0x166C, r25 ; 0x80166c 2ed8a: a0 93 6d 16 sts 0x166D, r26 ; 0x80166d 2ed8e: b0 93 6e 16 sts 0x166E, r27 ; 0x80166e 2ed92: 4a cf rjmp .-364 ; 0x2ec28 return cluster >= FAT32EOC_MIN; 2ed94: 88 3f cpi r24, 0xF8 ; 248 2ed96: ff ef ldi r31, 0xFF ; 255 2ed98: 9f 07 cpc r25, r31 2ed9a: af 07 cpc r26, r31 2ed9c: ff e0 ldi r31, 0x0F ; 15 2ed9e: bf 07 cpc r27, r31 2eda0: 80 f3 brcs .-32 ; 0x2ed82 2eda2: 3b cf rjmp .-394 ; 0x2ec1a // invalidate cache if block is in cache vol_->cacheSetBlockNumber(0XFFFFFFFF, false); } if (!vol_->writeBlock(block, src)) goto fail; } else { if (blockOffset == 0 && curPosition_ >= fileSize_) { 2eda4: 01 15 cp r16, r1 2eda6: 11 05 cpc r17, r1 2eda8: 69 f5 brne .+90 ; 0x2ee04 2edaa: 40 91 6f 16 lds r20, 0x166F ; 0x80166f 2edae: 50 91 70 16 lds r21, 0x1670 ; 0x801670 2edb2: 60 91 71 16 lds r22, 0x1671 ; 0x801671 2edb6: 70 91 72 16 lds r23, 0x1672 ; 0x801672 2edba: 80 91 78 16 lds r24, 0x1678 ; 0x801678 2edbe: 90 91 79 16 lds r25, 0x1679 ; 0x801679 2edc2: a0 91 7a 16 lds r26, 0x167A ; 0x80167a 2edc6: b0 91 7b 16 lds r27, 0x167B ; 0x80167b 2edca: 48 17 cp r20, r24 2edcc: 59 07 cpc r21, r25 2edce: 6a 07 cpc r22, r26 2edd0: 7b 07 cpc r23, r27 2edd2: c0 f0 brcs .+48 ; 0x2ee04 // start of new block don't need to read into cache if (!vol_->cacheFlush()) goto fail; 2edd4: 0f 94 1a 27 call 0x24e34 ; 0x24e34 2edd8: 88 23 and r24, r24 2edda: 09 f4 brne .+2 ; 0x2edde 2eddc: b3 cf rjmp .-154 ; 0x2ed44 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; 2edde: 81 e0 ldi r24, 0x01 ; 1 2ede0: 80 93 42 0e sts 0x0E42, r24 ; 0x800e42 cacheBlockNumber_ = blockNumber; 2ede4: 40 92 3a 0e sts 0x0E3A, r4 ; 0x800e3a 2ede8: 50 92 3b 0e sts 0x0E3B, r5 ; 0x800e3b 2edec: 60 92 3c 0e sts 0x0E3C, r6 ; 0x800e3c 2edf0: 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); 2edf4: a6 01 movw r20, r12 2edf6: b5 01 movw r22, r10 2edf8: c8 01 movw r24, r16 2edfa: 8a 5b subi r24, 0xBA ; 186 2edfc: 91 4f sbci r25, 0xF1 ; 241 2edfe: 0f 94 aa aa call 0x35554 ; 0x35554 2ee02: 6b cf rjmp .-298 ; 0x2ecda 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; 2ee04: 41 e0 ldi r20, 0x01 ; 1 2ee06: c3 01 movw r24, r6 2ee08: b2 01 movw r22, r4 2ee0a: 0f 94 12 28 call 0x25024 ; 0x25024 2ee0e: 81 11 cpse r24, r1 2ee10: f1 cf rjmp .-30 ; 0x2edf4 2ee12: 98 cf rjmp .-208 ; 0x2ed44 } curPosition_ += n; src += n; nToWrite -= n; } if (curPosition_ > fileSize_) { 2ee14: 80 91 78 16 lds r24, 0x1678 ; 0x801678 2ee18: 90 91 79 16 lds r25, 0x1679 ; 0x801679 2ee1c: a0 91 7a 16 lds r26, 0x167A ; 0x80167a 2ee20: b0 91 7b 16 lds r27, 0x167B ; 0x80167b 2ee24: 80 17 cp r24, r16 2ee26: 91 07 cpc r25, r17 2ee28: a2 07 cpc r26, r18 2ee2a: b3 07 cpc r27, r19 2ee2c: 68 f4 brcc .+26 ; 0x2ee48 2ee2e: 80 91 68 16 lds r24, 0x1668 ; 0x801668 // update fileSize and insure sync will update dir entry fileSize_ = curPosition_; 2ee32: 00 93 78 16 sts 0x1678, r16 ; 0x801678 2ee36: 10 93 79 16 sts 0x1679, r17 ; 0x801679 2ee3a: 20 93 7a 16 sts 0x167A, r18 ; 0x80167a 2ee3e: 30 93 7b 16 sts 0x167B, r19 ; 0x80167b flags_ |= F_FILE_DIR_DIRTY; 2ee42: 80 68 ori r24, 0x80 ; 128 2ee44: 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) { 2ee48: 80 91 68 16 lds r24, 0x1668 ; 0x801668 2ee4c: 83 fd sbrc r24, 3 2ee4e: 18 c0 rjmp .+48 ; 0x2ee80 if (!sync()) goto fail; } return nbyte; 2ee50: c4 01 movw r24, r8 fail: // return for write error writeError = true; return -1; } 2ee52: 0f 90 pop r0 2ee54: 0f 90 pop r0 2ee56: 0f 90 pop r0 2ee58: 0f 90 pop r0 2ee5a: df 91 pop r29 2ee5c: cf 91 pop r28 2ee5e: 1f 91 pop r17 2ee60: 0f 91 pop r16 2ee62: ff 90 pop r15 2ee64: ef 90 pop r14 2ee66: df 90 pop r13 2ee68: cf 90 pop r12 2ee6a: bf 90 pop r11 2ee6c: af 90 pop r10 2ee6e: 9f 90 pop r9 2ee70: 8f 90 pop r8 2ee72: 7f 90 pop r7 2ee74: 6f 90 pop r6 2ee76: 5f 90 pop r5 2ee78: 4f 90 pop r4 2ee7a: 3f 90 pop r3 2ee7c: 2f 90 pop r2 2ee7e: 08 95 ret // insure sync will update modified date and time flags_ |= F_FILE_DIR_DIRTY; } if (flags_ & O_SYNC) { if (!sync()) goto fail; 2ee80: 87 e6 ldi r24, 0x67 ; 103 2ee82: 96 e1 ldi r25, 0x16 ; 22 2ee84: 0f 94 40 2c call 0x25880 ; 0x25880 2ee88: 81 11 cpse r24, r1 2ee8a: e2 cf rjmp .-60 ; 0x2ee50 2ee8c: 5b cf rjmp .-330 ; 0x2ed44 0002ee8e : #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) { 2ee8e: 0f 93 push r16 2ee90: cf 93 push r28 2ee92: df 93 push r29 2ee94: cd b7 in r28, 0x3d ; 61 2ee96: de b7 in r29, 0x3e ; 62 2ee98: a3 97 sbiw r28, 0x23 ; 35 2ee9a: 0f b6 in r0, 0x3f ; 63 2ee9c: f8 94 cli 2ee9e: de bf out 0x3e, r29 ; 62 2eea0: 0f be out 0x3f, r0 ; 63 2eea2: cd bf out 0x3d, r28 ; 61 if (nr < sort_count) 2eea4: 20 91 78 15 lds r18, 0x1578 ; 0x801578 2eea8: 30 91 79 15 lds r19, 0x1579 ; 0x801579 2eeac: 82 17 cp r24, r18 2eeae: 93 07 cpc r25, r19 2eeb0: d8 f4 brcc .+54 ; 0x2eee8 getfilename_simple(sort_entries[(sdSort == SD_SORT_ALPHA) ? (sort_count - nr - 1) : nr]); 2eeb2: 61 30 cpi r22, 0x01 ; 1 2eeb4: 31 f4 brne .+12 ; 0x2eec2 2eeb6: 21 50 subi r18, 0x01 ; 1 2eeb8: 31 09 sbc r19, r1 2eeba: a9 01 movw r20, r18 2eebc: 48 1b sub r20, r24 2eebe: 59 0b sbc r21, r25 2eec0: ca 01 movw r24, r20 2eec2: 88 0f add r24, r24 2eec4: 99 1f adc r25, r25 2eec6: fc 01 movw r30, r24 2eec8: e6 58 subi r30, 0x86 ; 134 2eeca: fa 4e sbci r31, 0xEA ; 234 2eecc: 80 81 ld r24, Z 2eece: 91 81 ldd r25, Z+1 ; 0x01 2eed0: 0f 94 9e 6b call 0x2d73c ; 0x2d73c else getfilename_afterMaxSorting(nr); } 2eed4: a3 96 adiw r28, 0x23 ; 35 2eed6: 0f b6 in r0, 0x3f ; 63 2eed8: f8 94 cli 2eeda: de bf out 0x3e, r29 ; 62 2eedc: 0f be out 0x3f, r0 ; 63 2eede: cd bf out 0x3d, r28 ; 61 2eee0: df 91 pop r29 2eee2: cf 91 pop r28 2eee4: 0f 91 pop r16 2eee6: 08 95 ret void CardReader::getfilename_afterMaxSorting(uint16_t entry, const char * const match/*=NULL*/) { curDir = &workDir; 2eee8: 42 e8 ldi r20, 0x82 ; 130 2eeea: 54 e1 ldi r21, 0x14 ; 20 2eeec: 50 93 81 14 sts 0x1481, r21 ; 0x801481 2eef0: 40 93 80 14 sts 0x1480, r20 ; 0x801480 nrFiles = entry - sort_count + 1; 2eef4: 82 1b sub r24, r18 2eef6: 93 0b sbc r25, r19 2eef8: 01 96 adiw r24, 0x01 ; 1 2eefa: 90 93 f0 16 sts 0x16F0, r25 ; 0x8016f0 2eefe: 80 93 ef 16 sts 0x16EF, r24 ; 0x8016ef curDir->seekSet(lastSortedFilePosition << 5); 2ef02: 40 91 42 16 lds r20, 0x1642 ; 0x801642 2ef06: 50 91 43 16 lds r21, 0x1643 ; 0x801643 2ef0a: 85 e0 ldi r24, 0x05 ; 5 2ef0c: 44 0f add r20, r20 2ef0e: 55 1f adc r21, r21 2ef10: 8a 95 dec r24 2ef12: e1 f7 brne .-8 ; 0x2ef0c 2ef14: 70 e0 ldi r23, 0x00 ; 0 2ef16: 60 e0 ldi r22, 0x00 ; 0 2ef18: 82 e8 ldi r24, 0x82 ; 130 2ef1a: 94 e1 ldi r25, 0x14 ; 20 2ef1c: 0f 94 97 2a call 0x2552e ; 0x2552e }; struct ls_param { bool LFN : 1; bool timestamp : 1; inline ls_param():LFN(0), timestamp(0) { } 2ef20: 00 e0 ldi r16, 0x00 ; 0 2ef22: 0e 7f andi r16, 0xFE ; 254 2ef24: 0d 7f andi r16, 0xFD ; 253 lsDive("", *curDir, match, LS_GetFilename); 2ef26: e0 91 80 14 lds r30, 0x1480 ; 0x801480 2ef2a: f0 91 81 14 lds r31, 0x1481 ; 0x801481 2ef2e: 83 e2 ldi r24, 0x23 ; 35 2ef30: de 01 movw r26, r28 2ef32: 11 96 adiw r26, 0x01 ; 1 2ef34: 01 90 ld r0, Z+ 2ef36: 0d 92 st X+, r0 2ef38: 8a 95 dec r24 2ef3a: e1 f7 brne .-8 ; 0x2ef34 2ef3c: 22 e0 ldi r18, 0x02 ; 2 2ef3e: 50 e0 ldi r21, 0x00 ; 0 2ef40: 40 e0 ldi r20, 0x00 ; 0 2ef42: be 01 movw r22, r28 2ef44: 6f 5f subi r22, 0xFF ; 255 2ef46: 7f 4f sbci r23, 0xFF ; 255 2ef48: 8f ed ldi r24, 0xDF ; 223 2ef4a: 92 e0 ldi r25, 0x02 ; 2 2ef4c: 0f 94 28 69 call 0x2d250 ; 0x2d250 2ef50: ce 01 movw r24, r28 2ef52: 01 96 adiw r24, 0x01 ; 1 2ef54: 0e 94 fc 79 call 0xf3f8 ; 0xf3f8 2ef58: bd cf rjmp .-134 ; 0x2eed4 0002ef5a : SERIAL_PROTOCOL(fname); SERIAL_PROTOCOLLN('.'); } } void CardReader::openFileWrite(const char* name) 2ef5a: 0f 93 push r16 2ef5c: 1f 93 push r17 2ef5e: cf 93 push r28 2ef60: df 93 push r29 2ef62: 1f 92 push r1 2ef64: 1f 92 push r1 2ef66: cd b7 in r28, 0x3d ; 61 2ef68: de b7 in r29, 0x3e ; 62 { if(!mounted) 2ef6a: 20 91 d8 13 lds r18, 0x13D8 ; 0x8013d8 2ef6e: 22 23 and r18, r18 2ef70: 69 f1 breq .+90 ; 0x2efcc 2ef72: 8c 01 movw r16, r24 return; if(file.isOpen()){ //replacing current file by new file, or subfile call 2ef74: 80 91 6a 16 lds r24, 0x166A ; 0x80166a 2ef78: 88 23 and r24, r24 2ef7a: 79 f1 breq .+94 ; 0x2efda SERIAL_ECHOLN(sdpos); filespos[file_subcall_ctr]=sdpos; file_subcall_ctr++; file.close(); #else SERIAL_ECHOLNPGM("File already opened"); 2ef7c: 8a e4 ldi r24, 0x4A ; 74 2ef7e: 9f e9 ldi r25, 0x9F ; 159 2ef80: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 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; 2ef84: 10 92 d7 13 sts 0x13D7, r1 ; 0x8013d7 const char *fname=name; 2ef88: 1a 83 std Y+2, r17 ; 0x02 2ef8a: 09 83 std Y+1, r16 ; 0x01 if (!diveSubfolder(fname)) 2ef8c: ce 01 movw r24, r28 2ef8e: 01 96 adiw r24, 0x01 ; 1 2ef90: 0f 94 0c 71 call 0x2e218 ; 0x2e218 2ef94: 88 23 and r24, r24 2ef96: d1 f0 breq .+52 ; 0x2efcc return; //write if (!file.open(curDir, fname, O_CREAT | O_APPEND | O_WRITE | O_TRUNC)){ 2ef98: 49 81 ldd r20, Y+1 ; 0x01 2ef9a: 5a 81 ldd r21, Y+2 ; 0x02 2ef9c: 60 91 80 14 lds r22, 0x1480 ; 0x801480 2efa0: 70 91 81 14 lds r23, 0x1481 ; 0x801481 2efa4: 26 e5 ldi r18, 0x56 ; 86 2efa6: 87 e6 ldi r24, 0x67 ; 103 2efa8: 96 e1 ldi r25, 0x16 ; 22 2efaa: 0f 94 63 54 call 0x2a8c6 ; 0x2a8c6 2efae: 81 11 cpse r24, r1 2efb0: 22 c0 rjmp .+68 ; 0x2eff6 SERIAL_PROTOCOLRPGM(MSG_SD_OPEN_FILE_FAIL); 2efb2: 88 ed ldi r24, 0xD8 ; 216 2efb4: 9c e6 ldi r25, 0x6C ; 108 2efb6: 0e 94 15 7b call 0xf62a ; 0xf62a 2efba: 89 81 ldd r24, Y+1 ; 0x01 2efbc: 9a 81 ldd r25, Y+2 ; 0x02 2efbe: 0e 94 0e 86 call 0x10c1c ; 0x10c1c 2efc2: 8e e2 ldi r24, 0x2E ; 46 2efc4: 0e 94 02 7a call 0xf404 ; 0xf404 } void MarlinSerial::println(char c, int base) { print(c, base); println(); 2efc8: 0e 94 0d 7b call 0xf61a ; 0xf61a SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED lcd_setstatuspgm(ofFileSelected); scrollstuff = 0; } } 2efcc: 0f 90 pop r0 2efce: 0f 90 pop r0 2efd0: df 91 pop r29 2efd2: cf 91 pop r28 2efd4: 1f 91 pop r17 2efd6: 0f 91 pop r16 2efd8: 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 2efda: 10 92 8a 16 sts 0x168A, r1 ; 0x80168a SERIAL_ECHO_START; 2efde: 84 ee ldi r24, 0xE4 ; 228 2efe0: 92 ea ldi r25, 0xA2 ; 162 2efe2: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHORPGM(ofNowFreshFile); 2efe6: 82 e6 ldi r24, 0x62 ; 98 2efe8: 91 ea ldi r25, 0xA1 ; 161 2efea: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN(name); 2efee: c8 01 movw r24, r16 2eff0: 0e 94 1a 86 call 0x10c34 ; 0x10c34 2eff4: c7 cf rjmp .-114 ; 0x2ef84 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; 2eff6: 81 e0 ldi r24, 0x01 ; 1 2eff8: 80 93 d5 13 sts 0x13D5, r24 ; 0x8013d5 getfilename(0, fname); 2effc: 89 81 ldd r24, Y+1 ; 0x01 2effe: 9a 81 ldd r25, Y+2 ; 0x02 2f000: 0f 94 57 6b call 0x2d6ae ; 0x2d6ae SERIAL_PROTOCOLRPGM(ofWritingToFile);////MSG_SD_WRITE_TO_FILE 2f004: 88 e3 ldi r24, 0x38 ; 56 2f006: 9f e9 ldi r25, 0x9F ; 159 2f008: 0e 94 15 7b call 0xf62a ; 0xf62a printAbsFilenameFast(); 2f00c: 0f 94 3a 6c call 0x2d874 ; 0x2d874 SERIAL_PROTOCOLLN(); 2f010: 0e 94 0d 7b call 0xf61a ; 0xf61a SERIAL_PROTOCOLLNRPGM(ofFileSelected);////MSG_SD_FILE_SELECTED 2f014: 8e e3 ldi r24, 0x3E ; 62 2f016: 91 ea ldi r25, 0xA1 ; 161 2f018: 0e 94 0e 7d call 0xfa1c ; 0xfa1c lcd_setstatuspgm(ofFileSelected); 2f01c: 8e e3 ldi r24, 0x3E ; 62 2f01e: 91 ea ldi r25, 0xA1 ; 161 2f020: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 scrollstuff = 0; 2f024: 10 92 62 0d sts 0x0D62, r1 ; 0x800d62 2f028: d1 cf rjmp .-94 ; 0x2efcc 0002f02a : //presort(); #endif } } bool CardReader::ToshibaFlashAir_GetIP(uint8_t *ip) 2f02a: 0f 93 push r16 2f02c: 1f 93 push r17 2f02e: cf 93 push r28 2f030: df 93 push r29 2f032: ec 01 movw r28, r24 { memset(ip, 0, 4); 2f034: 84 e0 ldi r24, 0x04 ; 4 2f036: fe 01 movw r30, r28 2f038: 11 92 st Z+, r1 2f03a: 8a 95 dec r24 2f03c: e9 f7 brne .-6 ; 0x2f038 /** 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 2f03e: 23 e0 ldi r18, 0x03 ; 3 2f040: 30 ea ldi r19, 0xA0 ; 160 2f042: 4a e0 ldi r20, 0x0A ; 10 2f044: 50 e9 ldi r21, 0x90 ; 144 2f046: 60 e3 ldi r22, 0x30 ; 48 2f048: 84 e4 ldi r24, 0x44 ; 68 2f04a: 96 e1 ldi r25, 0x16 ; 22 2f04c: 0f 94 5d 26 call 0x24cba ; 0x24cba 2f050: 88 23 and r24, r24 2f052: 91 f0 breq .+36 ; 0x2f078 2f054: 23 e0 ldi r18, 0x03 ; 3 2f056: 30 ea ldi r19, 0xA0 ; 160 2f058: 4a e0 ldi r20, 0x0A ; 10 2f05a: 50 e9 ldi r21, 0x90 ; 144 2f05c: 61 e1 ldi r22, 0x11 ; 17 2f05e: 84 e4 ldi r24, 0x44 ; 68 2f060: 96 e1 ldi r25, 0x16 ; 22 2f062: 0f 94 5d 26 call 0x24cba ; 0x24cba 2f066: 88 23 and r24, r24 2f068: 39 f0 breq .+14 ; 0x2f078 bool eraseSingleBlockEnable(); /** * Set SD error code. * \param[in] code value for error code. */ void error(uint8_t code) {errorCode_ = code;} 2f06a: 80 e8 ldi r24, 0x80 ; 128 2f06c: 80 93 44 16 sts 0x1644, r24 ; 0x801644 chipSelectHigh(); spiSend(0xFF); // dummy clock to force FlashAir finish the command. return true; fail: chipSelectHigh(); 2f070: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 return false; 2f074: 80 e0 ldi r24, 0x00 ; 0 2f076: 2f c0 rjmp .+94 ; 0x2f0d6 //------------------------------------------------------------------------------ /** 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(); 2f078: 0f 94 89 0b call 0x21712 ; 0x21712 2f07c: 8b 01 movw r16, r22 while ((status_ = spiRec()) == 0XFF) { 2f07e: 0f 94 56 26 call 0x24cac ; 0x24cac 2f082: 80 93 46 16 sts 0x1646, r24 ; 0x801646 2f086: 8f 3f cpi r24, 0xFF ; 255 2f088: 69 f4 brne .+26 ; 0x2f0a4 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { 2f08a: 0f 94 89 0b call 0x21712 ; 0x21712 2f08e: 60 1b sub r22, r16 2f090: 71 0b sbc r23, r17 2f092: 6d 32 cpi r22, 0x2D ; 45 2f094: 71 40 sbci r23, 0x01 ; 1 2f096: 98 f3 brcs .-26 ; 0x2f07e 2f098: 81 e1 ldi r24, 0x11 ; 17 2f09a: 80 93 44 16 sts 0x1644, r24 ; 0x801644 goto fail; } return true; fail: chipSelectHigh(); 2f09e: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 2f0a2: e6 cf rjmp .-52 ; 0x2f070 if (((uint16_t)_millis() - t0) > SD_READ_TIMEOUT) { error(SD_CARD_ERROR_READ_TIMEOUT); goto fail; } } if (status_ != DATA_START_BLOCK) { 2f0a4: 8e 3f cpi r24, 0xFE ; 254 2f0a6: 11 f0 breq .+4 ; 0x2f0ac 2f0a8: 8f e0 ldi r24, 0x0F ; 15 2f0aa: f7 cf rjmp .-18 ; 0x2f09a 2f0ac: 8e 01 movw r16, r28 2f0ae: 0c 5f subi r16, 0xFC ; 252 2f0b0: 1f 4f sbci r17, 0xFF ; 255 goto fail; } // receive data for (i = 0; i < count; ++i) { dst[i] = spiRec(); 2f0b2: 0f 94 56 26 call 0x24cac ; 0x24cac 2f0b6: 89 93 st Y+, r24 if (!waitStartBlock()) { goto fail; } // receive data for (i = 0; i < count; ++i) { 2f0b8: c0 17 cp r28, r16 2f0ba: d1 07 cpc r29, r17 2f0bc: d1 f7 brne .-12 ; 0x2f0b2 2f0be: ce ef ldi r28, 0xFE ; 254 2f0c0: d1 e0 ldi r29, 0x01 ; 1 dst[i] = spiRec(); } // skip dummy bytes and 16-bit crc. for (; i < 514; ++i) { spiRec(); 2f0c2: 0f 94 56 26 call 0x24cac ; 0x24cac 2f0c6: 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) { 2f0c8: e1 f7 brne .-8 ; 0x2f0c2 spiRec(); } chipSelectHigh(); 2f0ca: 0f 94 7a 65 call 0x2caf4 ; 0x2caf4 spiSend(0xFF); // dummy clock to force FlashAir finish the command. 2f0ce: 8f ef ldi r24, 0xFF ; 255 2f0d0: 0f 94 51 26 call 0x24ca2 ; 0x24ca2 2f0d4: 81 e0 ldi r24, 0x01 ; 1 return card.readExtMemory(1, 1, 0x400+0x150, 4, ip); } 2f0d6: df 91 pop r29 2f0d8: cf 91 pop r28 2f0da: 1f 91 pop r17 2f0dc: 0f 91 pop r16 2f0de: 08 95 ret 0002f0e0 : } 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) 2f0e0: cf 92 push r12 2f0e2: df 92 push r13 2f0e4: ef 92 push r14 2f0e6: ff 92 push r15 2f0e8: 0f 93 push r16 2f0ea: 1f 93 push r17 2f0ec: cf 93 push r28 2f0ee: df 93 push r29 2f0f0: ec 01 movw r28, r24 2f0f2: 8b 01 movw r16, r22 2f0f4: 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) 2f0f6: 01 15 cp r16, r1 2f0f8: 11 05 cpc r17, r1 2f0fa: 09 f4 brne .+2 ; 0x2f0fe 2f0fc: 41 c0 rjmp .+130 ; 0x2f180 void print_hex_word(daddr_t val) { #if DADDR_SIZE > 16 print_hex_byte((val >> 16) & 0xFF); #endif print_hex_byte((val >> 8) & 0xFF); 2f0fe: 8d 2f mov r24, r29 2f100: 0e 94 49 79 call 0xf292 ; 0xf292 print_hex_byte(val & 0xFF); 2f104: 8c 2f mov r24, r28 2f106: 0e 94 49 79 call 0xf292 ; 0xf292 XFLASH_SPI_ENTER(); #endif while (count) { print_hex_word(address); putchar(' '); 2f10a: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 2f10e: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 2f112: 80 e2 ldi r24, 0x20 ; 32 2f114: 90 e0 ldi r25, 0x00 ; 0 2f116: 0f 94 e9 a2 call 0x345d2 ; 0x345d2 2f11a: 6e 01 movw r12, r28 2f11c: 80 e1 ldi r24, 0x10 ; 16 2f11e: c8 0e add r12, r24 2f120: d1 1c adc r13, r1 uint8_t count_line = countperline; while (count && count_line) { uint8_t data = 0; switch (type) 2f122: 81 e0 ldi r24, 0x01 ; 1 2f124: e8 16 cp r14, r24 2f126: 39 f1 breq .+78 ; 0x2f176 { case dcode_mem_t::sram: data = *((uint8_t*)address); break; 2f128: 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; 2f12a: 21 96 adiw r28, 0x01 ; 1 putchar(' '); 2f12c: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 2f130: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 2f134: 80 e2 ldi r24, 0x20 ; 32 2f136: 90 e0 ldi r25, 0x00 ; 0 2f138: 0f 94 e9 a2 call 0x345d2 ; 0x345d2 print_hex_byte(data); 2f13c: 8f 2d mov r24, r15 2f13e: 0e 94 49 79 call 0xf292 ; 0xf292 count_line--; count--; 2f142: 01 50 subi r16, 0x01 ; 1 2f144: 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)) 2f146: 0f b6 in r0, 0x3f ; 63 2f148: 07 fe sbrs r0, 7 2f14a: 06 c0 rjmp .+12 ; 0x2f158 2f14c: c8 01 movw r24, r16 2f14e: 9f 71 andi r25, 0x1F ; 31 2f150: 89 2b or r24, r25 2f152: 29 f4 brne .+10 ; 0x2f15e manage_heater(); 2f154: 0f 94 a8 37 call 0x26f50 ; 0x26f50 while (count) { print_hex_word(address); putchar(' '); uint8_t count_line = countperline; while (count && count_line) 2f158: 01 15 cp r16, r1 2f15a: 11 05 cpc r17, r1 2f15c: 19 f0 breq .+6 ; 0x2f164 2f15e: cc 15 cp r28, r12 2f160: dd 05 cpc r29, r13 2f162: f9 f6 brne .-66 ; 0x2f122 // 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'); 2f164: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 2f168: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 2f16c: 8a e0 ldi r24, 0x0A ; 10 2f16e: 90 e0 ldi r25, 0x00 ; 0 2f170: 0f 94 e9 a2 call 0x345d2 ; 0x345d2 2f174: c0 cf rjmp .-128 ; 0x2f0f6 { 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; 2f176: ce 01 movw r24, r28 2f178: 0f 94 81 a4 call 0x34902 ; 0x34902 2f17c: f8 2e mov r15, r24 2f17e: d5 cf rjmp .-86 ; 0x2f12a if((SREG & (1 << SREG_I)) && !((uint16_t)count % 8192)) manage_heater(); } putchar('\n'); } } 2f180: df 91 pop r29 2f182: cf 91 pop r28 2f184: 1f 91 pop r17 2f186: 0f 91 pop r16 2f188: ff 90 pop r15 2f18a: ef 90 pop r14 2f18c: df 90 pop r13 2f18e: cf 90 pop r12 2f190: 08 95 ret 0002f192 : #include "planner.h" #include "temperature.h" #include "ultralcd.h" #ifdef FILAMENT_SENSOR FSensorBlockRunout::FSensorBlockRunout() { 2f192: cf 93 push r28 2f194: 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; 2f196: c1 ef ldi r28, 0xF1 ; 241 2f198: d6 e1 ldi r29, 0x16 ; 22 2f19a: 1a 82 std Y+2, r1 ; 0x02 fsensor.deinit(); } } void Filament_sensor::setAutoLoadEnabled(bool state, bool updateEEPROM) { autoLoadEnabled = state; 2f19c: 19 82 std Y+1, r1 ; 0x01 return fsensorDetected; } #endif void PAT9125_sensor::setJamDetectionEnabled(bool state, bool updateEEPROM) { jamDetection = state; 2f19e: 1e 86 std Y+14, r1 ; 0x0e oldPos = pat9125_y; 2f1a0: 80 91 38 0e lds r24, 0x0E38 ; 0x800e38 2f1a4: 90 91 39 0e lds r25, 0x0E39 ; 0x800e39 2f1a8: 98 8b std Y+16, r25 ; 0x10 2f1aa: 8f 87 std Y+15, r24 ; 0x0f resetStepCount(); 2f1ac: 0f 94 2b 6d call 0x2da56 ; 0x2da56 jamErrCnt = 0; 2f1b0: 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"); } 2f1b2: df 91 pop r29 2f1b4: cf 91 pop r28 2f1b6: 08 95 ret 0002f1b8 : //! //! @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) 2f1b8: cf 92 push r12 2f1ba: df 92 push r13 2f1bc: ef 92 push r14 2f1be: ff 92 push r15 2f1c0: 69 01 movw r12, r18 2f1c2: 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); 2f1c4: 2d ec ldi r18, 0xCD ; 205 2f1c6: 3c ec ldi r19, 0xCC ; 204 2f1c8: 4c e4 ldi r20, 0x4C ; 76 2f1ca: 5e e3 ldi r21, 0x3E ; 62 2f1cc: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2f1d0: 2d ec ldi r18, 0xCD ; 205 2f1d2: 3c ec ldi r19, 0xCC ; 204 2f1d4: 4c e4 ldi r20, 0x4C ; 76 2f1d6: 5e e3 ldi r21, 0x3E ; 62 2f1d8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f1dc: 2d ef ldi r18, 0xFD ; 253 2f1de: 3d ea ldi r19, 0xAD ; 173 2f1e0: 40 e0 ldi r20, 0x00 ; 0 2f1e2: 5d e3 ldi r21, 0x3D ; 61 2f1e4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2f1e8: a7 01 movw r20, r14 2f1ea: 96 01 movw r18, r12 2f1ec: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f1f0: 24 e2 ldi r18, 0x24 ; 36 2f1f2: 30 ef ldi r19, 0xF0 ; 240 2f1f4: 49 e1 ldi r20, 0x19 ; 25 2f1f6: 50 e4 ldi r21, 0x40 ; 64 2f1f8: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> } 2f1fc: ff 90 pop r15 2f1fe: ef 90 pop r14 2f200: df 90 pop r13 2f202: cf 90 pop r12 2f204: 08 95 ret 0002f206 : //! //! 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) 2f206: 2f 92 push r2 2f208: 3f 92 push r3 2f20a: 4f 92 push r4 2f20c: 5f 92 push r5 2f20e: 6f 92 push r6 2f210: 7f 92 push r7 2f212: 8f 92 push r8 2f214: 9f 92 push r9 2f216: af 92 push r10 2f218: bf 92 push r11 2f21a: cf 92 push r12 2f21c: df 92 push r13 2f21e: ef 92 push r14 2f220: ff 92 push r15 2f222: 0f 93 push r16 2f224: 1f 93 push r17 2f226: cf 93 push r28 2f228: df 93 push r29 2f22a: 00 d0 rcall .+0 ; 0x2f22c 2f22c: 1f 92 push r1 2f22e: 1f 92 push r1 2f230: cd b7 in r28, 0x3d ; 61 2f232: de b7 in r29, 0x3e ; 62 2f234: 8c 83 std Y+4, r24 ; 0x04 2f236: 4a 01 movw r8, r20 2f238: 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); 2f23a: 23 e4 ldi r18, 0x43 ; 67 2f23c: 3d ec ldi r19, 0xCD ; 205 2f23e: 4f e2 ldi r20, 0x2F ; 47 2f240: 5d e3 ldi r21, 0x3D ; 61 2f242: cb 01 movw r24, r22 2f244: b4 01 movw r22, r8 2f246: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2f24a: 6b 01 movw r12, r22 2f24c: 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); 2f24e: 20 e0 ldi r18, 0x00 ; 0 2f250: 30 e0 ldi r19, 0x00 ; 0 2f252: 40 ea ldi r20, 0xA0 ; 160 2f254: 51 e4 ldi r21, 0x41 ; 65 2f256: c5 01 movw r24, r10 2f258: b4 01 movw r22, r8 2f25a: 0f 94 dc 78 call 0x2f1b8 ; 0x2f1b8 2f25e: 56 2e mov r5, r22 2f260: 47 2e mov r4, r23 2f262: 38 2e mov r3, r24 2f264: 29 2e mov r2, r25 const float short_extrusion = count_e(layer_height, extrusion_width, short_length); 2f266: a7 01 movw r20, r14 2f268: 96 01 movw r18, r12 2f26a: c5 01 movw r24, r10 2f26c: b4 01 movw r22, r8 2f26e: 0f 94 dc 78 call 0x2f1b8 ; 0x2f1b8 2f272: 69 83 std Y+1, r22 ; 0x01 2f274: 7a 83 std Y+2, r23 ; 0x02 2f276: 8b 83 std Y+3, r24 ; 0x03 2f278: 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) 2f27a: bc 80 ldd r11, Y+4 ; 0x04 2f27c: 8b 2d mov r24, r11 2f27e: 90 e0 ldi r25, 0x00 ; 0 2f280: 9c 01 movw r18, r24 2f282: 2d 5f subi r18, 0xFD ; 253 2f284: 3f 4f sbci r19, 0xFF ; 255 2f286: 3d 83 std Y+5, r19 ; 0x05 2f288: 2c 83 std Y+4, r18 ; 0x04 2f28a: 0b 2d mov r16, r11 2f28c: 10 e0 ldi r17, 0x00 ; 0 2f28e: 8c 81 ldd r24, Y+4 ; 0x04 2f290: 9d 81 ldd r25, Y+5 ; 0x05 2f292: 80 17 cp r24, r16 2f294: 91 07 cpc r25, r17 2f296: 0c f4 brge .+2 ; 0x2f29a 2f298: a1 c0 rjmp .+322 ; 0x2f3dc { enquecommandf_P(fmt1, 70, (35 - i*short_length * 2), long_extrusion); 2f29a: 2f 92 push r2 2f29c: 3f 92 push r3 2f29e: 4f 92 push r4 2f2a0: 5f 92 push r5 2f2a2: b8 01 movw r22, r16 2f2a4: 01 2e mov r0, r17 2f2a6: 00 0c add r0, r0 2f2a8: 88 0b sbc r24, r24 2f2aa: 99 0b sbc r25, r25 2f2ac: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2f2b0: a7 01 movw r20, r14 2f2b2: 96 01 movw r18, r12 2f2b4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f2b8: 9b 01 movw r18, r22 2f2ba: ac 01 movw r20, r24 2f2bc: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2f2c0: 9b 01 movw r18, r22 2f2c2: ac 01 movw r20, r24 2f2c4: 60 e0 ldi r22, 0x00 ; 0 2f2c6: 70 e0 ldi r23, 0x00 ; 0 2f2c8: 8c e0 ldi r24, 0x0C ; 12 2f2ca: 92 e4 ldi r25, 0x42 ; 66 2f2cc: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2f2d0: 9f 93 push r25 2f2d2: 8f 93 push r24 2f2d4: 7f 93 push r23 2f2d6: 6f 93 push r22 2f2d8: 1f 92 push r1 2f2da: 96 e4 ldi r25, 0x46 ; 70 2f2dc: 9f 93 push r25 2f2de: 23 e2 ldi r18, 0x23 ; 35 2f2e0: 3f e9 ldi r19, 0x9F ; 159 2f2e2: 3f 93 push r19 2f2e4: 2f 93 push r18 2f2e6: 0e 94 28 8e call 0x11c50 ; 0x11c50 enquecommandf_P(fmt1, 70, (35 - (2 * i + 1)*short_length), short_extrusion); 2f2ea: b8 01 movw r22, r16 2f2ec: 66 0f add r22, r22 2f2ee: 77 1f adc r23, r23 2f2f0: 6f 5f subi r22, 0xFF ; 255 2f2f2: 7f 4f sbci r23, 0xFF ; 255 2f2f4: 07 2e mov r0, r23 2f2f6: 00 0c add r0, r0 2f2f8: 88 0b sbc r24, r24 2f2fa: 99 0b sbc r25, r25 2f2fc: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2f300: a7 01 movw r20, r14 2f302: 96 01 movw r18, r12 2f304: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f308: 9b 01 movw r18, r22 2f30a: ac 01 movw r20, r24 2f30c: 60 e0 ldi r22, 0x00 ; 0 2f30e: 70 e0 ldi r23, 0x00 ; 0 2f310: 8c e0 ldi r24, 0x0C ; 12 2f312: 92 e4 ldi r25, 0x42 ; 66 2f314: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2f318: 96 2e mov r9, r22 2f31a: 87 2e mov r8, r23 2f31c: 78 2e mov r7, r24 2f31e: 69 2e mov r6, r25 2f320: af 92 push r10 2f322: 9b 81 ldd r25, Y+3 ; 0x03 2f324: 9f 93 push r25 2f326: 2a 81 ldd r18, Y+2 ; 0x02 2f328: 2f 93 push r18 2f32a: 39 81 ldd r19, Y+1 ; 0x01 2f32c: 3f 93 push r19 2f32e: 6f 92 push r6 2f330: 7f 92 push r7 2f332: 8f 92 push r8 2f334: 9f 92 push r9 2f336: 1f 92 push r1 2f338: 86 e4 ldi r24, 0x46 ; 70 2f33a: 8f 93 push r24 2f33c: 23 e2 ldi r18, 0x23 ; 35 2f33e: 3f e9 ldi r19, 0x9F ; 159 2f340: 3f 93 push r19 2f342: 2f 93 push r18 2f344: 0e 94 28 8e call 0x11c50 ; 0x11c50 enquecommandf_P(fmt1, 50, (35 - (2 * i + 1)*short_length), long_extrusion); 2f348: 2f 92 push r2 2f34a: 3f 92 push r3 2f34c: 4f 92 push r4 2f34e: 5f 92 push r5 2f350: 6f 92 push r6 2f352: 7f 92 push r7 2f354: 8f 92 push r8 2f356: 9f 92 push r9 2f358: 1f 92 push r1 2f35a: 92 e3 ldi r25, 0x32 ; 50 2f35c: 9f 93 push r25 2f35e: 23 e2 ldi r18, 0x23 ; 35 2f360: 3f e9 ldi r19, 0x9F ; 159 2f362: 3f 93 push r19 2f364: 2f 93 push r18 2f366: 0e 94 28 8e call 0x11c50 ; 0x11c50 enquecommandf_P(fmt1, 50, (35 - (i + 1)*short_length * 2), short_extrusion); 2f36a: 0f b6 in r0, 0x3f ; 63 2f36c: f8 94 cli 2f36e: de bf out 0x3e, r29 ; 62 2f370: 0f be out 0x3f, r0 ; 63 2f372: cd bf out 0x3d, r28 ; 61 2f374: af 92 push r10 2f376: 3b 81 ldd r19, Y+3 ; 0x03 2f378: 3f 93 push r19 2f37a: 8a 81 ldd r24, Y+2 ; 0x02 2f37c: 8f 93 push r24 2f37e: 99 81 ldd r25, Y+1 ; 0x01 2f380: 9f 93 push r25 2f382: b8 01 movw r22, r16 2f384: 6f 5f subi r22, 0xFF ; 255 2f386: 7f 4f sbci r23, 0xFF ; 255 2f388: 07 2e mov r0, r23 2f38a: 00 0c add r0, r0 2f38c: 88 0b sbc r24, r24 2f38e: 99 0b sbc r25, r25 2f390: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2f394: a7 01 movw r20, r14 2f396: 96 01 movw r18, r12 2f398: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f39c: 9b 01 movw r18, r22 2f39e: ac 01 movw r20, r24 2f3a0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2f3a4: 9b 01 movw r18, r22 2f3a6: ac 01 movw r20, r24 2f3a8: 60 e0 ldi r22, 0x00 ; 0 2f3aa: 70 e0 ldi r23, 0x00 ; 0 2f3ac: 8c e0 ldi r24, 0x0C ; 12 2f3ae: 92 e4 ldi r25, 0x42 ; 66 2f3b0: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2f3b4: 9f 93 push r25 2f3b6: 8f 93 push r24 2f3b8: 7f 93 push r23 2f3ba: 6f 93 push r22 2f3bc: 1f 92 push r1 2f3be: 22 e3 ldi r18, 0x32 ; 50 2f3c0: 2f 93 push r18 2f3c2: 83 e2 ldi r24, 0x23 ; 35 2f3c4: 9f e9 ldi r25, 0x9F ; 159 2f3c6: 9f 93 push r25 2f3c8: 8f 93 push r24 2f3ca: 0e 94 28 8e call 0x11c50 ; 0x11c50 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) 2f3ce: b3 94 inc r11 2f3d0: 0f b6 in r0, 0x3f ; 63 2f3d2: f8 94 cli 2f3d4: de bf out 0x3e, r29 ; 62 2f3d6: 0f be out 0x3f, r0 ; 63 2f3d8: cd bf out 0x3d, r28 ; 61 2f3da: 57 cf rjmp .-338 ; 0x2f28a 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); } } 2f3dc: 0f 90 pop r0 2f3de: 0f 90 pop r0 2f3e0: 0f 90 pop r0 2f3e2: 0f 90 pop r0 2f3e4: 0f 90 pop r0 2f3e6: df 91 pop r29 2f3e8: cf 91 pop r28 2f3ea: 1f 91 pop r17 2f3ec: 0f 91 pop r16 2f3ee: ff 90 pop r15 2f3f0: ef 90 pop r14 2f3f2: df 90 pop r13 2f3f4: cf 90 pop r12 2f3f6: bf 90 pop r11 2f3f8: af 90 pop r10 2f3fa: 9f 90 pop r9 2f3fc: 8f 90 pop r8 2f3fe: 7f 90 pop r7 2f400: 6f 90 pop r6 2f402: 5f 90 pop r5 2f404: 4f 90 pop r4 2f406: 3f 90 pop r3 2f408: 2f 90 pop r2 2f40a: 08 95 ret 0002f40c : } } void st_set_position(const long *pos) { CRITICAL_SECTION_START; 2f40c: 9f b7 in r25, 0x3f ; 63 2f40e: 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)); 2f410: 80 e1 ldi r24, 0x10 ; 16 2f412: ec e3 ldi r30, 0x3C ; 60 2f414: f6 e0 ldi r31, 0x06 ; 6 2f416: ac e4 ldi r26, 0x4C ; 76 2f418: b6 e0 ldi r27, 0x06 ; 6 2f41a: 01 90 ld r0, Z+ 2f41c: 0d 92 st X+, r0 2f41e: 8a 95 dec r24 2f420: e1 f7 brne .-8 ; 0x2f41a CRITICAL_SECTION_END; 2f422: 9f bf out 0x3f, r25 ; 63 } 2f424: 08 95 ret 0002f426 : #include "sound.h" namespace MMU2 { void BeginReport(CommandInProgress /*cip*/, ProgressCode ec) { custom_message_type = CustomMsg::MMUProgress; 2f426: 89 e0 ldi r24, 0x09 ; 9 2f428: 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])) 2f42c: e0 e6 ldi r30, 0x60 ; 96 2f42e: ff e9 ldi r31, 0x9F ; 159 2f430: 85 91 lpm r24, Z+ 2f432: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 2f434: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2f438: 0c 94 7c dc jmp 0x1b8f8 ; 0x1b8f8 0002f43c : 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) { 2f43c: 1f 93 push r17 2f43e: cf 93 push r28 2f440: df 93 push r29 2f442: ec 01 movw r28, r24 2f444: 16 2f mov r17, r22 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 2f446: 0f 94 94 18 call 0x23128 ; 0x23128 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))); 2f44a: fe 01 movw r30, r28 2f44c: 34 96 adiw r30, 0x04 ; 4 2f44e: 25 91 lpm r18, Z+ 2f450: 35 91 lpm r19, Z+ 2f452: 45 91 lpm r20, Z+ 2f454: 54 91 lpm r21, Z 2f456: fe 01 movw r30, r28 2f458: 65 91 lpm r22, Z+ 2f45a: 75 91 lpm r23, Z+ 2f45c: 85 91 lpm r24, Z+ 2f45e: 94 91 lpm r25, Z 2f460: 0f 94 62 4e call 0x29cc4 ; 0x29cc4 step++; 2f464: 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) { 2f466: 11 50 subi r17, 0x01 ; 1 2f468: 81 f7 brne .-32 ; 0x2f44a 2f46a: 0f 94 94 18 call 0x23128 ; 0x23128 // 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(); } 2f46e: df 91 pop r29 2f470: cf 91 pop r28 2f472: 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(); 2f474: 0d 94 60 4e jmp 0x29cc0 ; 0x29cc0 0002f478 : } void EndReport(CommandInProgress /*cip*/, ProgressCode /*ec*/) { // clear the status msg line - let the printed filename get visible again if (!printJobOngoing()) { 2f478: 0e 94 91 66 call 0xcd22 ; 0xcd22 2f47c: 81 11 cpse r24, r1 2f47e: 04 c0 rjmp .+8 ; 0x2f488 lcd_setstatuspgm(MSG_WELCOME); 2f480: 8a e8 ldi r24, 0x8A ; 138 2f482: 9c e6 ldi r25, 0x6C ; 108 2f484: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 } custom_message_type = CustomMsg::Status; 2f488: 10 92 5d 06 sts 0x065D, r1 ; 0x80065d } 2f48c: 08 95 ret 0002f48e : EndReport(cip, ProgressCode::OK); } }; bool MMU2::WaitForMMUReady() { switch (State()) { 2f48e: 80 91 01 13 lds r24, 0x1301 ; 0x801301 2f492: 88 23 and r24, r24 2f494: 11 f0 breq .+4 ; 0x2f49a 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; 2f496: 81 e0 ldi r24, 0x01 ; 1 2f498: 08 95 ret }; bool MMU2::WaitForMMUReady() { switch (State()) { case xState::Stopped: return false; 2f49a: 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; } } 2f49c: 08 95 ret 0002f49e : } #ifdef TMC2130 void homeaxis(uint8_t axis, uint8_t cnt, uint8_t* pstep) #else void homeaxis(uint8_t axis, uint8_t cnt) 2f49e: 2f 92 push r2 2f4a0: 3f 92 push r3 2f4a2: 4f 92 push r4 2f4a4: 5f 92 push r5 2f4a6: 6f 92 push r6 2f4a8: 7f 92 push r7 2f4aa: 8f 92 push r8 2f4ac: 9f 92 push r9 2f4ae: af 92 push r10 2f4b0: bf 92 push r11 2f4b2: cf 92 push r12 2f4b4: df 92 push r13 2f4b6: ef 92 push r14 2f4b8: ff 92 push r15 2f4ba: 0f 93 push r16 2f4bc: 1f 93 push r17 2f4be: cf 93 push r28 2f4c0: df 93 push r29 2f4c2: 00 d0 rcall .+0 ; 0x2f4c4 2f4c4: 00 d0 rcall .+0 ; 0x2f4c6 2f4c6: 00 d0 rcall .+0 ; 0x2f4c8 2f4c8: 1f 92 push r1 2f4ca: 1f 92 push r1 2f4cc: cd b7 in r28, 0x3d ; 61 2f4ce: de b7 in r29, 0x3e ; 62 2f4d0: 8b 83 std Y+3, r24 ; 0x03 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2f4d2: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.385> 2f4d6: 2d 83 std Y+5, r18 ; 0x05 check_endstops = check; 2f4d8: 81 e0 ldi r24, 0x01 ; 1 2f4da: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.385> #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) 2f4de: 9b 81 ldd r25, Y+3 ; 0x03 2f4e0: 92 30 cpi r25, 0x02 ; 2 2f4e2: 09 f4 brne .+2 ; 0x2f4e6 2f4e4: 5b c1 rjmp .+694 ; 0x2f79c 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); 2f4e6: a9 2f mov r26, r25 2f4e8: b0 e0 ldi r27, 0x00 ; 0 2f4ea: ba 83 std Y+2, r27 ; 0x02 2f4ec: a9 83 std Y+1, r26 ; 0x01 2f4ee: fd 01 movw r30, r26 2f4f0: e6 5e subi r30, 0xE6 ; 230 2f4f2: 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); 2f4f4: 24 91 lpm r18, Z 2f4f6: 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]; 2f4f8: 8d 01 movw r16, r26 2f4fa: 00 0f add r16, r16 2f4fc: 11 1f adc r17, r17 2f4fe: 00 0f add r16, r16 2f500: 11 1f adc r17, r17 2f502: f8 01 movw r30, r16 2f504: ee 50 subi r30, 0x0E ; 14 2f506: fd 4f sbci r31, 0xFD ; 253 2f508: 40 80 ld r4, Z 2f50a: 51 80 ldd r5, Z+1 ; 0x01 2f50c: 62 80 ldd r6, Z+2 ; 0x02 2f50e: 73 80 ldd r7, Z+3 ; 0x03 2f510: 40 92 7a 02 sts 0x027A, r4 ; 0x80027a 2f514: 50 92 7b 02 sts 0x027B, r5 ; 0x80027b 2f518: 60 92 7c 02 sts 0x027C, r6 ; 0x80027c 2f51c: 70 92 7d 02 sts 0x027D, r7 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f520: c3 01 movw r24, r6 2f522: b2 01 movw r22, r4 2f524: 0e 94 96 65 call 0xcb2c ; 0xcb2c 2f528: 4b 01 movw r8, r22 2f52a: 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; 2f52c: c8 01 movw r24, r16 2f52e: 8f 59 subi r24, 0x9F ; 159 2f530: 9d 4e sbci r25, 0xED ; 237 2f532: 1c 01 movw r2, r24 2f534: dc 01 movw r26, r24 2f536: 1d 92 st X+, r1 2f538: 1d 92 st X+, r1 2f53a: 1d 92 st X+, r1 2f53c: 1c 92 st X, r1 2f53e: 13 97 sbiw r26, 0x03 ; 3 plan_set_position_curposXYZE(); 2f540: 0f 94 cd 48 call 0x2919a ; 0x2919a set_destination_to_current(); 2f544: 0e 94 ff 66 call 0xcdfe ; 0xcdfe // destination[axis] = 11.f; destination[axis] = -3.f * axis_home_dir; 2f548: bc 81 ldd r27, Y+4 ; 0x04 2f54a: 6b 2f mov r22, r27 2f54c: bb 0f add r27, r27 2f54e: 77 0b sbc r23, r23 2f550: 88 0b sbc r24, r24 2f552: 99 0b sbc r25, r25 2f554: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2f558: 6b 01 movw r12, r22 2f55a: 7c 01 movw r14, r24 2f55c: f8 01 movw r30, r16 2f55e: e7 5d subi r30, 0xD7 ; 215 2f560: f9 4f sbci r31, 0xF9 ; 249 2f562: fb 87 std Y+11, r31 ; 0x0b 2f564: ea 87 std Y+10, r30 ; 0x0a 2f566: 20 e0 ldi r18, 0x00 ; 0 2f568: 30 e0 ldi r19, 0x00 ; 0 2f56a: 40 e4 ldi r20, 0x40 ; 64 2f56c: 50 ec ldi r21, 0xC0 ; 192 2f56e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f572: aa 85 ldd r26, Y+10 ; 0x0a 2f574: bb 85 ldd r27, Y+11 ; 0x0b 2f576: 6d 93 st X+, r22 2f578: 7d 93 st X+, r23 2f57a: 8d 93 st X+, r24 2f57c: 9c 93 st X, r25 2f57e: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f580: c5 01 movw r24, r10 2f582: b4 01 movw r22, r8 2f584: 0f 94 da 49 call 0x293b4 ; 0x293b4 st_synchronize(); 2f588: 0f 94 94 18 call 0x23128 ; 0x23128 // Move away from the possible collision with opposite endstop with the collision detection disabled. endstops_hit_on_purpose(); 2f58c: 0f 94 36 23 call 0x2466c ; 0x2466c 2f590: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.385> enable_endstops(false); current_position[axis] = 0; 2f594: f1 01 movw r30, r2 2f596: 10 82 st Z, r1 2f598: 11 82 std Z+1, r1 ; 0x01 2f59a: 12 82 std Z+2, r1 ; 0x02 2f59c: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2f59e: 0f 94 cd 48 call 0x2919a ; 0x2919a destination[axis] = 1. * axis_home_dir; 2f5a2: aa 85 ldd r26, Y+10 ; 0x0a 2f5a4: bb 85 ldd r27, Y+11 ; 0x0b 2f5a6: cd 92 st X+, r12 2f5a8: dd 92 st X+, r13 2f5aa: ed 92 st X+, r14 2f5ac: fc 92 st X, r15 2f5ae: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f5b0: c5 01 movw r24, r10 2f5b2: b4 01 movw r22, r8 2f5b4: 0f 94 da 49 call 0x293b4 ; 0x293b4 st_synchronize(); 2f5b8: 0f 94 94 18 call 0x23128 ; 0x23128 2f5bc: b1 e0 ldi r27, 0x01 ; 1 2f5be: b0 93 77 02 sts 0x0277, r27 ; 0x800277 <_ZL14check_endstops.lto_priv.385> { 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); 2f5c2: f8 01 movw r30, r16 2f5c4: e2 5f subi r30, 0xF2 ; 242 2f5c6: 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); 2f5c8: 85 91 lpm r24, Z+ 2f5ca: 95 91 lpm r25, Z+ 2f5cc: a5 91 lpm r26, Z+ 2f5ce: b4 91 lpm r27, Z 2f5d0: 8e 83 std Y+6, r24 ; 0x06 2f5d2: 9f 83 std Y+7, r25 ; 0x07 2f5d4: a8 87 std Y+8, r26 ; 0x08 2f5d6: 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); 2f5d8: 2d ec ldi r18, 0xCD ; 205 2f5da: 3c ec ldi r19, 0xCC ; 204 2f5dc: 4c e8 ldi r20, 0x8C ; 140 2f5de: 5f e3 ldi r21, 0x3F ; 63 2f5e0: c7 01 movw r24, r14 2f5e2: b6 01 movw r22, r12 2f5e4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f5e8: 2e 81 ldd r18, Y+6 ; 0x06 2f5ea: 3f 81 ldd r19, Y+7 ; 0x07 2f5ec: 48 85 ldd r20, Y+8 ; 0x08 2f5ee: 59 85 ldd r21, Y+9 ; 0x09 2f5f0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f5f4: aa 85 ldd r26, Y+10 ; 0x0a 2f5f6: bb 85 ldd r27, Y+11 ; 0x0b 2f5f8: 6d 93 st X+, r22 2f5fa: 7d 93 st X+, r23 2f5fc: 8d 93 st X+, r24 2f5fe: 9c 93 st X, r25 2f600: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f602: c5 01 movw r24, r10 2f604: b4 01 movw r22, r8 2f606: 0f 94 da 49 call 0x293b4 ; 0x293b4 st_synchronize(); 2f60a: 0f 94 94 18 call 0x23128 ; 0x23128 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(); 2f60e: 0f 94 36 23 call 0x2466c ; 0x2466c 2f612: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.385> enable_endstops(false); current_position[axis] = 0; 2f616: f1 01 movw r30, r2 2f618: 10 82 st Z, r1 2f61a: 11 82 std Z+1, r1 ; 0x01 2f61c: 12 82 std Z+2, r1 ; 0x02 2f61e: 13 82 std Z+3, r1 ; 0x03 plan_set_position_curposXYZE(); 2f620: 0f 94 cd 48 call 0x2919a ; 0x2919a destination[axis] = -10.f * axis_home_dir; 2f624: 20 e0 ldi r18, 0x00 ; 0 2f626: 30 e0 ldi r19, 0x00 ; 0 2f628: 40 e2 ldi r20, 0x20 ; 32 2f62a: 51 ec ldi r21, 0xC1 ; 193 2f62c: c7 01 movw r24, r14 2f62e: b6 01 movw r22, r12 2f630: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f634: aa 85 ldd r26, Y+10 ; 0x0a 2f636: bb 85 ldd r27, Y+11 ; 0x0b 2f638: 6d 93 st X+, r22 2f63a: 7d 93 st X+, r23 2f63c: 8d 93 st X+, r24 2f63e: 9c 93 st X, r25 2f640: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f642: c5 01 movw r24, r10 2f644: b4 01 movw r22, r8 2f646: 0f 94 da 49 call 0x293b4 ; 0x293b4 st_synchronize(); 2f64a: 0f 94 94 18 call 0x23128 ; 0x23128 endstops_hit_on_purpose(); 2f64e: 0f 94 36 23 call 0x2466c ; 0x2466c 2f652: b1 e0 ldi r27, 0x01 ; 1 2f654: b0 93 77 02 sts 0x0277, r27 ; 0x800277 <_ZL14check_endstops.lto_priv.385> // Now move left up to the collision, this time with a repeatable velocity. enable_endstops(true); destination[axis] = 11.f * axis_home_dir; 2f658: 20 e0 ldi r18, 0x00 ; 0 2f65a: 30 e0 ldi r19, 0x00 ; 0 2f65c: 40 e3 ldi r20, 0x30 ; 48 2f65e: 51 e4 ldi r21, 0x41 ; 65 2f660: c7 01 movw r24, r14 2f662: b6 01 movw r22, r12 2f664: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f668: ea 85 ldd r30, Y+10 ; 0x0a 2f66a: fb 85 ldd r31, Y+11 ; 0x0b 2f66c: 60 83 st Z, r22 2f66e: 71 83 std Z+1, r23 ; 0x01 2f670: 82 83 std Z+2, r24 ; 0x02 2f672: 93 83 std Z+3, r25 ; 0x03 #ifdef TMC2130 feedrate = homing_feedrate[axis]; #else //TMC2130 feedrate = homing_feedrate[axis] / 2; 2f674: 20 e0 ldi r18, 0x00 ; 0 2f676: 30 e0 ldi r19, 0x00 ; 0 2f678: 40 e0 ldi r20, 0x00 ; 0 2f67a: 5f e3 ldi r21, 0x3F ; 63 2f67c: c3 01 movw r24, r6 2f67e: b2 01 movw r22, r4 2f680: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f684: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 2f688: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 2f68c: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 2f690: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f694: 0e 94 96 65 call 0xcb2c ; 0xcb2c 2f698: 6b 01 movw r12, r22 2f69a: 7c 01 movw r14, r24 #endif //TMC2130 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f69c: 0f 94 da 49 call 0x293b4 ; 0x293b4 st_synchronize(); 2f6a0: 0f 94 94 18 call 0x23128 ; 0x23128 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(); 2f6a4: 0f 94 36 23 call 0x2466c ; 0x2466c 2f6a8: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.385> else tmc2130_do_steps(axis, 8, -axis_home_dir, 1000); tmc2130_home_exit(); #endif //TMC2130 axis_is_at_home(axis); 2f6ac: 8b 81 ldd r24, Y+3 ; 0x03 2f6ae: 0e 94 e0 65 call 0xcbc0 ; 0xcbc0 axis_known_position[axis] = true; 2f6b2: e9 81 ldd r30, Y+1 ; 0x01 2f6b4: fa 81 ldd r31, Y+2 ; 0x02 2f6b6: e7 5c subi r30, 0xC7 ; 199 2f6b8: f9 4f sbci r31, 0xF9 ; 249 2f6ba: 21 e0 ldi r18, 0x01 ; 1 2f6bc: 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; 2f6be: 8c 81 ldd r24, Y+4 ; 0x04 2f6c0: 99 27 eor r25, r25 2f6c2: 81 95 neg r24 2f6c4: 0c f4 brge .+2 ; 0x2f6c8 2f6c6: 90 95 com r25 2f6c8: bc 01 movw r22, r24 2f6ca: 07 2e mov r0, r23 2f6cc: 00 0c add r0, r0 2f6ce: 88 0b sbc r24, r24 2f6d0: 99 0b sbc r25, r25 2f6d2: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2f6d6: 2a e0 ldi r18, 0x0A ; 10 2f6d8: 37 ed ldi r19, 0xD7 ; 215 2f6da: 43 e2 ldi r20, 0x23 ; 35 2f6dc: 5c e3 ldi r21, 0x3C ; 60 2f6de: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f6e2: 20 e0 ldi r18, 0x00 ; 0 2f6e4: 30 e0 ldi r19, 0x00 ; 0 2f6e6: 40 e8 ldi r20, 0x80 ; 128 2f6e8: 52 e4 ldi r21, 0x42 ; 66 2f6ea: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f6ee: 4b 01 movw r8, r22 2f6f0: 5c 01 movw r10, r24 #endif //TMC2130 current_position[axis] -= dist; 2f6f2: ac 01 movw r20, r24 2f6f4: 9b 01 movw r18, r22 2f6f6: d1 01 movw r26, r2 2f6f8: 6d 91 ld r22, X+ 2f6fa: 7d 91 ld r23, X+ 2f6fc: 8d 91 ld r24, X+ 2f6fe: 9c 91 ld r25, X 2f700: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2f704: f1 01 movw r30, r2 2f706: 60 83 st Z, r22 2f708: 71 83 std Z+1, r23 ; 0x01 2f70a: 82 83 std Z+2, r24 ; 0x02 2f70c: 93 83 std Z+3, r25 ; 0x03 plan_set_position_curposXYZE(); 2f70e: 0f 94 cd 48 call 0x2919a ; 0x2919a current_position[axis] += dist; 2f712: d1 01 movw r26, r2 2f714: 2d 91 ld r18, X+ 2f716: 3d 91 ld r19, X+ 2f718: 4d 91 ld r20, X+ 2f71a: 5c 91 ld r21, X 2f71c: c5 01 movw r24, r10 2f71e: b4 01 movw r22, r8 2f720: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2f724: f1 01 movw r30, r2 2f726: 60 83 st Z, r22 2f728: 71 83 std Z+1, r23 ; 0x01 2f72a: 82 83 std Z+2, r24 ; 0x02 2f72c: 93 83 std Z+3, r25 ; 0x03 destination[axis] = current_position[axis]; 2f72e: aa 85 ldd r26, Y+10 ; 0x0a 2f730: bb 85 ldd r27, Y+11 ; 0x0b 2f732: 6d 93 st X+, r22 2f734: 7d 93 st X+, r23 2f736: 8d 93 st X+, r24 2f738: 9c 93 st X, r25 2f73a: 13 97 sbiw r26, 0x03 ; 3 plan_buffer_line_destinationXYZE(0.5f*feedrate_mm_s); 2f73c: 20 e0 ldi r18, 0x00 ; 0 2f73e: 30 e0 ldi r19, 0x00 ; 0 2f740: 40 e0 ldi r20, 0x00 ; 0 2f742: 5f e3 ldi r21, 0x3F ; 63 2f744: c7 01 movw r24, r14 2f746: b6 01 movw r22, r12 2f748: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f74c: 0f 94 da 49 call 0x293b4 ; 0x293b4 st_synchronize(); 2f750: 0f 94 94 18 call 0x23128 ; 0x23128 feedrate = 0.0; 2f754: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2f758: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2f75c: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2f760: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d 2f764: 2d 81 ldd r18, Y+5 ; 0x05 2f766: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.385> #ifdef TMC2130 FORCE_HIGH_POWER_END; #endif } enable_endstops(endstops_enabled); } 2f76a: 2b 96 adiw r28, 0x0b ; 11 2f76c: 0f b6 in r0, 0x3f ; 63 2f76e: f8 94 cli 2f770: de bf out 0x3e, r29 ; 62 2f772: 0f be out 0x3f, r0 ; 63 2f774: cd bf out 0x3d, r28 ; 61 2f776: df 91 pop r29 2f778: cf 91 pop r28 2f77a: 1f 91 pop r17 2f77c: 0f 91 pop r16 2f77e: ff 90 pop r15 2f780: ef 90 pop r14 2f782: df 90 pop r13 2f784: cf 90 pop r12 2f786: bf 90 pop r11 2f788: af 90 pop r10 2f78a: 9f 90 pop r9 2f78c: 8f 90 pop r8 2f78e: 7f 90 pop r7 2f790: 6f 90 pop r6 2f792: 5f 90 pop r5 2f794: 4f 90 pop r4 2f796: 3f 90 pop r3 2f798: 2f 90 pop r2 2f79a: 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); 2f79c: ec e1 ldi r30, 0x1C ; 28 2f79e: fe e9 ldi r31, 0x9E ; 158 2f7a0: b4 91 lpm r27, Z 2f7a2: 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; 2f7a4: 10 92 69 12 sts 0x1269, r1 ; 0x801269 2f7a8: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 2f7ac: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 2f7b0: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c plan_set_position_curposXYZE(); 2f7b4: 0f 94 cd 48 call 0x2919a ; 0x2919a #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); 2f7b8: e6 e1 ldi r30, 0x16 ; 22 2f7ba: fe e9 ldi r31, 0x9E ; 158 2f7bc: 85 90 lpm r8, Z+ 2f7be: 95 90 lpm r9, Z+ 2f7c0: a5 90 lpm r10, Z+ 2f7c2: 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; 2f7c4: e9 81 ldd r30, Y+1 ; 0x01 2f7c6: 6e 2f mov r22, r30 2f7c8: ee 0f add r30, r30 2f7ca: 77 0b sbc r23, r23 2f7cc: 88 0b sbc r24, r24 2f7ce: 99 0b sbc r25, r25 2f7d0: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2f7d4: 6b 01 movw r12, r22 2f7d6: 7c 01 movw r14, r24 2f7d8: 20 e0 ldi r18, 0x00 ; 0 2f7da: 30 e0 ldi r19, 0x00 ; 0 2f7dc: 40 ec ldi r20, 0xC0 ; 192 2f7de: 5f e3 ldi r21, 0x3F ; 63 2f7e0: c5 01 movw r24, r10 2f7e2: b4 01 movw r22, r8 2f7e4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f7e8: a7 01 movw r20, r14 2f7ea: 96 01 movw r18, r12 2f7ec: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f7f0: 60 93 31 06 sts 0x0631, r22 ; 0x800631 2f7f4: 70 93 32 06 sts 0x0632, r23 ; 0x800632 2f7f8: 80 93 33 06 sts 0x0633, r24 ; 0x800633 2f7fc: 90 93 34 06 sts 0x0634, r25 ; 0x800634 feedrate = homing_feedrate[axis]; 2f800: 80 e0 ldi r24, 0x00 ; 0 2f802: 90 e0 ldi r25, 0x00 ; 0 2f804: a8 e4 ldi r26, 0x48 ; 72 2f806: b4 e4 ldi r27, 0x44 ; 68 2f808: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2f80c: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2f810: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2f814: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d float feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f818: bc 01 movw r22, r24 2f81a: cd 01 movw r24, r26 2f81c: 0e 94 96 65 call 0xcb2c ; 0xcb2c 2f820: 4b 01 movw r8, r22 2f822: 5c 01 movw r10, r24 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f824: 0f 94 da 49 call 0x293b4 ; 0x293b4 st_synchronize(); 2f828: 0f 94 94 18 call 0x23128 ; 0x23128 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 current_position[axis] = 0; 2f82c: 10 92 69 12 sts 0x1269, r1 ; 0x801269 2f830: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 2f834: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 2f838: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c plan_set_position_curposXYZE(); 2f83c: 0f 94 cd 48 call 0x2919a ; 0x2919a #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); 2f840: 0a e0 ldi r16, 0x0A ; 10 2f842: 1e e9 ldi r17, 0x9E ; 158 2f844: f8 01 movw r30, r16 2f846: 65 91 lpm r22, Z+ 2f848: 75 91 lpm r23, Z+ 2f84a: 85 91 lpm r24, Z+ 2f84c: 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; 2f84e: 90 58 subi r25, 0x80 ; 128 2f850: a7 01 movw r20, r14 2f852: 96 01 movw r18, r12 2f854: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f858: 60 93 31 06 sts 0x0631, r22 ; 0x800631 2f85c: 70 93 32 06 sts 0x0632, r23 ; 0x800632 2f860: 80 93 33 06 sts 0x0633, r24 ; 0x800633 2f864: 90 93 34 06 sts 0x0634, r25 ; 0x800634 plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f868: c5 01 movw r24, r10 2f86a: b4 01 movw r22, r8 2f86c: 0f 94 da 49 call 0x293b4 ; 0x293b4 st_synchronize(); 2f870: 0f 94 94 18 call 0x23128 ; 0x23128 #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); 2f874: f8 01 movw r30, r16 2f876: 65 91 lpm r22, Z+ 2f878: 75 91 lpm r23, Z+ 2f87a: 85 91 lpm r24, Z+ 2f87c: 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; 2f87e: 9b 01 movw r18, r22 2f880: ac 01 movw r20, r24 2f882: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2f886: a7 01 movw r20, r14 2f888: 96 01 movw r18, r12 2f88a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 2f88e: 60 93 31 06 sts 0x0631, r22 ; 0x800631 2f892: 70 93 32 06 sts 0x0632, r23 ; 0x800632 2f896: 80 93 33 06 sts 0x0633, r24 ; 0x800633 2f89a: 90 93 34 06 sts 0x0634, r25 ; 0x800634 feedrate = homing_feedrate[axis] / 2; 2f89e: 80 e0 ldi r24, 0x00 ; 0 2f8a0: 90 e0 ldi r25, 0x00 ; 0 2f8a2: a8 ec ldi r26, 0xC8 ; 200 2f8a4: b3 e4 ldi r27, 0x43 ; 67 2f8a6: 80 93 7a 02 sts 0x027A, r24 ; 0x80027a 2f8aa: 90 93 7b 02 sts 0x027B, r25 ; 0x80027b 2f8ae: a0 93 7c 02 sts 0x027C, r26 ; 0x80027c 2f8b2: b0 93 7d 02 sts 0x027D, r27 ; 0x80027d feedrate_mm_s = get_feedrate_mm_s(feedrate); 2f8b6: bc 01 movw r22, r24 2f8b8: cd 01 movw r24, r26 2f8ba: 0e 94 96 65 call 0xcb2c ; 0xcb2c plan_buffer_line_destinationXYZE(feedrate_mm_s); 2f8be: 0f 94 da 49 call 0x293b4 ; 0x293b4 st_synchronize(); 2f8c2: 0f 94 94 18 call 0x23128 ; 0x23128 #ifdef TMC2130 check_Z_crash(); #endif //TMC2130 axis_is_at_home(axis); 2f8c6: 82 e0 ldi r24, 0x02 ; 2 2f8c8: 0e 94 e0 65 call 0xcbc0 ; 0xcbc0 destination[axis] = current_position[axis]; 2f8cc: 80 91 69 12 lds r24, 0x1269 ; 0x801269 2f8d0: 90 91 6a 12 lds r25, 0x126A ; 0x80126a 2f8d4: a0 91 6b 12 lds r26, 0x126B ; 0x80126b 2f8d8: b0 91 6c 12 lds r27, 0x126C ; 0x80126c 2f8dc: 80 93 31 06 sts 0x0631, r24 ; 0x800631 2f8e0: 90 93 32 06 sts 0x0632, r25 ; 0x800632 2f8e4: a0 93 33 06 sts 0x0633, r26 ; 0x800633 2f8e8: b0 93 34 06 sts 0x0634, r27 ; 0x800634 feedrate = 0.0; 2f8ec: 10 92 7a 02 sts 0x027A, r1 ; 0x80027a 2f8f0: 10 92 7b 02 sts 0x027B, r1 ; 0x80027b 2f8f4: 10 92 7c 02 sts 0x027C, r1 ; 0x80027c 2f8f8: 10 92 7d 02 sts 0x027D, r1 ; 0x80027d endstops_hit_on_purpose(); 2f8fc: 0f 94 36 23 call 0x2466c ; 0x2466c axis_known_position[axis] = true; 2f900: f1 e0 ldi r31, 0x01 ; 1 2f902: f0 93 3b 06 sts 0x063B, r31 ; 0x80063b 2f906: 2e cf rjmp .-420 ; 0x2f764 0002f908 : #ifdef MESH_BED_LEVELING mesh_bed_leveling mbl; void mesh_bed_leveling::reset() { active = 0; 2f908: 10 92 09 13 sts 0x1309, r1 ; 0x801309 memset(z_values, 0, sizeof(z_values)); 2f90c: ea e0 ldi r30, 0x0A ; 10 2f90e: f3 e1 ldi r31, 0x13 ; 19 2f910: 84 ec ldi r24, 0xC4 ; 196 2f912: df 01 movw r26, r30 2f914: 1d 92 st X+, r1 2f916: 8a 95 dec r24 2f918: e9 f7 brne .-6 ; 0x2f914 } 2f91a: 08 95 ret 0002f91c : 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 2f91c: 2f 92 push r2 2f91e: 3f 92 push r3 2f920: 4f 92 push r4 2f922: 5f 92 push r5 2f924: 6f 92 push r6 2f926: 7f 92 push r7 2f928: 8f 92 push r8 2f92a: 9f 92 push r9 2f92c: af 92 push r10 2f92e: bf 92 push r11 2f930: cf 92 push r12 2f932: df 92 push r13 2f934: ef 92 push r14 2f936: ff 92 push r15 2f938: 0f 93 push r16 2f93a: 1f 93 push r17 2f93c: cf 93 push r28 2f93e: df 93 push r29 2f940: 00 d0 rcall .+0 ; 0x2f942 2f942: cd b7 in r28, 0x3d ; 61 2f944: de b7 in r29, 0x3e ; 62 2f946: 4b 01 movw r8, r22 2f948: 5c 01 movw r10, r24 2f94a: 04 2f mov r16, r20 verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; bedPWMDisabled = 1; 2f94c: 81 e0 ldi r24, 0x01 ; 1 2f94e: 80 93 28 06 sts 0x0628, r24 ; 0x800628 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2f952: 20 91 77 02 lds r18, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.385> 2f956: 29 83 std Y+1, r18 ; 0x01 check_endstops = check; 2f958: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.385> //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); 2f95c: 80 e0 ldi r24, 0x00 ; 0 2f95e: 0f 94 1a 23 call 0x24634 ; 0x24634 2f962: 18 2f mov r17, r24 float z = 0.f; endstop_z_hit_on_purpose(); 2f964: 0f 94 28 23 call 0x24650 ; 0x24650 // move down until you find the 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 go_to_current(homing_feedrate[Z_AXIS]/60); 2f978: 65 e5 ldi r22, 0x55 ; 85 2f97a: 75 e5 ldi r23, 0x55 ; 85 2f97c: 85 e5 ldi r24, 0x55 ; 85 2f97e: 91 e4 ldi r25, 0x41 ; 65 2f980: 0f 94 82 4e call 0x29d04 ; 0x29d04 // 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 44 5f call 0xbe88 ; 0xbe88 if (! endstop_z_hit_on_purpose()) 2f988: 0f 94 28 23 call 0x24650 ; 0x24650 2f98c: 8b 83 std Y+3, r24 ; 0x03 2f98e: 88 23 and r24, r24 2f990: 09 f4 brne .+2 ; 0x2f994 2f992: eb c0 rjmp .+470 ; 0x2fb6a { //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) 2f994: 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; 2f996: c1 2c mov r12, r1 2f998: d1 2c mov r13, r1 2f99a: 76 01 movw r14, r12 #ifdef SUPPORT_VERBOSITY verbosity_level #endif //SUPPORT_VERBOSITY ) { bool high_deviation_occured = false; 2f99c: 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) 2f99e: 8a 81 ldd r24, Y+2 ; 0x02 2f9a0: 80 17 cp r24, r16 2f9a2: 08 f0 brcs .+2 ; 0x2f9a6 2f9a4: a4 c0 rjmp .+328 ; 0x2faee { current_position[Z_AXIS] += high_deviation_occured ? 0.5 : 0.2; 2f9a6: 60 91 69 12 lds r22, 0x1269 ; 0x801269 2f9aa: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 2f9ae: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 2f9b2: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 2f9b6: 20 e0 ldi r18, 0x00 ; 0 2f9b8: 30 e0 ldi r19, 0x00 ; 0 2f9ba: 40 e0 ldi r20, 0x00 ; 0 2f9bc: 5f e3 ldi r21, 0x3F ; 63 2f9be: 31 10 cpse r3, r1 2f9c0: 04 c0 rjmp .+8 ; 0x2f9ca 2f9c2: 2d ec ldi r18, 0xCD ; 205 2f9c4: 3c ec ldi r19, 0xCC ; 204 2f9c6: 4c e4 ldi r20, 0x4C ; 76 2f9c8: 5e e3 ldi r21, 0x3E ; 62 2f9ca: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2f9ce: 2b 01 movw r4, r22 2f9d0: 3c 01 movw r6, r24 2f9d2: 40 92 69 12 sts 0x1269, r4 ; 0x801269 2f9d6: 50 92 6a 12 sts 0x126A, r5 ; 0x80126a 2f9da: 60 92 6b 12 sts 0x126B, r6 ; 0x80126b 2f9de: 70 92 6c 12 sts 0x126C, r7 ; 0x80126c float z_bckp = current_position[Z_AXIS]; go_to_current(homing_feedrate[Z_AXIS]/60); 2f9e2: 65 e5 ldi r22, 0x55 ; 85 2f9e4: 75 e5 ldi r23, 0x55 ; 85 2f9e6: 85 e5 ldi r24, 0x55 ; 85 2f9e8: 91 e4 ldi r25, 0x41 ; 65 2f9ea: 0f 94 82 4e call 0x29d04 ; 0x29d04 // Move back down slowly to find bed. current_position[Z_AXIS] = minimum_z; 2f9ee: 80 92 69 12 sts 0x1269, r8 ; 0x801269 2f9f2: 90 92 6a 12 sts 0x126A, r9 ; 0x80126a 2f9f6: a0 92 6b 12 sts 0x126B, r10 ; 0x80126b 2f9fa: 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)); 2f9fe: 65 e5 ldi r22, 0x55 ; 85 2fa00: 75 e5 ldi r23, 0x55 ; 85 2fa02: 85 e5 ldi r24, 0x55 ; 85 2fa04: 90 e4 ldi r25, 0x40 ; 64 2fa06: 0f 94 82 4e call 0x29d04 ; 0x29d04 // 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(); 2fa0a: 0e 94 44 5f call 0xbe88 ; 0xbe88 //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) { 2fa0e: a3 01 movw r20, r6 2fa10: 92 01 movw r18, r4 2fa12: 60 91 69 12 lds r22, 0x1269 ; 0x801269 2fa16: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 2fa1a: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 2fa1e: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 2fa22: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2fa26: 9f 77 andi r25, 0x7F ; 127 2fa28: 2d ec ldi r18, 0xCD ; 205 2fa2a: 3c ec ldi r19, 0xCC ; 204 2fa2c: 4c ec ldi r20, 0xCC ; 204 2fa2e: 5c e3 ldi r21, 0x3C ; 60 2fa30: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2fa34: 87 ff sbrs r24, 7 2fa36: 16 c0 rjmp .+44 ; 0x2fa64 //printf_P(PSTR("PINDA triggered immediately, move Z higher and repeat measurement\n")); raise_z(0.5); 2fa38: 60 e0 ldi r22, 0x00 ; 0 2fa3a: 70 e0 ldi r23, 0x00 ; 0 2fa3c: 80 e0 ldi r24, 0x00 ; 0 2fa3e: 9f e3 ldi r25, 0x3F ; 63 2fa40: 0e 94 e5 6c call 0xd9ca ; 0xd9ca current_position[Z_AXIS] = minimum_z; 2fa44: 80 92 69 12 sts 0x1269, r8 ; 0x801269 2fa48: 90 92 6a 12 sts 0x126A, r9 ; 0x80126a 2fa4c: a0 92 6b 12 sts 0x126B, r10 ; 0x80126b 2fa50: b0 92 6c 12 sts 0x126C, r11 ; 0x80126c go_to_current(homing_feedrate[Z_AXIS]/(4*60)); 2fa54: 65 e5 ldi r22, 0x55 ; 85 2fa56: 75 e5 ldi r23, 0x55 ; 85 2fa58: 85 e5 ldi r24, 0x55 ; 85 2fa5a: 90 e4 ldi r25, 0x40 ; 64 2fa5c: 0f 94 82 4e call 0x29d04 ; 0x29d04 // 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(); 2fa60: 0e 94 44 5f call 0xbe88 ; 0xbe88 } if (!endstop_z_hit_on_purpose()) 2fa64: 0f 94 28 23 call 0x24650 ; 0x24650 2fa68: 28 2e mov r2, r24 2fa6a: 88 23 and r24, r24 2fa6c: 09 f4 brne .+2 ; 0x2fa70 2fa6e: 7d c0 rjmp .+250 ; 0x2fb6a 2fa70: 40 90 69 12 lds r4, 0x1269 ; 0x801269 2fa74: 50 90 6a 12 lds r5, 0x126A ; 0x80126a 2fa78: 60 90 6b 12 lds r6, 0x126B ; 0x80126b 2fa7c: 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; 2fa80: 9a 81 ldd r25, Y+2 ; 0x02 2fa82: 99 23 and r25, r25 2fa84: d9 f0 breq .+54 ; 0x2fabc 2fa86: 69 2f mov r22, r25 2fa88: 70 e0 ldi r23, 0x00 ; 0 2fa8a: 90 e0 ldi r25, 0x00 ; 0 2fa8c: 80 e0 ldi r24, 0x00 ; 0 2fa8e: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 2fa92: 9b 01 movw r18, r22 2fa94: ac 01 movw r20, r24 2fa96: c7 01 movw r24, r14 2fa98: b6 01 movw r22, r12 2fa9a: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 2fa9e: 9b 01 movw r18, r22 2faa0: ac 01 movw r20, r24 2faa2: c3 01 movw r24, r6 2faa4: b2 01 movw r22, r4 2faa6: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 2faaa: 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 2faac: 2d ec ldi r18, 0xCD ; 205 2faae: 3c ec ldi r19, 0xCC ; 204 2fab0: 4c e4 ldi r20, 0x4C ; 76 2fab2: 5d e3 ldi r21, 0x3D ; 61 2fab4: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2fab8: 18 16 cp r1, r24 2faba: 64 f0 brlt .+24 ; 0x2fad4 #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]; 2fabc: a3 01 movw r20, r6 2fabe: 92 01 movw r18, r4 2fac0: c7 01 movw r24, r14 2fac2: b6 01 movw r22, r12 2fac4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2fac8: 6b 01 movw r12, r22 2faca: 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) 2facc: 8a 81 ldd r24, Y+2 ; 0x02 2face: 8f 5f subi r24, 0xFF ; 255 2fad0: 8a 83 std Y+2, r24 ; 0x02 2fad2: 65 cf rjmp .-310 ; 0x2f99e 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 2fad4: 31 10 cpse r3, r1 2fad6: 49 c0 rjmp .+146 ; 0x2fb6a //printf_P(PSTR("high dev. first occurence\n")); delay_keep_alive(500); //damping 2fad8: 84 ef ldi r24, 0xF4 ; 244 2fada: 91 e0 ldi r25, 0x01 ; 1 2fadc: 0e 94 07 8d call 0x11a0e ; 0x11a0e //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; 2fae0: 32 2c mov r3, r2 i = -1; 2fae2: 2f ef ldi r18, 0xFF ; 255 2fae4: 2a 83 std Y+2, r18 ; 0x02 z = 0; 2fae6: c1 2c mov r12, r1 2fae8: d1 2c mov r13, r1 2faea: 76 01 movw r14, r12 2faec: ef cf rjmp .-34 ; 0x2facc } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; if (n_iter > 1) 2faee: 02 30 cpi r16, 0x02 ; 2 2faf0: 38 f5 brcc .+78 ; 0x2fb40 goto error; } } //printf_P(PSTR("PINDA triggered at %f\n"), current_position[Z_AXIS]); } current_position[Z_AXIS] = z; 2faf2: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2faf6: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2fafa: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2fafe: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c 2fb02: 99 81 ldd r25, Y+1 ; 0x01 2fb04: 90 93 77 02 sts 0x0277, r25 ; 0x800277 <_ZL14check_endstops.lto_priv.385> if (n_iter > 1) current_position[Z_AXIS] /= float(n_iter); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2fb08: 81 2f mov r24, r17 2fb0a: 0f 94 1a 23 call 0x24634 ; 0x24634 // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 3"); #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2fb0e: 10 92 28 06 sts 0x0628, r1 ; 0x800628 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; return false; } 2fb12: 8b 81 ldd r24, Y+3 ; 0x03 2fb14: 0f 90 pop r0 2fb16: 0f 90 pop r0 2fb18: 0f 90 pop r0 2fb1a: df 91 pop r29 2fb1c: cf 91 pop r28 2fb1e: 1f 91 pop r17 2fb20: 0f 91 pop r16 2fb22: ff 90 pop r15 2fb24: ef 90 pop r14 2fb26: df 90 pop r13 2fb28: cf 90 pop r12 2fb2a: bf 90 pop r11 2fb2c: af 90 pop r10 2fb2e: 9f 90 pop r9 2fb30: 8f 90 pop r8 2fb32: 7f 90 pop r7 2fb34: 6f 90 pop r6 2fb36: 5f 90 pop r5 2fb38: 4f 90 pop r4 2fb3a: 3f 90 pop r3 2fb3c: 2f 90 pop r2 2fb3e: 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); 2fb40: 60 2f mov r22, r16 2fb42: 70 e0 ldi r23, 0x00 ; 0 2fb44: 90 e0 ldi r25, 0x00 ; 0 2fb46: 80 e0 ldi r24, 0x00 ; 0 2fb48: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 2fb4c: 9b 01 movw r18, r22 2fb4e: ac 01 movw r20, r24 2fb50: c7 01 movw r24, r14 2fb52: b6 01 movw r22, r12 2fb54: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 2fb58: 60 93 69 12 sts 0x1269, r22 ; 0x801269 2fb5c: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 2fb60: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 2fb64: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c 2fb68: cc cf rjmp .-104 ; 0x2fb02 2fb6a: 29 81 ldd r18, Y+1 ; 0x01 2fb6c: 20 93 77 02 sts 0x0277, r18 ; 0x800277 <_ZL14check_endstops.lto_priv.385> return true; error: // SERIAL_ECHOLNPGM("find_bed_induction_sensor_point_z 4"); enable_endstops(endstops_enabled); enable_z_endstop(endstop_z_enabled); 2fb70: 81 2f mov r24, r17 2fb72: 0f 94 1a 23 call 0x24634 ; 0x24634 #ifdef TMC2130 if (bHighPowerForced) FORCE_HIGH_POWER_END; #endif bedPWMDisabled = 0; 2fb76: 10 92 28 06 sts 0x0628, r1 ; 0x800628 return false; 2fb7a: 1b 82 std Y+3, r1 ; 0x03 2fb7c: ca cf rjmp .-108 ; 0x2fb12 0002fb7e : //! @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) 2fb7e: 2f 92 push r2 2fb80: 3f 92 push r3 2fb82: 4f 92 push r4 2fb84: 5f 92 push r5 2fb86: 6f 92 push r6 2fb88: 7f 92 push r7 2fb8a: 8f 92 push r8 2fb8c: 9f 92 push r9 2fb8e: af 92 push r10 2fb90: bf 92 push r11 2fb92: cf 92 push r12 2fb94: df 92 push r13 2fb96: ef 92 push r14 2fb98: ff 92 push r15 2fb9a: 0f 93 push r16 2fb9c: 1f 93 push r17 2fb9e: cf 93 push r28 2fba0: df 93 push r29 2fba2: cd b7 in r28, 0x3d ; 61 2fba4: de b7 in r29, 0x3e ; 62 2fba6: ce 5c subi r28, 0xCE ; 206 2fba8: d1 09 sbc r29, r1 2fbaa: 0f b6 in r0, 0x3f ; 63 2fbac: f8 94 cli 2fbae: de bf out 0x3e, r29 ; 62 2fbb0: 0f be out 0x3f, r0 ; 63 2fbb2: cd bf out 0x3d, r28 ; 61 2fbb4: 18 2f mov r17, r24 #endif // TMC2130 FORCE_BL_ON_START; // Only Z calibration? if (!onlyZ) 2fbb6: 81 11 cpse r24, r1 2fbb8: 04 c0 rjmp .+8 ; 0x2fbc2 { disable_heater(); 2fbba: 0f 94 9e 0e call 0x21d3c ; 0x21d3c eeprom_adjust_bed_reset(); //reset bed level correction 2fbbe: 0e 94 30 79 call 0xf260 ; 0xf260 } // Disable the default update procedure of the display. We will do a modal dialog. lcd_update_enable(false); 2fbc2: 80 e0 ldi r24, 0x00 ; 0 2fbc4: 0e 94 89 70 call 0xe112 ; 0xe112 // Let the planner use the uncorrected coordinates. mbl.reset(); 2fbc8: 0f 94 84 7c call 0x2f908 ; 0x2f908 // 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(); 2fbcc: 0e 94 7e 62 call 0xc4fc ; 0xc4fc babystepLoadZ = 0; } void babystep_reset() { babystepLoadZ = 0; 2fbd0: 10 92 27 06 sts 0x0627, r1 ; 0x800627 <_ZL13babystepLoadZ.lto_priv.450+0x1> 2fbd4: 10 92 26 06 sts 0x0626, r1 ; 0x800626 <_ZL13babystepLoadZ.lto_priv.450> // 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)); 2fbd8: e9 e3 ldi r30, 0x39 ; 57 2fbda: f6 e0 ldi r31, 0x06 ; 6 2fbdc: 83 e0 ldi r24, 0x03 ; 3 2fbde: df 01 movw r26, r30 2fbe0: 1d 92 st X+, r1 2fbe2: 8a 95 dec r24 2fbe4: e9 f7 brne .-6 ; 0x2fbe0 // Home in the XY plane. //set_destination_to_current(); int l_feedmultiply = setup_for_endstop_move(); 2fbe6: 81 e0 ldi r24, 0x01 ; 1 2fbe8: 0e 94 b7 65 call 0xcb6e ; 0xcb6e 2fbec: c7 55 subi r28, 0x57 ; 87 2fbee: df 4f sbci r29, 0xFF ; 255 2fbf0: 99 83 std Y+1, r25 ; 0x01 2fbf2: 88 83 st Y, r24 2fbf4: c9 5a subi r28, 0xA9 ; 169 2fbf6: d0 40 sbci r29, 0x00 ; 0 lcd_display_message_fullscreen_P(_T(MSG_AUTO_HOME)); 2fbf8: 83 e8 ldi r24, 0x83 ; 131 2fbfa: 92 e6 ldi r25, 0x62 ; 98 2fbfc: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2fc00: 0e 94 91 de call 0x1bd22 ; 0x1bd22 raise_z_above(MESH_HOME_Z_SEARCH); 2fc04: 60 e0 ldi r22, 0x00 ; 0 2fc06: 70 e0 ldi r23, 0x00 ; 0 2fc08: 80 ea ldi r24, 0xA0 ; 160 2fc0a: 90 e4 ldi r25, 0x40 ; 64 2fc0c: 0e 94 47 6d call 0xda8e ; 0xda8e } /**/ void home_xy() { set_destination_to_current(); 2fc10: 0e 94 ff 66 call 0xcdfe ; 0xcdfe homeaxis(X_AXIS); 2fc14: 80 e0 ldi r24, 0x00 ; 0 2fc16: 0f 94 4f 7a call 0x2f49e ; 0x2f49e homeaxis(Y_AXIS); 2fc1a: 81 e0 ldi r24, 0x01 ; 1 2fc1c: 0f 94 4f 7a call 0x2f49e ; 0x2f49e plan_set_position_curposXYZE(); 2fc20: 0f 94 cd 48 call 0x2919a ; 0x2919a endstops_hit_on_purpose(); 2fc24: 0f 94 36 23 call 0x2466c ; 0x2466c 2fc28: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.385> 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; 2fc2c: 20 e0 ldi r18, 0x00 ; 0 2fc2e: 30 e0 ldi r19, 0x00 ; 0 2fc30: 40 ea ldi r20, 0xA0 ; 160 2fc32: 50 e4 ldi r21, 0x40 ; 64 2fc34: 60 91 61 12 lds r22, 0x1261 ; 0x801261 2fc38: 70 91 62 12 lds r23, 0x1262 ; 0x801262 2fc3c: 80 91 63 12 lds r24, 0x1263 ; 0x801263 2fc40: 90 91 64 12 lds r25, 0x1264 ; 0x801264 2fc44: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2fc48: 60 93 61 12 sts 0x1261, r22 ; 0x801261 2fc4c: 70 93 62 12 sts 0x1262, r23 ; 0x801262 2fc50: 80 93 63 12 sts 0x1263, r24 ; 0x801263 2fc54: 90 93 64 12 sts 0x1264, r25 ; 0x801264 current_position[Y_AXIS] += 5; 2fc58: 20 e0 ldi r18, 0x00 ; 0 2fc5a: 30 e0 ldi r19, 0x00 ; 0 2fc5c: 40 ea ldi r20, 0xA0 ; 160 2fc5e: 50 e4 ldi r21, 0x40 ; 64 2fc60: 60 91 65 12 lds r22, 0x1265 ; 0x801265 2fc64: 70 91 66 12 lds r23, 0x1266 ; 0x801266 2fc68: 80 91 67 12 lds r24, 0x1267 ; 0x801267 2fc6c: 90 91 68 12 lds r25, 0x1268 ; 0x801268 2fc70: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 2fc74: 60 93 65 12 sts 0x1265, r22 ; 0x801265 2fc78: 70 93 66 12 sts 0x1266, r23 ; 0x801266 2fc7c: 80 93 67 12 sts 0x1267, r24 ; 0x801267 2fc80: 90 93 68 12 sts 0x1268, r25 ; 0x801268 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 2fc84: 60 e0 ldi r22, 0x00 ; 0 2fc86: 70 e0 ldi r23, 0x00 ; 0 2fc88: 80 ea ldi r24, 0xA0 ; 160 2fc8a: 91 e4 ldi r25, 0x41 ; 65 2fc8c: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 2fc90: 0f 94 94 18 call 0x23128 ; 0x23128 // 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)) 2fc94: 81 2f mov r24, r17 2fc96: 0e 94 aa f9 call 0x1f354 ; 0x1f354 2fc9a: e5 96 adiw r28, 0x35 ; 53 2fc9c: 8f af std Y+63, r24 ; 0x3f 2fc9e: e5 97 sbiw r28, 0x35 ; 53 2fca0: 81 11 cpse r24, r1 2fca2: 04 c0 rjmp .+8 ; 0x2fcac //! @param verbosity_level //! @retval true Succeeded //! @retval false Failed bool gcode_M45(bool onlyZ, int8_t verbosity_level) { bool final_result = false; 2fca4: e5 96 adiw r28, 0x35 ; 53 2fca6: 1f ae std Y+63, r1 ; 0x3f 2fca8: e5 97 sbiw r28, 0x35 ; 53 2fcaa: 6f c4 rjmp .+2270 ; 0x3058a { #else //TMC2130 if (lcd_calibrate_z_end_stop_manual(onlyZ)) { #endif //TMC2130 lcd_show_fullscreen_message_and_wait_P(_T(MSG_CONFIRM_NOZZLE_CLEAN)); 2fcac: 87 e4 ldi r24, 0x47 ; 71 2fcae: 92 e6 ldi r25, 0x62 ; 98 2fcb0: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2fcb4: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa if(onlyZ){ 2fcb8: 11 23 and r17, r17 2fcba: 09 f4 brne .+2 ; 0x2fcbe 2fcbc: 41 c4 rjmp .+2178 ; 0x30540 prompt_steel_sheet_on_bed(true); 2fcbe: 81 e0 ldi r24, 0x01 ; 1 2fcc0: 0e 94 21 e9 call 0x1d242 ; 0x1d242 lcd_display_message_fullscreen_P(_T(MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1)); 2fcc4: 85 e1 ldi r24, 0x15 ; 21 2fcc6: 92 e6 ldi r25, 0x62 ; 98 2fcc8: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2fccc: 0e 94 91 de call 0x1bd22 ; 0x1bd22 lcd_puts_at_P(0,3,_n("1/9")); 2fcd0: 46 e8 ldi r20, 0x86 ; 134 2fcd2: 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")); 2fcd4: 63 e0 ldi r22, 0x03 ; 3 2fcd6: 80 e0 ldi r24, 0x00 ; 0 2fcd8: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 } refresh_cmd_timeout(); 2fcdc: 0e 94 92 65 call 0xcb24 ; 0xcb24 if (((degHotend(0) > MAX_HOTEND_TEMP_CALIBRATION) || (degBed() > MAX_BED_TEMP_CALIBRATION)) && (!onlyZ)) { lcd_wait_for_cool_down(); } #endif //STEEL_SHEET if(!onlyZ) 2fce0: 11 11 cpse r17, r1 2fce2: 1b c0 rjmp .+54 ; 0x2fd1a { KEEPALIVE_STATE(PAUSED_FOR_USER); 2fce4: 84 e0 ldi r24, 0x04 ; 4 2fce6: 80 93 78 02 sts 0x0278, r24 ; 0x800278 prompt_steel_sheet_on_bed(false); 2fcea: 80 e0 ldi r24, 0x00 ; 0 2fcec: 0e 94 21 e9 call 0x1d242 ; 0x1d242 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PAPER)); 2fcf0: 8b e5 ldi r24, 0x5B ; 91 2fcf2: 91 e6 ldi r25, 0x61 ; 97 2fcf4: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2fcf8: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa KEEPALIVE_STATE(IN_HANDLER); 2fcfc: 82 e0 ldi r24, 0x02 ; 2 2fcfe: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_display_message_fullscreen_P(_T(MSG_FIND_BED_OFFSET_AND_SKEW_LINE1)); 2fd02: 83 ef ldi r24, 0xF3 ; 243 2fd04: 91 e6 ldi r25, 0x61 ; 97 2fd06: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2fd0a: 0e 94 91 de call 0x1bd22 ; 0x1bd22 lcd_puts_at_P(0,3,_n("1/4")); 2fd0e: 4e e7 ldi r20, 0x7E ; 126 2fd10: 5c e6 ldi r21, 0x6C ; 108 2fd12: 63 e0 ldi r22, 0x03 ; 3 2fd14: 80 e0 ldi r24, 0x00 ; 0 2fd16: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 return hit; } bool enable_endstops(bool check) { bool old = check_endstops; 2fd1a: 00 91 77 02 lds r16, 0x0277 ; 0x800277 <_ZL14check_endstops.lto_priv.385> check_endstops = check; 2fd1e: 10 92 77 02 sts 0x0277, r1 ; 0x800277 <_ZL14check_endstops.lto_priv.385> } bool endstops_enabled = enable_endstops(false); raise_z(-1); 2fd22: 60 e0 ldi r22, 0x00 ; 0 2fd24: 70 e0 ldi r23, 0x00 ; 0 2fd26: 80 e8 ldi r24, 0x80 ; 128 2fd28: 9f eb ldi r25, 0xBF ; 191 2fd2a: 0e 94 e5 6c call 0xd9ca ; 0xd9ca // Move the print head close to the bed. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 2fd2e: c1 2c mov r12, r1 2fd30: d1 2c mov r13, r1 2fd32: b0 ea ldi r27, 0xA0 ; 160 2fd34: eb 2e mov r14, r27 2fd36: b0 e4 ldi r27, 0x40 ; 64 2fd38: fb 2e mov r15, r27 2fd3a: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2fd3e: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2fd42: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2fd46: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c 2fd4a: 81 e0 ldi r24, 0x01 ; 1 2fd4c: 80 93 77 02 sts 0x0277, r24 ; 0x800277 <_ZL14check_endstops.lto_priv.385> enable_endstops(true); #ifdef TMC2130 tmc2130_home_enter(Z_AXIS_MASK); #endif //TMC2130 plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 2fd50: 60 e0 ldi r22, 0x00 ; 0 2fd52: 70 e0 ldi r23, 0x00 ; 0 2fd54: 80 ea ldi r24, 0xA0 ; 160 2fd56: 91 e4 ldi r25, 0x41 ; 65 2fd58: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 2fd5c: 0f 94 94 18 call 0x23128 ; 0x23128 2fd60: 00 93 77 02 sts 0x0277, r16 ; 0x800277 <_ZL14check_endstops.lto_priv.385> #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)) && 2fd64: 82 e0 ldi r24, 0x02 ; 2 2fd66: 0f 94 80 18 call 0x23100 ; 0x23100 2fd6a: 2d ec ldi r18, 0xCD ; 205 2fd6c: 3c ec ldi r19, 0xCC ; 204 2fd6e: 44 ea ldi r20, 0xA4 ; 164 2fd70: 50 e4 ldi r21, 0x40 ; 64 2fd72: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 2fd76: 18 16 cp r1, r24 2fd78: 0c f4 brge .+2 ; 0x2fd7c 2fd7a: eb c3 rjmp .+2006 ; 0x30552 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) 2fd7c: 82 e0 ldi r24, 0x02 ; 2 2fd7e: 0f 94 80 18 call 0x23100 ; 0x23100 #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)) && 2fd82: 23 e3 ldi r18, 0x33 ; 51 2fd84: 33 e3 ldi r19, 0x33 ; 51 2fd86: 4b e9 ldi r20, 0x9B ; 155 2fd88: 50 e4 ldi r21, 0x40 ; 64 2fd8a: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 2fd8e: 87 fd sbrc r24, 7 2fd90: e0 c3 rjmp .+1984 ; 0x30552 (st_get_position_mm(Z_AXIS) >= (MESH_HOME_Z_SEARCH - HOME_Z_SEARCH_THRESHOLD))) { if (onlyZ) 2fd92: 11 11 cpse r17, r1 2fd94: e3 c3 rjmp .+1990 ; 0x3055c } } else { // Reset the baby step value and the baby step applied flag. calibration_status_clear(CALIBRATION_STATUS_LIVE_ADJUST); 2fd96: 80 e1 ldi r24, 0x10 ; 16 2fd98: 0e 94 e1 d4 call 0x1a9c2 ; 0x1a9c2 eeprom_update_word_notify(reinterpret_cast(&(EEPROM_Sheets_base->s[(eeprom_read_byte(&(EEPROM_Sheets_base->active_sheet)))].z_offset)),0); 2fd9c: 81 ea ldi r24, 0xA1 ; 161 2fd9e: 9d e0 ldi r25, 0x0D ; 13 2fda0: 0f 94 81 a4 call 0x34902 ; 0x34902 2fda4: bb e0 ldi r27, 0x0B ; 11 2fda6: 8b 9f mul r24, r27 2fda8: c0 01 movw r24, r0 2fdaa: 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); 2fdac: 70 e0 ldi r23, 0x00 ; 0 2fdae: 60 e0 ldi r22, 0x00 ; 0 2fdb0: 80 5b subi r24, 0xB0 ; 176 2fdb2: 92 4f sbci r25, 0xF2 ; 242 2fdb4: 0f 94 c3 a4 call 0x34986 ; 0x34986 } 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(); 2fdb8: 0e 94 92 65 call 0xcb24 ; 0xcb24 // 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); 2fdbc: ea e0 ldi r30, 0x0A ; 10 2fdbe: f3 e1 ldi r31, 0x13 ; 19 2fdc0: 84 ec ldi r24, 0xC4 ; 196 2fdc2: df 01 movw r26, r30 2fdc4: 1d 92 st X+, r1 2fdc6: 8a 95 dec r24 2fdc8: e9 f7 brne .-6 ; 0x2fdc4 { #else //NEW_XYZCAL while (iteration < 3) { #endif //NEW_XYZCAL SERIAL_ECHOPGM("Iteration: "); 2fdca: 86 e2 ldi r24, 0x26 ; 38 2fdcc: 9d e9 ldi r25, 0x9D ; 157 2fdce: 0e 94 15 7b call 0xf62a ; 0xf62a MYSERIAL.println(int(iteration + 1)); 2fdd2: 81 e0 ldi r24, 0x01 ; 1 2fdd4: 90 e0 ldi r25, 0x00 ; 0 2fdd6: 0f 94 5d 65 call 0x2caba ; 0x2caba 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)); 2fdda: 83 ef ldi r24, 0xF3 ; 243 2fddc: 91 e6 ldi r25, 0x61 ; 97 2fdde: 0e 94 8b 75 call 0xeb16 ; 0xeb16 2fde2: 0e 94 91 de call 0x1bd22 ; 0x1bd22 #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; 2fde6: c0 92 69 12 sts 0x1269, r12 ; 0x801269 2fdea: d0 92 6a 12 sts 0x126A, r13 ; 0x80126a 2fdee: e0 92 6b 12 sts 0x126B, r14 ; 0x80126b 2fdf2: f0 92 6c 12 sts 0x126C, r15 ; 0x80126c 2fdf6: b2 e0 ldi r27, 0x02 ; 2 2fdf8: e1 96 adiw r28, 0x31 ; 49 2fdfa: bf af std Y+63, r27 ; 0x3f 2fdfc: e1 97 sbiw r28, 0x31 ; 49 2fdfe: 21 e0 ldi r18, 0x01 ; 1 2fe00: 3d e9 ldi r19, 0x9D ; 157 2fe02: cd 56 subi r28, 0x6D ; 109 2fe04: df 4f sbci r29, 0xFF ; 255 2fe06: 39 83 std Y+1, r19 ; 0x01 2fe08: 28 83 st Y, r18 2fe0a: c3 59 subi r28, 0x93 ; 147 2fe0c: d0 40 sbci r29, 0x00 ; 0 2fe0e: 49 e0 ldi r20, 0x09 ; 9 2fe10: 53 e1 ldi r21, 0x13 ; 19 2fe12: cf 56 subi r28, 0x6F ; 111 2fe14: df 4f sbci r29, 0xFF ; 255 2fe16: 59 83 std Y+1, r21 ; 0x01 2fe18: 48 83 st Y, r20 2fe1a: c1 59 subi r28, 0x91 ; 145 2fe1c: d0 40 sbci r29, 0x00 ; 0 2fe1e: a0 96 adiw r28, 0x20 ; 32 2fe20: 5f af std Y+63, r21 ; 0x3f 2fe22: 4e af std Y+62, r20 ; 0x3e 2fe24: a0 97 sbiw r28, 0x20 ; 32 2fe26: e0 96 adiw r28, 0x30 ; 48 2fe28: 3f af std Y+63, r19 ; 0x3f 2fe2a: 2e af std Y+62, r18 ; 0x3e 2fe2c: 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; 2fe2e: a7 96 adiw r28, 0x27 ; 39 2fe30: 1f ae std Y+63, r1 ; 0x3f 2fe32: a7 97 sbiw r28, 0x27 ; 39 for (int k = 0; k < 4; ++k) { 2fe34: 31 2c mov r3, r1 2fe36: 21 2c mov r2, r1 // Don't let the manage_inactivity() function remove power from the motors. refresh_cmd_timeout(); 2fe38: 0e 94 92 65 call 0xcb24 ; 0xcb24 #ifdef MESH_BED_CALIBRATION_SHOW_LCD lcd_set_cursor(0, 3); 2fe3c: 63 e0 ldi r22, 0x03 ; 3 2fe3e: 80 e0 ldi r24, 0x00 ; 0 2fe40: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_printf_P(PSTR("%d/4"),(k+1)); 2fe44: bf ef ldi r27, 0xFF ; 255 2fe46: 2b 1a sub r2, r27 2fe48: 3b 0a sbc r3, r27 2fe4a: 3f 92 push r3 2fe4c: 2f 92 push r2 2fe4e: e1 e2 ldi r30, 0x21 ; 33 2fe50: fd e9 ldi r31, 0x9D ; 157 2fe52: ff 93 push r31 2fe54: ef 93 push r30 2fe56: 0e 94 5c 6f call 0xdeb8 ; 0xdeb8 } #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); 2fe5a: 65 e5 ldi r22, 0x55 ; 85 2fe5c: 75 e5 ldi r23, 0x55 ; 85 2fe5e: 85 e5 ldi r24, 0x55 ; 85 2fe60: 91 e4 ldi r25, 0x41 ; 65 2fe62: 0f 94 82 4e call 0x29d04 ; 0x29d04 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); 2fe66: e0 96 adiw r28, 0x30 ; 48 2fe68: ee ad ldd r30, Y+62 ; 0x3e 2fe6a: ff ad ldd r31, Y+63 ; 0x3f 2fe6c: e0 97 sbiw r28, 0x30 ; 48 2fe6e: 85 91 lpm r24, Z+ 2fe70: 95 91 lpm r25, Z+ 2fe72: a5 91 lpm r26, Z+ 2fe74: b4 91 lpm r27, Z 2fe76: 80 93 61 12 sts 0x1261, r24 ; 0x801261 2fe7a: 90 93 62 12 sts 0x1262, r25 ; 0x801262 2fe7e: a0 93 63 12 sts 0x1263, r26 ; 0x801263 2fe82: b0 93 64 12 sts 0x1264, r27 ; 0x801264 current_position[Y_AXIS] = pgm_read_float(bed_ref_points_4 + k * 2 + 1); 2fe86: e0 96 adiw r28, 0x30 ; 48 2fe88: ee ad ldd r30, Y+62 ; 0x3e 2fe8a: ff ad ldd r31, Y+63 ; 0x3f 2fe8c: e0 97 sbiw r28, 0x30 ; 48 2fe8e: 34 96 adiw r30, 0x04 ; 4 2fe90: 85 91 lpm r24, Z+ 2fe92: 95 91 lpm r25, Z+ 2fe94: a5 91 lpm r26, Z+ 2fe96: b4 91 lpm r27, Z 2fe98: 80 93 65 12 sts 0x1265, r24 ; 0x801265 2fe9c: 90 93 66 12 sts 0x1266, r25 ; 0x801266 2fea0: a0 93 67 12 sts 0x1267, r26 ; 0x801267 2fea4: 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); 2fea8: 60 e0 ldi r22, 0x00 ; 0 2feaa: 70 e0 ldi r23, 0x00 ; 0 2feac: 88 e4 ldi r24, 0x48 ; 72 2feae: 92 e4 ldi r25, 0x42 ; 66 2feb0: 0f 94 82 4e call 0x29d04 ; 0x29d04 return pos * 0.01f; } void xyzcal_measure_enter(void) { DBG(_n("xyzcal_measure_enter\n")); 2feb4: 46 e8 ldi r20, 0x86 ; 134 2feb6: 5b e9 ldi r21, 0x9B ; 155 2feb8: 5f 93 push r21 2feba: 4f 93 push r20 2febc: 0f 94 43 a3 call 0x34686 ; 0x34686 lcd_puts_at_P(4,3,PSTR("Measure center ")); ////MSG_MEASURE_CENTER c=16 2fec0: 45 e7 ldi r20, 0x75 ; 117 2fec2: 5b e9 ldi r21, 0x9B ; 155 2fec4: 63 e0 ldi r22, 0x03 ; 3 2fec6: 84 e0 ldi r24, 0x04 ; 4 2fec8: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 // disable heaters and stop motion before we initialize sm4 disable_heater(); 2fecc: 0f 94 9e 0e call 0x21d3c ; 0x21d3c st_synchronize(); 2fed0: 0f 94 94 18 call 0x23128 ; 0x23128 // disable incompatible interrupts DISABLE_STEPPER_DRIVER_INTERRUPT(); 2fed4: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 2fed8: 8d 7f andi r24, 0xFD ; 253 2feda: 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" ); 2fede: 0f b6 in r0, 0x3f ; 63 2fee0: f8 94 cli 2fee2: a8 95 wdr 2fee4: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2fee8: 88 61 ori r24, 0x18 ; 24 2feea: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2feee: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 2fef2: 0f be out 0x3f, r0 ; 63 #ifdef WATCHDOG wdt_disable(); #endif //WATCHDOG // setup internal callbacks sm4_stop_cb = 0; 2fef4: 10 92 25 06 sts 0x0625, r1 ; 0x800625 2fef8: 10 92 24 06 sts 0x0624, r1 ; 0x800624 sm4_update_pos_cb = xyzcal_update_pos; 2fefc: 85 e4 ldi r24, 0x45 ; 69 2fefe: 9b eb ldi r25, 0xBB ; 187 2ff00: 90 93 23 06 sts 0x0623, r25 ; 0x800623 2ff04: 80 93 22 06 sts 0x0622, r24 ; 0x800622 sm4_calc_delay_cb = xyzcal_calc_delay; 2ff08: a0 e4 ldi r26, 0x40 ; 64 2ff0a: bb eb ldi r27, 0xBB ; 187 2ff0c: b0 93 21 06 sts 0x0621, r27 ; 0x800621 2ff10: 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]); 2ff14: 00 91 54 06 lds r16, 0x0654 ; 0x800654 2ff18: 10 91 55 06 lds r17, 0x0655 ; 0x800655 2ff1c: 20 91 56 06 lds r18, 0x0656 ; 0x800656 2ff20: 30 91 57 06 lds r19, 0x0657 ; 0x800657 2ff24: 40 91 50 06 lds r20, 0x0650 ; 0x800650 2ff28: 50 91 51 06 lds r21, 0x0651 ; 0x800651 2ff2c: 60 91 52 06 lds r22, 0x0652 ; 0x800652 2ff30: 70 91 53 06 lds r23, 0x0653 ; 0x800653 2ff34: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 2ff38: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 2ff3c: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 2ff40: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 2ff44: 3f 93 push r19 2ff46: 2f 93 push r18 2ff48: 1f 93 push r17 2ff4a: 0f 93 push r16 2ff4c: 7f 93 push r23 2ff4e: 6f 93 push r22 2ff50: 5f 93 push r21 2ff52: 4f 93 push r20 2ff54: bf 93 push r27 2ff56: af 93 push r26 2ff58: 9f 93 push r25 2ff5a: 8f 93 push r24 2ff5c: e5 e2 ldi r30, 0x25 ; 37 2ff5e: fc e9 ldi r31, 0x9C ; 156 2ff60: ff 93 push r31 2ff62: ef 93 push r30 2ff64: 0f 94 43 a3 call 0x34686 ; 0x34686 int16_t x0 = _X; 2ff68: 40 90 4c 06 lds r4, 0x064C ; 0x80064c 2ff6c: 50 90 4d 06 lds r5, 0x064D ; 0x80064d 2ff70: 60 90 4e 06 lds r6, 0x064E ; 0x80064e 2ff74: 70 90 4f 06 lds r7, 0x064F ; 0x80064f 2ff78: b4 2c mov r11, r4 2ff7a: a5 2c mov r10, r5 int16_t y0 = _Y; 2ff7c: 80 91 50 06 lds r24, 0x0650 ; 0x800650 2ff80: 90 91 51 06 lds r25, 0x0651 ; 0x800651 2ff84: a0 91 52 06 lds r26, 0x0652 ; 0x800652 2ff88: b0 91 53 06 lds r27, 0x0653 ; 0x800653 2ff8c: a6 96 adiw r28, 0x26 ; 38 2ff8e: 8c af std Y+60, r24 ; 0x3c 2ff90: 9d af std Y+61, r25 ; 0x3d 2ff92: ae af std Y+62, r26 ; 0x3e 2ff94: bf af std Y+63, r27 ; 0x3f 2ff96: a6 97 sbiw r28, 0x26 ; 38 2ff98: a3 96 adiw r28, 0x23 ; 35 2ff9a: 9f ac ldd r9, Y+63 ; 0x3f 2ff9c: a3 97 sbiw r28, 0x23 ; 35 2ff9e: a4 96 adiw r28, 0x24 ; 36 2ffa0: 8f ac ldd r8, Y+63 ; 0x3f 2ffa2: a4 97 sbiw r28, 0x24 ; 36 int16_t z = _Z; 2ffa4: c0 90 54 06 lds r12, 0x0654 ; 0x800654 2ffa8: d0 90 55 06 lds r13, 0x0655 ; 0x800655 2ffac: e0 90 56 06 lds r14, 0x0656 ; 0x800656 2ffb0: f0 90 57 06 lds r15, 0x0657 ; 0x800657 2ffb4: 0f b6 in r0, 0x3f ; 63 2ffb6: f8 94 cli 2ffb8: de bf out 0x3e, r29 ; 62 2ffba: 0f be out 0x3f, r0 ; 63 2ffbc: cd bf out 0x3d, r28 ; 61 // int16_t min_z = -6000; // int16_t dz = 100; while (z > -2300) { //-6mm + 0.25mm 2ffbe: b5 e0 ldi r27, 0x05 ; 5 2ffc0: cb 16 cp r12, r27 2ffc2: b7 ef ldi r27, 0xF7 ; 247 2ffc4: db 06 cpc r13, r27 2ffc6: 0c f4 brge .+2 ; 0x2ffca 2ffc8: 3a c3 rjmp .+1652 ; 0x3063e } 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; 2ffca: 1a 82 std Y+2, r1 ; 0x02 2ffcc: 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); 2ffce: 1f 92 push r1 2ffd0: 1f 92 push r1 2ffd2: e3 e0 ldi r30, 0x03 ; 3 2ffd4: ef 93 push r30 2ffd6: f4 e8 ldi r31, 0x84 ; 132 2ffd8: ff 93 push r31 2ffda: 1f 92 push r1 2ffdc: 24 e6 ldi r18, 0x64 ; 100 2ffde: 2f 93 push r18 2ffe0: df 92 push r13 2ffe2: cf 92 push r12 2ffe4: 8f 92 push r8 2ffe6: 9f 92 push r9 2ffe8: af 92 push r10 2ffea: bf 92 push r11 2ffec: 4c e9 ldi r20, 0x9C ; 156 2ffee: 5b e9 ldi r21, 0x9B ; 155 2fff0: 5f 93 push r21 2fff2: 4f 93 push r20 2fff4: 0f 94 43 a3 call 0x34686 ; 0x34686 if (!ret && (ad < 720)) 2fff8: 0f b6 in r0, 0x3f ; 63 2fffa: f8 94 cli 2fffc: de bf out 0x3e, r29 ; 62 2fffe: 0f be out 0x3f, r0 ; 63 30000: cd bf out 0x3d, r28 ; 61 30002: 89 81 ldd r24, Y+1 ; 0x01 30004: 9a 81 ldd r25, Y+2 ; 0x02 30006: 80 3d cpi r24, 0xD0 ; 208 30008: 92 40 sbci r25, 0x02 ; 2 3000a: 08 f4 brcc .+2 ; 0x3000e 3000c: e3 c2 rjmp .+1478 ; 0x305d4 if ((ret = xyzcal_spiral2(cx, cy, z0 - 0*dz, dz, radius, 0, delay_us, check_pinda, &ad)) != 0) ad += 0; if (!ret && (ad < 1440)) 3000e: 89 81 ldd r24, Y+1 ; 0x01 30010: 9a 81 ldd r25, Y+2 ; 0x02 30012: 80 3a cpi r24, 0xA0 ; 160 30014: 95 40 sbci r25, 0x05 ; 5 30016: 10 f0 brcs .+4 ; 0x3001c 30018: 0d 94 f4 8e jmp 0x31de8 ; 0x31de8 if ((ret = xyzcal_spiral2(cx, cy, z0 - 1*dz, dz, -radius, 0, delay_us, check_pinda, &ad)) != 0) 3001c: 9e 01 movw r18, r28 3001e: 2f 5f subi r18, 0xFF ; 255 30020: 3f 4f sbci r19, 0xFF ; 255 30022: 79 01 movw r14, r18 30024: 10 e0 ldi r17, 0x00 ; 0 30026: 00 e0 ldi r16, 0x00 ; 0 30028: 2c e7 ldi r18, 0x7C ; 124 3002a: 3c ef ldi r19, 0xFC ; 252 3002c: a6 01 movw r20, r12 3002e: 44 56 subi r20, 0x64 ; 100 30030: 51 09 sbc r21, r1 30032: 69 2d mov r22, r9 30034: 78 2d mov r23, r8 30036: 8b 2d mov r24, r11 30038: 9a 2d mov r25, r10 3003a: 0f 94 13 5f call 0x2be26 ; 0x2be26 3003e: 88 23 and r24, r24 30040: 11 f4 brne .+4 ; 0x30046 30042: 0d 94 f4 8e jmp 0x31de8 ; 0x31de8 ad += 720; 30046: 89 81 ldd r24, Y+1 ; 0x01 30048: 9a 81 ldd r25, Y+2 ; 0x02 3004a: 80 53 subi r24, 0x30 ; 48 3004c: 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); 3004e: c0 90 54 06 lds r12, 0x0654 ; 0x800654 30052: d0 90 55 06 lds r13, 0x0655 ; 0x800655 30056: e0 90 56 06 lds r14, 0x0656 ; 0x800656 3005a: f0 90 57 06 lds r15, 0x0657 ; 0x800657 3005e: 00 91 50 06 lds r16, 0x0650 ; 0x800650 30062: 10 91 51 06 lds r17, 0x0651 ; 0x800651 30066: 20 91 52 06 lds r18, 0x0652 ; 0x800652 3006a: 30 91 53 06 lds r19, 0x0653 ; 0x800653 3006e: 40 91 4c 06 lds r20, 0x064C ; 0x80064c 30072: 50 91 4d 06 lds r21, 0x064D ; 0x80064d 30076: 60 91 4e 06 lds r22, 0x064E ; 0x80064e 3007a: 70 91 4f 06 lds r23, 0x064F ; 0x80064f 3007e: 9f 93 push r25 30080: 8f 93 push r24 30082: df 92 push r13 30084: cf 92 push r12 30086: 1f 93 push r17 30088: 0f 93 push r16 3008a: 5f 93 push r21 3008c: 4f 93 push r20 3008e: 81 e0 ldi r24, 0x01 ; 1 30090: 9c e9 ldi r25, 0x9C ; 156 30092: 9f 93 push r25 30094: 8f 93 push r24 30096: 0f 94 43 a3 call 0x34686 ; 0x34686 /// 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); 3009a: 40 91 54 06 lds r20, 0x0654 ; 0x800654 3009e: 50 91 55 06 lds r21, 0x0655 ; 0x800655 300a2: 60 91 56 06 lds r22, 0x0656 ; 0x800656 300a6: 70 91 57 06 lds r23, 0x0657 ; 0x800657 300aa: 48 54 subi r20, 0x48 ; 72 300ac: 51 09 sbc r21, r1 300ae: 00 e0 ldi r16, 0x00 ; 0 300b0: 28 ec ldi r18, 0xC8 ; 200 300b2: 30 e0 ldi r19, 0x00 ; 0 300b4: a3 96 adiw r28, 0x23 ; 35 300b6: 6f ad ldd r22, Y+63 ; 0x3f 300b8: a3 97 sbiw r28, 0x23 ; 35 300ba: a4 96 adiw r28, 0x24 ; 36 300bc: 7f ad ldd r23, Y+63 ; 0x3f 300be: a4 97 sbiw r28, 0x24 ; 36 300c0: c2 01 movw r24, r4 300c2: 0e 94 b7 d3 call 0x1a76e ; 0x1a76e /// 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; 300c6: 20 91 4c 06 lds r18, 0x064C ; 0x80064c 300ca: 30 91 4d 06 lds r19, 0x064D ; 0x80064d 300ce: 40 91 4e 06 lds r20, 0x064E ; 0x80064e 300d2: 50 91 4f 06 lds r21, 0x064F ; 0x80064f 300d6: 6e 96 adiw r28, 0x1e ; 30 300d8: 2c af std Y+60, r18 ; 0x3c 300da: 3d af std Y+61, r19 ; 0x3d 300dc: 4e af std Y+62, r20 ; 0x3e 300de: 5f af std Y+63, r21 ; 0x3f 300e0: 6e 97 sbiw r28, 0x1e ; 30 int16_t y = _Y; 300e2: 80 91 50 06 lds r24, 0x0650 ; 0x800650 300e6: 90 91 51 06 lds r25, 0x0651 ; 0x800651 300ea: a0 91 52 06 lds r26, 0x0652 ; 0x800652 300ee: b0 91 53 06 lds r27, 0x0653 ; 0x800653 300f2: ae 96 adiw r28, 0x2e ; 46 300f4: 8c af std Y+60, r24 ; 0x3c 300f6: 9d af std Y+61, r25 ; 0x3d 300f8: ae af std Y+62, r26 ; 0x3e 300fa: bf af std Y+63, r27 ; 0x3f 300fc: ae 97 sbiw r28, 0x2e ; 46 const int16_t z = _Z; 300fe: 20 91 54 06 lds r18, 0x0654 ; 0x800654 30102: 30 91 55 06 lds r19, 0x0655 ; 0x800655 30106: 40 91 56 06 lds r20, 0x0656 ; 0x800656 3010a: 50 91 57 06 lds r21, 0x0657 ; 0x800657 3010e: e9 96 adiw r28, 0x39 ; 57 30110: 2c af std Y+60, r18 ; 0x3c 30112: 3d af std Y+61, r19 ; 0x3d 30114: 4e af std Y+62, r20 ; 0x3e 30116: 5f af std Y+63, r21 ; 0x3f 30118: e9 97 sbiw r28, 0x39 ; 57 3011a: ae e5 ldi r26, 0x5E ; 94 3011c: ba e0 ldi r27, 0x0A ; 10 3011e: 0f b6 in r0, 0x3f ; 63 30120: f8 94 cli 30122: de bf out 0x3e, r29 ; 62 30124: 0f be out 0x3f, r0 ; 63 30126: cd bf out 0x3d, r28 ; 61 30128: 90 e0 ldi r25, 0x00 ; 0 3012a: 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)); 3012c: fc 01 movw r30, r24 3012e: e4 56 subi r30, 0x64 ; 100 30130: f3 46 sbci r31, 0x63 ; 99 30132: 25 91 lpm r18, Z+ 30134: 34 91 lpm r19, Z 30136: 2d 93 st X+, r18 30138: 3d 93 st X+, r19 pattern10[i] = pgm_read_word((uint16_t*)(xyzcal_point_pattern_10 + i)); 3013a: fc 01 movw r30, r24 3013c: ec 57 subi r30, 0x7C ; 124 3013e: f3 46 sbci r31, 0x63 ; 99 30140: 25 91 lpm r18, Z+ 30142: 34 91 lpm r19, Z 30144: 57 96 adiw r26, 0x17 ; 23 30146: 3c 93 st X, r19 30148: 2e 93 st -X, r18 3014a: 56 97 sbiw r26, 0x16 ; 22 3014c: 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++){ 3014e: 88 31 cpi r24, 0x18 ; 24 30150: 91 05 cpc r25, r1 30152: 61 f7 brne .-40 ; 0x3012c 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); 30154: e7 96 adiw r28, 0x37 ; 55 30156: 4e ad ldd r20, Y+62 ; 0x3e 30158: 5f ad ldd r21, Y+63 ; 0x3f 3015a: e7 97 sbiw r28, 0x37 ; 55 3015c: ac 96 adiw r28, 0x2c ; 44 3015e: 6e ad ldd r22, Y+62 ; 0x3e 30160: 7f ad ldd r23, Y+63 ; 0x3f 30162: ac 97 sbiw r28, 0x2c ; 44 30164: 6c 96 adiw r28, 0x1c ; 28 30166: 8e ad ldd r24, Y+62 ; 0x3e 30168: 9f ad ldd r25, Y+63 ; 0x3f 3016a: 6c 97 sbiw r28, 0x1c ; 28 3016c: 0f 94 4f 60 call 0x2c09e ; 0x2c09e 30170: 2e e5 ldi r18, 0x5E ; 94 30172: 36 e0 ldi r19, 0x06 ; 6 30174: a4 96 adiw r28, 0x24 ; 36 30176: 3f af std Y+63, r19 ; 0x3f 30178: 2e af std Y+62, r18 ; 0x3e 3017a: a4 97 sbiw r28, 0x24 ; 36 3017c: 79 01 movw r14, r18 3017e: f0 e2 ldi r31, 0x20 ; 32 30180: 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]); 30182: a7 e4 ldi r26, 0x47 ; 71 30184: ca 2e mov r12, r26 30186: ac e9 ldi r26, 0x9C ; 156 30188: da 2e mov r13, r26 } DBG(endl); 3018a: 0c e9 ldi r16, 0x9C ; 156 3018c: 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); 3018e: 57 01 movw r10, r14 30190: e0 e2 ldi r30, 0x20 ; 32 30192: 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]); 30194: d5 01 movw r26, r10 30196: 8d 91 ld r24, X+ 30198: 5d 01 movw r10, r26 3019a: 1f 92 push r1 3019c: 8f 93 push r24 3019e: df 92 push r13 301a0: cf 92 push r12 301a2: 0f 94 43 a3 call 0x34686 ; 0x34686 301a6: 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){ 301a8: 0f 90 pop r0 301aa: 0f 90 pop r0 301ac: 0f 90 pop r0 301ae: 0f 90 pop r0 301b0: 81 10 cpse r8, r1 301b2: f0 cf rjmp .-32 ; 0x30194 DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); 301b4: 1f 93 push r17 301b6: 0f 93 push r16 301b8: 0f 94 43 a3 call 0x34686 ; 0x34686 301bc: 9a 94 dec r9 301be: b0 e2 ldi r27, 0x20 ; 32 301c0: eb 0e add r14, r27 301c2: 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){ 301c4: 0f 90 pop r0 301c6: 0f 90 pop r0 301c8: 91 10 cpse r9, r1 301ca: e1 cf rjmp .-62 ; 0x3018e for (uint8_t x = 0; x < 32; ++x){ DBG(_n("%02x"), matrix_32x32[idx_y + x]); } DBG(endl); } DBG(endl); 301cc: 1f 93 push r17 301ce: 0f 93 push r16 301d0: 0f 94 43 a3 call 0x34686 ; 0x34686 301d4: 6e e5 ldi r22, 0x5E ; 94 301d6: 7a e0 ldi r23, 0x0A ; 10 301d8: 0f 90 pop r0 301da: 0f 90 pop r0 301dc: ee e5 ldi r30, 0x5E ; 94 301de: 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; 301e0: 90 e0 ldi r25, 0x00 ; 0 301e2: 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; 301e4: 50 e0 ldi r21, 0x00 ; 0 301e6: 40 e0 ldi r20, 0x00 ; 0 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { 301e8: 21 91 ld r18, Z+ 301ea: 21 11 cpse r18, r1 301ec: 67 c4 rjmp .+2254 ; 0x30abc ++mins; 301ee: 4f 5f subi r20, 0xFF ; 255 301f0: 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){ 301f2: 6e 17 cp r22, r30 301f4: 7f 07 cpc r23, r31 301f6: c1 f7 brne .-16 ; 0x301e8 ++maxs; } } const int16_t rest = 1024 - mins - maxs; if (mins + maxs > threshold_total 301f8: 9a 01 movw r18, r20 301fa: 28 0f add r18, r24 301fc: 39 1f adc r19, r25 301fe: 25 38 cpi r18, 0x85 ; 133 30200: 33 40 sbci r19, 0x03 ; 3 30202: a4 f0 brlt .+40 ; 0x3022c && mins > threshold_extreme 30204: 43 33 cpi r20, 0x33 ; 51 30206: 51 05 cpc r21, r1 30208: 8c f0 brlt .+34 ; 0x3022c && maxs > threshold_extreme 3020a: 83 33 cpi r24, 0x33 ; 51 3020c: 91 05 cpc r25, r1 3020e: 74 f0 brlt .+28 ; 0x3022c ++mins; } else if (matrix32[i] == 0xFF){ ++maxs; } } const int16_t rest = 1024 - mins - maxs; 30210: 20 e0 ldi r18, 0x00 ; 0 30212: 34 e0 ldi r19, 0x04 ; 4 30214: 24 1b sub r18, r20 30216: 35 0b sbc r19, r21 30218: 28 1b sub r18, r24 3021a: 39 0b sbc r19, r25 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest 3021c: 24 17 cp r18, r20 3021e: 35 07 cpc r19, r21 30220: 2c f4 brge .+10 ; 0x3022c } 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; 30222: 1d ef ldi r17, 0xFD ; 253 if (mins + maxs > threshold_total && mins > threshold_extreme && maxs > threshold_extreme && mins > rest && maxs > rest) 30224: 28 17 cp r18, r24 30226: 39 07 cpc r19, r25 30228: 0c f4 brge .+2 ; 0x3022c 3022a: 39 c2 rjmp .+1138 ; 0x3069e } /// 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; 3022c: 66 96 adiw r28, 0x16 ; 22 3022e: 1f ae std Y+63, r1 ; 0x3f 30230: 66 97 sbiw r28, 0x16 ; 22 uint8_t r08 = 0; 30232: 62 96 adiw r28, 0x12 ; 18 30234: 1f ae std Y+63, r1 ; 0x3f 30236: 62 97 sbiw r28, 0x12 ; 18 uint8_t match08 = 0; uint8_t c10 = 0; 30238: 22 96 adiw r28, 0x02 ; 2 3023a: 1f ae std Y+63, r1 ; 0x3f 3023c: 22 97 sbiw r28, 0x02 ; 2 uint8_t r10 = 0; 3023e: 19 82 std Y+1, r1 ; 0x01 30240: ae 01 movw r20, r28 30242: 4f 5a subi r20, 0xAF ; 175 30244: 5f 4f sbci r21, 0xFF ; 255 30246: be 01 movw r22, r28 30248: 6b 5a subi r22, 0xAB ; 171 3024a: 7f 4f sbci r23, 0xFF ; 255 3024c: 8e e5 ldi r24, 0x5E ; 94 3024e: 9a e0 ldi r25, 0x0A ; 10 30250: 0f 94 38 58 call 0x2b070 ; 0x2b070 30254: 08 2f mov r16, r24 30256: ae 01 movw r20, r28 30258: 4f 5f subi r20, 0xFF ; 255 3025a: 5f 4f sbci r21, 0xFF ; 255 3025c: be 01 movw r22, r28 3025e: 6f 5b subi r22, 0xBF ; 191 30260: 7f 4f sbci r23, 0xFF ; 255 30262: 86 e7 ldi r24, 0x76 ; 118 30264: 9a e0 ldi r25, 0x0A ; 10 30266: 0f 94 38 58 call 0x2b070 ; 0x2b070 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; 3026a: 66 96 adiw r28, 0x16 ; 22 3026c: 6f ad ldd r22, Y+63 ; 0x3f 3026e: 66 97 sbiw r28, 0x16 ; 22 row = r08; 30270: 62 96 adiw r28, 0x12 ; 18 30272: 1f ad ldd r17, Y+63 ; 0x3f 30274: 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){ 30276: 80 17 cp r24, r16 30278: 28 f0 brcs .+10 ; 0x30284 col = c08; row = r08; return match08; } col = c10; 3027a: 22 96 adiw r28, 0x02 ; 2 3027c: 6f ad ldd r22, Y+63 ; 0x3f 3027e: 22 97 sbiw r28, 0x02 ; 2 row = r10; 30280: 19 81 ldd r17, Y+1 ; 0x01 30282: 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){ 30284: 08 35 cpi r16, 0x58 ; 88 30286: 08 f4 brcc .+2 ; 0x3028a 30288: 1e c4 rjmp .+2108 ; 0x30ac6 /// find precise circle /// move to the center of the pattern (+5.5) float xf = uc + 5.5f; 3028a: 70 e0 ldi r23, 0x00 ; 0 3028c: 90 e0 ldi r25, 0x00 ; 0 3028e: 80 e0 ldi r24, 0x00 ; 0 30290: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 30294: 20 e0 ldi r18, 0x00 ; 0 30296: 30 e0 ldi r19, 0x00 ; 0 30298: 40 eb ldi r20, 0xB0 ; 176 3029a: 50 e4 ldi r21, 0x40 ; 64 3029c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 302a0: 2b 01 movw r4, r22 302a2: 3c 01 movw r6, r24 302a4: 65 96 adiw r28, 0x15 ; 21 302a6: 4c ae std Y+60, r4 ; 0x3c 302a8: 5d ae std Y+61, r5 ; 0x3d 302aa: 6e ae std Y+62, r6 ; 0x3e 302ac: 7f ae std Y+63, r7 ; 0x3f 302ae: 65 97 sbiw r28, 0x15 ; 21 float yf = ur + 5.5f; 302b0: 61 2f mov r22, r17 302b2: 70 e0 ldi r23, 0x00 ; 0 302b4: 90 e0 ldi r25, 0x00 ; 0 302b6: 80 e0 ldi r24, 0x00 ; 0 302b8: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 302bc: 20 e0 ldi r18, 0x00 ; 0 302be: 30 e0 ldi r19, 0x00 ; 0 302c0: 40 eb ldi r20, 0xB0 ; 176 302c2: 50 e4 ldi r21, 0x40 ; 64 302c4: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 302c8: 4b 01 movw r8, r22 302ca: 5c 01 movw r10, r24 302cc: 25 96 adiw r28, 0x05 ; 5 302ce: 8c ae std Y+60, r8 ; 0x3c 302d0: 9d ae std Y+61, r9 ; 0x3d 302d2: ae ae std Y+62, r10 ; 0x3e 302d4: bf ae std Y+63, r11 ; 0x3f 302d6: 25 97 sbiw r28, 0x05 ; 5 float radius = 4.5f; ///< default radius 302d8: 20 e0 ldi r18, 0x00 ; 0 302da: 30 e0 ldi r19, 0x00 ; 0 302dc: 40 e9 ldi r20, 0x90 ; 144 302de: 50 e4 ldi r21, 0x40 ; 64 302e0: 29 83 std Y+1, r18 ; 0x01 302e2: 3a 83 std Y+2, r19 ; 0x02 302e4: 4b 83 std Y+3, r20 ; 0x03 302e6: 5c 83 std Y+4, r21 ; 0x04 constexpr const uint8_t iterations = 20; dynamic_circle(matrix32, xf, yf, radius, iterations); 302e8: ae 01 movw r20, r28 302ea: 4f 5f subi r20, 0xFF ; 255 302ec: 5f 4f sbci r21, 0xFF ; 255 302ee: be 01 movw r22, r28 302f0: 6f 5b subi r22, 0xBF ; 191 302f2: 7f 4f sbci r23, 0xFF ; 255 302f4: ce 01 movw r24, r28 302f6: 8f 5a subi r24, 0xAF ; 175 302f8: 9f 4f sbci r25, 0xFF ; 255 302fa: 0f 94 93 5b call 0x2b726 ; 0x2b726 if (fabs(xf - (uc + 5.5f)) > 3 || fabs(yf - (ur + 5.5f)) > 3 || fabs(radius - 5) > 3){ 302fe: a3 01 movw r20, r6 30300: 92 01 movw r18, r4 30302: 65 96 adiw r28, 0x15 ; 21 30304: 6c ad ldd r22, Y+60 ; 0x3c 30306: 7d ad ldd r23, Y+61 ; 0x3d 30308: 8e ad ldd r24, Y+62 ; 0x3e 3030a: 9f ad ldd r25, Y+63 ; 0x3f 3030c: 65 97 sbiw r28, 0x15 ; 21 3030e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 30312: 6b 01 movw r12, r22 30314: 7c 01 movw r14, r24 30316: 9f 77 andi r25, 0x7F ; 127 30318: 20 e0 ldi r18, 0x00 ; 0 3031a: 30 e0 ldi r19, 0x00 ; 0 3031c: 40 e4 ldi r20, 0x40 ; 64 3031e: 50 e4 ldi r21, 0x40 ; 64 30320: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 30324: 18 16 cp r1, r24 30326: 34 f1 brlt .+76 ; 0x30374 30328: a5 01 movw r20, r10 3032a: 94 01 movw r18, r8 3032c: 25 96 adiw r28, 0x05 ; 5 3032e: 6c ad ldd r22, Y+60 ; 0x3c 30330: 7d ad ldd r23, Y+61 ; 0x3d 30332: 8e ad ldd r24, Y+62 ; 0x3e 30334: 9f ad ldd r25, Y+63 ; 0x3f 30336: 25 97 sbiw r28, 0x05 ; 5 30338: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 3033c: 9f 77 andi r25, 0x7F ; 127 3033e: 20 e0 ldi r18, 0x00 ; 0 30340: 30 e0 ldi r19, 0x00 ; 0 30342: 40 e4 ldi r20, 0x40 ; 64 30344: 50 e4 ldi r21, 0x40 ; 64 30346: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 3034a: 18 16 cp r1, r24 3034c: 9c f0 brlt .+38 ; 0x30374 3034e: 20 e0 ldi r18, 0x00 ; 0 30350: 30 e0 ldi r19, 0x00 ; 0 30352: 40 ea ldi r20, 0xA0 ; 160 30354: 50 e4 ldi r21, 0x40 ; 64 30356: 69 81 ldd r22, Y+1 ; 0x01 30358: 7a 81 ldd r23, Y+2 ; 0x02 3035a: 8b 81 ldd r24, Y+3 ; 0x03 3035c: 9c 81 ldd r25, Y+4 ; 0x04 3035e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 30362: 9f 77 andi r25, 0x7F ; 127 30364: 20 e0 ldi r18, 0x00 ; 0 30366: 30 e0 ldi r19, 0x00 ; 0 30368: 40 e4 ldi r20, 0x40 ; 64 3036a: 50 e4 ldi r21, 0x40 ; 64 3036c: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 30370: 18 16 cp r1, r24 30372: bc f5 brge .+110 ; 0x303e2 //@size=88 DBG(_n(" [%f %f][%f] mm divergence\n"), xf - (uc + 5.5f), yf - (ur + 5.5f), radius - 5); 30374: 20 e0 ldi r18, 0x00 ; 0 30376: 30 e0 ldi r19, 0x00 ; 0 30378: 40 ea ldi r20, 0xA0 ; 160 3037a: 50 e4 ldi r21, 0x40 ; 64 3037c: 69 81 ldd r22, Y+1 ; 0x01 3037e: 7a 81 ldd r23, Y+2 ; 0x02 30380: 8b 81 ldd r24, Y+3 ; 0x03 30382: 9c 81 ldd r25, Y+4 ; 0x04 30384: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 30388: 9f 93 push r25 3038a: 8f 93 push r24 3038c: 7f 93 push r23 3038e: 6f 93 push r22 30390: a5 01 movw r20, r10 30392: 94 01 movw r18, r8 30394: 25 96 adiw r28, 0x05 ; 5 30396: 6c ad ldd r22, Y+60 ; 0x3c 30398: 7d ad ldd r23, Y+61 ; 0x3d 3039a: 8e ad ldd r24, Y+62 ; 0x3e 3039c: 9f ad ldd r25, Y+63 ; 0x3f 3039e: 25 97 sbiw r28, 0x05 ; 5 303a0: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 303a4: 9f 93 push r25 303a6: 8f 93 push r24 303a8: 7f 93 push r23 303aa: 6f 93 push r22 303ac: ff 92 push r15 303ae: ef 92 push r14 303b0: df 92 push r13 303b2: cf 92 push r12 303b4: 88 e6 ldi r24, 0x68 ; 104 303b6: 9c e9 ldi r25, 0x9C ; 156 303b8: 9f 93 push r25 303ba: 8f 93 push r24 303bc: 0f 94 43 a3 call 0x34686 ; 0x34686 /// dynamic algorithm diverged, use original position instead xf = uc + 5.5f; 303c0: 65 96 adiw r28, 0x15 ; 21 303c2: 4c ae std Y+60, r4 ; 0x3c 303c4: 5d ae std Y+61, r5 ; 0x3d 303c6: 6e ae std Y+62, r6 ; 0x3e 303c8: 7f ae std Y+63, r7 ; 0x3f 303ca: 65 97 sbiw r28, 0x15 ; 21 yf = ur + 5.5f; 303cc: 25 96 adiw r28, 0x05 ; 5 303ce: 8c ae std Y+60, r8 ; 0x3c 303d0: 9d ae std Y+61, r9 ; 0x3d 303d2: ae ae std Y+62, r10 ; 0x3e 303d4: bf ae std Y+63, r11 ; 0x3f 303d6: 25 97 sbiw r28, 0x05 ; 5 303d8: 0f b6 in r0, 0x3f ; 63 303da: f8 94 cli 303dc: de bf out 0x3e, r29 ; 62 303de: 0f be out 0x3f, r0 ; 63 303e0: cd bf out 0x3d, r28 ; 61 } /// move to the center of area and convert to position xf = (float)x + (xf - 15.5f) * 64; 303e2: 20 e0 ldi r18, 0x00 ; 0 303e4: 30 e0 ldi r19, 0x00 ; 0 303e6: 48 e7 ldi r20, 0x78 ; 120 303e8: 51 e4 ldi r21, 0x41 ; 65 303ea: 65 96 adiw r28, 0x15 ; 21 303ec: 6c ad ldd r22, Y+60 ; 0x3c 303ee: 7d ad ldd r23, Y+61 ; 0x3d 303f0: 8e ad ldd r24, Y+62 ; 0x3e 303f2: 9f ad ldd r25, Y+63 ; 0x3f 303f4: 65 97 sbiw r28, 0x15 ; 21 303f6: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 303fa: 20 e0 ldi r18, 0x00 ; 0 303fc: 30 e0 ldi r19, 0x00 ; 0 303fe: 40 e8 ldi r20, 0x80 ; 128 30400: 52 e4 ldi r21, 0x42 ; 66 30402: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30406: 6b 01 movw r12, r22 30408: 7c 01 movw r14, r24 3040a: 6c 96 adiw r28, 0x1c ; 28 3040c: ae ad ldd r26, Y+62 ; 0x3e 3040e: bf ad ldd r27, Y+63 ; 0x3f 30410: 6c 97 sbiw r28, 0x1c ; 28 30412: bd 01 movw r22, r26 30414: bb 0f add r27, r27 30416: 88 0b sbc r24, r24 30418: 99 0b sbc r25, r25 3041a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 3041e: 9b 01 movw r18, r22 30420: ac 01 movw r20, r24 30422: c7 01 movw r24, r14 30424: b6 01 movw r22, r12 30426: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 3042a: 6b 01 movw r12, r22 3042c: 7c 01 movw r14, r24 3042e: 65 96 adiw r28, 0x15 ; 21 30430: cc ae std Y+60, r12 ; 0x3c 30432: dd ae std Y+61, r13 ; 0x3d 30434: ee ae std Y+62, r14 ; 0x3e 30436: ff ae std Y+63, r15 ; 0x3f 30438: 65 97 sbiw r28, 0x15 ; 21 yf = (float)y + (yf - 15.5f) * 64; 3043a: 20 e0 ldi r18, 0x00 ; 0 3043c: 30 e0 ldi r19, 0x00 ; 0 3043e: 48 e7 ldi r20, 0x78 ; 120 30440: 51 e4 ldi r21, 0x41 ; 65 30442: 25 96 adiw r28, 0x05 ; 5 30444: 6c ad ldd r22, Y+60 ; 0x3c 30446: 7d ad ldd r23, Y+61 ; 0x3d 30448: 8e ad ldd r24, Y+62 ; 0x3e 3044a: 9f ad ldd r25, Y+63 ; 0x3f 3044c: 25 97 sbiw r28, 0x05 ; 5 3044e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 30452: 20 e0 ldi r18, 0x00 ; 0 30454: 30 e0 ldi r19, 0x00 ; 0 30456: 40 e8 ldi r20, 0x80 ; 128 30458: 52 e4 ldi r21, 0x42 ; 66 3045a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3045e: 4b 01 movw r8, r22 30460: 5c 01 movw r10, r24 30462: ac 96 adiw r28, 0x2c ; 44 30464: ee ad ldd r30, Y+62 ; 0x3e 30466: ff ad ldd r31, Y+63 ; 0x3f 30468: ac 97 sbiw r28, 0x2c ; 44 3046a: bf 01 movw r22, r30 3046c: ff 0f add r31, r31 3046e: 88 0b sbc r24, r24 30470: 99 0b sbc r25, r25 30472: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 30476: 9b 01 movw r18, r22 30478: ac 01 movw r20, r24 3047a: c5 01 movw r24, r10 3047c: b4 01 movw r22, r8 3047e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 30482: 25 96 adiw r28, 0x05 ; 5 30484: 6c af std Y+60, r22 ; 0x3c 30486: 7d af std Y+61, r23 ; 0x3d 30488: 8e af std Y+62, r24 ; 0x3e 3048a: 9f af std Y+63, r25 ; 0x3f 3048c: 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; 3048e: 2a e0 ldi r18, 0x0A ; 10 30490: 37 ed ldi r19, 0xD7 ; 215 30492: 43 e2 ldi r20, 0x23 ; 35 30494: 5c e3 ldi r21, 0x3C ; 60 30496: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__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)); 3049a: 9f 93 push r25 3049c: 8f 93 push r24 3049e: 7f 93 push r23 304a0: 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; 304a2: 2a e0 ldi r18, 0x0A ; 10 304a4: 37 ed ldi r19, 0xD7 ; 215 304a6: 43 e2 ldi r20, 0x23 ; 35 304a8: 5c e3 ldi r21, 0x3C ; 60 304aa: c7 01 movw r24, r14 304ac: b6 01 movw r22, r12 304ae: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__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)); 304b2: 9f 93 push r25 304b4: 8f 93 push r24 304b6: 7f 93 push r23 304b8: 6f 93 push r22 304ba: 8c e4 ldi r24, 0x4C ; 76 304bc: 9c e9 ldi r25, 0x9C ; 156 304be: 9f 93 push r25 304c0: 8f 93 push r24 304c2: 0f 94 43 a3 call 0x34686 ; 0x34686 uint16_t round_to_u16(float f){ return (uint16_t)(f + .5f); } int16_t round_to_i16(float f){ return (int16_t)(f + .5f); 304c6: 20 e0 ldi r18, 0x00 ; 0 304c8: 30 e0 ldi r19, 0x00 ; 0 304ca: 40 e0 ldi r20, 0x00 ; 0 304cc: 5f e3 ldi r21, 0x3F ; 63 304ce: 25 96 adiw r28, 0x05 ; 5 304d0: 6c ad ldd r22, Y+60 ; 0x3c 304d2: 7d ad ldd r23, Y+61 ; 0x3d 304d4: 8e ad ldd r24, Y+62 ; 0x3e 304d6: 9f ad ldd r25, Y+63 ; 0x3f 304d8: 25 97 sbiw r28, 0x05 ; 5 304da: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 304de: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 304e2: 6b 01 movw r12, r22 304e4: 20 e0 ldi r18, 0x00 ; 0 304e6: 30 e0 ldi r19, 0x00 ; 0 304e8: 40 e0 ldi r20, 0x00 ; 0 304ea: 5f e3 ldi r21, 0x3F ; 63 304ec: 65 96 adiw r28, 0x15 ; 21 304ee: 6c ad ldd r22, Y+60 ; 0x3c 304f0: 7d ad ldd r23, Y+61 ; 0x3d 304f2: 8e ad ldd r24, Y+62 ; 0x3e 304f4: 9f ad ldd r25, Y+63 ; 0x3f 304f6: 65 97 sbiw r28, 0x15 ; 21 304f8: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 304fc: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> 30500: 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); 30502: 00 e0 ldi r16, 0x00 ; 0 30504: 28 ec ldi r18, 0xC8 ; 200 30506: 30 e0 ldi r19, 0x00 ; 0 30508: e7 96 adiw r28, 0x37 ; 55 3050a: 4e ad ldd r20, Y+62 ; 0x3e 3050c: 5f ad ldd r21, Y+63 ; 0x3f 3050e: e7 97 sbiw r28, 0x37 ; 55 30510: b6 01 movw r22, r12 30512: 0e 94 b7 d3 call 0x1a76e ; 0x1a76e 30516: 0f b6 in r0, 0x3f ; 63 30518: f8 94 cli 3051a: de bf out 0x3e, r29 ; 62 3051c: 0f be out 0x3f, r0 ; 63 3051e: cd bf out 0x3d, r28 ; 61 ret = BED_SKEW_OFFSET_DETECTION_POINT_FOUND; 30520: 10 e0 ldi r17, 0x00 ; 0 30522: 8e e3 ldi r24, 0x3E ; 62 30524: 9d e0 ldi r25, 0x0D ; 13 } /// wipe buffer for (uint16_t i = 0; i < sizeof(block_t)*BLOCK_BUFFER_SIZE; i++) matrix32[i] = 0; 30526: a4 96 adiw r28, 0x24 ; 36 30528: ae ad ldd r26, Y+62 ; 0x3e 3052a: bf ad ldd r27, Y+63 ; 0x3f 3052c: a4 97 sbiw r28, 0x24 ; 36 3052e: 1d 92 st X+, r1 30530: a4 96 adiw r28, 0x24 ; 36 30532: bf af std Y+63, r27 ; 0x3f 30534: ae af std Y+62, r26 ; 0x3e 30536: 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++) 30538: 8a 17 cp r24, r26 3053a: 9b 07 cpc r25, r27 3053c: a1 f7 brne .-24 ; 0x30526 3053e: af c0 rjmp .+350 ; 0x3069e 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)); 30540: 83 ef ldi r24, 0xF3 ; 243 30542: 91 e6 ldi r25, 0x61 ; 97 30544: 0e 94 8b 75 call 0xeb16 ; 0xeb16 30548: 0e 94 91 de call 0x1bd22 ; 0x1bd22 lcd_puts_at_P(0,3,_n("1/4")); 3054c: 42 e8 ldi r20, 0x82 ; 130 3054e: 5c e6 ldi r21, 0x6C ; 108 30550: c1 cb rjmp .-2174 ; 0x2fcd4 } } } else { lcd_show_fullscreen_message_and_wait_P(PSTR("Calibration failed! Check the axes and run again.")); 30552: 82 e3 ldi r24, 0x32 ; 50 30554: 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); 30556: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 3055a: a4 cb rjmp .-2232 ; 0x2fca4 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); 3055c: c7 55 subi r28, 0x57 ; 87 3055e: df 4f sbci r29, 0xFF ; 255 30560: 88 81 ld r24, Y 30562: 99 81 ldd r25, Y+1 ; 0x01 30564: c9 5a subi r28, 0xA9 ; 169 30566: d0 40 sbci r29, 0x00 ; 0 30568: 0e 94 9d 65 call 0xcb3a ; 0xcb3a // Z only calibration. // Load the machine correction matrix world2machine_initialize(); 3056c: 0e 94 17 61 call 0xc22e ; 0xc22e // and correct the current_position to match the transformed coordinate system. world2machine_update_current(); 30570: 0e 94 53 5f call 0xbea6 ; 0xbea6 //FIXME bool result = sample_mesh_and_store_reference(); 30574: 0f 94 8b 52 call 0x2a516 ; 0x2a516 30578: e5 96 adiw r28, 0x35 ; 53 3057a: 8f af std Y+63, r24 ; 0x3f 3057c: e5 97 sbiw r28, 0x35 ; 53 if (result) 3057e: 88 23 and r24, r24 30580: 09 f4 brne .+2 ; 0x30584 30582: 90 cb rjmp .-2272 ; 0x2fca4 { calibration_status_set(CALIBRATION_STATUS_Z); 30584: 84 e0 ldi r24, 0x04 ; 4 30586: 0e 94 36 d5 call 0x1aa6c ; 0x1aa6c } else { // Timeouted. } lcd_update_enable(true); 3058a: 81 e0 ldi r24, 0x01 ; 1 3058c: 0e 94 89 70 call 0xe112 ; 0xe112 #endif // TMC2130 FORCE_BL_ON_END; return final_result; } 30590: e5 96 adiw r28, 0x35 ; 53 30592: 8f ad ldd r24, Y+63 ; 0x3f 30594: e5 97 sbiw r28, 0x35 ; 53 30596: c2 53 subi r28, 0x32 ; 50 30598: df 4f sbci r29, 0xFF ; 255 3059a: 0f b6 in r0, 0x3f ; 63 3059c: f8 94 cli 3059e: de bf out 0x3e, r29 ; 62 305a0: 0f be out 0x3f, r0 ; 63 305a2: cd bf out 0x3d, r28 ; 61 305a4: df 91 pop r29 305a6: cf 91 pop r28 305a8: 1f 91 pop r17 305aa: 0f 91 pop r16 305ac: ff 90 pop r15 305ae: ef 90 pop r14 305b0: df 90 pop r13 305b2: cf 90 pop r12 305b4: bf 90 pop r11 305b6: af 90 pop r10 305b8: 9f 90 pop r9 305ba: 8f 90 pop r8 305bc: 7f 90 pop r7 305be: 6f 90 pop r6 305c0: 5f 90 pop r5 305c2: 4f 90 pop r4 305c4: 3f 90 pop r3 305c6: 2f 90 pop r2 305c8: 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) { 305ca: e1 e0 ldi r30, 0x01 ; 1 305cc: e1 96 adiw r28, 0x31 ; 49 305ce: ef af std Y+63, r30 ; 0x3f 305d0: e1 97 sbiw r28, 0x31 ; 49 305d2: 15 cc rjmp .-2006 ; 0x2fdfe 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) 305d4: fe 01 movw r30, r28 305d6: 31 96 adiw r30, 0x01 ; 1 305d8: 7f 01 movw r14, r30 305da: 10 e0 ldi r17, 0x00 ; 0 305dc: 00 e0 ldi r16, 0x00 ; 0 305de: 24 e8 ldi r18, 0x84 ; 132 305e0: 33 e0 ldi r19, 0x03 ; 3 305e2: a6 01 movw r20, r12 305e4: 69 2d mov r22, r9 305e6: 78 2d mov r23, r8 305e8: 8b 2d mov r24, r11 305ea: 9a 2d mov r25, r10 305ec: 0f 94 13 5f call 0x2be26 ; 0x2be26 ad += 0; if (!ret && (ad < 1440)) 305f0: 88 23 and r24, r24 305f2: 09 f4 brne .+2 ; 0x305f6 305f4: 0c cd rjmp .-1512 ; 0x3000e 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; 305f6: 89 81 ldd r24, Y+1 ; 0x01 305f8: 9a 81 ldd r25, Y+2 ; 0x02 305fa: 29 cd rjmp .-1454 ; 0x3004e 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)) 305fc: 89 81 ldd r24, Y+1 ; 0x01 305fe: 9a 81 ldd r25, Y+2 ; 0x02 30600: 80 34 cpi r24, 0x40 ; 64 30602: 9b 40 sbci r25, 0x0B ; 11 30604: b8 f4 brcc .+46 ; 0x30634 if ((ret = xyzcal_spiral2(cx, cy, z0 - 3*dz, dz, -radius, 180, delay_us, check_pinda, &ad)) != 0) 30606: ce 01 movw r24, r28 30608: 01 96 adiw r24, 0x01 ; 1 3060a: 7c 01 movw r14, r24 3060c: 04 eb ldi r16, 0xB4 ; 180 3060e: 10 e0 ldi r17, 0x00 ; 0 30610: 2c e7 ldi r18, 0x7C ; 124 30612: 3c ef ldi r19, 0xFC ; 252 30614: a6 01 movw r20, r12 30616: 4c 52 subi r20, 0x2C ; 44 30618: 51 40 sbci r21, 0x01 ; 1 3061a: 69 2d mov r22, r9 3061c: 78 2d mov r23, r8 3061e: 8b 2d mov r24, r11 30620: 9a 2d mov r25, r10 30622: 0f 94 13 5f call 0x2be26 ; 0x2be26 30626: 88 23 and r24, r24 30628: 29 f0 breq .+10 ; 0x30634 ad += 2160; 3062a: 89 81 ldd r24, Y+1 ; 0x01 3062c: 9a 81 ldd r25, Y+2 ; 0x02 3062e: 80 59 subi r24, 0x90 ; 144 30630: 97 4f sbci r25, 0xF7 ; 247 30632: 0d cd rjmp .-1510 ; 0x3004e /// 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; 30634: 90 e9 ldi r25, 0x90 ; 144 30636: c9 1a sub r12, r25 30638: 91 e0 ldi r25, 0x01 ; 1 3063a: d9 0a sbc r13, r25 3063c: c0 cc rjmp .-1664 ; 0x2ffbe } //@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]); 3063e: 00 91 54 06 lds r16, 0x0654 ; 0x800654 30642: 10 91 55 06 lds r17, 0x0655 ; 0x800655 30646: 20 91 56 06 lds r18, 0x0656 ; 0x800656 3064a: 30 91 57 06 lds r19, 0x0657 ; 0x800657 3064e: 40 91 50 06 lds r20, 0x0650 ; 0x800650 30652: 50 91 51 06 lds r21, 0x0651 ; 0x800651 30656: 60 91 52 06 lds r22, 0x0652 ; 0x800652 3065a: 70 91 53 06 lds r23, 0x0653 ; 0x800653 3065e: 80 91 4c 06 lds r24, 0x064C ; 0x80064c 30662: 90 91 4d 06 lds r25, 0x064D ; 0x80064d 30666: a0 91 4e 06 lds r26, 0x064E ; 0x80064e 3066a: b0 91 4f 06 lds r27, 0x064F ; 0x80064f 3066e: 3f 93 push r19 30670: 2f 93 push r18 30672: 1f 93 push r17 30674: 0f 93 push r16 30676: 7f 93 push r23 30678: 6f 93 push r22 3067a: 5f 93 push r21 3067c: 4f 93 push r20 3067e: bf 93 push r27 30680: af 93 push r26 30682: 9f 93 push r25 30684: 8f 93 push r24 30686: 84 ed ldi r24, 0xD4 ; 212 30688: 9b e9 ldi r25, 0x9B ; 155 3068a: 9f 93 push r25 3068c: 8f 93 push r24 3068e: 0f 94 43 a3 call 0x34686 ; 0x34686 30692: 0f b6 in r0, 0x3f ; 63 30694: f8 94 cli 30696: de bf out 0x3e, r29 ; 62 30698: 0f be out 0x3f, r0 ; 63 3069a: 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; 3069c: 1f ef ldi r17, 0xFF ; 255 sm4_calc_delay_cb = xyzcal_calc_delay; } void xyzcal_measure_leave(void) { DBG(_n("xyzcal_measure_leave\n")); 3069e: 84 eb ldi r24, 0xB4 ; 180 306a0: 9c e9 ldi r25, 0x9C ; 156 306a2: 9f 93 push r25 306a4: 8f 93 push r24 306a6: 0f 94 43 a3 call 0x34686 ; 0x34686 lcd_set_cursor(4,3); 306aa: 63 e0 ldi r22, 0x03 ; 3 306ac: 84 e0 ldi r24, 0x04 ; 4 306ae: 0e 94 ab 6f call 0xdf56 ; 0xdf56 lcd_space(16); 306b2: 80 e1 ldi r24, 0x10 ; 16 306b4: 0e 94 79 6f call 0xdef2 ; 0xdef2 // resync planner position from counters (changed by xyzcal_update_pos) planner_reset_position(); 306b8: 0f 94 40 4b call 0x29680 ; 0x29680 : "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" ); 306bc: 88 e1 ldi r24, 0x18 ; 24 306be: 98 e2 ldi r25, 0x28 ; 40 306c0: 0f b6 in r0, 0x3f ; 63 306c2: f8 94 cli 306c4: a8 95 wdr 306c6: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 306ca: 0f be out 0x3f, r0 ; 63 306cc: 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); 306d0: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> 306d4: 80 64 ori r24, 0x40 ; 64 306d6: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__TEXT_REGION_LENGTH__+0x7c2060> #endif //EMERGENCY_HANDLERS #endif //WATCHDOG ENABLE_STEPPER_DRIVER_INTERRUPT(); 306da: 80 91 6f 00 lds r24, 0x006F ; 0x80006f <__TEXT_REGION_LENGTH__+0x7c206f> 306de: 82 60 ori r24, 0x02 ; 2 306e0: 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){ 306e4: 0f 90 pop r0 306e6: 0f 90 pop r0 306e8: 1d 3f cpi r17, 0xFD ; 253 306ea: 09 f4 brne .+2 ; 0x306ee 306ec: ee c1 rjmp .+988 ; 0x30aca 306ee: 1f 3f cpi r17, 0xFF ; 255 306f0: 11 f4 brne .+4 ; 0x306f6 306f2: 0d 94 b0 8e jmp 0x31d60 ; 0x31d60 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); 306f6: 20 e0 ldi r18, 0x00 ; 0 306f8: 30 e0 ldi r19, 0x00 ; 0 306fa: a9 01 movw r20, r18 306fc: a0 96 adiw r28, 0x20 ; 32 306fe: ee ad ldd r30, Y+62 ; 0x3e 30700: ff ad ldd r31, Y+63 ; 0x3f 30702: a0 97 sbiw r28, 0x20 ; 32 30704: 61 81 ldd r22, Z+1 ; 0x01 30706: 72 81 ldd r23, Z+2 ; 0x02 30708: 83 81 ldd r24, Z+3 ; 0x03 3070a: 94 81 ldd r25, Z+4 ; 0x04 3070c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> pt[0] += (current_position[X_AXIS]/(iteration + 1)); //count average 30710: 20 91 61 12 lds r18, 0x1261 ; 0x801261 30714: 30 91 62 12 lds r19, 0x1262 ; 0x801262 30718: 40 91 63 12 lds r20, 0x1263 ; 0x801263 3071c: 50 91 64 12 lds r21, 0x1264 ; 0x801264 30720: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 30724: a0 96 adiw r28, 0x20 ; 32 30726: ae ad ldd r26, Y+62 ; 0x3e 30728: bf ad ldd r27, Y+63 ; 0x3f 3072a: a0 97 sbiw r28, 0x20 ; 32 3072c: 11 96 adiw r26, 0x01 ; 1 3072e: 6d 93 st X+, r22 30730: 7d 93 st X+, r23 30732: 8d 93 st X+, r24 30734: 9c 93 st X, r25 30736: 14 97 sbiw r26, 0x04 ; 4 pt[1] = (pt[1] * iteration) / (iteration + 1); pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 30738: c0 90 65 12 lds r12, 0x1265 ; 0x801265 3073c: d0 90 66 12 lds r13, 0x1266 ; 0x801266 30740: e0 90 67 12 lds r14, 0x1267 ; 0x801267 30744: 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); 30748: 20 e0 ldi r18, 0x00 ; 0 3074a: 30 e0 ldi r19, 0x00 ; 0 3074c: a9 01 movw r20, r18 3074e: 15 96 adiw r26, 0x05 ; 5 30750: 6d 91 ld r22, X+ 30752: 7d 91 ld r23, X+ 30754: 8d 91 ld r24, X+ 30756: 9c 91 ld r25, X 30758: 18 97 sbiw r26, 0x08 ; 8 3075a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> pt[1] += (current_position[Y_AXIS] / (iteration + 1)); 3075e: a7 01 movw r20, r14 30760: 96 01 movw r18, r12 30762: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 30766: a0 96 adiw r28, 0x20 ; 32 30768: ee ad ldd r30, Y+62 ; 0x3e 3076a: ff ad ldd r31, Y+63 ; 0x3f 3076c: a0 97 sbiw r28, 0x20 ; 32 3076e: 65 83 std Z+5, r22 ; 0x05 30770: 76 83 std Z+6, r23 ; 0x06 30772: 87 83 std Z+7, r24 ; 0x07 30774: 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) 30776: 20 e0 ldi r18, 0x00 ; 0 30778: 30 e0 ldi r19, 0x00 ; 0 3077a: 40 e8 ldi r20, 0x80 ; 128 3077c: 50 ec ldi r21, 0xC0 ; 192 3077e: c7 01 movw r24, r14 30780: b6 01 movw r22, r12 30782: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 30786: 87 ff sbrs r24, 7 30788: 0c c0 rjmp .+24 ; 0x307a2 current_position[Y_AXIS] = Y_MIN_POS; 3078a: 80 e0 ldi r24, 0x00 ; 0 3078c: 90 e0 ldi r25, 0x00 ; 0 3078e: a0 e8 ldi r26, 0x80 ; 128 30790: b0 ec ldi r27, 0xC0 ; 192 30792: 80 93 65 12 sts 0x1265, r24 ; 0x801265 30796: 90 93 66 12 sts 0x1266, r25 ; 0x801266 3079a: a0 93 67 12 sts 0x1267, r26 ; 0x801267 3079e: 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; 307a2: 20 e0 ldi r18, 0x00 ; 0 307a4: 30 e0 ldi r19, 0x00 ; 0 307a6: 40 e4 ldi r20, 0x40 ; 64 307a8: 50 e4 ldi r21, 0x40 ; 64 307aa: 60 91 69 12 lds r22, 0x1269 ; 0x801269 307ae: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 307b2: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 307b6: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 307ba: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 307be: 60 93 69 12 sts 0x1269, r22 ; 0x801269 307c2: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 307c6: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 307ca: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c 307ce: e0 96 adiw r28, 0x30 ; 48 307d0: 2e ad ldd r18, Y+62 ; 0x3e 307d2: 3f ad ldd r19, Y+63 ; 0x3f 307d4: e0 97 sbiw r28, 0x30 ; 48 307d6: 28 5f subi r18, 0xF8 ; 248 307d8: 3f 4f sbci r19, 0xFF ; 255 307da: e0 96 adiw r28, 0x30 ; 48 307dc: 3f af std Y+63, r19 ; 0x3f 307de: 2e af std Y+62, r18 ; 0x3e 307e0: e0 97 sbiw r28, 0x30 ; 48 307e2: a0 96 adiw r28, 0x20 ; 32 307e4: 4e ad ldd r20, Y+62 ; 0x3e 307e6: 5f ad ldd r21, Y+63 ; 0x3f 307e8: a0 97 sbiw r28, 0x20 ; 32 307ea: 48 5f subi r20, 0xF8 ; 248 307ec: 5f 4f sbci r21, 0xFF ; 255 307ee: a0 96 adiw r28, 0x20 ; 32 307f0: 5f af std Y+63, r21 ; 0x3f 307f2: 4e af std Y+62, r20 ; 0x3e 307f4: 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) { 307f6: 54 e0 ldi r21, 0x04 ; 4 307f8: 25 16 cp r2, r21 307fa: 31 04 cpc r3, r1 307fc: 09 f0 breq .+2 ; 0x30800 307fe: 1c cb rjmp .-2504 ; 0x2fe38 go_to_current(homing_feedrate[X_AXIS] / 60.f); delay_keep_alive(3000); } #endif // SUPPORT_VERBOSITY } if (!retry) 30800: a7 96 adiw r28, 0x27 ; 39 30802: 6f ad ldd r22, Y+63 ; 0x3f 30804: a7 97 sbiw r28, 0x27 ; 39 30806: 66 23 and r22, r22 30808: 31 f0 breq .+12 ; 0x30816 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) { 3080a: e1 96 adiw r28, 0x31 ; 49 3080c: 8f ad ldd r24, Y+63 ; 0x3f 3080e: e1 97 sbiw r28, 0x31 ; 49 30810: 81 30 cpi r24, 0x01 ; 1 30812: 09 f0 breq .+2 ; 0x30816 30814: da ce rjmp .-588 ; 0x305ca #endif // SUPPORT_VERBOSITY } if (!retry) break; } DBG(_n("All 4 calibration points found.\n")); 30816: 8d e5 ldi r24, 0x5D ; 93 30818: 9c e6 ldi r25, 0x6C ; 108 3081a: 9f 93 push r25 3081c: 8f 93 push r24 3081e: 0f 94 43 a3 call 0x34686 ; 0x34686 delay_keep_alive(0); //manage_heater, reset watchdog, manage inactivity 30822: 90 e0 ldi r25, 0x00 ; 0 30824: 80 e0 ldi r24, 0x00 ; 0 30826: 0e 94 07 8d call 0x11a0e ; 0x11a0e 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) { 3082a: 0f 90 pop r0 3082c: 0f 90 pop r0 3082e: 20 e0 ldi r18, 0x00 ; 0 30830: 30 e0 ldi r19, 0x00 ; 0 30832: 40 e9 ldi r20, 0x90 ; 144 30834: 50 ec ldi r21, 0xC0 ; 192 30836: 60 91 0e 13 lds r22, 0x130E ; 0x80130e 3083a: 70 91 0f 13 lds r23, 0x130F ; 0x80130f 3083e: 80 91 10 13 lds r24, 0x1310 ; 0x801310 30842: 90 91 11 13 lds r25, 0x1311 ; 0x801311 30846: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 3084a: 87 ff sbrs r24, 7 3084c: 45 c1 rjmp .+650 ; 0x30ad8 too_far_mask |= 1 << 1; //front center point is out of reach SERIAL_ECHOLNPGM(""); 3084e: 80 e0 ldi r24, 0x00 ; 0 30850: 9d e9 ldi r25, 0x9D ; 157 30852: 0e 94 0e 7d call 0xfa1c ; 0xfa1c SERIAL_ECHOPGM("WARNING: Front point not reachable. Y coordinate:"); 30856: 8e ec ldi r24, 0xCE ; 206 30858: 9c e9 ldi r25, 0x9C ; 156 3085a: 0e 94 15 7b call 0xf62a ; 0xf62a else printNumber(n, base); } void MarlinSerial::print(double n, int digits) { printFloat(n, digits); 3085e: 60 91 0e 13 lds r22, 0x130E ; 0x80130e 30862: 70 91 0f 13 lds r23, 0x130F ; 0x80130f 30866: 80 91 10 13 lds r24, 0x1310 ; 0x801310 3086a: 90 91 11 13 lds r25, 0x1311 ; 0x801311 3086e: 42 e0 ldi r20, 0x02 ; 2 30870: 0e 94 97 7a call 0xf52e ; 0xf52e MYSERIAL.print(pts[1]); SERIAL_ECHOPGM(" < "); 30874: 8a ec ldi r24, 0xCA ; 202 30876: 9c e9 ldi r25, 0x9C ; 156 30878: 0e 94 15 7b call 0xf62a ; 0xf62a MYSERIAL.println(Y_MIN_POS_CALIBRATION_POINT_OUT_OF_REACH); 3087c: 60 e0 ldi r22, 0x00 ; 0 3087e: 70 e0 ldi r23, 0x00 ; 0 30880: 80 e9 ldi r24, 0x90 ; 144 30882: 90 ec ldi r25, 0xC0 ; 192 30884: 0f 94 40 65 call 0x2ca80 ; 0x2ca80 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 30888: 92 e0 ldi r25, 0x02 ; 2 3088a: af 96 adiw r28, 0x2f ; 47 3088c: 9f af std Y+63, r25 ; 0x3f 3088e: 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; 30890: 10 92 3a 13 sts 0x133A, r1 ; 0x80133a 30894: 10 92 3b 13 sts 0x133B, r1 ; 0x80133b 30898: 10 92 3c 13 sts 0x133C, r1 ; 0x80133c 3089c: 10 92 3d 13 sts 0x133D, r1 ; 0x80133d cntr[1] = 0.f; 308a0: 10 92 3e 13 sts 0x133E, r1 ; 0x80133e 308a4: 10 92 3f 13 sts 0x133F, r1 ; 0x80133f 308a8: 10 92 40 13 sts 0x1340, r1 ; 0x801340 308ac: 10 92 41 13 sts 0x1341, r1 ; 0x801341 308b0: a4 e6 ldi r26, 0x64 ; 100 308b2: e6 96 adiw r28, 0x36 ; 54 308b4: af af std Y+63, r26 ; 0x3f 308b6: 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; 308b8: a2 96 adiw r28, 0x22 ; 34 308ba: 1c ae std Y+60, r1 ; 0x3c 308bc: 1d ae std Y+61, r1 ; 0x3d 308be: 1e ae std Y+62, r1 ; 0x3e 308c0: 1f ae std Y+63, r1 ; 0x3f 308c2: 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; 308c4: a6 96 adiw r28, 0x26 ; 38 308c6: 1c ae std Y+60, r1 ; 0x3c 308c8: 1d ae std Y+61, r1 ; 0x3d 308ca: 1e ae std Y+62, r1 ; 0x3e 308cc: 1f ae std Y+63, r1 ; 0x3f 308ce: 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 }; 308d0: fe 01 movw r30, r28 308d2: 31 96 adiw r30, 0x01 ; 1 308d4: 68 96 adiw r28, 0x18 ; 24 308d6: ff af std Y+63, r31 ; 0x3f 308d8: ee af std Y+62, r30 ; 0x3e 308da: 68 97 sbiw r28, 0x18 ; 24 float b[4] = { 0.f }; 308dc: 9e 01 movw r18, r28 308de: 2f 5b subi r18, 0xBF ; 191 308e0: 3f 4f sbci r19, 0xFF ; 255 308e2: 6a 96 adiw r28, 0x1a ; 26 308e4: 3f af std Y+63, r19 ; 0x3f 308e6: 2e af std Y+62, r18 ; 0x3e 308e8: 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; 308ea: a6 96 adiw r28, 0x26 ; 38 308ec: 6c ad ldd r22, Y+60 ; 0x3c 308ee: 7d ad ldd r23, Y+61 ; 0x3d 308f0: 8e ad ldd r24, Y+62 ; 0x3e 308f2: 9f ad ldd r25, Y+63 ; 0x3f 308f4: a6 97 sbiw r28, 0x26 ; 38 308f6: 0f 94 a3 a6 call 0x34d46 ; 0x34d46 308fa: 6e 96 adiw r28, 0x1e ; 30 308fc: 6c af std Y+60, r22 ; 0x3c 308fe: 7d af std Y+61, r23 ; 0x3d 30900: 8e af std Y+62, r24 ; 0x3e 30902: 9f af std Y+63, r25 ; 0x3f 30904: 6e 97 sbiw r28, 0x1e ; 30 float s1 = sin(a1) * MACHINE_AXIS_SCALE_X; 30906: a6 96 adiw r28, 0x26 ; 38 30908: 6c ad ldd r22, Y+60 ; 0x3c 3090a: 7d ad ldd r23, Y+61 ; 0x3d 3090c: 8e ad ldd r24, Y+62 ; 0x3e 3090e: 9f ad ldd r25, Y+63 ; 0x3f 30910: a6 97 sbiw r28, 0x26 ; 38 30912: 0f 94 69 a9 call 0x352d2 ; 0x352d2 30916: cb 57 subi r28, 0x7B ; 123 30918: df 4f sbci r29, 0xFF ; 255 3091a: 68 83 st Y, r22 3091c: 79 83 std Y+1, r23 ; 0x01 3091e: 8a 83 std Y+2, r24 ; 0x02 30920: 9b 83 std Y+3, r25 ; 0x03 30922: c5 58 subi r28, 0x85 ; 133 30924: d0 40 sbci r29, 0x00 ; 0 float c2 = cos(a2) * MACHINE_AXIS_SCALE_Y; 30926: a2 96 adiw r28, 0x22 ; 34 30928: 6c ad ldd r22, Y+60 ; 0x3c 3092a: 7d ad ldd r23, Y+61 ; 0x3d 3092c: 8e ad ldd r24, Y+62 ; 0x3e 3092e: 9f ad ldd r25, Y+63 ; 0x3f 30930: a2 97 sbiw r28, 0x22 ; 34 30932: 0f 94 a3 a6 call 0x34d46 ; 0x34d46 30936: c7 57 subi r28, 0x77 ; 119 30938: df 4f sbci r29, 0xFF ; 255 3093a: 68 83 st Y, r22 3093c: 79 83 std Y+1, r23 ; 0x01 3093e: 8a 83 std Y+2, r24 ; 0x02 30940: 9b 83 std Y+3, r25 ; 0x03 30942: c9 58 subi r28, 0x89 ; 137 30944: d0 40 sbci r29, 0x00 ; 0 float s2 = sin(a2) * MACHINE_AXIS_SCALE_Y; 30946: a2 96 adiw r28, 0x22 ; 34 30948: 6c ad ldd r22, Y+60 ; 0x3c 3094a: 7d ad ldd r23, Y+61 ; 0x3d 3094c: 8e ad ldd r24, Y+62 ; 0x3e 3094e: 9f ad ldd r25, Y+63 ; 0x3f 30950: a2 97 sbiw r28, 0x22 ; 34 30952: 0f 94 69 a9 call 0x352d2 ; 0x352d2 30956: cb 56 subi r28, 0x6B ; 107 30958: df 4f sbci r29, 0xFF ; 255 3095a: 68 83 st Y, r22 3095c: 79 83 std Y+1, r23 ; 0x01 3095e: 8a 83 std Y+2, r24 ; 0x02 30960: 9b 83 std Y+3, r25 ; 0x03 30962: c5 59 subi r28, 0x95 ; 149 30964: d0 40 sbci r29, 0x00 ; 0 // Prepare the Normal equation for the Gauss-Newton method. float A[4][4] = { 0.f }; 30966: 68 96 adiw r28, 0x18 ; 24 30968: ae ad ldd r26, Y+62 ; 0x3e 3096a: bf ad ldd r27, Y+63 ; 0x3f 3096c: 68 97 sbiw r28, 0x18 ; 24 3096e: e0 e4 ldi r30, 0x40 ; 64 30970: 1d 92 st X+, r1 30972: ea 95 dec r30 30974: e9 f7 brne .-6 ; 0x30970 float b[4] = { 0.f }; 30976: 80 e1 ldi r24, 0x10 ; 16 30978: 6a 96 adiw r28, 0x1a ; 26 3097a: ae ad ldd r26, Y+62 ; 0x3e 3097c: bf ad ldd r27, Y+63 ; 0x3f 3097e: 6a 97 sbiw r28, 0x1a ; 26 30980: 1d 92 st X+, r1 30982: 8a 95 dec r24 30984: e9 f7 brne .-6 ; 0x30980 float acc; delay_keep_alive(0); //manage heater, reset watchdog, manage inactivity 30986: 90 e0 ldi r25, 0x00 ; 0 30988: 80 e0 ldi r24, 0x00 ; 0 3098a: 0e 94 07 8d call 0x11a0e ; 0x11a0e 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); 3098e: 20 91 3a 13 lds r18, 0x133A ; 0x80133a 30992: 30 91 3b 13 lds r19, 0x133B ; 0x80133b 30996: 40 91 3c 13 lds r20, 0x133C ; 0x80133c 3099a: 50 91 3d 13 lds r21, 0x133D ; 0x80133d 3099e: c5 55 subi r28, 0x55 ; 85 309a0: df 4f sbci r29, 0xFF ; 255 309a2: 28 83 st Y, r18 309a4: 39 83 std Y+1, r19 ; 0x01 309a6: 4a 83 std Y+2, r20 ; 0x02 309a8: 5b 83 std Y+3, r21 ; 0x03 309aa: cb 5a subi r28, 0xAB ; 171 309ac: 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); 309ae: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 309b2: 90 91 3f 13 lds r25, 0x133F ; 0x80133f 309b6: a0 91 40 13 lds r26, 0x1340 ; 0x801340 309ba: b0 91 41 13 lds r27, 0x1341 ; 0x801341 309be: c1 55 subi r28, 0x51 ; 81 309c0: df 4f sbci r29, 0xFF ; 255 309c2: 88 83 st Y, r24 309c4: 99 83 std Y+1, r25 ; 0x01 309c6: aa 83 std Y+2, r26 ; 0x02 309c8: bb 83 std Y+3, r27 ; 0x03 309ca: cf 5a subi r28, 0xAF ; 175 309cc: d0 40 sbci r29, 0x00 ; 0 309ce: de 01 movw r26, r28 309d0: af 5b subi r26, 0xBF ; 191 309d2: bf 4f sbci r27, 0xFF ; 255 309d4: c7 56 subi r28, 0x67 ; 103 309d6: df 4f sbci r29, 0xFF ; 255 309d8: b9 83 std Y+1, r27 ; 0x01 309da: a8 83 st Y, r26 309dc: c9 59 subi r28, 0x99 ; 153 309de: d0 40 sbci r29, 0x00 ; 0 309e0: fe 01 movw r30, r28 309e2: 31 96 adiw r30, 0x01 ; 1 309e4: ac 96 adiw r28, 0x2c ; 44 309e6: ff af std Y+63, r31 ; 0x3f 309e8: ee af std Y+62, r30 ; 0x3e 309ea: 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) { 309ec: 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])); 309ee: cb 56 subi r28, 0x6B ; 107 309f0: df 4f sbci r29, 0xFF ; 255 309f2: 28 81 ld r18, Y 309f4: 39 81 ldd r19, Y+1 ; 0x01 309f6: 4a 81 ldd r20, Y+2 ; 0x02 309f8: 5b 81 ldd r21, Y+3 ; 0x03 309fa: c5 59 subi r28, 0x95 ; 149 309fc: d0 40 sbci r29, 0x00 ; 0 309fe: 50 58 subi r21, 0x80 ; 128 30a00: ed 96 adiw r28, 0x3d ; 61 30a02: 2c af std Y+60, r18 ; 0x3c 30a04: 3d af std Y+61, r19 ; 0x3d 30a06: 4e af std Y+62, r20 ; 0x3e 30a08: 5f af std Y+63, r21 ; 0x3f 30a0a: 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])); 30a0c: c7 57 subi r28, 0x77 ; 119 30a0e: df 4f sbci r29, 0xFF ; 255 30a10: 88 81 ld r24, Y 30a12: 99 81 ldd r25, Y+1 ; 0x01 30a14: aa 81 ldd r26, Y+2 ; 0x02 30a16: bb 81 ldd r27, Y+3 ; 0x03 30a18: c9 58 subi r28, 0x89 ; 137 30a1a: d0 40 sbci r29, 0x00 ; 0 30a1c: b0 58 subi r27, 0x80 ; 128 30a1e: c3 58 subi r28, 0x83 ; 131 30a20: df 4f sbci r29, 0xFF ; 255 30a22: 88 83 st Y, r24 30a24: 99 83 std Y+1, r25 ; 0x01 30a26: aa 83 std Y+2, r26 ; 0x02 30a28: bb 83 std Y+3, r27 ; 0x03 30a2a: cd 57 subi r28, 0x7D ; 125 30a2c: 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]) : 30a2e: cb 57 subi r28, 0x7B ; 123 30a30: df 4f sbci r29, 0xFF ; 255 30a32: 28 81 ld r18, Y 30a34: 39 81 ldd r19, Y+1 ; 0x01 30a36: 4a 81 ldd r20, Y+2 ; 0x02 30a38: 5b 81 ldd r21, Y+3 ; 0x03 30a3a: c5 58 subi r28, 0x85 ; 133 30a3c: d0 40 sbci r29, 0x00 ; 0 30a3e: 50 58 subi r21, 0x80 ; 128 30a40: cf 57 subi r28, 0x7F ; 127 30a42: df 4f sbci r29, 0xFF ; 255 30a44: 28 83 st Y, r18 30a46: 39 83 std Y+1, r19 ; 0x01 30a48: 4a 83 std Y+2, r20 ; 0x02 30a4a: 5b 83 std Y+3, r21 ; 0x03 30a4c: c1 58 subi r28, 0x81 ; 129 30a4e: 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) { 30a50: ac 96 adiw r28, 0x2c ; 44 30a52: 2e ac ldd r2, Y+62 ; 0x3e 30a54: 3f ac ldd r3, Y+63 ; 0x3f 30a56: ac 97 sbiw r28, 0x2c ; 44 for (uint8_t c = 0; c < 4; ++c) { 30a58: 10 e0 ldi r17, 0x00 ; 0 30a5a: 69 e0 ldi r22, 0x09 ; 9 30a5c: 46 2e mov r4, r22 30a5e: 63 e1 ldi r22, 0x13 ; 19 30a60: 56 2e mov r5, r22 30a62: 74 e0 ldi r23, 0x04 ; 4 30a64: 77 2e mov r7, r23 acc = 0; 30a66: c1 2c mov r12, r1 30a68: d1 2c mov r13, r1 30a6a: 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) { 30a6c: 01 30 cpi r16, 0x01 ; 1 30a6e: 11 f4 brne .+4 ; 0x30a74 30a70: 0d 94 64 8f jmp 0x31ec8 ; 0x31ec8 30a74: 11 30 cpi r17, 0x01 ; 1 30a76: 11 f4 brne .+4 ; 0x30a7c 30a78: 0d 94 16 8f jmp 0x31e2c ; 0x31e2c float a = (r == 0) ? 1.f : 30a7c: 00 23 and r16, r16 30a7e: 11 f4 brne .+4 ; 0x30a84 30a80: 0d 94 56 8f jmp 0x31eac ; 0x31eac ((r == 2) ? (-s1 * measured_pts[2 * i]) : 30a84: 02 30 cpi r16, 0x02 ; 2 30a86: 61 f5 brne .+88 ; 0x30ae0 30a88: d2 01 movw r26, r4 30a8a: 11 96 adiw r26, 0x01 ; 1 30a8c: 2d 91 ld r18, X+ 30a8e: 3d 91 ld r19, X+ 30a90: 4d 91 ld r20, X+ 30a92: 5c 91 ld r21, X 30a94: 14 97 sbiw r26, 0x04 ; 4 30a96: cf 57 subi r28, 0x7F ; 127 30a98: df 4f sbci r29, 0xFF ; 255 30a9a: 68 81 ld r22, Y 30a9c: 79 81 ldd r23, Y+1 ; 0x01 30a9e: 8a 81 ldd r24, Y+2 ; 0x02 30aa0: 9b 81 ldd r25, Y+3 ; 0x03 30aa2: c1 58 subi r28, 0x81 ; 129 30aa4: d0 40 sbci r29, 0x00 ; 0 30aa6: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30aaa: 4b 01 movw r8, r22 30aac: 5c 01 movw r10, r24 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 30aae: 11 11 cpse r17, r1 30ab0: 25 c0 rjmp .+74 ; 0x30afc 30ab2: 60 e0 ldi r22, 0x00 ; 0 30ab4: 70 e0 ldi r23, 0x00 ; 0 30ab6: 80 e8 ldi r24, 0x80 ; 128 30ab8: 9f e3 ldi r25, 0x3F ; 63 30aba: 35 c0 rjmp .+106 ; 0x30b26 int16_t maxs = 0; for (int16_t i = 0; i < 32*32;++i){ if (matrix32[i] == 0) { ++mins; } else if (matrix32[i] == 0xFF){ 30abc: 2f 3f cpi r18, 0xFF ; 255 30abe: 09 f0 breq .+2 ; 0x30ac2 30ac0: 98 cb rjmp .-2256 ; 0x301f2 ++maxs; 30ac2: 01 96 adiw r24, 0x01 ; 1 30ac4: 96 cb rjmp .-2260 ; 0x301f2 /// 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; 30ac6: 1f ef ldi r17, 0xFF ; 255 30ac8: 2c cd rjmp .-1448 ; 0x30522 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; 30aca: e5 96 adiw r28, 0x35 ; 53 30acc: bf ad ldd r27, Y+63 ; 0x3f 30ace: e5 97 sbiw r28, 0x35 ; 53 30ad0: a7 96 adiw r28, 0x27 ; 39 30ad2: bf af std Y+63, r27 ; 0x3f 30ad4: a7 97 sbiw r28, 0x27 ; 39 30ad6: 0f ce rjmp .-994 ; 0x306f6 // 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; 30ad8: af 96 adiw r28, 0x2f ; 47 30ada: 1f ae std Y+63, r1 ; 0x3f 30adc: af 97 sbiw r28, 0x2f ; 47 30ade: d8 ce rjmp .-592 ; 0x30890 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]) : 30ae0: f2 01 movw r30, r4 30ae2: 25 81 ldd r18, Z+5 ; 0x05 30ae4: 36 81 ldd r19, Z+6 ; 0x06 30ae6: 47 81 ldd r20, Z+7 ; 0x07 30ae8: 50 85 ldd r21, Z+8 ; 0x08 30aea: c3 58 subi r28, 0x83 ; 131 30aec: df 4f sbci r29, 0xFF ; 255 30aee: 68 81 ld r22, Y 30af0: 79 81 ldd r23, Y+1 ; 0x01 30af2: 8a 81 ldd r24, Y+2 ; 0x02 30af4: 9b 81 ldd r25, Y+3 ; 0x03 30af6: cd 57 subi r28, 0x7D ; 125 30af8: d0 40 sbci r29, 0x00 ; 0 30afa: d5 cf rjmp .-86 ; 0x30aa6 (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : ((c == 2) ? (-s1 * measured_pts[2 * i]) : 30afc: 12 30 cpi r17, 0x02 ; 2 30afe: 11 f0 breq .+4 ; 0x30b04 30b00: 0d 94 57 8e jmp 0x31cae ; 0x31cae 30b04: d2 01 movw r26, r4 30b06: 11 96 adiw r26, 0x01 ; 1 30b08: 2d 91 ld r18, X+ 30b0a: 3d 91 ld r19, X+ 30b0c: 4d 91 ld r20, X+ 30b0e: 5c 91 ld r21, X 30b10: 14 97 sbiw r26, 0x04 ; 4 30b12: cf 57 subi r28, 0x7F ; 127 30b14: df 4f sbci r29, 0xFF ; 255 30b16: 68 81 ld r22, Y 30b18: 79 81 ldd r23, Y+1 ; 0x01 30b1a: 8a 81 ldd r24, Y+2 ; 0x02 30b1c: 9b 81 ldd r25, Y+3 ; 0x03 30b1e: c1 58 subi r28, 0x81 ; 129 30b20: d0 40 sbci r29, 0x00 ; 0 30b22: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> (-c2 * measured_pts[2 * i + 1])); float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += a * b * w; 30b26: 9b 01 movw r18, r22 30b28: ac 01 movw r20, r24 30b2a: c5 01 movw r24, r10 30b2c: b4 01 movw r22, r8 30b2e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30b32: 9b 01 movw r18, r22 30b34: ac 01 movw r20, r24 30b36: c7 01 movw r24, r14 30b38: b6 01 movw r22, r12 30b3a: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 30b3e: 6b 01 movw r12, r22 30b40: 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) { 30b42: 01 11 cpse r16, r1 30b44: 0d 94 6e 8f jmp 0x31edc ; 0x31edc 30b48: 7a 94 dec r7 30b4a: f8 e0 ldi r31, 0x08 ; 8 30b4c: 4f 0e add r4, r31 30b4e: 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) { 30b50: 71 10 cpse r7, r1 30b52: 8c cf rjmp .-232 ; 0x30a6c (-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; 30b54: d1 01 movw r26, r2 30b56: cd 92 st X+, r12 30b58: dd 92 st X+, r13 30b5a: ed 92 st X+, r14 30b5c: fd 92 st X+, r15 30b5e: 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) { 30b60: 1f 5f subi r17, 0xFF ; 255 30b62: 14 30 cpi r17, 0x04 ; 4 30b64: 09 f0 breq .+2 ; 0x30b68 30b66: 79 cf rjmp .-270 ; 0x30a5a 30b68: 31 e0 ldi r19, 0x01 ; 1 30b6a: 23 2e mov r2, r19 30b6c: 3d e9 ldi r19, 0x9D ; 157 30b6e: 33 2e mov r3, r19 30b70: e9 e0 ldi r30, 0x09 ; 9 30b72: f3 e1 ldi r31, 0x13 ; 19 30b74: a8 96 adiw r28, 0x28 ; 40 30b76: ff af std Y+63, r31 ; 0x3f 30b78: ee af std Y+62, r30 ; 0x3e 30b7a: a8 97 sbiw r28, 0x28 ; 40 } } A[r][c] = acc; } // J^T times f(x) acc = 0.f; 30b7c: c3 57 subi r28, 0x73 ; 115 30b7e: df 4f sbci r29, 0xFF ; 255 30b80: 18 82 st Y, r1 30b82: cd 58 subi r28, 0x8D ; 141 30b84: d0 40 sbci r29, 0x00 ; 0 30b86: c3 56 subi r28, 0x63 ; 99 30b88: df 4f sbci r29, 0xFF ; 255 30b8a: 18 82 st Y, r1 30b8c: cd 59 subi r28, 0x9D ; 157 30b8e: d0 40 sbci r29, 0x00 ; 0 30b90: cf 55 subi r28, 0x5F ; 95 30b92: df 4f sbci r29, 0xFF ; 255 30b94: 18 82 st Y, r1 30b96: c1 5a subi r28, 0xA1 ; 161 30b98: d0 40 sbci r29, 0x00 ; 0 30b9a: 10 e0 ldi r17, 0x00 ; 0 30b9c: a8 96 adiw r28, 0x28 ; 40 30b9e: ae ad ldd r26, Y+62 ; 0x3e 30ba0: bf ad ldd r27, Y+63 ; 0x3f 30ba2: a8 97 sbiw r28, 0x28 ; 40 30ba4: 11 96 adiw r26, 0x01 ; 1 30ba6: 2d 91 ld r18, X+ 30ba8: 3d 91 ld r19, X+ 30baa: 4d 91 ld r20, X+ 30bac: 5c 91 ld r21, X 30bae: 14 97 sbiw r26, 0x04 ; 4 30bb0: e4 96 adiw r28, 0x34 ; 52 30bb2: 2c af std Y+60, r18 ; 0x3c 30bb4: 3d af std Y+61, r19 ; 0x3d 30bb6: 4e af std Y+62, r20 ; 0x3e 30bb8: 5f af std Y+63, r21 ; 0x3f 30bba: e4 97 sbiw r28, 0x34 ; 52 30bbc: 15 96 adiw r26, 0x05 ; 5 30bbe: 4d 90 ld r4, X+ 30bc0: 5d 90 ld r5, X+ 30bc2: 6d 90 ld r6, X+ 30bc4: 7c 90 ld r7, X 30bc6: 18 97 sbiw r26, 0x08 ; 8 for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 30bc8: 00 23 and r16, r16 30bca: 11 f4 brne .+4 ; 0x30bd0 30bcc: 0d 94 8a 8e jmp 0x31d14 ; 0x31d14 ((r == 1) ? 0.f : 30bd0: 81 2c mov r8, r1 30bd2: 91 2c mov r9, r1 30bd4: 54 01 movw r10, r8 30bd6: 01 30 cpi r16, 0x01 ; 1 30bd8: 81 f0 breq .+32 ; 0x30bfa ((r == 2) ? (-s1 * measured_pts[2 * i]) : 30bda: 02 30 cpi r16, 0x02 ; 2 30bdc: 11 f0 breq .+4 ; 0x30be2 30bde: 0d 94 7e 8e jmp 0x31cfc ; 0x31cfc 30be2: cf 57 subi r28, 0x7F ; 127 30be4: df 4f sbci r29, 0xFF ; 255 30be6: 68 81 ld r22, Y 30be8: 79 81 ldd r23, Y+1 ; 0x01 30bea: 8a 81 ldd r24, Y+2 ; 0x02 30bec: 9b 81 ldd r25, Y+3 ; 0x03 30bee: c1 58 subi r28, 0x81 ; 129 30bf0: d0 40 sbci r29, 0x00 ; 0 30bf2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30bf6: 4b 01 movw r8, r22 30bf8: 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); 30bfa: e4 96 adiw r28, 0x34 ; 52 30bfc: 2c ad ldd r18, Y+60 ; 0x3c 30bfe: 3d ad ldd r19, Y+61 ; 0x3d 30c00: 4e ad ldd r20, Y+62 ; 0x3e 30c02: 5f ad ldd r21, Y+63 ; 0x3f 30c04: e4 97 sbiw r28, 0x34 ; 52 30c06: 6e 96 adiw r28, 0x1e ; 30 30c08: 6c ad ldd r22, Y+60 ; 0x3c 30c0a: 7d ad ldd r23, Y+61 ; 0x3d 30c0c: 8e ad ldd r24, Y+62 ; 0x3e 30c0e: 9f ad ldd r25, Y+63 ; 0x3f 30c10: 6e 97 sbiw r28, 0x1e ; 30 30c12: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30c16: 6b 01 movw r12, r22 30c18: 7c 01 movw r14, r24 30c1a: f1 01 movw r30, r2 30c1c: 25 91 lpm r18, Z+ 30c1e: 35 91 lpm r19, Z+ 30c20: 45 91 lpm r20, Z+ 30c22: 54 91 lpm r21, Z 30c24: cb 55 subi r28, 0x5B ; 91 30c26: df 4f sbci r29, 0xFF ; 255 30c28: 28 83 st Y, r18 30c2a: 39 83 std Y+1, r19 ; 0x01 30c2c: 4a 83 std Y+2, r20 ; 0x02 30c2e: 5b 83 std Y+3, r21 ; 0x03 30c30: c5 5a subi r28, 0xA5 ; 165 30c32: d0 40 sbci r29, 0x00 ; 0 30c34: a3 01 movw r20, r6 30c36: 92 01 movw r18, r4 30c38: cb 56 subi r28, 0x6B ; 107 30c3a: df 4f sbci r29, 0xFF ; 255 30c3c: 68 81 ld r22, Y 30c3e: 79 81 ldd r23, Y+1 ; 0x01 30c40: 8a 81 ldd r24, Y+2 ; 0x02 30c42: 9b 81 ldd r25, Y+3 ; 0x03 30c44: c5 59 subi r28, 0x95 ; 149 30c46: d0 40 sbci r29, 0x00 ; 0 30c48: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30c4c: 9b 01 movw r18, r22 30c4e: ac 01 movw r20, r24 30c50: c7 01 movw r24, r14 30c52: b6 01 movw r22, r12 30c54: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 30c58: c5 55 subi r28, 0x55 ; 85 30c5a: df 4f sbci r29, 0xFF ; 255 30c5c: 28 81 ld r18, Y 30c5e: 39 81 ldd r19, Y+1 ; 0x01 30c60: 4a 81 ldd r20, Y+2 ; 0x02 30c62: 5b 81 ldd r21, Y+3 ; 0x03 30c64: cb 5a subi r28, 0xAB ; 171 30c66: d0 40 sbci r29, 0x00 ; 0 30c68: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 30c6c: cb 55 subi r28, 0x5B ; 91 30c6e: df 4f sbci r29, 0xFF ; 255 30c70: 28 81 ld r18, Y 30c72: 39 81 ldd r19, Y+1 ; 0x01 30c74: 4a 81 ldd r20, Y+2 ; 0x02 30c76: 5b 81 ldd r21, Y+3 ; 0x03 30c78: c5 5a subi r28, 0xA5 ; 165 30c7a: d0 40 sbci r29, 0x00 ; 0 30c7c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; 30c80: a5 01 movw r20, r10 30c82: 94 01 movw r18, r8 30c84: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30c88: c3 57 subi r28, 0x73 ; 115 30c8a: df 4f sbci r29, 0xFF ; 255 30c8c: 28 81 ld r18, Y 30c8e: cd 58 subi r28, 0x8D ; 141 30c90: d0 40 sbci r29, 0x00 ; 0 30c92: c3 56 subi r28, 0x63 ; 99 30c94: df 4f sbci r29, 0xFF ; 255 30c96: 38 81 ld r19, Y 30c98: cd 59 subi r28, 0x9D ; 157 30c9a: d0 40 sbci r29, 0x00 ; 0 30c9c: cf 55 subi r28, 0x5F ; 95 30c9e: df 4f sbci r29, 0xFF ; 255 30ca0: 48 81 ld r20, Y 30ca2: c1 5a subi r28, 0xA1 ; 161 30ca4: d0 40 sbci r29, 0x00 ; 0 30ca6: 51 2f mov r21, r17 30ca8: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 30cac: c3 57 subi r28, 0x73 ; 115 30cae: df 4f sbci r29, 0xFF ; 255 30cb0: 68 83 st Y, r22 30cb2: 79 83 std Y+1, r23 ; 0x01 30cb4: 8a 83 std Y+2, r24 ; 0x02 30cb6: 9b 83 std Y+3, r25 ; 0x03 30cb8: cd 58 subi r28, 0x8D ; 141 30cba: d0 40 sbci r29, 0x00 ; 0 } { float j = (r == 0) ? 0.f : 30cbc: 00 23 and r16, r16 30cbe: 11 f4 brne .+4 ; 0x30cc4 30cc0: 0d 94 92 8e jmp 0x31d24 ; 0x31d24 ((r == 1) ? 1.f : 30cc4: 01 30 cpi r16, 0x01 ; 1 30cc6: 11 f4 brne .+4 ; 0x30ccc 30cc8: 0d 94 97 8e jmp 0x31d2e ; 0x31d2e ((r == 2) ? ( c1 * measured_pts[2 * i]) : 30ccc: 02 30 cpi r16, 0x02 ; 2 30cce: 61 f0 breq .+24 ; 0x30ce8 30cd0: a3 01 movw r20, r6 30cd2: 92 01 movw r18, r4 30cd4: ed 96 adiw r28, 0x3d ; 61 30cd6: 6c ad ldd r22, Y+60 ; 0x3c 30cd8: 7d ad ldd r23, Y+61 ; 0x3d 30cda: 8e ad ldd r24, Y+62 ; 0x3e 30cdc: 9f ad ldd r25, Y+63 ; 0x3f 30cde: ed 97 sbiw r28, 0x3d ; 61 30ce0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30ce4: 6b 01 movw r12, r22 30ce6: 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); 30ce8: f1 01 movw r30, r2 30cea: 34 96 adiw r30, 0x04 ; 4 30cec: 85 90 lpm r8, Z+ 30cee: 95 90 lpm r9, Z+ 30cf0: a5 90 lpm r10, Z+ 30cf2: b4 90 lpm r11, Z 30cf4: e4 96 adiw r28, 0x34 ; 52 30cf6: 2c ad ldd r18, Y+60 ; 0x3c 30cf8: 3d ad ldd r19, Y+61 ; 0x3d 30cfa: 4e ad ldd r20, Y+62 ; 0x3e 30cfc: 5f ad ldd r21, Y+63 ; 0x3f 30cfe: e4 97 sbiw r28, 0x34 ; 52 30d00: cb 57 subi r28, 0x7B ; 123 30d02: df 4f sbci r29, 0xFF ; 255 30d04: 68 81 ld r22, Y 30d06: 79 81 ldd r23, Y+1 ; 0x01 30d08: 8a 81 ldd r24, Y+2 ; 0x02 30d0a: 9b 81 ldd r25, Y+3 ; 0x03 30d0c: c5 58 subi r28, 0x85 ; 133 30d0e: d0 40 sbci r29, 0x00 ; 0 30d10: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30d14: e4 96 adiw r28, 0x34 ; 52 30d16: 6c af std Y+60, r22 ; 0x3c 30d18: 7d af std Y+61, r23 ; 0x3d 30d1a: 8e af std Y+62, r24 ; 0x3e 30d1c: 9f af std Y+63, r25 ; 0x3f 30d1e: e4 97 sbiw r28, 0x34 ; 52 30d20: a3 01 movw r20, r6 30d22: 92 01 movw r18, r4 30d24: c7 57 subi r28, 0x77 ; 119 30d26: df 4f sbci r29, 0xFF ; 255 30d28: 68 81 ld r22, Y 30d2a: 79 81 ldd r23, Y+1 ; 0x01 30d2c: 8a 81 ldd r24, Y+2 ; 0x02 30d2e: 9b 81 ldd r25, Y+3 ; 0x03 30d30: c9 58 subi r28, 0x89 ; 137 30d32: d0 40 sbci r29, 0x00 ; 0 30d34: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30d38: 9b 01 movw r18, r22 30d3a: ac 01 movw r20, r24 30d3c: e4 96 adiw r28, 0x34 ; 52 30d3e: 6c ad ldd r22, Y+60 ; 0x3c 30d40: 7d ad ldd r23, Y+61 ; 0x3d 30d42: 8e ad ldd r24, Y+62 ; 0x3e 30d44: 9f ad ldd r25, Y+63 ; 0x3f 30d46: e4 97 sbiw r28, 0x34 ; 52 30d48: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 30d4c: c1 55 subi r28, 0x51 ; 81 30d4e: df 4f sbci r29, 0xFF ; 255 30d50: 28 81 ld r18, Y 30d52: 39 81 ldd r19, Y+1 ; 0x01 30d54: 4a 81 ldd r20, Y+2 ; 0x02 30d56: 5b 81 ldd r21, Y+3 ; 0x03 30d58: cf 5a subi r28, 0xAF ; 175 30d5a: d0 40 sbci r29, 0x00 ; 0 30d5c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 30d60: a5 01 movw r20, r10 30d62: 94 01 movw r18, r8 30d64: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += j * fy * w; 30d68: a7 01 movw r20, r14 30d6a: 96 01 movw r18, r12 30d6c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 30d70: c3 57 subi r28, 0x73 ; 115 30d72: df 4f sbci r29, 0xFF ; 255 30d74: 28 81 ld r18, Y 30d76: 39 81 ldd r19, Y+1 ; 0x01 30d78: 4a 81 ldd r20, Y+2 ; 0x02 30d7a: 5b 81 ldd r21, Y+3 ; 0x03 30d7c: cd 58 subi r28, 0x8D ; 141 30d7e: d0 40 sbci r29, 0x00 ; 0 30d80: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 30d84: c3 57 subi r28, 0x73 ; 115 30d86: df 4f sbci r29, 0xFF ; 255 30d88: 68 83 st Y, r22 30d8a: cd 58 subi r28, 0x8D ; 141 30d8c: d0 40 sbci r29, 0x00 ; 0 30d8e: c3 56 subi r28, 0x63 ; 99 30d90: df 4f sbci r29, 0xFF ; 255 30d92: 78 83 st Y, r23 30d94: cd 59 subi r28, 0x9D ; 157 30d96: d0 40 sbci r29, 0x00 ; 0 30d98: cf 55 subi r28, 0x5F ; 95 30d9a: df 4f sbci r29, 0xFF ; 255 30d9c: 88 83 st Y, r24 30d9e: c1 5a subi r28, 0xA1 ; 161 30da0: d0 40 sbci r29, 0x00 ; 0 30da2: 19 2f mov r17, r25 30da4: a8 96 adiw r28, 0x28 ; 40 30da6: 4e ad ldd r20, Y+62 ; 0x3e 30da8: 5f ad ldd r21, Y+63 ; 0x3f 30daa: a8 97 sbiw r28, 0x28 ; 40 30dac: 48 5f subi r20, 0xF8 ; 248 30dae: 5f 4f sbci r21, 0xFF ; 255 30db0: a8 96 adiw r28, 0x28 ; 40 30db2: 5f af std Y+63, r21 ; 0x3f 30db4: 4e af std Y+62, r20 ; 0x3e 30db6: a8 97 sbiw r28, 0x28 ; 40 30db8: 58 e0 ldi r21, 0x08 ; 8 30dba: 25 0e add r2, r21 30dbc: 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) { 30dbe: a9 e2 ldi r26, 0x29 ; 41 30dc0: b3 e1 ldi r27, 0x13 ; 19 30dc2: a8 96 adiw r28, 0x28 ; 40 30dc4: ee ad ldd r30, Y+62 ; 0x3e 30dc6: ff ad ldd r31, Y+63 ; 0x3f 30dc8: a8 97 sbiw r28, 0x28 ; 40 30dca: ae 17 cp r26, r30 30dcc: bf 07 cpc r27, r31 30dce: 09 f0 breq .+2 ; 0x30dd2 30dd0: e5 ce rjmp .-566 ; 0x30b9c 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; 30dd2: 90 58 subi r25, 0x80 ; 128 30dd4: c7 56 subi r28, 0x67 ; 103 30dd6: df 4f sbci r29, 0xFF ; 255 30dd8: a8 81 ld r26, Y 30dda: b9 81 ldd r27, Y+1 ; 0x01 30ddc: c9 59 subi r28, 0x99 ; 153 30dde: d0 40 sbci r29, 0x00 ; 0 30de0: 6d 93 st X+, r22 30de2: 7d 93 st X+, r23 30de4: 8d 93 st X+, r24 30de6: 9d 93 st X+, r25 30de8: c7 56 subi r28, 0x67 ; 103 30dea: df 4f sbci r29, 0xFF ; 255 30dec: b9 83 std Y+1, r27 ; 0x01 30dee: a8 83 st Y, r26 30df0: c9 59 subi r28, 0x99 ; 153 30df2: 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) { 30df4: 0f 5f subi r16, 0xFF ; 255 30df6: ac 96 adiw r28, 0x2c ; 44 30df8: ee ad ldd r30, Y+62 ; 0x3e 30dfa: ff ad ldd r31, Y+63 ; 0x3f 30dfc: ac 97 sbiw r28, 0x2c ; 44 30dfe: 70 96 adiw r30, 0x10 ; 16 30e00: ac 96 adiw r28, 0x2c ; 44 30e02: ff af std Y+63, r31 ; 0x3f 30e04: ee af std Y+62, r30 ; 0x3e 30e06: ac 97 sbiw r28, 0x2c ; 44 30e08: 04 30 cpi r16, 0x04 ; 4 30e0a: 09 f0 breq .+2 ; 0x30e0e 30e0c: 21 ce rjmp .-958 ; 0x30a50 } // 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]; 30e0e: 25 96 adiw r28, 0x05 ; 5 30e10: 2c ad ldd r18, Y+60 ; 0x3c 30e12: 3d ad ldd r19, Y+61 ; 0x3d 30e14: 4e ad ldd r20, Y+62 ; 0x3e 30e16: 5f ad ldd r21, Y+63 ; 0x3f 30e18: 25 97 sbiw r28, 0x05 ; 5 30e1a: ae 96 adiw r28, 0x2e ; 46 30e1c: 2c af std Y+60, r18 ; 0x3c 30e1e: 3d af std Y+61, r19 ; 0x3d 30e20: 4e af std Y+62, r20 ; 0x3e 30e22: 5f af std Y+63, r21 ; 0x3f 30e24: ae 97 sbiw r28, 0x2e ; 46 30e26: 8d 81 ldd r24, Y+5 ; 0x05 30e28: 9e 81 ldd r25, Y+6 ; 0x06 30e2a: af 81 ldd r26, Y+7 ; 0x07 30e2c: b8 85 ldd r27, Y+8 ; 0x08 30e2e: e4 96 adiw r28, 0x34 ; 52 30e30: 8c af std Y+60, r24 ; 0x3c 30e32: 9d af std Y+61, r25 ; 0x3d 30e34: ae af std Y+62, r26 ; 0x3e 30e36: bf af std Y+63, r27 ; 0x3f 30e38: e4 97 sbiw r28, 0x34 ; 52 30e3a: 29 85 ldd r18, Y+9 ; 0x09 30e3c: 3a 85 ldd r19, Y+10 ; 0x0a 30e3e: 4b 85 ldd r20, Y+11 ; 0x0b 30e40: 5c 85 ldd r21, Y+12 ; 0x0c 30e42: ed 96 adiw r28, 0x3d ; 61 30e44: 2c af std Y+60, r18 ; 0x3c 30e46: 3d af std Y+61, r19 ; 0x3d 30e48: 4e af std Y+62, r20 ; 0x3e 30e4a: 5f af std Y+63, r21 ; 0x3f 30e4c: ed 97 sbiw r28, 0x3d ; 61 30e4e: 8d 85 ldd r24, Y+13 ; 0x0d 30e50: 9e 85 ldd r25, Y+14 ; 0x0e 30e52: af 85 ldd r26, Y+15 ; 0x0f 30e54: b8 89 ldd r27, Y+16 ; 0x10 30e56: c3 58 subi r28, 0x83 ; 131 30e58: df 4f sbci r29, 0xFF ; 255 30e5a: 88 83 st Y, r24 30e5c: 99 83 std Y+1, r25 ; 0x01 30e5e: aa 83 std Y+2, r26 ; 0x02 30e60: bb 83 std Y+3, r27 ; 0x03 30e62: cd 57 subi r28, 0x7D ; 125 30e64: d0 40 sbci r29, 0x00 ; 0 30e66: 29 81 ldd r18, Y+1 ; 0x01 30e68: 3a 81 ldd r19, Y+2 ; 0x02 30e6a: 4b 81 ldd r20, Y+3 ; 0x03 30e6c: 5c 81 ldd r21, Y+4 ; 0x04 30e6e: cf 57 subi r28, 0x7F ; 127 30e70: df 4f sbci r29, 0xFF ; 255 30e72: 28 83 st Y, r18 30e74: 39 83 std Y+1, r19 ; 0x01 30e76: 4a 83 std Y+2, r20 ; 0x02 30e78: 5b 83 std Y+3, r21 ; 0x03 30e7a: c1 58 subi r28, 0x81 ; 129 30e7c: 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]; 30e7e: 29 96 adiw r28, 0x09 ; 9 30e80: 8c ad ldd r24, Y+60 ; 0x3c 30e82: 9d ad ldd r25, Y+61 ; 0x3d 30e84: ae ad ldd r26, Y+62 ; 0x3e 30e86: bf ad ldd r27, Y+63 ; 0x3f 30e88: 29 97 sbiw r28, 0x09 ; 9 30e8a: cb 57 subi r28, 0x7B ; 123 30e8c: df 4f sbci r29, 0xFF ; 255 30e8e: 88 83 st Y, r24 30e90: 99 83 std Y+1, r25 ; 0x01 30e92: aa 83 std Y+2, r26 ; 0x02 30e94: bb 83 std Y+3, r27 ; 0x03 30e96: c5 58 subi r28, 0x85 ; 133 30e98: d0 40 sbci r29, 0x00 ; 0 30e9a: 29 89 ldd r18, Y+17 ; 0x11 30e9c: 3a 89 ldd r19, Y+18 ; 0x12 30e9e: 4b 89 ldd r20, Y+19 ; 0x13 30ea0: 5c 89 ldd r21, Y+20 ; 0x14 30ea2: c7 57 subi r28, 0x77 ; 119 30ea4: df 4f sbci r29, 0xFF ; 255 30ea6: 28 83 st Y, r18 30ea8: 39 83 std Y+1, r19 ; 0x01 30eaa: 4a 83 std Y+2, r20 ; 0x02 30eac: 5b 83 std Y+3, r21 ; 0x03 30eae: c9 58 subi r28, 0x89 ; 137 30eb0: d0 40 sbci r29, 0x00 ; 0 30eb2: 89 8d ldd r24, Y+25 ; 0x19 30eb4: 9a 8d ldd r25, Y+26 ; 0x1a 30eb6: ab 8d ldd r26, Y+27 ; 0x1b 30eb8: bc 8d ldd r27, Y+28 ; 0x1c 30eba: cb 56 subi r28, 0x6B ; 107 30ebc: df 4f sbci r29, 0xFF ; 255 30ebe: 88 83 st Y, r24 30ec0: 99 83 std Y+1, r25 ; 0x01 30ec2: aa 83 std Y+2, r26 ; 0x02 30ec4: bb 83 std Y+3, r27 ; 0x03 30ec6: c5 59 subi r28, 0x95 ; 149 30ec8: d0 40 sbci r29, 0x00 ; 0 30eca: 2d 8d ldd r18, Y+29 ; 0x1d 30ecc: 3e 8d ldd r19, Y+30 ; 0x1e 30ece: 4f 8d ldd r20, Y+31 ; 0x1f 30ed0: 58 a1 ldd r21, Y+32 ; 0x20 30ed2: c7 56 subi r28, 0x67 ; 103 30ed4: df 4f sbci r29, 0xFF ; 255 30ed6: 28 83 st Y, r18 30ed8: 39 83 std Y+1, r19 ; 0x01 30eda: 4a 83 std Y+2, r20 ; 0x02 30edc: 5b 83 std Y+3, r21 ; 0x03 30ede: c9 59 subi r28, 0x99 ; 153 30ee0: d0 40 sbci r29, 0x00 ; 0 30ee2: 8d 89 ldd r24, Y+21 ; 0x15 30ee4: 9e 89 ldd r25, Y+22 ; 0x16 30ee6: af 89 ldd r26, Y+23 ; 0x17 30ee8: b8 8d ldd r27, Y+24 ; 0x18 30eea: c3 57 subi r28, 0x73 ; 115 30eec: df 4f sbci r29, 0xFF ; 255 30eee: 88 83 st Y, r24 30ef0: 99 83 std Y+1, r25 ; 0x01 30ef2: aa 83 std Y+2, r26 ; 0x02 30ef4: bb 83 std Y+3, r27 ; 0x03 30ef6: cd 58 subi r28, 0x8D ; 141 30ef8: 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]; 30efa: 2d 96 adiw r28, 0x0d ; 13 30efc: 2c ad ldd r18, Y+60 ; 0x3c 30efe: 3d ad ldd r19, Y+61 ; 0x3d 30f00: 4e ad ldd r20, Y+62 ; 0x3e 30f02: 5f ad ldd r21, Y+63 ; 0x3f 30f04: 2d 97 sbiw r28, 0x0d ; 13 30f06: c3 56 subi r28, 0x63 ; 99 30f08: df 4f sbci r29, 0xFF ; 255 30f0a: 28 83 st Y, r18 30f0c: 39 83 std Y+1, r19 ; 0x01 30f0e: 4a 83 std Y+2, r20 ; 0x02 30f10: 5b 83 std Y+3, r21 ; 0x03 30f12: cd 59 subi r28, 0x9D ; 157 30f14: d0 40 sbci r29, 0x00 ; 0 30f16: 89 a1 ldd r24, Y+33 ; 0x21 30f18: 9a a1 ldd r25, Y+34 ; 0x22 30f1a: ab a1 ldd r26, Y+35 ; 0x23 30f1c: bc a1 ldd r27, Y+36 ; 0x24 30f1e: cf 55 subi r28, 0x5F ; 95 30f20: df 4f sbci r29, 0xFF ; 255 30f22: 88 83 st Y, r24 30f24: 99 83 std Y+1, r25 ; 0x01 30f26: aa 83 std Y+2, r26 ; 0x02 30f28: bb 83 std Y+3, r27 ; 0x03 30f2a: c1 5a subi r28, 0xA1 ; 161 30f2c: d0 40 sbci r29, 0x00 ; 0 30f2e: 2d a1 ldd r18, Y+37 ; 0x25 30f30: 3e a1 ldd r19, Y+38 ; 0x26 30f32: 4f a1 ldd r20, Y+39 ; 0x27 30f34: 58 a5 ldd r21, Y+40 ; 0x28 30f36: cb 55 subi r28, 0x5B ; 91 30f38: df 4f sbci r29, 0xFF ; 255 30f3a: 28 83 st Y, r18 30f3c: 39 83 std Y+1, r19 ; 0x01 30f3e: 4a 83 std Y+2, r20 ; 0x02 30f40: 5b 83 std Y+3, r21 ; 0x03 30f42: c5 5a subi r28, 0xA5 ; 165 30f44: d0 40 sbci r29, 0x00 ; 0 30f46: 8d a5 ldd r24, Y+45 ; 0x2d 30f48: 9e a5 ldd r25, Y+46 ; 0x2e 30f4a: af a5 ldd r26, Y+47 ; 0x2f 30f4c: b8 a9 ldd r27, Y+48 ; 0x30 30f4e: cd 54 subi r28, 0x4D ; 77 30f50: df 4f sbci r29, 0xFF ; 255 30f52: 88 83 st Y, r24 30f54: 99 83 std Y+1, r25 ; 0x01 30f56: aa 83 std Y+2, r26 ; 0x02 30f58: bb 83 std Y+3, r27 ; 0x03 30f5a: c3 5b subi r28, 0xB3 ; 179 30f5c: d0 40 sbci r29, 0x00 ; 0 30f5e: 29 a5 ldd r18, Y+41 ; 0x29 30f60: 3a a5 ldd r19, Y+42 ; 0x2a 30f62: 4b a5 ldd r20, Y+43 ; 0x2b 30f64: 5c a5 ldd r21, Y+44 ; 0x2c 30f66: c9 54 subi r28, 0x49 ; 73 30f68: df 4f sbci r29, 0xFF ; 255 30f6a: 28 83 st Y, r18 30f6c: 39 83 std Y+1, r19 ; 0x01 30f6e: 4a 83 std Y+2, r20 ; 0x02 30f70: 5b 83 std Y+3, r21 ; 0x03 30f72: c7 5b subi r28, 0xB7 ; 183 30f74: 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]; 30f76: 61 96 adiw r28, 0x11 ; 17 30f78: 8c ad ldd r24, Y+60 ; 0x3c 30f7a: 9d ad ldd r25, Y+61 ; 0x3d 30f7c: ae ad ldd r26, Y+62 ; 0x3e 30f7e: bf ad ldd r27, Y+63 ; 0x3f 30f80: 61 97 sbiw r28, 0x11 ; 17 30f82: c5 54 subi r28, 0x45 ; 69 30f84: df 4f sbci r29, 0xFF ; 255 30f86: 88 83 st Y, r24 30f88: 99 83 std Y+1, r25 ; 0x01 30f8a: aa 83 std Y+2, r26 ; 0x02 30f8c: bb 83 std Y+3, r27 ; 0x03 30f8e: cb 5b subi r28, 0xBB ; 187 30f90: d0 40 sbci r29, 0x00 ; 0 30f92: 29 a9 ldd r18, Y+49 ; 0x31 30f94: 3a a9 ldd r19, Y+50 ; 0x32 30f96: 4b a9 ldd r20, Y+51 ; 0x33 30f98: 5c a9 ldd r21, Y+52 ; 0x34 30f9a: c1 54 subi r28, 0x41 ; 65 30f9c: df 4f sbci r29, 0xFF ; 255 30f9e: 28 83 st Y, r18 30fa0: 39 83 std Y+1, r19 ; 0x01 30fa2: 4a 83 std Y+2, r20 ; 0x02 30fa4: 5b 83 std Y+3, r21 ; 0x03 30fa6: cf 5b subi r28, 0xBF ; 191 30fa8: d0 40 sbci r29, 0x00 ; 0 30faa: 8d a9 ldd r24, Y+53 ; 0x35 30fac: 9e a9 ldd r25, Y+54 ; 0x36 30fae: af a9 ldd r26, Y+55 ; 0x37 30fb0: b8 ad ldd r27, Y+56 ; 0x38 30fb2: cd 53 subi r28, 0x3D ; 61 30fb4: df 4f sbci r29, 0xFF ; 255 30fb6: 88 83 st Y, r24 30fb8: 99 83 std Y+1, r25 ; 0x01 30fba: aa 83 std Y+2, r26 ; 0x02 30fbc: bb 83 std Y+3, r27 ; 0x03 30fbe: c3 5c subi r28, 0xC3 ; 195 30fc0: d0 40 sbci r29, 0x00 ; 0 30fc2: 29 ad ldd r18, Y+57 ; 0x39 30fc4: 3a ad ldd r19, Y+58 ; 0x3a 30fc6: 4b ad ldd r20, Y+59 ; 0x3b 30fc8: 5c ad ldd r21, Y+60 ; 0x3c 30fca: c9 53 subi r28, 0x39 ; 57 30fcc: df 4f sbci r29, 0xFF ; 255 30fce: 28 83 st Y, r18 30fd0: 39 83 std Y+1, r19 ; 0x01 30fd2: 4a 83 std Y+2, r20 ; 0x02 30fd4: 5b 83 std Y+3, r21 ; 0x03 30fd6: c7 5c subi r28, 0xC7 ; 199 30fd8: d0 40 sbci r29, 0x00 ; 0 30fda: 21 96 adiw r28, 0x01 ; 1 30fdc: 8c ad ldd r24, Y+60 ; 0x3c 30fde: 9d ad ldd r25, Y+61 ; 0x3d 30fe0: ae ad ldd r26, Y+62 ; 0x3e 30fe2: bf ad ldd r27, Y+63 ; 0x3f 30fe4: 21 97 sbiw r28, 0x01 ; 1 30fe6: c5 53 subi r28, 0x35 ; 53 30fe8: df 4f sbci r29, 0xFF ; 255 30fea: 88 83 st Y, r24 30fec: 99 83 std Y+1, r25 ; 0x01 30fee: aa 83 std Y+2, r26 ; 0x02 30ff0: bb 83 std Y+3, r27 ; 0x03 30ff2: cb 5c subi r28, 0xCB ; 203 30ff4: d0 40 sbci r29, 0x00 ; 0 30ff6: 14 e6 ldi r17, 0x64 ; 100 } b[r] = -acc; } // Solve for h by a Gauss iteration method. float h[4] = { 0.f }; 30ff8: c1 2c mov r12, r1 30ffa: d1 2c mov r13, r1 30ffc: 76 01 movw r14, r12 30ffe: 46 01 movw r8, r12 31000: 57 01 movw r10, r14 31002: 26 01 movw r4, r12 31004: 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]; 31006: a3 01 movw r20, r6 31008: 92 01 movw r18, r4 3100a: e4 96 adiw r28, 0x34 ; 52 3100c: 6c ad ldd r22, Y+60 ; 0x3c 3100e: 7d ad ldd r23, Y+61 ; 0x3d 31010: 8e ad ldd r24, Y+62 ; 0x3e 31012: 9f ad ldd r25, Y+63 ; 0x3f 31014: e4 97 sbiw r28, 0x34 ; 52 31016: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3101a: 9b 01 movw r18, r22 3101c: ac 01 movw r20, r24 3101e: ae 96 adiw r28, 0x2e ; 46 31020: 6c ad ldd r22, Y+60 ; 0x3c 31022: 7d ad ldd r23, Y+61 ; 0x3d 31024: 8e ad ldd r24, Y+62 ; 0x3e 31026: 9f ad ldd r25, Y+63 ; 0x3f 31028: ae 97 sbiw r28, 0x2e ; 46 3102a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 3102e: 2b 01 movw r4, r22 31030: 3c 01 movw r6, r24 31032: a5 01 movw r20, r10 31034: 94 01 movw r18, r8 31036: ed 96 adiw r28, 0x3d ; 61 31038: 6c ad ldd r22, Y+60 ; 0x3c 3103a: 7d ad ldd r23, Y+61 ; 0x3d 3103c: 8e ad ldd r24, Y+62 ; 0x3e 3103e: 9f ad ldd r25, Y+63 ; 0x3f 31040: ed 97 sbiw r28, 0x3d ; 61 31042: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31046: 9b 01 movw r18, r22 31048: ac 01 movw r20, r24 3104a: c3 01 movw r24, r6 3104c: b2 01 movw r22, r4 3104e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 31052: 2b 01 movw r4, r22 31054: 3c 01 movw r6, r24 31056: a7 01 movw r20, r14 31058: 96 01 movw r18, r12 3105a: c3 58 subi r28, 0x83 ; 131 3105c: df 4f sbci r29, 0xFF ; 255 3105e: 68 81 ld r22, Y 31060: 79 81 ldd r23, Y+1 ; 0x01 31062: 8a 81 ldd r24, Y+2 ; 0x02 31064: 9b 81 ldd r25, Y+3 ; 0x03 31066: cd 57 subi r28, 0x7D ; 125 31068: d0 40 sbci r29, 0x00 ; 0 3106a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3106e: 9b 01 movw r18, r22 31070: ac 01 movw r20, r24 31072: c3 01 movw r24, r6 31074: b2 01 movw r22, r4 31076: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 3107a: cf 57 subi r28, 0x7F ; 127 3107c: df 4f sbci r29, 0xFF ; 255 3107e: 28 81 ld r18, Y 31080: 39 81 ldd r19, Y+1 ; 0x01 31082: 4a 81 ldd r20, Y+2 ; 0x02 31084: 5b 81 ldd r21, Y+3 ; 0x03 31086: c1 58 subi r28, 0x81 ; 129 31088: d0 40 sbci r29, 0x00 ; 0 3108a: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 3108e: 6e 96 adiw r28, 0x1e ; 30 31090: 6c af std Y+60, r22 ; 0x3c 31092: 7d af std Y+61, r23 ; 0x3d 31094: 8e af std Y+62, r24 ; 0x3e 31096: 9f af std Y+63, r25 ; 0x3f 31098: 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]; 3109a: c7 57 subi r28, 0x77 ; 119 3109c: df 4f sbci r29, 0xFF ; 255 3109e: 28 81 ld r18, Y 310a0: 39 81 ldd r19, Y+1 ; 0x01 310a2: 4a 81 ldd r20, Y+2 ; 0x02 310a4: 5b 81 ldd r21, Y+3 ; 0x03 310a6: c9 58 subi r28, 0x89 ; 137 310a8: d0 40 sbci r29, 0x00 ; 0 310aa: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 310ae: 9b 01 movw r18, r22 310b0: ac 01 movw r20, r24 310b2: cb 57 subi r28, 0x7B ; 123 310b4: df 4f sbci r29, 0xFF ; 255 310b6: 68 81 ld r22, Y 310b8: 79 81 ldd r23, Y+1 ; 0x01 310ba: 8a 81 ldd r24, Y+2 ; 0x02 310bc: 9b 81 ldd r25, Y+3 ; 0x03 310be: c5 58 subi r28, 0x85 ; 133 310c0: d0 40 sbci r29, 0x00 ; 0 310c2: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 310c6: 2b 01 movw r4, r22 310c8: 3c 01 movw r6, r24 310ca: a5 01 movw r20, r10 310cc: 94 01 movw r18, r8 310ce: cb 56 subi r28, 0x6B ; 107 310d0: df 4f sbci r29, 0xFF ; 255 310d2: 68 81 ld r22, Y 310d4: 79 81 ldd r23, Y+1 ; 0x01 310d6: 8a 81 ldd r24, Y+2 ; 0x02 310d8: 9b 81 ldd r25, Y+3 ; 0x03 310da: c5 59 subi r28, 0x95 ; 149 310dc: d0 40 sbci r29, 0x00 ; 0 310de: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 310e2: 9b 01 movw r18, r22 310e4: ac 01 movw r20, r24 310e6: c3 01 movw r24, r6 310e8: b2 01 movw r22, r4 310ea: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 310ee: 4b 01 movw r8, r22 310f0: 5c 01 movw r10, r24 310f2: a7 01 movw r20, r14 310f4: 96 01 movw r18, r12 310f6: c7 56 subi r28, 0x67 ; 103 310f8: df 4f sbci r29, 0xFF ; 255 310fa: 68 81 ld r22, Y 310fc: 79 81 ldd r23, Y+1 ; 0x01 310fe: 8a 81 ldd r24, Y+2 ; 0x02 31100: 9b 81 ldd r25, Y+3 ; 0x03 31102: c9 59 subi r28, 0x99 ; 153 31104: d0 40 sbci r29, 0x00 ; 0 31106: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3110a: 9b 01 movw r18, r22 3110c: ac 01 movw r20, r24 3110e: c5 01 movw r24, r10 31110: b4 01 movw r22, r8 31112: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 31116: c3 57 subi r28, 0x73 ; 115 31118: df 4f sbci r29, 0xFF ; 255 3111a: 28 81 ld r18, Y 3111c: 39 81 ldd r19, Y+1 ; 0x01 3111e: 4a 81 ldd r20, Y+2 ; 0x02 31120: 5b 81 ldd r21, Y+3 ; 0x03 31122: cd 58 subi r28, 0x8D ; 141 31124: d0 40 sbci r29, 0x00 ; 0 31126: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 3112a: 2b 01 movw r4, r22 3112c: 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]; 3112e: cf 55 subi r28, 0x5F ; 95 31130: df 4f sbci r29, 0xFF ; 255 31132: 28 81 ld r18, Y 31134: 39 81 ldd r19, Y+1 ; 0x01 31136: 4a 81 ldd r20, Y+2 ; 0x02 31138: 5b 81 ldd r21, Y+3 ; 0x03 3113a: c1 5a subi r28, 0xA1 ; 161 3113c: d0 40 sbci r29, 0x00 ; 0 3113e: 6e 96 adiw r28, 0x1e ; 30 31140: 6c ad ldd r22, Y+60 ; 0x3c 31142: 7d ad ldd r23, Y+61 ; 0x3d 31144: 8e ad ldd r24, Y+62 ; 0x3e 31146: 9f ad ldd r25, Y+63 ; 0x3f 31148: 6e 97 sbiw r28, 0x1e ; 30 3114a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3114e: 9b 01 movw r18, r22 31150: ac 01 movw r20, r24 31152: c3 56 subi r28, 0x63 ; 99 31154: df 4f sbci r29, 0xFF ; 255 31156: 68 81 ld r22, Y 31158: 79 81 ldd r23, Y+1 ; 0x01 3115a: 8a 81 ldd r24, Y+2 ; 0x02 3115c: 9b 81 ldd r25, Y+3 ; 0x03 3115e: cd 59 subi r28, 0x9D ; 157 31160: d0 40 sbci r29, 0x00 ; 0 31162: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 31166: 4b 01 movw r8, r22 31168: 5c 01 movw r10, r24 3116a: cb 55 subi r28, 0x5B ; 91 3116c: df 4f sbci r29, 0xFF ; 255 3116e: 28 81 ld r18, Y 31170: 39 81 ldd r19, Y+1 ; 0x01 31172: 4a 81 ldd r20, Y+2 ; 0x02 31174: 5b 81 ldd r21, Y+3 ; 0x03 31176: c5 5a subi r28, 0xA5 ; 165 31178: d0 40 sbci r29, 0x00 ; 0 3117a: c3 01 movw r24, r6 3117c: b2 01 movw r22, r4 3117e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31182: 9b 01 movw r18, r22 31184: ac 01 movw r20, r24 31186: c5 01 movw r24, r10 31188: b4 01 movw r22, r8 3118a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 3118e: 4b 01 movw r8, r22 31190: 5c 01 movw r10, r24 31192: a7 01 movw r20, r14 31194: 96 01 movw r18, r12 31196: cd 54 subi r28, 0x4D ; 77 31198: df 4f sbci r29, 0xFF ; 255 3119a: 68 81 ld r22, Y 3119c: 79 81 ldd r23, Y+1 ; 0x01 3119e: 8a 81 ldd r24, Y+2 ; 0x02 311a0: 9b 81 ldd r25, Y+3 ; 0x03 311a2: c3 5b subi r28, 0xB3 ; 179 311a4: d0 40 sbci r29, 0x00 ; 0 311a6: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 311aa: 9b 01 movw r18, r22 311ac: ac 01 movw r20, r24 311ae: c5 01 movw r24, r10 311b0: b4 01 movw r22, r8 311b2: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 311b6: c9 54 subi r28, 0x49 ; 73 311b8: df 4f sbci r29, 0xFF ; 255 311ba: 28 81 ld r18, Y 311bc: 39 81 ldd r19, Y+1 ; 0x01 311be: 4a 81 ldd r20, Y+2 ; 0x02 311c0: 5b 81 ldd r21, Y+3 ; 0x03 311c2: c7 5b subi r28, 0xB7 ; 183 311c4: d0 40 sbci r29, 0x00 ; 0 311c6: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 311ca: 4b 01 movw r8, r22 311cc: 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]; 311ce: c1 54 subi r28, 0x41 ; 65 311d0: df 4f sbci r29, 0xFF ; 255 311d2: 28 81 ld r18, Y 311d4: 39 81 ldd r19, Y+1 ; 0x01 311d6: 4a 81 ldd r20, Y+2 ; 0x02 311d8: 5b 81 ldd r21, Y+3 ; 0x03 311da: cf 5b subi r28, 0xBF ; 191 311dc: d0 40 sbci r29, 0x00 ; 0 311de: 6e 96 adiw r28, 0x1e ; 30 311e0: 6c ad ldd r22, Y+60 ; 0x3c 311e2: 7d ad ldd r23, Y+61 ; 0x3d 311e4: 8e ad ldd r24, Y+62 ; 0x3e 311e6: 9f ad ldd r25, Y+63 ; 0x3f 311e8: 6e 97 sbiw r28, 0x1e ; 30 311ea: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 311ee: 9b 01 movw r18, r22 311f0: ac 01 movw r20, r24 311f2: c5 54 subi r28, 0x45 ; 69 311f4: df 4f sbci r29, 0xFF ; 255 311f6: 68 81 ld r22, Y 311f8: 79 81 ldd r23, Y+1 ; 0x01 311fa: 8a 81 ldd r24, Y+2 ; 0x02 311fc: 9b 81 ldd r25, Y+3 ; 0x03 311fe: cb 5b subi r28, 0xBB ; 187 31200: d0 40 sbci r29, 0x00 ; 0 31202: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 31206: 6b 01 movw r12, r22 31208: 7c 01 movw r14, r24 3120a: cd 53 subi r28, 0x3D ; 61 3120c: df 4f sbci r29, 0xFF ; 255 3120e: 28 81 ld r18, Y 31210: 39 81 ldd r19, Y+1 ; 0x01 31212: 4a 81 ldd r20, Y+2 ; 0x02 31214: 5b 81 ldd r21, Y+3 ; 0x03 31216: c3 5c subi r28, 0xC3 ; 195 31218: d0 40 sbci r29, 0x00 ; 0 3121a: c3 01 movw r24, r6 3121c: b2 01 movw r22, r4 3121e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31222: 9b 01 movw r18, r22 31224: ac 01 movw r20, r24 31226: c7 01 movw r24, r14 31228: b6 01 movw r22, r12 3122a: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 3122e: 6b 01 movw r12, r22 31230: 7c 01 movw r14, r24 31232: c9 53 subi r28, 0x39 ; 57 31234: df 4f sbci r29, 0xFF ; 255 31236: 28 81 ld r18, Y 31238: 39 81 ldd r19, Y+1 ; 0x01 3123a: 4a 81 ldd r20, Y+2 ; 0x02 3123c: 5b 81 ldd r21, Y+3 ; 0x03 3123e: c7 5c subi r28, 0xC7 ; 199 31240: d0 40 sbci r29, 0x00 ; 0 31242: c5 01 movw r24, r10 31244: b4 01 movw r22, r8 31246: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3124a: 9b 01 movw r18, r22 3124c: ac 01 movw r20, r24 3124e: c7 01 movw r24, r14 31250: b6 01 movw r22, r12 31252: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 31256: c5 53 subi r28, 0x35 ; 53 31258: df 4f sbci r29, 0xFF ; 255 3125a: 28 81 ld r18, Y 3125c: 39 81 ldd r19, Y+1 ; 0x01 3125e: 4a 81 ldd r20, Y+2 ; 0x02 31260: 5b 81 ldd r21, Y+3 ; 0x03 31262: cb 5c subi r28, 0xCB ; 203 31264: d0 40 sbci r29, 0x00 ; 0 31266: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 3126a: 6b 01 movw r12, r22 3126c: 7c 01 movw r14, r24 3126e: 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) { 31270: 09 f0 breq .+2 ; 0x31274 31272: c9 ce rjmp .-622 ; 0x31006 // 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]; 31274: 6e 96 adiw r28, 0x1e ; 30 31276: 2c ad ldd r18, Y+60 ; 0x3c 31278: 3d ad ldd r19, Y+61 ; 0x3d 3127a: 4e ad ldd r20, Y+62 ; 0x3e 3127c: 5f ad ldd r21, Y+63 ; 0x3f 3127e: 6e 97 sbiw r28, 0x1e ; 30 31280: c5 55 subi r28, 0x55 ; 85 31282: df 4f sbci r29, 0xFF ; 255 31284: 68 81 ld r22, Y 31286: 79 81 ldd r23, Y+1 ; 0x01 31288: 8a 81 ldd r24, Y+2 ; 0x02 3128a: 9b 81 ldd r25, Y+3 ; 0x03 3128c: cb 5a subi r28, 0xAB ; 171 3128e: d0 40 sbci r29, 0x00 ; 0 31290: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 31294: 60 93 3a 13 sts 0x133A, r22 ; 0x80133a 31298: 70 93 3b 13 sts 0x133B, r23 ; 0x80133b 3129c: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c 312a0: 90 93 3d 13 sts 0x133D, r25 ; 0x80133d cntr[1] += h[1]; 312a4: a3 01 movw r20, r6 312a6: 92 01 movw r18, r4 312a8: c1 55 subi r28, 0x51 ; 81 312aa: df 4f sbci r29, 0xFF ; 255 312ac: 68 81 ld r22, Y 312ae: 79 81 ldd r23, Y+1 ; 0x01 312b0: 8a 81 ldd r24, Y+2 ; 0x02 312b2: 9b 81 ldd r25, Y+3 ; 0x03 312b4: cf 5a subi r28, 0xAF ; 175 312b6: d0 40 sbci r29, 0x00 ; 0 312b8: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 312bc: 60 93 3e 13 sts 0x133E, r22 ; 0x80133e 312c0: 70 93 3f 13 sts 0x133F, r23 ; 0x80133f 312c4: 80 93 40 13 sts 0x1340, r24 ; 0x801340 312c8: 90 93 41 13 sts 0x1341, r25 ; 0x801341 a1 += h[2]; 312cc: a5 01 movw r20, r10 312ce: 94 01 movw r18, r8 312d0: a6 96 adiw r28, 0x26 ; 38 312d2: 6c ad ldd r22, Y+60 ; 0x3c 312d4: 7d ad ldd r23, Y+61 ; 0x3d 312d6: 8e ad ldd r24, Y+62 ; 0x3e 312d8: 9f ad ldd r25, Y+63 ; 0x3f 312da: a6 97 sbiw r28, 0x26 ; 38 312dc: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 312e0: a6 96 adiw r28, 0x26 ; 38 312e2: 6c af std Y+60, r22 ; 0x3c 312e4: 7d af std Y+61, r23 ; 0x3d 312e6: 8e af std Y+62, r24 ; 0x3e 312e8: 9f af std Y+63, r25 ; 0x3f 312ea: a6 97 sbiw r28, 0x26 ; 38 a2 += h[3]; 312ec: a7 01 movw r20, r14 312ee: 96 01 movw r18, r12 312f0: a2 96 adiw r28, 0x22 ; 34 312f2: 6c ad ldd r22, Y+60 ; 0x3c 312f4: 7d ad ldd r23, Y+61 ; 0x3d 312f6: 8e ad ldd r24, Y+62 ; 0x3e 312f8: 9f ad ldd r25, Y+63 ; 0x3f 312fa: a2 97 sbiw r28, 0x22 ; 34 312fc: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 31300: a2 96 adiw r28, 0x22 ; 34 31302: 6c af std Y+60, r22 ; 0x3c 31304: 7d af std Y+61, r23 ; 0x3d 31306: 8e af std Y+62, r24 ; 0x3e 31308: 9f af std Y+63, r25 ; 0x3f 3130a: a2 97 sbiw r28, 0x22 ; 34 3130c: e6 96 adiw r28, 0x36 ; 54 3130e: 9f ad ldd r25, Y+63 ; 0x3f 31310: e6 97 sbiw r28, 0x36 ; 54 31312: 91 50 subi r25, 0x01 ; 1 31314: e6 96 adiw r28, 0x36 ; 54 31316: 9f af std Y+63, r25 ; 0x3f 31318: 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) { 3131a: 91 11 cpse r25, r1 3131c: e6 ca rjmp .-2612 ; 0x308ea SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 3131e: a6 96 adiw r28, 0x26 ; 38 31320: 6c ad ldd r22, Y+60 ; 0x3c 31322: 7d ad ldd r23, Y+61 ; 0x3d 31324: 8e ad ldd r24, Y+62 ; 0x3e 31326: 9f ad ldd r25, Y+63 ; 0x3f 31328: a6 97 sbiw r28, 0x26 ; 38 3132a: 0f 94 a3 a6 call 0x34d46 ; 0x34d46 3132e: 60 93 2a 13 sts 0x132A, r22 ; 0x80132a 31332: 70 93 2b 13 sts 0x132B, r23 ; 0x80132b 31336: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 3133a: 90 93 2d 13 sts 0x132D, r25 ; 0x80132d vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 3133e: a6 96 adiw r28, 0x26 ; 38 31340: 6c ad ldd r22, Y+60 ; 0x3c 31342: 7d ad ldd r23, Y+61 ; 0x3d 31344: 8e ad ldd r24, Y+62 ; 0x3e 31346: 9f ad ldd r25, Y+63 ; 0x3f 31348: a6 97 sbiw r28, 0x26 ; 38 3134a: 0f 94 69 a9 call 0x352d2 ; 0x352d2 3134e: 60 93 2e 13 sts 0x132E, r22 ; 0x80132e 31352: 70 93 2f 13 sts 0x132F, r23 ; 0x80132f 31356: 80 93 30 13 sts 0x1330, r24 ; 0x801330 3135a: 90 93 31 13 sts 0x1331, r25 ; 0x801331 vec_y[0] = -sin(a2) * MACHINE_AXIS_SCALE_Y; 3135e: a2 96 adiw r28, 0x22 ; 34 31360: 6c ad ldd r22, Y+60 ; 0x3c 31362: 7d ad ldd r23, Y+61 ; 0x3d 31364: 8e ad ldd r24, Y+62 ; 0x3e 31366: 9f ad ldd r25, Y+63 ; 0x3f 31368: a2 97 sbiw r28, 0x22 ; 34 3136a: 0f 94 69 a9 call 0x352d2 ; 0x352d2 3136e: 90 58 subi r25, 0x80 ; 128 31370: 60 93 32 13 sts 0x1332, r22 ; 0x801332 31374: 70 93 33 13 sts 0x1333, r23 ; 0x801333 31378: 80 93 34 13 sts 0x1334, r24 ; 0x801334 3137c: 90 93 35 13 sts 0x1335, r25 ; 0x801335 vec_y[1] = cos(a2) * MACHINE_AXIS_SCALE_Y; 31380: a2 96 adiw r28, 0x22 ; 34 31382: 6c ad ldd r22, Y+60 ; 0x3c 31384: 7d ad ldd r23, Y+61 ; 0x3d 31386: 8e ad ldd r24, Y+62 ; 0x3e 31388: 9f ad ldd r25, Y+63 ; 0x3f 3138a: a2 97 sbiw r28, 0x22 ; 34 3138c: 0f 94 a3 a6 call 0x34d46 ; 0x34d46 31390: 60 93 36 13 sts 0x1336, r22 ; 0x801336 31394: 70 93 37 13 sts 0x1337, r23 ; 0x801337 31398: 80 93 38 13 sts 0x1338, r24 ; 0x801338 3139c: 90 93 39 13 sts 0x1339, r25 ; 0x801339 BedSkewOffsetDetectionResultType result = BED_SKEW_OFFSET_DETECTION_PERFECT; { angleDiff = fabs(a2 - a1); 313a0: a6 96 adiw r28, 0x26 ; 38 313a2: 2c ad ldd r18, Y+60 ; 0x3c 313a4: 3d ad ldd r19, Y+61 ; 0x3d 313a6: 4e ad ldd r20, Y+62 ; 0x3e 313a8: 5f ad ldd r21, Y+63 ; 0x3f 313aa: a6 97 sbiw r28, 0x26 ; 38 313ac: a2 96 adiw r28, 0x22 ; 34 313ae: 6c ad ldd r22, Y+60 ; 0x3c 313b0: 7d ad ldd r23, Y+61 ; 0x3d 313b2: 8e ad ldd r24, Y+62 ; 0x3e 313b4: 9f ad ldd r25, Y+63 ; 0x3f 313b6: a2 97 sbiw r28, 0x22 ; 34 313b8: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 313bc: 4b 01 movw r8, r22 313be: 5c 01 movw r10, r24 313c0: 7c 01 movw r14, r24 313c2: 6b 01 movw r12, r22 313c4: e8 94 clt 313c6: f7 f8 bld r15, 7 /// XY skew and Y-bed skew DBG(_n("Measured skews: %f %f\n"), degrees(a2 - a1), degrees(a2)); 313c8: 21 ee ldi r18, 0xE1 ; 225 313ca: 3e e2 ldi r19, 0x2E ; 46 313cc: 45 e6 ldi r20, 0x65 ; 101 313ce: 52 e4 ldi r21, 0x42 ; 66 313d0: a2 96 adiw r28, 0x22 ; 34 313d2: 6c ad ldd r22, Y+60 ; 0x3c 313d4: 7d ad ldd r23, Y+61 ; 0x3d 313d6: 8e ad ldd r24, Y+62 ; 0x3e 313d8: 9f ad ldd r25, Y+63 ; 0x3f 313da: a2 97 sbiw r28, 0x22 ; 34 313dc: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 313e0: 9f 93 push r25 313e2: 8f 93 push r24 313e4: 7f 93 push r23 313e6: 6f 93 push r22 313e8: 21 ee ldi r18, 0xE1 ; 225 313ea: 3e e2 ldi r19, 0x2E ; 46 313ec: 45 e6 ldi r20, 0x65 ; 101 313ee: 52 e4 ldi r21, 0x42 ; 66 313f0: c5 01 movw r24, r10 313f2: b4 01 movw r22, r8 313f4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 313f8: 9f 93 push r25 313fa: 8f 93 push r24 313fc: 7f 93 push r23 313fe: 6f 93 push r22 31400: 89 e0 ldi r24, 0x09 ; 9 31402: 9c e6 ldi r25, 0x6C ; 108 31404: 9f 93 push r25 31406: 8f 93 push r24 31408: 0f 94 43 a3 call 0x34686 ; 0x34686 if (previous_value != value) { eeprom_float_notify(dst, previous_value, value, false); } } #endif //DEBUG_EEPROM_CHANGES eeprom_update_float(dst, value); 3140c: b7 01 movw r22, r14 3140e: a6 01 movw r20, r12 31410: 80 e6 ldi r24, 0x60 ; 96 31412: 9f e0 ldi r25, 0x0F ; 15 31414: 0f 94 b7 a4 call 0x3496e ; 0x3496e 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) 31418: 0f b6 in r0, 0x3f ; 63 3141a: f8 94 cli 3141c: de bf out 0x3e, r29 ; 62 3141e: 0f be out 0x3f, r0 ; 63 31420: cd bf out 0x3d, r28 ; 61 31422: 2f e1 ldi r18, 0x1F ; 31 31424: 32 e4 ldi r19, 0x42 ; 66 31426: 49 e0 ldi r20, 0x09 ; 9 31428: 5b e3 ldi r21, 0x3B ; 59 3142a: c7 01 movw r24, r14 3142c: b6 01 movw r22, r12 3142e: 0f 94 32 a8 call 0x35064 ; 0x35064 <__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; 31432: 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) 31434: 18 16 cp r1, r24 31436: 64 f4 brge .+24 ; 0x31450 result = (angleDiff > bed_skew_angle_extreme) ? 31438: 25 e3 ldi r18, 0x35 ; 53 3143a: 3a ef ldi r19, 0xFA ; 250 3143c: 4e e8 ldi r20, 0x8E ; 142 3143e: 5b e3 ldi r21, 0x3B ; 59 31440: c7 01 movw r24, r14 31442: b6 01 movw r22, r12 31444: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 31448: 12 e0 ldi r17, 0x02 ; 2 3144a: 18 16 cp r1, r24 3144c: 0c f0 brlt .+2 ; 0x31450 3144e: 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 || 31450: 25 e3 ldi r18, 0x35 ; 53 31452: 3a ef ldi r19, 0xFA ; 250 31454: 4e e8 ldi r20, 0x8E ; 142 31456: 5b e3 ldi r21, 0x3B ; 59 31458: a6 96 adiw r28, 0x26 ; 38 3145a: 6c ad ldd r22, Y+60 ; 0x3c 3145c: 7d ad ldd r23, Y+61 ; 0x3d 3145e: 8e ad ldd r24, Y+62 ; 0x3e 31460: 9f ad ldd r25, Y+63 ; 0x3f 31462: a6 97 sbiw r28, 0x26 ; 38 31464: 9f 77 andi r25, 0x7F ; 127 31466: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 3146a: 18 16 cp r1, r24 3146c: 0c f4 brge .+2 ; 0x31470 3146e: 67 c4 rjmp .+2254 ; 0x31d3e 31470: 25 e3 ldi r18, 0x35 ; 53 31472: 3a ef ldi r19, 0xFA ; 250 31474: 4e e8 ldi r20, 0x8E ; 142 31476: 5b e3 ldi r21, 0x3B ; 59 31478: a2 96 adiw r28, 0x22 ; 34 3147a: 6c ad ldd r22, Y+60 ; 0x3c 3147c: 7d ad ldd r23, Y+61 ; 0x3d 3147e: 8e ad ldd r24, Y+62 ; 0x3e 31480: 9f ad ldd r25, Y+63 ; 0x3f 31482: a2 97 sbiw r28, 0x22 ; 34 31484: 9f 77 andi r25, 0x7F ; 127 31486: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 3148a: 18 16 cp r1, r24 3148c: 0c f4 brge .+2 ; 0x31490 3148e: 57 c4 rjmp .+2222 ; 0x31d3e 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]; 31490: 20 91 2a 13 lds r18, 0x132A ; 0x80132a 31494: 30 91 2b 13 lds r19, 0x132B ; 0x80132b 31498: 40 91 2c 13 lds r20, 0x132C ; 0x80132c 3149c: 50 91 2d 13 lds r21, 0x132D ; 0x80132d 314a0: ae 96 adiw r28, 0x2e ; 46 314a2: 2c af std Y+60, r18 ; 0x3c 314a4: 3d af std Y+61, r19 ; 0x3d 314a6: 4e af std Y+62, r20 ; 0x3e 314a8: 5f af std Y+63, r21 ; 0x3f 314aa: ae 97 sbiw r28, 0x2e ; 46 314ac: 80 91 32 13 lds r24, 0x1332 ; 0x801332 314b0: 90 91 33 13 lds r25, 0x1333 ; 0x801333 314b4: a0 91 34 13 lds r26, 0x1334 ; 0x801334 314b8: b0 91 35 13 lds r27, 0x1335 ; 0x801335 314bc: e9 96 adiw r28, 0x39 ; 57 314be: 8c af std Y+60, r24 ; 0x3c 314c0: 9d af std Y+61, r25 ; 0x3d 314c2: ae af std Y+62, r26 ; 0x3e 314c4: bf af std Y+63, r27 ; 0x3f 314c6: e9 97 sbiw r28, 0x39 ; 57 314c8: 20 91 3a 13 lds r18, 0x133A ; 0x80133a 314cc: 30 91 3b 13 lds r19, 0x133B ; 0x80133b 314d0: 40 91 3c 13 lds r20, 0x133C ; 0x80133c 314d4: 50 91 3d 13 lds r21, 0x133D ; 0x80133d 314d8: e4 96 adiw r28, 0x34 ; 52 314da: 2c af std Y+60, r18 ; 0x3c 314dc: 3d af std Y+61, r19 ; 0x3d 314de: 4e af std Y+62, r20 ; 0x3e 314e0: 5f af std Y+63, r21 ; 0x3f 314e2: 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]; 314e4: 80 91 2e 13 lds r24, 0x132E ; 0x80132e 314e8: 90 91 2f 13 lds r25, 0x132F ; 0x80132f 314ec: a0 91 30 13 lds r26, 0x1330 ; 0x801330 314f0: b0 91 31 13 lds r27, 0x1331 ; 0x801331 314f4: ed 96 adiw r28, 0x3d ; 61 314f6: 8c af std Y+60, r24 ; 0x3c 314f8: 9d af std Y+61, r25 ; 0x3d 314fa: ae af std Y+62, r26 ; 0x3e 314fc: bf af std Y+63, r27 ; 0x3f 314fe: ed 97 sbiw r28, 0x3d ; 61 31500: 20 91 36 13 lds r18, 0x1336 ; 0x801336 31504: 30 91 37 13 lds r19, 0x1337 ; 0x801337 31508: 40 91 38 13 lds r20, 0x1338 ; 0x801338 3150c: 50 91 39 13 lds r21, 0x1339 ; 0x801339 31510: c3 58 subi r28, 0x83 ; 131 31512: df 4f sbci r29, 0xFF ; 255 31514: 28 83 st Y, r18 31516: 39 83 std Y+1, r19 ; 0x01 31518: 4a 83 std Y+2, r20 ; 0x02 3151a: 5b 83 std Y+3, r21 ; 0x03 3151c: cd 57 subi r28, 0x7D ; 125 3151e: d0 40 sbci r29, 0x00 ; 0 31520: 80 91 3e 13 lds r24, 0x133E ; 0x80133e 31524: 90 91 3f 13 lds r25, 0x133F ; 0x80133f 31528: a0 91 40 13 lds r26, 0x1340 ; 0x801340 3152c: b0 91 41 13 lds r27, 0x1341 ; 0x801341 31530: cf 57 subi r28, 0x7F ; 127 31532: df 4f sbci r29, 0xFF ; 255 31534: 88 83 st Y, r24 31536: 99 83 std Y+1, r25 ; 0x01 31538: aa 83 std Y+2, r26 ; 0x02 3153a: bb 83 std Y+3, r27 ; 0x03 3153c: c1 58 subi r28, 0x81 ; 129 3153e: d0 40 sbci r29, 0x00 ; 0 31540: a1 e0 ldi r26, 0x01 ; 1 31542: bd e9 ldi r27, 0x9D ; 157 31544: 6c 96 adiw r28, 0x1c ; 28 31546: bf af std Y+63, r27 ; 0x3f 31548: ae af std Y+62, r26 ; 0x3e 3154a: 6c 97 sbiw r28, 0x1c ; 28 3154c: 89 e0 ldi r24, 0x09 ; 9 3154e: 28 2e mov r2, r24 31550: 83 e1 ldi r24, 0x13 ; 19 31552: 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]; 31554: f1 01 movw r30, r2 31556: c1 80 ldd r12, Z+1 ; 0x01 31558: d2 80 ldd r13, Z+2 ; 0x02 3155a: e3 80 ldd r14, Z+3 ; 0x03 3155c: f4 80 ldd r15, Z+4 ; 0x04 3155e: 45 80 ldd r4, Z+5 ; 0x05 31560: 56 80 ldd r5, Z+6 ; 0x06 31562: 67 80 ldd r6, Z+7 ; 0x07 31564: 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; 31566: 6c 96 adiw r28, 0x1c ; 28 31568: ee ad ldd r30, Y+62 ; 0x3e 3156a: ff ad ldd r31, Y+63 ; 0x3f 3156c: 6c 97 sbiw r28, 0x1c ; 28 3156e: 25 91 lpm r18, Z+ 31570: 35 91 lpm r19, Z+ 31572: 45 91 lpm r20, Z+ 31574: 54 91 lpm r21, Z 31576: cb 57 subi r28, 0x7B ; 123 31578: df 4f sbci r29, 0xFF ; 255 3157a: 28 83 st Y, r18 3157c: 39 83 std Y+1, r19 ; 0x01 3157e: 4a 83 std Y+2, r20 ; 0x02 31580: 5b 83 std Y+3, r21 ; 0x03 31582: c5 58 subi r28, 0x85 ; 133 31584: d0 40 sbci r29, 0x00 ; 0 float errY = pgm_read_float(true_pts + i * 2 + 1) - y; 31586: 6c 96 adiw r28, 0x1c ; 28 31588: ee ad ldd r30, Y+62 ; 0x3e 3158a: ff ad ldd r31, Y+63 ; 0x3f 3158c: 6c 97 sbiw r28, 0x1c ; 28 3158e: 34 96 adiw r30, 0x04 ; 4 31590: 85 90 lpm r8, Z+ 31592: 95 90 lpm r9, Z+ 31594: a5 90 lpm r10, Z+ 31596: 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]; 31598: ed 96 adiw r28, 0x3d ; 61 3159a: 2c ad ldd r18, Y+60 ; 0x3c 3159c: 3d ad ldd r19, Y+61 ; 0x3d 3159e: 4e ad ldd r20, Y+62 ; 0x3e 315a0: 5f ad ldd r21, Y+63 ; 0x3f 315a2: ed 97 sbiw r28, 0x3d ; 61 315a4: c7 01 movw r24, r14 315a6: b6 01 movw r22, r12 315a8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 315ac: c7 57 subi r28, 0x77 ; 119 315ae: df 4f sbci r29, 0xFF ; 255 315b0: 68 83 st Y, r22 315b2: 79 83 std Y+1, r23 ; 0x01 315b4: 8a 83 std Y+2, r24 ; 0x02 315b6: 9b 83 std Y+3, r25 ; 0x03 315b8: c9 58 subi r28, 0x89 ; 137 315ba: d0 40 sbci r29, 0x00 ; 0 315bc: c3 58 subi r28, 0x83 ; 131 315be: df 4f sbci r29, 0xFF ; 255 315c0: 28 81 ld r18, Y 315c2: 39 81 ldd r19, Y+1 ; 0x01 315c4: 4a 81 ldd r20, Y+2 ; 0x02 315c6: 5b 81 ldd r21, Y+3 ; 0x03 315c8: cd 57 subi r28, 0x7D ; 125 315ca: d0 40 sbci r29, 0x00 ; 0 315cc: c3 01 movw r24, r6 315ce: b2 01 movw r22, r4 315d0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 315d4: 9b 01 movw r18, r22 315d6: ac 01 movw r20, r24 315d8: c7 57 subi r28, 0x77 ; 119 315da: df 4f sbci r29, 0xFF ; 255 315dc: 68 81 ld r22, Y 315de: 79 81 ldd r23, Y+1 ; 0x01 315e0: 8a 81 ldd r24, Y+2 ; 0x02 315e2: 9b 81 ldd r25, Y+3 ; 0x03 315e4: c9 58 subi r28, 0x89 ; 137 315e6: d0 40 sbci r29, 0x00 ; 0 315e8: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 315ec: cf 57 subi r28, 0x7F ; 127 315ee: df 4f sbci r29, 0xFF ; 255 315f0: 28 81 ld r18, Y 315f2: 39 81 ldd r19, Y+1 ; 0x01 315f4: 4a 81 ldd r20, Y+2 ; 0x02 315f6: 5b 81 ldd r21, Y+3 ; 0x03 315f8: c1 58 subi r28, 0x81 ; 129 315fa: d0 40 sbci r29, 0x00 ; 0 315fc: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 31600: 9b 01 movw r18, r22 31602: 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; 31604: c5 01 movw r24, r10 31606: b4 01 movw r22, r8 31608: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 3160c: 4b 01 movw r8, r22 3160e: 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]; 31610: a7 01 movw r20, r14 31612: 96 01 movw r18, r12 31614: ae 96 adiw r28, 0x2e ; 46 31616: 6c ad ldd r22, Y+60 ; 0x3c 31618: 7d ad ldd r23, Y+61 ; 0x3d 3161a: 8e ad ldd r24, Y+62 ; 0x3e 3161c: 9f ad ldd r25, Y+63 ; 0x3f 3161e: ae 97 sbiw r28, 0x2e ; 46 31620: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31624: 6b 01 movw r12, r22 31626: 7c 01 movw r14, r24 31628: a3 01 movw r20, r6 3162a: 92 01 movw r18, r4 3162c: e9 96 adiw r28, 0x39 ; 57 3162e: 6c ad ldd r22, Y+60 ; 0x3c 31630: 7d ad ldd r23, Y+61 ; 0x3d 31632: 8e ad ldd r24, Y+62 ; 0x3e 31634: 9f ad ldd r25, Y+63 ; 0x3f 31636: e9 97 sbiw r28, 0x39 ; 57 31638: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3163c: 9b 01 movw r18, r22 3163e: ac 01 movw r20, r24 31640: c7 01 movw r24, r14 31642: b6 01 movw r22, r12 31644: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 31648: e4 96 adiw r28, 0x34 ; 52 3164a: 2c ad ldd r18, Y+60 ; 0x3c 3164c: 3d ad ldd r19, Y+61 ; 0x3d 3164e: 4e ad ldd r20, Y+62 ; 0x3e 31650: 5f ad ldd r21, Y+63 ; 0x3f 31652: e4 97 sbiw r28, 0x34 ; 52 31654: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 31658: 9b 01 movw r18, r22 3165a: ac 01 movw r20, r24 float y = vec_x[1] * measured_pts[i * 2] + vec_y[1] * measured_pts[i * 2 + 1] + cntr[1]; float errX = pgm_read_float(true_pts + i * 2) - x; 3165c: cb 57 subi r28, 0x7B ; 123 3165e: df 4f sbci r29, 0xFF ; 255 31660: 68 81 ld r22, Y 31662: 79 81 ldd r23, Y+1 ; 0x01 31664: 8a 81 ldd r24, Y+2 ; 0x02 31666: 9b 81 ldd r25, Y+3 ; 0x03 31668: c5 58 subi r28, 0x85 ; 133 3166a: d0 40 sbci r29, 0x00 ; 0 3166c: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> float errY = pgm_read_float(true_pts + i * 2 + 1) - y; float err = hypot(errX, errY); 31670: a5 01 movw r20, r10 31672: 94 01 movw r18, r8 31674: 0f 94 45 a8 call 0x3508a ; 0x3508a } 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) { 31678: 2d ec ldi r18, 0xCD ; 205 3167a: 3c ec ldi r19, 0xCC ; 204 3167c: 4c e4 ldi r20, 0x4C ; 76 3167e: 5f e3 ldi r21, 0x3F ; 63 31680: 0f 94 32 a8 call 0x35064 ; 0x35064 <__gesf2> 31684: 18 16 cp r1, r24 31686: 0c f4 brge .+2 ; 0x3168a result = BED_SKEW_OFFSET_DETECTION_FITTING_FAILED; 31688: 1e ef ldi r17, 0xFE ; 254 3168a: 38 e0 ldi r19, 0x08 ; 8 3168c: 23 0e add r2, r19 3168e: 31 1c adc r3, r1 31690: 6c 96 adiw r28, 0x1c ; 28 31692: 4e ad ldd r20, Y+62 ; 0x3e 31694: 5f ad ldd r21, Y+63 ; 0x3f 31696: 6c 97 sbiw r28, 0x1c ; 28 31698: 48 5f subi r20, 0xF8 ; 248 3169a: 5f 4f sbci r21, 0xFF ; 255 3169c: 6c 96 adiw r28, 0x1c ; 28 3169e: 5f af std Y+63, r21 ; 0x3f 316a0: 4e af std Y+62, r20 ; 0x3e 316a2: 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) { 316a4: a8 96 adiw r28, 0x28 ; 40 316a6: 8e ad ldd r24, Y+62 ; 0x3e 316a8: 9f ad ldd r25, Y+63 ; 0x3f 316aa: a8 97 sbiw r28, 0x28 ; 40 316ac: 82 15 cp r24, r2 316ae: 93 05 cpc r25, r3 316b0: 09 f0 breq .+2 ; 0x316b4 316b2: 50 cf rjmp .-352 ; 0x31554 MYSERIAL.println(BED_CALIBRATION_POINT_OFFSET_MAX_EUCLIDIAN); SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY if (result == BED_SKEW_OFFSET_DETECTION_PERFECT) { 316b4: 11 11 cpse r17, r1 316b6: 62 c1 rjmp .+708 ; 0x3197c #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); 316b8: a2 96 adiw r28, 0x22 ; 34 316ba: 2c ad ldd r18, Y+60 ; 0x3c 316bc: 3d ad ldd r19, Y+61 ; 0x3d 316be: 4e ad ldd r20, Y+62 ; 0x3e 316c0: 5f ad ldd r21, Y+63 ; 0x3f 316c2: a2 97 sbiw r28, 0x22 ; 34 316c4: a6 96 adiw r28, 0x26 ; 38 316c6: 6c ad ldd r22, Y+60 ; 0x3c 316c8: 7d ad ldd r23, Y+61 ; 0x3d 316ca: 8e ad ldd r24, Y+62 ; 0x3e 316cc: 9f ad ldd r25, Y+63 ; 0x3f 316ce: a6 97 sbiw r28, 0x26 ; 38 316d0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 316d4: 20 e0 ldi r18, 0x00 ; 0 316d6: 30 e0 ldi r19, 0x00 ; 0 316d8: 40 e0 ldi r20, 0x00 ; 0 316da: 5f e3 ldi r21, 0x3F ; 63 316dc: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 316e0: 6b 01 movw r12, r22 316e2: 7c 01 movw r14, r24 vec_x[0] = cos(a1) * MACHINE_AXIS_SCALE_X; 316e4: 0f 94 a3 a6 call 0x34d46 ; 0x34d46 316e8: a2 96 adiw r28, 0x22 ; 34 316ea: 6c af std Y+60, r22 ; 0x3c 316ec: 7d af std Y+61, r23 ; 0x3d 316ee: 8e af std Y+62, r24 ; 0x3e 316f0: 9f af std Y+63, r25 ; 0x3f 316f2: a2 97 sbiw r28, 0x22 ; 34 316f4: 60 93 2a 13 sts 0x132A, r22 ; 0x80132a 316f8: 70 93 2b 13 sts 0x132B, r23 ; 0x80132b 316fc: 80 93 2c 13 sts 0x132C, r24 ; 0x80132c 31700: 90 93 2d 13 sts 0x132D, r25 ; 0x80132d vec_x[1] = sin(a1) * MACHINE_AXIS_SCALE_X; 31704: c7 01 movw r24, r14 31706: b6 01 movw r22, r12 31708: 0f 94 69 a9 call 0x352d2 ; 0x352d2 3170c: a6 96 adiw r28, 0x26 ; 38 3170e: 6c af std Y+60, r22 ; 0x3c 31710: 7d af std Y+61, r23 ; 0x3d 31712: 8e af std Y+62, r24 ; 0x3e 31714: 9f af std Y+63, r25 ; 0x3f 31716: a6 97 sbiw r28, 0x26 ; 38 31718: 60 93 2e 13 sts 0x132E, r22 ; 0x80132e 3171c: 70 93 2f 13 sts 0x132F, r23 ; 0x80132f 31720: 80 93 30 13 sts 0x1330, r24 ; 0x801330 31724: 90 93 31 13 sts 0x1331, r25 ; 0x801331 vec_y[0] = -sin(a1) * MACHINE_AXIS_SCALE_Y; 31728: 9b 01 movw r18, r22 3172a: ac 01 movw r20, r24 3172c: 50 58 subi r21, 0x80 ; 128 3172e: aa 96 adiw r28, 0x2a ; 42 31730: 2c af std Y+60, r18 ; 0x3c 31732: 3d af std Y+61, r19 ; 0x3d 31734: 4e af std Y+62, r20 ; 0x3e 31736: 5f af std Y+63, r21 ; 0x3f 31738: aa 97 sbiw r28, 0x2a ; 42 3173a: 20 93 32 13 sts 0x1332, r18 ; 0x801332 3173e: 30 93 33 13 sts 0x1333, r19 ; 0x801333 31742: 40 93 34 13 sts 0x1334, r20 ; 0x801334 31746: 50 93 35 13 sts 0x1335, r21 ; 0x801335 vec_y[1] = cos(a1) * MACHINE_AXIS_SCALE_Y; 3174a: a2 96 adiw r28, 0x22 ; 34 3174c: 8c ad ldd r24, Y+60 ; 0x3c 3174e: 9d ad ldd r25, Y+61 ; 0x3d 31750: ae ad ldd r26, Y+62 ; 0x3e 31752: bf ad ldd r27, Y+63 ; 0x3f 31754: a2 97 sbiw r28, 0x22 ; 34 31756: 80 93 36 13 sts 0x1336, r24 ; 0x801336 3175a: 90 93 37 13 sts 0x1337, r25 ; 0x801337 3175e: a0 93 38 13 sts 0x1338, r26 ; 0x801338 31762: b0 93 39 13 sts 0x1339, r27 ; 0x801339 // Refresh the offset. cntr[0] = 0.f; 31766: 10 92 3a 13 sts 0x133A, r1 ; 0x80133a 3176a: 10 92 3b 13 sts 0x133B, r1 ; 0x80133b 3176e: 10 92 3c 13 sts 0x133C, r1 ; 0x80133c 31772: 10 92 3d 13 sts 0x133D, r1 ; 0x80133d cntr[1] = 0.f; 31776: 10 92 3e 13 sts 0x133E, r1 ; 0x80133e 3177a: 10 92 3f 13 sts 0x133F, r1 ; 0x80133f 3177e: 10 92 40 13 sts 0x1340, r1 ; 0x801340 31782: 10 92 41 13 sts 0x1341, r1 ; 0x801341 float wx = 0.f; 31786: 41 2c mov r4, r1 31788: 51 2c mov r5, r1 3178a: 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]; 3178c: cf 56 subi r28, 0x6F ; 111 3178e: df 4f sbci r29, 0xFF ; 255 31790: a8 81 ld r26, Y 31792: b9 81 ldd r27, Y+1 ; 0x01 31794: c1 59 subi r28, 0x91 ; 145 31796: d0 40 sbci r29, 0x00 ; 0 31798: 11 96 adiw r26, 0x01 ; 1 3179a: 8d 90 ld r8, X+ 3179c: 9d 90 ld r9, X+ 3179e: ad 90 ld r10, X+ 317a0: bc 90 ld r11, X 317a2: 14 97 sbiw r26, 0x04 ; 4 317a4: 15 96 adiw r26, 0x05 ; 5 317a6: 2d 91 ld r18, X+ 317a8: 3d 91 ld r19, X+ 317aa: 4d 91 ld r20, X+ 317ac: 5c 91 ld r21, X 317ae: 18 97 sbiw r26, 0x08 ; 8 317b0: 6e 96 adiw r28, 0x1e ; 30 317b2: 2c af std Y+60, r18 ; 0x3c 317b4: 3d af std Y+61, r19 ; 0x3d 317b6: 4e af std Y+62, r20 ; 0x3e 317b8: 5f af std Y+63, r21 ; 0x3f 317ba: 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); 317bc: cd 56 subi r28, 0x6D ; 109 317be: df 4f sbci r29, 0xFF ; 255 317c0: e8 81 ld r30, Y 317c2: f9 81 ldd r31, Y+1 ; 0x01 317c4: c3 59 subi r28, 0x93 ; 147 317c6: d0 40 sbci r29, 0x00 ; 0 317c8: c5 90 lpm r12, Z+ 317ca: d5 90 lpm r13, Z+ 317cc: e5 90 lpm r14, Z+ 317ce: 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]; 317d0: a5 01 movw r20, r10 317d2: 94 01 movw r18, r8 317d4: a2 96 adiw r28, 0x22 ; 34 317d6: 6c ad ldd r22, Y+60 ; 0x3c 317d8: 7d ad ldd r23, Y+61 ; 0x3d 317da: 8e ad ldd r24, Y+62 ; 0x3e 317dc: 9f ad ldd r25, Y+63 ; 0x3f 317de: a2 97 sbiw r28, 0x22 ; 34 317e0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 317e4: ae 96 adiw r28, 0x2e ; 46 317e6: 6c af std Y+60, r22 ; 0x3c 317e8: 7d af std Y+61, r23 ; 0x3d 317ea: 8e af std Y+62, r24 ; 0x3e 317ec: 9f af std Y+63, r25 ; 0x3f 317ee: ae 97 sbiw r28, 0x2e ; 46 317f0: 6e 96 adiw r28, 0x1e ; 30 317f2: 2c ad ldd r18, Y+60 ; 0x3c 317f4: 3d ad ldd r19, Y+61 ; 0x3d 317f6: 4e ad ldd r20, Y+62 ; 0x3e 317f8: 5f ad ldd r21, Y+63 ; 0x3f 317fa: 6e 97 sbiw r28, 0x1e ; 30 317fc: aa 96 adiw r28, 0x2a ; 42 317fe: 6c ad ldd r22, Y+60 ; 0x3c 31800: 7d ad ldd r23, Y+61 ; 0x3d 31802: 8e ad ldd r24, Y+62 ; 0x3e 31804: 9f ad ldd r25, Y+63 ; 0x3f 31806: aa 97 sbiw r28, 0x2a ; 42 31808: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3180c: 9b 01 movw r18, r22 3180e: ac 01 movw r20, r24 31810: ae 96 adiw r28, 0x2e ; 46 31812: 6c ad ldd r22, Y+60 ; 0x3c 31814: 7d ad ldd r23, Y+61 ; 0x3d 31816: 8e ad ldd r24, Y+62 ; 0x3e 31818: 9f ad ldd r25, Y+63 ; 0x3f 3181a: ae 97 sbiw r28, 0x2e ; 46 3181c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 31820: 9b 01 movw r18, r22 31822: 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); 31824: c7 01 movw r24, r14 31826: b6 01 movw r22, r12 31828: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 3182c: 20 91 3a 13 lds r18, 0x133A ; 0x80133a 31830: 30 91 3b 13 lds r19, 0x133B ; 0x80133b 31834: 40 91 3c 13 lds r20, 0x133C ; 0x80133c 31838: 50 91 3d 13 lds r21, 0x133D ; 0x80133d 3183c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 31840: 6b 01 movw r12, r22 31842: 7c 01 movw r14, r24 31844: c0 92 3a 13 sts 0x133A, r12 ; 0x80133a 31848: d0 92 3b 13 sts 0x133B, r13 ; 0x80133b 3184c: e0 92 3c 13 sts 0x133C, r14 ; 0x80133c 31850: f0 92 3d 13 sts 0x133D, r15 ; 0x80133d wx += w; 31854: 20 e0 ldi r18, 0x00 ; 0 31856: 30 e0 ldi r19, 0x00 ; 0 31858: 40 e8 ldi r20, 0x80 ; 128 3185a: 5f e3 ldi r21, 0x3F ; 63 3185c: c3 01 movw r24, r6 3185e: b2 01 movw r22, r4 31860: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 31864: 2b 01 movw r4, r22 31866: 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); 31868: cd 56 subi r28, 0x6D ; 109 3186a: df 4f sbci r29, 0xFF ; 255 3186c: e8 81 ld r30, Y 3186e: f9 81 ldd r31, Y+1 ; 0x01 31870: c3 59 subi r28, 0x93 ; 147 31872: d0 40 sbci r29, 0x00 ; 0 31874: 34 96 adiw r30, 0x04 ; 4 31876: 25 91 lpm r18, Z+ 31878: 35 91 lpm r19, Z+ 3187a: 45 91 lpm r20, Z+ 3187c: 54 91 lpm r21, Z 3187e: ae 96 adiw r28, 0x2e ; 46 31880: 2c af std Y+60, r18 ; 0x3c 31882: 3d af std Y+61, r19 ; 0x3d 31884: 4e af std Y+62, r20 ; 0x3e 31886: 5f af std Y+63, r21 ; 0x3f 31888: 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]; 3188a: a5 01 movw r20, r10 3188c: 94 01 movw r18, r8 3188e: a6 96 adiw r28, 0x26 ; 38 31890: 6c ad ldd r22, Y+60 ; 0x3c 31892: 7d ad ldd r23, Y+61 ; 0x3d 31894: 8e ad ldd r24, Y+62 ; 0x3e 31896: 9f ad ldd r25, Y+63 ; 0x3f 31898: a6 97 sbiw r28, 0x26 ; 38 3189a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3189e: 4b 01 movw r8, r22 318a0: 5c 01 movw r10, r24 318a2: 6e 96 adiw r28, 0x1e ; 30 318a4: 2c ad ldd r18, Y+60 ; 0x3c 318a6: 3d ad ldd r19, Y+61 ; 0x3d 318a8: 4e ad ldd r20, Y+62 ; 0x3e 318aa: 5f ad ldd r21, Y+63 ; 0x3f 318ac: 6e 97 sbiw r28, 0x1e ; 30 318ae: a2 96 adiw r28, 0x22 ; 34 318b0: 6c ad ldd r22, Y+60 ; 0x3c 318b2: 7d ad ldd r23, Y+61 ; 0x3d 318b4: 8e ad ldd r24, Y+62 ; 0x3e 318b6: 9f ad ldd r25, Y+63 ; 0x3f 318b8: a2 97 sbiw r28, 0x22 ; 34 318ba: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 318be: 9b 01 movw r18, r22 318c0: ac 01 movw r20, r24 318c2: c5 01 movw r24, r10 318c4: b4 01 movw r22, r8 318c6: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 318ca: 9b 01 movw r18, r22 318cc: 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); 318ce: ae 96 adiw r28, 0x2e ; 46 318d0: 6c ad ldd r22, Y+60 ; 0x3c 318d2: 7d ad ldd r23, Y+61 ; 0x3d 318d4: 8e ad ldd r24, Y+62 ; 0x3e 318d6: 9f ad ldd r25, Y+63 ; 0x3f 318d8: ae 97 sbiw r28, 0x2e ; 46 318da: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 318de: 20 91 3e 13 lds r18, 0x133E ; 0x80133e 318e2: 30 91 3f 13 lds r19, 0x133F ; 0x80133f 318e6: 40 91 40 13 lds r20, 0x1340 ; 0x801340 318ea: 50 91 41 13 lds r21, 0x1341 ; 0x801341 318ee: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 318f2: 4b 01 movw r8, r22 318f4: 5c 01 movw r10, r24 318f6: 80 92 3e 13 sts 0x133E, r8 ; 0x80133e 318fa: 90 92 3f 13 sts 0x133F, r9 ; 0x80133f 318fe: a0 92 40 13 sts 0x1340, r10 ; 0x801340 31902: b0 92 41 13 sts 0x1341, r11 ; 0x801341 31906: cf 56 subi r28, 0x6F ; 111 31908: df 4f sbci r29, 0xFF ; 255 3190a: 48 81 ld r20, Y 3190c: 59 81 ldd r21, Y+1 ; 0x01 3190e: c1 59 subi r28, 0x91 ; 145 31910: d0 40 sbci r29, 0x00 ; 0 31912: 48 5f subi r20, 0xF8 ; 248 31914: 5f 4f sbci r21, 0xFF ; 255 31916: cf 56 subi r28, 0x6F ; 111 31918: df 4f sbci r29, 0xFF ; 255 3191a: 59 83 std Y+1, r21 ; 0x01 3191c: 48 83 st Y, r20 3191e: c1 59 subi r28, 0x91 ; 145 31920: d0 40 sbci r29, 0x00 ; 0 31922: cd 56 subi r28, 0x6D ; 109 31924: df 4f sbci r29, 0xFF ; 255 31926: 88 81 ld r24, Y 31928: 99 81 ldd r25, Y+1 ; 0x01 3192a: c3 59 subi r28, 0x93 ; 147 3192c: d0 40 sbci r29, 0x00 ; 0 3192e: 08 96 adiw r24, 0x08 ; 8 31930: cd 56 subi r28, 0x6D ; 109 31932: df 4f sbci r29, 0xFF ; 255 31934: 99 83 std Y+1, r25 ; 0x01 31936: 88 83 st Y, r24 31938: c3 59 subi r28, 0x93 ; 147 3193a: 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) { 3193c: 24 16 cp r2, r20 3193e: 35 06 cpc r3, r21 31940: 09 f0 breq .+2 ; 0x31944 31942: 24 cf rjmp .-440 ; 0x3178c SERIAL_ECHOLNPGM(""); } #endif // SUPPORT_VERBOSITY } cntr[0] /= wx; 31944: a3 01 movw r20, r6 31946: 92 01 movw r18, r4 31948: c7 01 movw r24, r14 3194a: b6 01 movw r22, r12 3194c: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 31950: 60 93 3a 13 sts 0x133A, r22 ; 0x80133a 31954: 70 93 3b 13 sts 0x133B, r23 ; 0x80133b 31958: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c 3195c: 90 93 3d 13 sts 0x133D, r25 ; 0x80133d cntr[1] /= wy; 31960: a3 01 movw r20, r6 31962: 92 01 movw r18, r4 31964: c5 01 movw r24, r10 31966: b4 01 movw r22, r8 31968: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 3196c: 60 93 3e 13 sts 0x133E, r22 ; 0x80133e 31970: 70 93 3f 13 sts 0x133F, r23 ; 0x80133f 31974: 80 93 40 13 sts 0x1340, r24 ; 0x801340 31978: 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]; 3197c: 40 90 2a 13 lds r4, 0x132A ; 0x80132a 31980: 50 90 2b 13 lds r5, 0x132B ; 0x80132b 31984: 60 90 2c 13 lds r6, 0x132C ; 0x80132c 31988: 70 90 2d 13 lds r7, 0x132D ; 0x80132d 3198c: c0 90 36 13 lds r12, 0x1336 ; 0x801336 31990: d0 90 37 13 lds r13, 0x1337 ; 0x801337 31994: e0 90 38 13 lds r14, 0x1338 ; 0x801338 31998: f0 90 39 13 lds r15, 0x1339 ; 0x801339 3199c: 20 91 2e 13 lds r18, 0x132E ; 0x80132e 319a0: 30 91 2f 13 lds r19, 0x132F ; 0x80132f 319a4: 40 91 30 13 lds r20, 0x1330 ; 0x801330 319a8: 50 91 31 13 lds r21, 0x1331 ; 0x801331 319ac: a2 96 adiw r28, 0x22 ; 34 319ae: 2c af std Y+60, r18 ; 0x3c 319b0: 3d af std Y+61, r19 ; 0x3d 319b2: 4e af std Y+62, r20 ; 0x3e 319b4: 5f af std Y+63, r21 ; 0x3f 319b6: a2 97 sbiw r28, 0x22 ; 34 319b8: 80 91 32 13 lds r24, 0x1332 ; 0x801332 319bc: 90 91 33 13 lds r25, 0x1333 ; 0x801333 319c0: a0 91 34 13 lds r26, 0x1334 ; 0x801334 319c4: b0 91 35 13 lds r27, 0x1335 ; 0x801335 319c8: a6 96 adiw r28, 0x26 ; 38 319ca: 8c af std Y+60, r24 ; 0x3c 319cc: 9d af std Y+61, r25 ; 0x3d 319ce: ae af std Y+62, r26 ; 0x3e 319d0: bf af std Y+63, r27 ; 0x3f 319d2: a6 97 sbiw r28, 0x26 ; 38 319d4: a7 01 movw r20, r14 319d6: 96 01 movw r18, r12 319d8: c3 01 movw r24, r6 319da: b2 01 movw r22, r4 319dc: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 319e0: 4b 01 movw r8, r22 319e2: 5c 01 movw r10, r24 319e4: a6 96 adiw r28, 0x26 ; 38 319e6: 2c ad ldd r18, Y+60 ; 0x3c 319e8: 3d ad ldd r19, Y+61 ; 0x3d 319ea: 4e ad ldd r20, Y+62 ; 0x3e 319ec: 5f ad ldd r21, Y+63 ; 0x3f 319ee: a6 97 sbiw r28, 0x26 ; 38 319f0: a2 96 adiw r28, 0x22 ; 34 319f2: 6c ad ldd r22, Y+60 ; 0x3c 319f4: 7d ad ldd r23, Y+61 ; 0x3d 319f6: 8e ad ldd r24, Y+62 ; 0x3e 319f8: 9f ad ldd r25, Y+63 ; 0x3f 319fa: a2 97 sbiw r28, 0x22 ; 34 319fc: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31a00: 9b 01 movw r18, r22 31a02: ac 01 movw r20, r24 31a04: c5 01 movw r24, r10 31a06: b4 01 movw r22, r8 31a08: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 31a0c: 4b 01 movw r8, r22 31a0e: 5c 01 movw r10, r24 float Ainv[2][2] = { { vec_y[1] / d, -vec_y[0] / d }, 31a10: ac 01 movw r20, r24 31a12: 9b 01 movw r18, r22 31a14: c7 01 movw r24, r14 31a16: b6 01 movw r22, r12 31a18: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 31a1c: 6b 01 movw r12, r22 31a1e: 7c 01 movw r14, r24 31a20: a6 96 adiw r28, 0x26 ; 38 31a22: 6c ad ldd r22, Y+60 ; 0x3c 31a24: 7d ad ldd r23, Y+61 ; 0x3d 31a26: 8e ad ldd r24, Y+62 ; 0x3e 31a28: 9f ad ldd r25, Y+63 ; 0x3f 31a2a: a6 97 sbiw r28, 0x26 ; 38 31a2c: 90 58 subi r25, 0x80 ; 128 31a2e: a5 01 movw r20, r10 31a30: 94 01 movw r18, r8 31a32: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 31a36: a6 96 adiw r28, 0x26 ; 38 31a38: 6c af std Y+60, r22 ; 0x3c 31a3a: 7d af std Y+61, r23 ; 0x3d 31a3c: 8e af std Y+62, r24 ; 0x3e 31a3e: 9f af std Y+63, r25 ; 0x3f 31a40: a6 97 sbiw r28, 0x26 ; 38 { -vec_x[1] / d, vec_x[0] / d } 31a42: a2 96 adiw r28, 0x22 ; 34 31a44: 6c ad ldd r22, Y+60 ; 0x3c 31a46: 7d ad ldd r23, Y+61 ; 0x3d 31a48: 8e ad ldd r24, Y+62 ; 0x3e 31a4a: 9f ad ldd r25, Y+63 ; 0x3f 31a4c: a2 97 sbiw r28, 0x22 ; 34 31a4e: 90 58 subi r25, 0x80 ; 128 31a50: a5 01 movw r20, r10 31a52: 94 01 movw r18, r8 31a54: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 31a58: aa 96 adiw r28, 0x2a ; 42 31a5a: 6c af std Y+60, r22 ; 0x3c 31a5c: 7d af std Y+61, r23 ; 0x3d 31a5e: 8e af std Y+62, r24 ; 0x3e 31a60: 9f af std Y+63, r25 ; 0x3f 31a62: aa 97 sbiw r28, 0x2a ; 42 31a64: a5 01 movw r20, r10 31a66: 94 01 movw r18, r8 31a68: c3 01 movw r24, r6 31a6a: b2 01 movw r22, r4 31a6c: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 31a70: 4b 01 movw r8, r22 31a72: 5c 01 movw r10, r24 }; float cntrInv[2] = { -Ainv[0][0] * cntr[0] - Ainv[0][1] * cntr[1], 31a74: 40 90 3a 13 lds r4, 0x133A ; 0x80133a 31a78: 50 90 3b 13 lds r5, 0x133B ; 0x80133b 31a7c: 60 90 3c 13 lds r6, 0x133C ; 0x80133c 31a80: 70 90 3d 13 lds r7, 0x133D ; 0x80133d 31a84: 20 91 3e 13 lds r18, 0x133E ; 0x80133e 31a88: 30 91 3f 13 lds r19, 0x133F ; 0x80133f 31a8c: 40 91 40 13 lds r20, 0x1340 ; 0x801340 31a90: 50 91 41 13 lds r21, 0x1341 ; 0x801341 31a94: a2 96 adiw r28, 0x22 ; 34 31a96: 2c af std Y+60, r18 ; 0x3c 31a98: 3d af std Y+61, r19 ; 0x3d 31a9a: 4e af std Y+62, r20 ; 0x3e 31a9c: 5f af std Y+63, r21 ; 0x3f 31a9e: a2 97 sbiw r28, 0x22 ; 34 -Ainv[1][0] * cntr[0] - Ainv[1][1] * cntr[1] }; vec_x[0] = Ainv[0][0]; 31aa0: c0 92 2a 13 sts 0x132A, r12 ; 0x80132a 31aa4: d0 92 2b 13 sts 0x132B, r13 ; 0x80132b 31aa8: e0 92 2c 13 sts 0x132C, r14 ; 0x80132c 31aac: f0 92 2d 13 sts 0x132D, r15 ; 0x80132d vec_x[1] = Ainv[1][0]; 31ab0: aa 96 adiw r28, 0x2a ; 42 31ab2: 8c ad ldd r24, Y+60 ; 0x3c 31ab4: 9d ad ldd r25, Y+61 ; 0x3d 31ab6: ae ad ldd r26, Y+62 ; 0x3e 31ab8: bf ad ldd r27, Y+63 ; 0x3f 31aba: aa 97 sbiw r28, 0x2a ; 42 31abc: 80 93 2e 13 sts 0x132E, r24 ; 0x80132e 31ac0: 90 93 2f 13 sts 0x132F, r25 ; 0x80132f 31ac4: a0 93 30 13 sts 0x1330, r26 ; 0x801330 31ac8: b0 93 31 13 sts 0x1331, r27 ; 0x801331 vec_y[0] = Ainv[0][1]; 31acc: a6 96 adiw r28, 0x26 ; 38 31ace: 2c ad ldd r18, Y+60 ; 0x3c 31ad0: 3d ad ldd r19, Y+61 ; 0x3d 31ad2: 4e ad ldd r20, Y+62 ; 0x3e 31ad4: 5f ad ldd r21, Y+63 ; 0x3f 31ad6: a6 97 sbiw r28, 0x26 ; 38 31ad8: 20 93 32 13 sts 0x1332, r18 ; 0x801332 31adc: 30 93 33 13 sts 0x1333, r19 ; 0x801333 31ae0: 40 93 34 13 sts 0x1334, r20 ; 0x801334 31ae4: 50 93 35 13 sts 0x1335, r21 ; 0x801335 vec_y[1] = Ainv[1][1]; 31ae8: 80 92 36 13 sts 0x1336, r8 ; 0x801336 31aec: 90 92 37 13 sts 0x1337, r9 ; 0x801337 31af0: a0 92 38 13 sts 0x1338, r10 ; 0x801338 31af4: 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], 31af8: c7 01 movw r24, r14 31afa: b6 01 movw r22, r12 31afc: 90 58 subi r25, 0x80 ; 128 31afe: a3 01 movw r20, r6 31b00: 92 01 movw r18, r4 31b02: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31b06: 6b 01 movw r12, r22 31b08: 7c 01 movw r14, r24 31b0a: a2 96 adiw r28, 0x22 ; 34 31b0c: 2c ad ldd r18, Y+60 ; 0x3c 31b0e: 3d ad ldd r19, Y+61 ; 0x3d 31b10: 4e ad ldd r20, Y+62 ; 0x3e 31b12: 5f ad ldd r21, Y+63 ; 0x3f 31b14: a2 97 sbiw r28, 0x22 ; 34 31b16: a6 96 adiw r28, 0x26 ; 38 31b18: 6c ad ldd r22, Y+60 ; 0x3c 31b1a: 7d ad ldd r23, Y+61 ; 0x3d 31b1c: 8e ad ldd r24, Y+62 ; 0x3e 31b1e: 9f ad ldd r25, Y+63 ; 0x3f 31b20: a6 97 sbiw r28, 0x26 ; 38 31b22: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31b26: 9b 01 movw r18, r22 31b28: ac 01 movw r20, r24 31b2a: c7 01 movw r24, r14 31b2c: b6 01 movw r22, r12 31b2e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__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]; 31b32: 60 93 3a 13 sts 0x133A, r22 ; 0x80133a 31b36: 70 93 3b 13 sts 0x133B, r23 ; 0x80133b 31b3a: 80 93 3c 13 sts 0x133C, r24 ; 0x80133c 31b3e: 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] 31b42: aa 96 adiw r28, 0x2a ; 42 31b44: 6c ad ldd r22, Y+60 ; 0x3c 31b46: 7d ad ldd r23, Y+61 ; 0x3d 31b48: 8e ad ldd r24, Y+62 ; 0x3e 31b4a: 9f ad ldd r25, Y+63 ; 0x3f 31b4c: aa 97 sbiw r28, 0x2a ; 42 31b4e: 90 58 subi r25, 0x80 ; 128 31b50: a3 01 movw r20, r6 31b52: 92 01 movw r18, r4 31b54: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31b58: 6b 01 movw r12, r22 31b5a: 7c 01 movw r14, r24 31b5c: a2 96 adiw r28, 0x22 ; 34 31b5e: 2c ad ldd r18, Y+60 ; 0x3c 31b60: 3d ad ldd r19, Y+61 ; 0x3d 31b62: 4e ad ldd r20, Y+62 ; 0x3e 31b64: 5f ad ldd r21, Y+63 ; 0x3f 31b66: a2 97 sbiw r28, 0x22 ; 34 31b68: c5 01 movw r24, r10 31b6a: b4 01 movw r22, r8 31b6c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31b70: 9b 01 movw r18, r22 31b72: ac 01 movw r20, r24 31b74: c7 01 movw r24, r14 31b76: b6 01 movw r22, r12 31b78: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__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]; 31b7c: 60 93 3e 13 sts 0x133E, r22 ; 0x80133e 31b80: 70 93 3f 13 sts 0x133F, r23 ; 0x80133f 31b84: 80 93 40 13 sts 0x1340, r24 ; 0x801340 31b88: 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 31b8c: 90 e0 ldi r25, 0x00 ; 0 31b8e: 80 e0 ldi r24, 0x00 ; 0 31b90: 0e 94 07 8d call 0x11a0e ; 0x11a0e if (result >= 0) { 31b94: 17 fd sbrc r17, 7 31b96: d5 c0 rjmp .+426 ; 0x31d42 DBG(_n("Calibration success.\n")); 31b98: 87 e4 ldi r24, 0x47 ; 71 31b9a: 9c e6 ldi r25, 0x6C ; 108 31b9c: 9f 93 push r25 31b9e: 8f 93 push r24 31ba0: 0f 94 43 a3 call 0x34686 ; 0x34686 world2machine_update(vec_x, vec_y, cntr); 31ba4: 4a e3 ldi r20, 0x3A ; 58 31ba6: 53 e1 ldi r21, 0x13 ; 19 31ba8: 62 e3 ldi r22, 0x32 ; 50 31baa: 73 e1 ldi r23, 0x13 ; 19 31bac: 8a e2 ldi r24, 0x2A ; 42 31bae: 93 e1 ldi r25, 0x13 ; 19 31bb0: 0e 94 ce 5f call 0xbf9c ; 0xbf9c #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); 31bb4: 48 e0 ldi r20, 0x08 ; 8 31bb6: 50 e0 ldi r21, 0x00 ; 0 31bb8: 65 ee ldi r22, 0xE5 ; 229 31bba: 7f e0 ldi r23, 0x0F ; 15 31bbc: 8a e3 ldi r24, 0x3A ; 58 31bbe: 93 e1 ldi r25, 0x13 ; 19 31bc0: 0f 94 95 a4 call 0x3492a ; 0x3492a 31bc4: 48 e0 ldi r20, 0x08 ; 8 31bc6: 50 e0 ldi r21, 0x00 ; 0 31bc8: 6d ed ldi r22, 0xDD ; 221 31bca: 7f e0 ldi r23, 0x0F ; 15 31bcc: 8a e2 ldi r24, 0x2A ; 42 31bce: 93 e1 ldi r25, 0x13 ; 19 31bd0: 0f 94 95 a4 call 0x3492a ; 0x3492a 31bd4: 48 e0 ldi r20, 0x08 ; 8 31bd6: 50 e0 ldi r21, 0x00 ; 0 31bd8: 65 ed ldi r22, 0xD5 ; 213 31bda: 7f e0 ldi r23, 0x0F ; 15 31bdc: 82 e3 ldi r24, 0x32 ; 50 31bde: 93 e1 ldi r25, 0x13 ; 19 31be0: 0f 94 95 a4 call 0x3492a ; 0x3492a 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(); 31be4: 0e 94 53 5f call 0xbea6 ; 0xbea6 } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ DBG(_n("Fitting failed => calibration failed.\n")); 31be8: 0f 90 pop r0 31bea: 0f 90 pop r0 BedSkewOffsetDetectionResultType result = find_bed_offset_and_skew(verbosity_level, point_too_far_mask); clean_up_after_endstop_move(l_feedmultiply); 31bec: c7 55 subi r28, 0x57 ; 87 31bee: df 4f sbci r29, 0xFF ; 255 31bf0: 88 81 ld r24, Y 31bf2: 99 81 ldd r25, Y+1 ; 0x01 31bf4: c9 5a subi r28, 0xA9 ; 169 31bf6: d0 40 sbci r29, 0x00 ; 0 31bf8: 0e 94 9d 65 call 0xcb3a ; 0xcb3a // Print head up. current_position[Z_AXIS] = MESH_HOME_Z_SEARCH; 31bfc: 80 e0 ldi r24, 0x00 ; 0 31bfe: 90 e0 ldi r25, 0x00 ; 0 31c00: a0 ea ldi r26, 0xA0 ; 160 31c02: b0 e4 ldi r27, 0x40 ; 64 31c04: 80 93 69 12 sts 0x1269, r24 ; 0x801269 31c08: 90 93 6a 12 sts 0x126A, r25 ; 0x80126a 31c0c: a0 93 6b 12 sts 0x126B, r26 ; 0x80126b 31c10: b0 93 6c 12 sts 0x126C, r27 ; 0x80126c plan_buffer_line_curposXYZE(homing_feedrate[Z_AXIS] / 40); 31c14: 60 e0 ldi r22, 0x00 ; 0 31c16: 70 e0 ldi r23, 0x00 ; 0 31c18: 80 ea ldi r24, 0xA0 ; 160 31c1a: 91 e4 ldi r25, 0x41 ; 65 31c1c: 0f 94 0d 4a call 0x2941a ; 0x2941a st_synchronize(); 31c20: 0f 94 94 18 call 0x23128 ; 0x23128 //#ifndef NEW_XYZCAL if (result >= 0) 31c24: 17 fd sbrc r17, 7 31c26: 22 c0 rjmp .+68 ; 0x31c6c 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; 31c28: 10 92 69 12 sts 0x1269, r1 ; 0x801269 31c2c: 10 92 6a 12 sts 0x126A, r1 ; 0x80126a 31c30: 10 92 6b 12 sts 0x126B, r1 ; 0x80126b 31c34: 10 92 6c 12 sts 0x126C, r1 ; 0x80126c destination[Z_AXIS] = 150.F; 31c38: 80 e0 ldi r24, 0x00 ; 0 31c3a: 90 e0 ldi r25, 0x00 ; 0 31c3c: a6 e1 ldi r26, 0x16 ; 22 31c3e: b3 e4 ldi r27, 0x43 ; 67 31c40: 80 93 31 06 sts 0x0631, r24 ; 0x800631 31c44: 90 93 32 06 sts 0x0632, r25 ; 0x800632 31c48: a0 93 33 06 sts 0x0633, r26 ; 0x800633 31c4c: b0 93 34 06 sts 0x0634, r27 ; 0x800634 plan_buffer_line_destinationXYZE(homing_feedrate[Z_AXIS] / 60); 31c50: 65 e5 ldi r22, 0x55 ; 85 31c52: 75 e5 ldi r23, 0x55 ; 85 31c54: 85 e5 ldi r24, 0x55 ; 85 31c56: 91 e4 ldi r25, 0x41 ; 65 31c58: 0f 94 da 49 call 0x293b4 ; 0x293b4 lcd_show_fullscreen_message_and_wait_P(_T(MSG_PLACE_STEEL_SHEET)); 31c5c: 85 e9 ldi r24, 0x95 ; 149 31c5e: 90 e6 ldi r25, 0x60 ; 96 31c60: 0e 94 8b 75 call 0xeb16 ; 0xeb16 31c64: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa // 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()) 31c68: 0f 94 8b 52 call 0x2a516 ; 0x2a516 st_synchronize(); // if (result >= 0) babystep_apply(); #endif //HEATBED_V2 } //#endif //NEW_XYZCAL lcd_update_enable(true); 31c6c: 81 e0 ldi r24, 0x01 ; 1 31c6e: 0e 94 89 70 call 0xe112 ; 0xe112 lcd_update(2); 31c72: 82 e0 ldi r24, 0x02 ; 2 31c74: 0e 94 4a 6f call 0xde94 ; 0xde94 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)); 31c78: 86 e5 ldi r24, 0x56 ; 86 31c7a: 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) { 31c7c: 1f 3f cpi r17, 0xFF ; 255 31c7e: 99 f0 breq .+38 ; 0x31ca6 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) { 31c80: 1e 3f cpi r17, 0xFE ; 254 31c82: 09 f0 breq .+2 ; 0x31c86 31c84: 73 c0 rjmp .+230 ; 0x31d6c if (point_too_far_mask == 0) 31c86: af 96 adiw r28, 0x2f ; 47 31c88: 4f ad ldd r20, Y+63 ; 0x3f 31c8a: af 97 sbiw r28, 0x2f ; 47 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 31c8c: 81 e2 ldi r24, 0x21 ; 33 31c8e: 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) 31c90: 44 23 and r20, r20 31c92: 49 f0 breq .+18 ; 0x31ca6 msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); else if (point_too_far_mask == 2 || point_too_far_mask == 7) 31c94: af 96 adiw r28, 0x2f ; 47 31c96: 5f ad ldd r21, Y+63 ; 0x3f 31c98: 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); 31c9a: 8f ed ldi r24, 0xDF ; 223 31c9c: 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) 31c9e: 52 30 cpi r21, 0x02 ; 2 31ca0: 11 f0 breq .+4 ; 0x31ca6 // 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); 31ca2: 88 e9 ldi r24, 0x98 ; 152 31ca4: 9f e5 ldi r25, 0x5F ; 95 31ca6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 31caa: 0d 94 ab 82 jmp 0x30556 ; 0x30556 (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]) : 31cae: f2 01 movw r30, r4 31cb0: 25 81 ldd r18, Z+5 ; 0x05 31cb2: 36 81 ldd r19, Z+6 ; 0x06 31cb4: 47 81 ldd r20, Z+7 ; 0x07 31cb6: 50 85 ldd r21, Z+8 ; 0x08 31cb8: c3 58 subi r28, 0x83 ; 131 31cba: df 4f sbci r29, 0xFF ; 255 31cbc: 68 81 ld r22, Y 31cbe: 79 81 ldd r23, Y+1 ; 0x01 31cc0: 8a 81 ldd r24, Y+2 ; 0x02 31cc2: 9b 81 ldd r25, Y+3 ; 0x03 31cc4: cd 57 subi r28, 0x7D ; 125 31cc6: d0 40 sbci r29, 0x00 ; 0 31cc8: 0d 94 91 85 jmp 0x30b22 ; 0x30b22 // 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]) : 31ccc: f2 01 movw r30, r4 31cce: 25 81 ldd r18, Z+5 ; 0x05 31cd0: 36 81 ldd r19, Z+6 ; 0x06 31cd2: 47 81 ldd r20, Z+7 ; 0x07 31cd4: 50 85 ldd r21, Z+8 ; 0x08 31cd6: ed 96 adiw r28, 0x3d ; 61 31cd8: 6c ad ldd r22, Y+60 ; 0x3c 31cda: 7d ad ldd r23, Y+61 ; 0x3d 31cdc: 8e ad ldd r24, Y+62 ; 0x3e 31cde: 9f ad ldd r25, Y+63 ; 0x3f 31ce0: ed 97 sbiw r28, 0x3d ; 61 31ce2: b8 c0 rjmp .+368 ; 0x31e54 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : ((c == 2) ? ( c1 * measured_pts[2 * i]) : 31ce4: f2 01 movw r30, r4 31ce6: 25 81 ldd r18, Z+5 ; 0x05 31ce8: 36 81 ldd r19, Z+6 ; 0x06 31cea: 47 81 ldd r20, Z+7 ; 0x07 31cec: 50 85 ldd r21, Z+8 ; 0x08 31cee: ed 96 adiw r28, 0x3d ; 61 31cf0: 6c ad ldd r22, Y+60 ; 0x3c 31cf2: 7d ad ldd r23, Y+61 ; 0x3d 31cf4: 8e ad ldd r24, Y+62 ; 0x3e 31cf6: 9f ad ldd r25, Y+63 ; 0x3f 31cf8: ed 97 sbiw r28, 0x3d ; 61 31cfa: c6 c0 rjmp .+396 ; 0x31e88 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]) : 31cfc: a3 01 movw r20, r6 31cfe: 92 01 movw r18, r4 31d00: c3 58 subi r28, 0x83 ; 131 31d02: df 4f sbci r29, 0xFF ; 255 31d04: 68 81 ld r22, Y 31d06: 79 81 ldd r23, Y+1 ; 0x01 31d08: 8a 81 ldd r24, Y+2 ; 0x02 31d0a: 9b 81 ldd r25, Y+3 ; 0x03 31d0c: cd 57 subi r28, 0x7D ; 125 31d0e: d0 40 sbci r29, 0x00 ; 0 31d10: 0d 94 f9 85 jmp 0x30bf2 ; 0x30bf2 // J^T times f(x) acc = 0.f; for (uint8_t i = 0; i < npts; ++i) { { float j = (r == 0) ? 1.f : 31d14: 81 2c mov r8, r1 31d16: 91 2c mov r9, r1 31d18: 20 e8 ldi r18, 0x80 ; 128 31d1a: a2 2e mov r10, r18 31d1c: 2f e3 ldi r18, 0x3F ; 63 31d1e: b2 2e mov r11, r18 31d20: 0d 94 fd 85 jmp 0x30bfa ; 0x30bfa float w = point_weight_x(i, measured_pts[2 * i + 1]); acc += j * fx * w; } { float j = (r == 0) ? 0.f : 31d24: c1 2c mov r12, r1 31d26: d1 2c mov r13, r1 31d28: 76 01 movw r14, r12 31d2a: 0d 94 74 86 jmp 0x30ce8 ; 0x30ce8 ((r == 1) ? 1.f : 31d2e: c1 2c mov r12, r1 31d30: d1 2c mov r13, r1 31d32: 90 e8 ldi r25, 0x80 ; 128 31d34: e9 2e mov r14, r25 31d36: 9f e3 ldi r25, 0x3F ; 63 31d38: f9 2e mov r15, r25 31d3a: 0d 94 74 86 jmp 0x30ce8 ; 0x30ce8 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; 31d3e: 12 e0 ldi r17, 0x02 ; 2 31d40: a7 cb rjmp .-2226 ; 0x31490 } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 31d42: 1e 3f cpi r17, 0xFE ; 254 31d44: 89 f4 brne .+34 ; 0x31d68 31d46: af 96 adiw r28, 0x2f ; 47 31d48: 3f ad ldd r19, Y+63 ; 0x3f 31d4a: af 97 sbiw r28, 0x2f ; 47 31d4c: 32 30 cpi r19, 0x02 ; 2 31d4e: 09 f0 breq .+2 ; 0x31d52 31d50: 4d cf rjmp .-358 ; 0x31bec DBG(_n("Fitting failed => calibration failed.\n")); 31d52: 80 e2 ldi r24, 0x20 ; 32 31d54: 9c e6 ldi r25, 0x6C ; 108 31d56: 9f 93 push r25 31d58: 8f 93 push r24 31d5a: 0f 94 43 a3 call 0x34686 ; 0x34686 31d5e: 44 cf rjmp .-376 ; 0x31be8 // 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; 31d60: af 96 adiw r28, 0x2f ; 47 31d62: 1f ae std Y+63, r1 ; 0x3f 31d64: af 97 sbiw r28, 0x2f ; 47 31d66: 42 cf rjmp .-380 ; 0x31bec } } #endif // SUPPORT_VERBOSITY return result; } if (result == BED_SKEW_OFFSET_DETECTION_FITTING_FAILED && too_far_mask == 2){ 31d68: 1f ef ldi r17, 0xFF ; 255 31d6a: 40 cf rjmp .-384 ; 0x31bec 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) { 31d6c: af 96 adiw r28, 0x2f ; 47 31d6e: 6f ad ldd r22, Y+63 ; 0x3f 31d70: af 97 sbiw r28, 0x2f ; 47 31d72: 61 11 cpse r22, r1 31d74: 13 c0 rjmp .+38 ; 0x31d9c 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); 31d76: 8d e7 ldi r24, 0x7D ; 125 31d78: 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) { 31d7a: 11 30 cpi r17, 0x01 ; 1 31d7c: 51 f0 breq .+20 ; 0x31d92 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); 31d7e: 8a e3 ldi r24, 0x3A ; 58 31d80: 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) { 31d82: 12 30 cpi r17, 0x02 ; 2 31d84: 31 f0 breq .+12 ; 0x31d92 default: // should not happen msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED); 31d86: 81 e2 ldi r24, 0x21 ; 33 31d88: 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) { 31d8a: 11 11 cpse r17, r1 31d8c: 02 c0 rjmp .+4 ; 0x31d92 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); 31d8e: 82 ec ldi r24, 0xC2 ; 194 31d90: 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); 31d92: 0e 94 8b 75 call 0xeb16 ; 0xeb16 break; } lcd_show_fullscreen_message_and_wait_P(msg); 31d96: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 31d9a: 0d c0 rjmp .+26 ; 0x31db6 // 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) 31d9c: af 96 adiw r28, 0x2f ; 47 31d9e: 8f ad ldd r24, Y+63 ; 0x3f 31da0: af 97 sbiw r28, 0x2f ; 47 31da2: 82 30 cpi r24, 0x02 ; 2 31da4: f1 f4 brne .+60 ; 0x31de2 // Only the center point or all the three front points. msg = _T(MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR); 31da6: 81 e5 ldi r24, 0x51 ; 81 31da8: 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); 31daa: 0e 94 8b 75 call 0xeb16 ; 0xeb16 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); 31dae: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa } if (point_too_far_mask == 0 || result > 0) { 31db2: 11 16 cp r1, r17 31db4: 04 f3 brlt .-64 ; 0x31d76 //#endif //NEW_XYZCAL lcd_update_enable(true); lcd_update(2); lcd_bed_calibration_show_result(result, point_too_far_mask); if (result >= 0) 31db6: 1f 3f cpi r17, 0xFF ; 255 31db8: 11 f4 brne .+4 ; 0x31dbe 31dba: 0d 94 52 7e jmp 0x2fca4 ; 0x2fca4 { // 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); 31dbe: 86 e0 ldi r24, 0x06 ; 6 31dc0: 0e 94 36 d5 call 0x1aa6c ; 0x1aa6c if (!eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE)) 31dc4: 8f e5 ldi r24, 0x5F ; 95 31dc6: 9f e0 ldi r25, 0x0F ; 15 31dc8: 0f 94 81 a4 call 0x34902 ; 0x34902 31dcc: 81 11 cpse r24, r1 31dce: 0d 94 c5 82 jmp 0x3058a ; 0x3058a lcd_show_fullscreen_message_and_wait_P(_T(MSG_BABYSTEP_Z_NOT_SET)); 31dd2: 8c eb ldi r24, 0xBC ; 188 31dd4: 90 e6 ldi r25, 0x60 ; 96 31dd6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 31dda: 0e 94 55 e8 call 0x1d0aa ; 0x1d0aa 31dde: 0d 94 c5 82 jmp 0x3058a ; 0x3058a 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); 31de2: 85 e0 ldi r24, 0x05 ; 5 31de4: 9f e5 ldi r25, 0x5F ; 95 31de6: e1 cf rjmp .-62 ; 0x31daa 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)) 31de8: 89 81 ldd r24, Y+1 ; 0x01 31dea: 9a 81 ldd r25, Y+2 ; 0x02 31dec: 80 37 cpi r24, 0x70 ; 112 31dee: 98 40 sbci r25, 0x08 ; 8 31df0: 10 f0 brcs .+4 ; 0x31df6 31df2: 0d 94 fe 82 jmp 0x305fc ; 0x305fc if ((ret = xyzcal_spiral2(cx, cy, z0 - 2*dz, dz, radius, 180, delay_us, check_pinda, &ad)) != 0) 31df6: ae 01 movw r20, r28 31df8: 4f 5f subi r20, 0xFF ; 255 31dfa: 5f 4f sbci r21, 0xFF ; 255 31dfc: 7a 01 movw r14, r20 31dfe: 04 eb ldi r16, 0xB4 ; 180 31e00: 10 e0 ldi r17, 0x00 ; 0 31e02: 24 e8 ldi r18, 0x84 ; 132 31e04: 33 e0 ldi r19, 0x03 ; 3 31e06: a6 01 movw r20, r12 31e08: 48 5c subi r20, 0xC8 ; 200 31e0a: 51 09 sbc r21, r1 31e0c: 69 2d mov r22, r9 31e0e: 78 2d mov r23, r8 31e10: 8b 2d mov r24, r11 31e12: 9a 2d mov r25, r10 31e14: 0f 94 13 5f call 0x2be26 ; 0x2be26 31e18: 88 23 and r24, r24 31e1a: 11 f4 brne .+4 ; 0x31e20 31e1c: 0d 94 fe 82 jmp 0x305fc ; 0x305fc ad += 1440; 31e20: 89 81 ldd r24, Y+1 ; 0x01 31e22: 9a 81 ldd r25, Y+2 ; 0x02 31e24: 80 56 subi r24, 0x60 ; 96 31e26: 9a 4f sbci r25, 0xFA ; 250 31e28: 0d 94 27 80 jmp 0x3004e ; 0x3004e 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) { 31e2c: 00 23 and r16, r16 31e2e: 11 f4 brne .+4 ; 0x31e34 31e30: 0d 94 a4 85 jmp 0x30b48 ; 0x30b48 float a = (r == 1) ? 1.f : ((r == 2) ? ( c1 * measured_pts[2 * i]) : 31e34: 02 30 cpi r16, 0x02 ; 2 31e36: 09 f0 breq .+2 ; 0x31e3a 31e38: 49 cf rjmp .-366 ; 0x31ccc 31e3a: d2 01 movw r26, r4 31e3c: 11 96 adiw r26, 0x01 ; 1 31e3e: 2d 91 ld r18, X+ 31e40: 3d 91 ld r19, X+ 31e42: 4d 91 ld r20, X+ 31e44: 5c 91 ld r21, X 31e46: 14 97 sbiw r26, 0x04 ; 4 31e48: 6e 96 adiw r28, 0x1e ; 30 31e4a: 6c ad ldd r22, Y+60 ; 0x3c 31e4c: 7d ad ldd r23, Y+61 ; 0x3d 31e4e: 8e ad ldd r24, Y+62 ; 0x3e 31e50: 9f ad ldd r25, Y+63 ; 0x3f 31e52: 6e 97 sbiw r28, 0x1e ; 30 31e54: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31e58: 4b 01 movw r8, r22 31e5a: 5c 01 movw r10, r24 (-s2 * measured_pts[2 * i + 1])); float b = (c == 1) ? 1.f : 31e5c: 60 e0 ldi r22, 0x00 ; 0 31e5e: 70 e0 ldi r23, 0x00 ; 0 31e60: 80 e8 ldi r24, 0x80 ; 128 31e62: 9f e3 ldi r25, 0x3F ; 63 31e64: 11 30 cpi r17, 0x01 ; 1 31e66: 91 f0 breq .+36 ; 0x31e8c ((c == 2) ? ( c1 * measured_pts[2 * i]) : 31e68: 12 30 cpi r17, 0x02 ; 2 31e6a: 09 f0 breq .+2 ; 0x31e6e 31e6c: 3b cf rjmp .-394 ; 0x31ce4 31e6e: d2 01 movw r26, r4 31e70: 11 96 adiw r26, 0x01 ; 1 31e72: 2d 91 ld r18, X+ 31e74: 3d 91 ld r19, X+ 31e76: 4d 91 ld r20, X+ 31e78: 5c 91 ld r21, X 31e7a: 14 97 sbiw r26, 0x04 ; 4 31e7c: 6e 96 adiw r28, 0x1e ; 30 31e7e: 6c ad ldd r22, Y+60 ; 0x3c 31e80: 7d ad ldd r23, Y+61 ; 0x3d 31e82: 8e ad ldd r24, Y+62 ; 0x3e 31e84: 9f ad ldd r25, Y+63 ; 0x3f 31e86: 6e 97 sbiw r28, 0x1e ; 30 31e88: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> (-s2 * measured_pts[2 * i + 1])); float w = point_weight_y(i, measured_pts[2 * i + 1]); acc += a * b * w; 31e8c: 9b 01 movw r18, r22 31e8e: ac 01 movw r20, r24 31e90: c5 01 movw r24, r10 31e92: b4 01 movw r22, r8 31e94: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 31e98: 9b 01 movw r18, r22 31e9a: ac 01 movw r20, r24 31e9c: c7 01 movw r24, r14 31e9e: b6 01 movw r22, r12 31ea0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 31ea4: 6b 01 movw r12, r22 31ea6: 7c 01 movw r14, r24 31ea8: 0d 94 a4 85 jmp 0x30b48 ; 0x30b48 // 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 : 31eac: 81 2c mov r8, r1 31eae: 91 2c mov r9, r1 31eb0: 50 e8 ldi r21, 0x80 ; 128 31eb2: a5 2e mov r10, r21 31eb4: 5f e3 ldi r21, 0x3F ; 63 31eb6: b5 2e mov r11, r21 ((r == 2) ? (-s1 * measured_pts[2 * i]) : (-c2 * measured_pts[2 * i + 1])); float b = (c == 0) ? 1.f : 31eb8: 11 11 cpse r17, r1 31eba: 0d 94 7e 85 jmp 0x30afc ; 0x30afc ((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; 31ebe: 20 e0 ldi r18, 0x00 ; 0 31ec0: 30 e0 ldi r19, 0x00 ; 0 31ec2: 40 e8 ldi r20, 0x80 ; 128 31ec4: 5f e3 ldi r21, 0x3F ; 63 31ec6: ea cf rjmp .-44 ; 0x31e9c // 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 : 31ec8: 81 2c mov r8, r1 31eca: 91 2c mov r9, r1 31ecc: 40 e8 ldi r20, 0x80 ; 128 31ece: a4 2e mov r10, r20 31ed0: 4f e3 ldi r20, 0x3F ; 63 31ed2: 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) { 31ed4: 11 11 cpse r17, r1 31ed6: c2 cf rjmp .-124 ; 0x31e5c 31ed8: 0d 94 a4 85 jmp 0x30b48 ; 0x30b48 31edc: 11 11 cpse r17, r1 31ede: aa cf rjmp .-172 ; 0x31e34 31ee0: 0d 94 a4 85 jmp 0x30b48 ; 0x30b48 00031ee4 : 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, 31ee4: 1f 93 push r17 31ee6: cf 93 push r28 31ee8: df 93 push r29 31eea: c8 2f mov r28, r24 31eec: d6 2f mov r29, r22 const bool _default) { bool _result = check_opposite; lcd_clear(); 31eee: 0e 94 77 70 call 0xe0ee ; 0xe0ee lcd_puts_at_P(0, 0, _T(MSG_SELFTEST_FAN)); 31ef2: 8f e2 ldi r24, 0x2F ; 47 31ef4: 9e e5 ldi r25, 0x5E ; 94 31ef6: 0e 94 8b 75 call 0xeb16 ; 0xeb16 31efa: ac 01 movw r20, r24 31efc: 60 e0 ldi r22, 0x00 ; 0 31efe: 80 e0 ldi r24, 0x00 ; 0 31f00: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 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)); 31f04: 89 e0 ldi r24, 0x09 ; 9 31f06: 9e e5 ldi r25, 0x5E ; 94 31f08: c1 11 cpse r28, r1 31f0a: 02 c0 rjmp .+4 ; 0x31f10 31f0c: 8c e1 ldi r24, 0x1C ; 28 31f0e: 9e e5 ldi r25, 0x5E ; 94 31f10: 0e 94 8b 75 call 0xeb16 ; 0xeb16 31f14: ac 01 movw r20, r24 31f16: 61 e0 ldi r22, 0x01 ; 1 31f18: 80 e0 ldi r24, 0x00 ; 0 31f1a: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 31f1e: 8f ef ldi r24, 0xFF ; 255 31f20: 80 93 55 12 sts 0x1255, r24 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 31f24: 80 93 1d 06 sts 0x061D, r24 ; 0x80061d #endif manage_heater(); 31f28: 0f 94 a8 37 call 0x26f50 ; 0x26f50 // 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); 31f2c: 64 ef ldi r22, 0xF4 ; 244 31f2e: 71 e0 ldi r23, 0x01 ; 1 31f30: 80 e0 ldi r24, 0x00 ; 0 31f32: 90 e0 ldi r25, 0x00 ; 0 31f34: 0f 94 56 0b call 0x216ac ; 0x216ac lcd_puts_at_P(1, 2, _T(MSG_SELFTEST_FAN_YES)); 31f38: 8e ef ldi r24, 0xFE ; 254 31f3a: 9d e5 ldi r25, 0x5D ; 93 31f3c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 31f40: ac 01 movw r20, r24 31f42: 62 e0 ldi r22, 0x02 ; 2 31f44: 81 e0 ldi r24, 0x01 ; 1 31f46: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 lcd_putc_at(0, 3, '>'); 31f4a: 4e e3 ldi r20, 0x3E ; 62 31f4c: 63 e0 ldi r22, 0x03 ; 3 31f4e: 80 e0 ldi r24, 0x00 ; 0 31f50: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_puts_P(_T(MSG_SELFTEST_FAN_NO)); 31f54: 8f ee ldi r24, 0xEF ; 239 31f56: 9d e5 ldi r25, 0x5D ; 93 31f58: 0e 94 8b 75 call 0xeb16 ; 0xeb16 31f5c: 0e 94 6e 6f call 0xdedc ; 0xdedc lcd_encoder = _default; 31f60: 6d 2f mov r22, r29 31f62: 70 e0 ldi r23, 0x00 ; 0 31f64: 70 93 1f 06 sts 0x061F, r23 ; 0x80061f 31f68: 60 93 1e 06 sts 0x061E, r22 ; 0x80061e KEEPALIVE_STATE(PAUSED_FOR_USER); 31f6c: 84 e0 ldi r24, 0x04 ; 4 31f6e: 80 93 78 02 sts 0x0278, r24 ; 0x800278 lcd_consume_click(); 31f72: 0e 94 c1 73 call 0xe782 ; 0xe782 31f76: dc 2f mov r29, r28 do { if (lcd_encoder) { if (lcd_encoder < 0) { _result = !check_opposite; 31f78: 11 e0 ldi r17, 0x01 ; 1 31f7a: 1c 27 eor r17, r28 KEEPALIVE_STATE(PAUSED_FOR_USER); lcd_consume_click(); do { if (lcd_encoder) { 31f7c: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 31f80: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 31f84: 00 97 sbiw r24, 0x00 ; 0 31f86: 19 f1 breq .+70 ; 0x31fce if (lcd_encoder < 0) { 31f88: 97 ff sbrs r25, 7 31f8a: 0b c0 rjmp .+22 ; 0x31fa2 _result = !check_opposite; 31f8c: d1 2f mov r29, r17 lcd_putc_at(0, 2, '>'); 31f8e: 4e e3 ldi r20, 0x3E ; 62 31f90: 62 e0 ldi r22, 0x02 ; 2 31f92: 80 e0 ldi r24, 0x00 ; 0 31f94: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_putc_at(0, 3, ' '); 31f98: 40 e2 ldi r20, 0x20 ; 32 31f9a: 63 e0 ldi r22, 0x03 ; 3 31f9c: 80 e0 ldi r24, 0x00 ; 0 31f9e: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 } if (lcd_encoder > 0) { 31fa2: 80 91 1e 06 lds r24, 0x061E ; 0x80061e 31fa6: 90 91 1f 06 lds r25, 0x061F ; 0x80061f 31faa: 18 16 cp r1, r24 31fac: 19 06 cpc r1, r25 31fae: 5c f4 brge .+22 ; 0x31fc6 _result = check_opposite; lcd_putc_at(0, 2, ' '); 31fb0: 40 e2 ldi r20, 0x20 ; 32 31fb2: 62 e0 ldi r22, 0x02 ; 2 31fb4: 80 e0 ldi r24, 0x00 ; 0 31fb6: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 lcd_putc_at(0, 3, '>'); 31fba: 4e e3 ldi r20, 0x3E ; 62 31fbc: 63 e0 ldi r22, 0x03 ; 3 31fbe: 80 e0 ldi r24, 0x00 ; 0 31fc0: 0e 94 64 70 call 0xe0c8 ; 0xe0c8 31fc4: dc 2f mov r29, r28 } lcd_encoder = 0; 31fc6: 10 92 1f 06 sts 0x061F, r1 ; 0x80061f 31fca: 10 92 1e 06 sts 0x061E, r1 ; 0x80061e } manage_heater(); 31fce: 0f 94 a8 37 call 0x26f50 ; 0x26f50 manage_inactivity(true); 31fd2: 81 e0 ldi r24, 0x01 ; 1 31fd4: 0e 94 ad 8a call 0x1155a ; 0x1155a _delay(100); 31fd8: 64 e6 ldi r22, 0x64 ; 100 31fda: 70 e0 ldi r23, 0x00 ; 0 31fdc: 80 e0 ldi r24, 0x00 ; 0 31fde: 90 e0 ldi r25, 0x00 ; 0 31fe0: 0f 94 56 0b call 0x216ac ; 0x216ac } while (!lcd_clicked()); 31fe4: 0e 94 c6 73 call 0xe78c ; 0xe78c 31fe8: 88 23 and r24, r24 31fea: 41 f2 breq .-112 ; 0x31f7c KEEPALIVE_STATE(IN_HANDLER); 31fec: 82 e0 ldi r24, 0x02 ; 2 31fee: 80 93 78 02 sts 0x0278, r24 ; 0x800278 setExtruderAutoFanState(0); // Turn off hotend fan 31ff2: 80 e0 ldi r24, 0x00 ; 0 31ff4: 0e 94 00 78 call 0xf000 ; 0xf000 } /// @brief Set print fan speed /// @param speed ranges from 0 to 255 static void lcd_selftest_setfan(const uint8_t speed) { fanSpeed = speed; 31ff8: 10 92 55 12 sts 0x1255, r1 ; 0x801255 #ifdef FAN_SOFT_PWM fanSpeedSoftPwm = speed; 31ffc: 10 92 1d 06 sts 0x061D, r1 ; 0x80061d #endif manage_heater(); 32000: 0f 94 a8 37 call 0x26f50 ; 0x26f50 KEEPALIVE_STATE(IN_HANDLER); setExtruderAutoFanState(0); // Turn off hotend fan lcd_selftest_setfan(0); // Turn off print fan return _result; } 32004: 8d 2f mov r24, r29 32006: df 91 pop r29 32008: cf 91 pop r28 3200a: 1f 91 pop r17 3200c: 08 95 ret 0003200e : #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) { 3200e: 4f 92 push r4 32010: 5f 92 push r5 32012: 6f 92 push r6 32014: 7f 92 push r7 32016: af 92 push r10 32018: bf 92 push r11 3201a: cf 92 push r12 3201c: df 92 push r13 3201e: ef 92 push r14 32020: ff 92 push r15 32022: 0f 93 push r16 32024: 1f 93 push r17 32026: cf 93 push r28 32028: df 93 push r29 3202a: 24 e0 ldi r18, 0x04 ; 4 3202c: 30 e0 ldi r19, 0x00 ; 0 3202e: 41 e0 ldi r20, 0x01 ; 1 32030: 50 e0 ldi r21, 0x00 ; 0 32032: d9 01 movw r26, r18 32034: ab 50 subi r26, 0x0B ; 11 32036: b5 46 sbci r27, 0x65 ; 101 uint8_t i; short (*tt)[][2] = (short (*)[][2])(heater_ttbl_map[e]); for (i=1; i raw) 32038: fd 01 movw r30, r26 3203a: 65 91 lpm r22, Z+ 3203c: 74 91 lpm r23, Z 3203e: 86 17 cp r24, r22 32040: 97 07 cpc r25, r23 32042: 0c f0 brlt .+2 ; 0x32046 32044: 66 c0 rjmp .+204 ; 0x32112 { celsius = PGM_RD_W((*tt)[i-1][1]) + 32046: 41 50 subi r20, 0x01 ; 1 32048: 51 09 sbc r21, r1 3204a: 44 0f add r20, r20 3204c: 55 1f adc r21, r21 3204e: 44 0f add r20, r20 32050: 55 1f adc r21, r21 32052: ea 01 movw r28, r20 32054: c9 50 subi r28, 0x09 ; 9 32056: d5 46 sbci r29, 0x65 ; 101 32058: fe 01 movw r30, r28 3205a: 05 91 lpm r16, Z+ 3205c: 14 91 lpm r17, Z (raw - PGM_RD_W((*tt)[i-1][0])) * 3205e: 4b 50 subi r20, 0x0B ; 11 32060: 55 46 sbci r21, 0x65 ; 101 32062: fa 01 movw r30, r20 32064: 65 91 lpm r22, Z+ 32066: 74 91 lpm r23, Z (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 32068: f9 01 movw r30, r18 3206a: e9 50 subi r30, 0x09 ; 9 3206c: f5 46 sbci r31, 0x65 ; 101 3206e: e5 90 lpm r14, Z+ 32070: f4 90 lpm r15, Z 32072: fe 01 movw r30, r28 32074: c5 90 lpm r12, Z+ 32076: d4 90 lpm r13, Z (float)(PGM_RD_W((*tt)[i][0]) - PGM_RD_W((*tt)[i-1][0])); 32078: fd 01 movw r30, r26 3207a: c5 91 lpm r28, Z+ 3207c: d4 91 lpm r29, Z 3207e: fa 01 movw r30, r20 32080: a5 90 lpm r10, Z+ 32082: 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])) * 32084: 86 1b sub r24, r22 32086: 97 0b sbc r25, r23 32088: bc 01 movw r22, r24 3208a: 99 0f add r25, r25 3208c: 88 0b sbc r24, r24 3208e: 99 0b sbc r25, r25 32090: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 32094: 2b 01 movw r4, r22 32096: 3c 01 movw r6, r24 (float)(PGM_RD_W((*tt)[i][1]) - PGM_RD_W((*tt)[i-1][1])) / 32098: b7 01 movw r22, r14 3209a: 6c 19 sub r22, r12 3209c: 7d 09 sbc r23, r13 3209e: 07 2e mov r0, r23 320a0: 00 0c add r0, r0 320a2: 88 0b sbc r24, r24 320a4: 99 0b sbc r25, r25 320a6: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 320aa: 9b 01 movw r18, r22 320ac: 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])) * 320ae: c3 01 movw r24, r6 320b0: b2 01 movw r22, r4 320b2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 320b6: 6b 01 movw r12, r22 320b8: 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])); 320ba: be 01 movw r22, r28 320bc: 6a 19 sub r22, r10 320be: 7b 09 sbc r23, r11 320c0: 07 2e mov r0, r23 320c2: 00 0c add r0, r0 320c4: 88 0b sbc r24, r24 320c6: 99 0b sbc r25, r25 320c8: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 320cc: 9b 01 movw r18, r22 320ce: 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])) / 320d0: c7 01 movw r24, r14 320d2: b6 01 movw r22, r12 320d4: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 320d8: 6b 01 movw r12, r22 320da: 7c 01 movw r14, r24 for (i=1; i raw) { celsius = PGM_RD_W((*tt)[i-1][1]) + 320dc: b8 01 movw r22, r16 320de: 11 0f add r17, r17 320e0: 88 0b sbc r24, r24 320e2: 99 0b sbc r25, r25 320e4: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 320e8: 9b 01 movw r18, r22 320ea: ac 01 movw r20, r24 320ec: c7 01 movw r24, r14 320ee: b6 01 movw r22, r12 320f0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__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; } 320f4: df 91 pop r29 320f6: cf 91 pop r28 320f8: 1f 91 pop r17 320fa: 0f 91 pop r16 320fc: ff 90 pop r15 320fe: ef 90 pop r14 32100: df 90 pop r13 32102: cf 90 pop r12 32104: bf 90 pop r11 32106: af 90 pop r10 32108: 7f 90 pop r7 3210a: 6f 90 pop r6 3210c: 5f 90 pop r5 3210e: 4f 90 pop r4 32110: 08 95 ret 32112: 4f 5f subi r20, 0xFF ; 255 32114: 5f 4f sbci r21, 0xFF ; 255 32116: 2c 5f subi r18, 0xFC ; 252 32118: 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 32120: 88 cf rjmp .-240 ; 0x32032 break; } } // Overflow: Set to last value in the table if (i == heater_ttbllen_map[e]) celsius = PGM_RD_W((*tt)[i-1][1]); 32122: e3 e7 ldi r30, 0x73 ; 115 32124: fb e9 ldi r31, 0x9B ; 155 32126: 65 91 lpm r22, Z+ 32128: 74 91 lpm r23, Z 3212a: 07 2e mov r0, r23 3212c: 00 0c add r0, r0 3212e: 88 0b sbc r24, r24 32130: 99 0b sbc r25, r25 32132: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 32136: de cf rjmp .-68 ; 0x320f4 00032138 : useU2X = false; } #endif // set up the first (original serial port) if (useU2X) { M_UCSRxA = 1 << M_U2Xx; 32138: 22 e0 ldi r18, 0x02 ; 2 3213a: 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; 3213e: 10 92 c5 00 sts 0x00C5, r1 ; 0x8000c5 <__TEXT_REGION_LENGTH__+0x7c20c5> M_UBRRxL = baud_setting; 32142: 90 e1 ldi r25, 0x10 ; 16 32144: 90 93 c4 00 sts 0x00C4, r25 ; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7c20c4> sbi(M_UCSRxB, M_RXENx); 32148: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 3214c: 80 61 ori r24, 0x10 ; 16 3214e: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_TXENx); 32152: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 32156: 88 60 ori r24, 0x08 ; 8 32158: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> sbi(M_UCSRxB, M_RXCIEx); 3215c: 80 91 c1 00 lds r24, 0x00C1 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> 32160: 80 68 ori r24, 0x80 ; 128 32162: 80 93 c1 00 sts 0x00C1, r24 ; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7c20c1> if (selectedSerialPort == 1) { //set up also the second serial port 32166: 80 91 1c 06 lds r24, 0x061C ; 0x80061c 3216a: 81 30 cpi r24, 0x01 ; 1 3216c: a9 f4 brne .+42 ; 0x32198 if (useU2X) { UCSR1A = 1 << U2X1; 3216e: 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; 32172: 10 92 cd 00 sts 0x00CD, r1 ; 0x8000cd <__TEXT_REGION_LENGTH__+0x7c20cd> UBRR1L = baud_setting; 32176: 90 93 cc 00 sts 0x00CC, r25 ; 0x8000cc <__TEXT_REGION_LENGTH__+0x7c20cc> sbi(UCSR1B, RXEN1); 3217a: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 3217e: 80 61 ori r24, 0x10 ; 16 32180: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, TXEN1); 32184: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 32188: 88 60 ori r24, 0x08 ; 8 3218a: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> sbi(UCSR1B, RXCIE1); 3218e: 80 91 c9 00 lds r24, 0x00C9 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> 32192: 80 68 ori r24, 0x80 ; 128 32194: 80 93 c9 00 sts 0x00C9, r24 ; 0x8000c9 <__TEXT_REGION_LENGTH__+0x7c20c9> } } 32198: 08 95 ret 0003219a : { previous_millis_cmd.start(); } #ifdef FWRETRACT void retract(bool retracting, bool swapretract = false) { 3219a: 8f 92 push r8 3219c: 9f 92 push r9 3219e: af 92 push r10 321a0: bf 92 push r11 321a2: cf 92 push r12 321a4: df 92 push r13 321a6: ef 92 push r14 321a8: ff 92 push r15 321aa: 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]) { 321ae: 88 23 and r24, r24 321b0: 09 f4 brne .+2 ; 0x321b4 321b2: 9d c0 rjmp .+314 ; 0x322ee 321b4: 91 11 cpse r25, r1 321b6: 92 c0 rjmp .+292 ; 0x322dc st_synchronize(); 321b8: 0f 94 94 18 call 0x23128 ; 0x23128 set_destination_to_current(); 321bc: 0e 94 ff 66 call 0xcdfe ; 0xcdfe current_position[E_AXIS]+=(swapretract?retract_length_swap:cs.retract_length)*float(extrudemultiply)*0.01f; 321c0: 60 91 75 02 lds r22, 0x0275 ; 0x800275 321c4: 70 91 76 02 lds r23, 0x0276 ; 0x800276 321c8: 07 2e mov r0, r23 321ca: 00 0c add r0, r0 321cc: 88 0b sbc r24, r24 321ce: 99 0b sbc r25, r25 321d0: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 321d4: 20 91 ea 0d lds r18, 0x0DEA ; 0x800dea 321d8: 30 91 eb 0d lds r19, 0x0DEB ; 0x800deb 321dc: 40 91 ec 0d lds r20, 0x0DEC ; 0x800dec 321e0: 50 91 ed 0d lds r21, 0x0DED ; 0x800ded 321e4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 321e8: 2a e0 ldi r18, 0x0A ; 10 321ea: 37 ed ldi r19, 0xD7 ; 215 321ec: 43 e2 ldi r20, 0x23 ; 35 321ee: 5c e3 ldi r21, 0x3C ; 60 321f0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 321f4: 20 91 6d 12 lds r18, 0x126D ; 0x80126d 321f8: 30 91 6e 12 lds r19, 0x126E ; 0x80126e 321fc: 40 91 6f 12 lds r20, 0x126F ; 0x80126f 32200: 50 91 70 12 lds r21, 0x1270 ; 0x801270 32204: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 32208: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 3220c: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 32210: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 32214: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_set_e_position(current_position[E_AXIS]); 32218: 8d e6 ldi r24, 0x6D ; 109 3221a: 92 e1 ldi r25, 0x12 ; 18 3221c: 0f 94 65 3a call 0x274ca ; 0x274ca float oldFeedrate = feedrate; 32220: c0 90 7a 02 lds r12, 0x027A ; 0x80027a 32224: d0 90 7b 02 lds r13, 0x027B ; 0x80027b 32228: e0 90 7c 02 lds r14, 0x027C ; 0x80027c 3222c: f0 90 7d 02 lds r15, 0x027D ; 0x80027d feedrate=cs.retract_feedrate*60; 32230: 20 e0 ldi r18, 0x00 ; 0 32232: 30 e0 ldi r19, 0x00 ; 0 32234: 40 e7 ldi r20, 0x70 ; 112 32236: 52 e4 ldi r21, 0x42 ; 66 32238: 60 91 ee 0d lds r22, 0x0DEE ; 0x800dee 3223c: 70 91 ef 0d lds r23, 0x0DEF ; 0x800def 32240: 80 91 f0 0d lds r24, 0x0DF0 ; 0x800df0 32244: 90 91 f1 0d lds r25, 0x0DF1 ; 0x800df1 32248: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3224c: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 32250: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 32254: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 32258: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d retracted[active_extruder]=true; 3225c: 81 e0 ldi r24, 0x01 ; 1 3225e: 80 93 1b 06 sts 0x061B, r24 ; 0x80061b prepare_move(); 32262: 90 e0 ldi r25, 0x00 ; 0 32264: 80 e0 ldi r24, 0x00 ; 0 32266: 0e 94 0c 6b call 0xd618 ; 0xd618 if(cs.retract_zlift) { 3226a: 20 e0 ldi r18, 0x00 ; 0 3226c: 30 e0 ldi r19, 0x00 ; 0 3226e: a9 01 movw r20, r18 32270: 60 91 f2 0d lds r22, 0x0DF2 ; 0x800df2 32274: 70 91 f3 0d lds r23, 0x0DF3 ; 0x800df3 32278: 80 91 f4 0d lds r24, 0x0DF4 ; 0x800df4 3227c: 90 91 f5 0d lds r25, 0x0DF5 ; 0x800df5 32280: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 32284: 88 23 and r24, r24 32286: 11 f1 breq .+68 ; 0x322cc st_synchronize(); 32288: 0f 94 94 18 call 0x23128 ; 0x23128 current_position[Z_AXIS]-=cs.retract_zlift; 3228c: 20 91 f2 0d lds r18, 0x0DF2 ; 0x800df2 32290: 30 91 f3 0d lds r19, 0x0DF3 ; 0x800df3 32294: 40 91 f4 0d lds r20, 0x0DF4 ; 0x800df4 32298: 50 91 f5 0d lds r21, 0x0DF5 ; 0x800df5 3229c: 60 91 69 12 lds r22, 0x1269 ; 0x801269 322a0: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 322a4: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 322a8: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 322ac: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 322b0: 60 93 69 12 sts 0x1269, r22 ; 0x801269 322b4: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 322b8: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 322bc: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_set_position_curposXYZE(); 322c0: 0f 94 cd 48 call 0x2919a ; 0x2919a prepare_move(); 322c4: 90 e0 ldi r25, 0x00 ; 0 322c6: 80 e0 ldi r24, 0x00 ; 0 322c8: 0e 94 0c 6b call 0xd618 ; 0xd618 } feedrate = oldFeedrate; 322cc: c0 92 7a 02 sts 0x027A, r12 ; 0x80027a 322d0: d0 92 7b 02 sts 0x027B, r13 ; 0x80027b 322d4: e0 92 7c 02 sts 0x027C, r14 ; 0x80027c 322d8: 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 322dc: ff 90 pop r15 322de: ef 90 pop r14 322e0: df 90 pop r13 322e2: cf 90 pop r12 322e4: bf 90 pop r11 322e6: af 90 pop r10 322e8: 9f 90 pop r9 322ea: 8f 90 pop r8 322ec: 08 95 ret current_position[Z_AXIS]-=cs.retract_zlift; plan_set_position_curposXYZE(); prepare_move(); } feedrate = oldFeedrate; } else if(!retracting && retracted[active_extruder]) { 322ee: 99 23 and r25, r25 322f0: a9 f3 breq .-22 ; 0x322dc st_synchronize(); 322f2: 0f 94 94 18 call 0x23128 ; 0x23128 set_destination_to_current(); 322f6: 0e 94 ff 66 call 0xcdfe ; 0xcdfe float oldFeedrate = feedrate; 322fa: 80 90 7a 02 lds r8, 0x027A ; 0x80027a 322fe: 90 90 7b 02 lds r9, 0x027B ; 0x80027b 32302: a0 90 7c 02 lds r10, 0x027C ; 0x80027c 32306: b0 90 7d 02 lds r11, 0x027D ; 0x80027d feedrate=cs.retract_recover_feedrate*60; 3230a: 20 e0 ldi r18, 0x00 ; 0 3230c: 30 e0 ldi r19, 0x00 ; 0 3230e: 40 e7 ldi r20, 0x70 ; 112 32310: 52 e4 ldi r21, 0x42 ; 66 32312: 60 91 fa 0d lds r22, 0x0DFA ; 0x800dfa 32316: 70 91 fb 0d lds r23, 0x0DFB ; 0x800dfb 3231a: 80 91 fc 0d lds r24, 0x0DFC ; 0x800dfc 3231e: 90 91 fd 0d lds r25, 0x0DFD ; 0x800dfd 32322: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 32326: 60 93 7a 02 sts 0x027A, r22 ; 0x80027a 3232a: 70 93 7b 02 sts 0x027B, r23 ; 0x80027b 3232e: 80 93 7c 02 sts 0x027C, r24 ; 0x80027c 32332: 90 93 7d 02 sts 0x027D, r25 ; 0x80027d if(cs.retract_zlift) { 32336: c0 90 f2 0d lds r12, 0x0DF2 ; 0x800df2 3233a: d0 90 f3 0d lds r13, 0x0DF3 ; 0x800df3 3233e: e0 90 f4 0d lds r14, 0x0DF4 ; 0x800df4 32342: f0 90 f5 0d lds r15, 0x0DF5 ; 0x800df5 32346: 20 e0 ldi r18, 0x00 ; 0 32348: 30 e0 ldi r19, 0x00 ; 0 3234a: a9 01 movw r20, r18 3234c: c7 01 movw r24, r14 3234e: b6 01 movw r22, r12 32350: 0f 94 9e a6 call 0x34d3c ; 0x34d3c <__cmpsf2> 32354: 88 23 and r24, r24 32356: e1 f0 breq .+56 ; 0x32390 current_position[Z_AXIS]+=cs.retract_zlift; 32358: a7 01 movw r20, r14 3235a: 96 01 movw r18, r12 3235c: 60 91 69 12 lds r22, 0x1269 ; 0x801269 32360: 70 91 6a 12 lds r23, 0x126A ; 0x80126a 32364: 80 91 6b 12 lds r24, 0x126B ; 0x80126b 32368: 90 91 6c 12 lds r25, 0x126C ; 0x80126c 3236c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 32370: 60 93 69 12 sts 0x1269, r22 ; 0x801269 32374: 70 93 6a 12 sts 0x126A, r23 ; 0x80126a 32378: 80 93 6b 12 sts 0x126B, r24 ; 0x80126b 3237c: 90 93 6c 12 sts 0x126C, r25 ; 0x80126c plan_set_position_curposXYZE(); 32380: 0f 94 cd 48 call 0x2919a ; 0x2919a prepare_move(); 32384: 90 e0 ldi r25, 0x00 ; 0 32386: 80 e0 ldi r24, 0x00 ; 0 32388: 0e 94 0c 6b call 0xd618 ; 0xd618 st_synchronize(); 3238c: 0f 94 94 18 call 0x23128 ; 0x23128 } current_position[E_AXIS]-=(swapretract?(retract_length_swap+retract_recover_length_swap):(cs.retract_length+cs.retract_recover_length))*float(extrudemultiply)*0.01f; 32390: 20 91 f6 0d lds r18, 0x0DF6 ; 0x800df6 32394: 30 91 f7 0d lds r19, 0x0DF7 ; 0x800df7 32398: 40 91 f8 0d lds r20, 0x0DF8 ; 0x800df8 3239c: 50 91 f9 0d lds r21, 0x0DF9 ; 0x800df9 323a0: 60 91 ea 0d lds r22, 0x0DEA ; 0x800dea 323a4: 70 91 eb 0d lds r23, 0x0DEB ; 0x800deb 323a8: 80 91 ec 0d lds r24, 0x0DEC ; 0x800dec 323ac: 90 91 ed 0d lds r25, 0x0DED ; 0x800ded 323b0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 323b4: 6b 01 movw r12, r22 323b6: 7c 01 movw r14, r24 323b8: 60 91 75 02 lds r22, 0x0275 ; 0x800275 323bc: 70 91 76 02 lds r23, 0x0276 ; 0x800276 323c0: 07 2e mov r0, r23 323c2: 00 0c add r0, r0 323c4: 88 0b sbc r24, r24 323c6: 99 0b sbc r25, r25 323c8: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 323cc: 9b 01 movw r18, r22 323ce: ac 01 movw r20, r24 323d0: c7 01 movw r24, r14 323d2: b6 01 movw r22, r12 323d4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 323d8: 2a e0 ldi r18, 0x0A ; 10 323da: 37 ed ldi r19, 0xD7 ; 215 323dc: 43 e2 ldi r20, 0x23 ; 35 323de: 5c e3 ldi r21, 0x3C ; 60 323e0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 323e4: 9b 01 movw r18, r22 323e6: ac 01 movw r20, r24 323e8: 60 91 6d 12 lds r22, 0x126D ; 0x80126d 323ec: 70 91 6e 12 lds r23, 0x126E ; 0x80126e 323f0: 80 91 6f 12 lds r24, 0x126F ; 0x80126f 323f4: 90 91 70 12 lds r25, 0x1270 ; 0x801270 323f8: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 323fc: 60 93 6d 12 sts 0x126D, r22 ; 0x80126d 32400: 70 93 6e 12 sts 0x126E, r23 ; 0x80126e 32404: 80 93 6f 12 sts 0x126F, r24 ; 0x80126f 32408: 90 93 70 12 sts 0x1270, r25 ; 0x801270 plan_set_e_position(current_position[E_AXIS]); 3240c: 8d e6 ldi r24, 0x6D ; 109 3240e: 92 e1 ldi r25, 0x12 ; 18 32410: 0f 94 65 3a call 0x274ca ; 0x274ca retracted[active_extruder]=false; 32414: 10 92 1b 06 sts 0x061B, r1 ; 0x80061b prepare_move(); 32418: 90 e0 ldi r25, 0x00 ; 0 3241a: 80 e0 ldi r24, 0x00 ; 0 3241c: 0e 94 0c 6b call 0xd618 ; 0xd618 feedrate = oldFeedrate; 32420: 80 92 7a 02 sts 0x027A, r8 ; 0x80027a 32424: 90 92 7b 02 sts 0x027B, r9 ; 0x80027b 32428: a0 92 7c 02 sts 0x027C, r10 ; 0x80027c 3242c: b0 92 7d 02 sts 0x027D, r11 ; 0x80027d 32430: 55 cf rjmp .-342 ; 0x322dc 00032432 : float mesh_bed_leveling::get_z(float x, float y) { 32432: 2f 92 push r2 32434: 3f 92 push r3 32436: 4f 92 push r4 32438: 5f 92 push r5 3243a: 6f 92 push r6 3243c: 7f 92 push r7 3243e: 8f 92 push r8 32440: 9f 92 push r9 32442: af 92 push r10 32444: bf 92 push r11 32446: cf 92 push r12 32448: df 92 push r13 3244a: ef 92 push r14 3244c: ff 92 push r15 3244e: 0f 93 push r16 32450: 1f 93 push r17 32452: cf 93 push r28 32454: df 93 push r29 32456: 00 d0 rcall .+0 ; 0x32458 32458: 00 d0 rcall .+0 ; 0x3245a 3245a: 00 d0 rcall .+0 ; 0x3245c 3245c: 1f 92 push r1 3245e: cd b7 in r28, 0x3d ; 61 32460: de b7 in r29, 0x3e ; 62 32462: 2b 01 movw r4, r22 32464: 3c 01 movw r6, r24 32466: 49 01 movw r8, r18 32468: 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)); 3246a: 20 e0 ldi r18, 0x00 ; 0 3246c: 30 e0 ldi r19, 0x00 ; 0 3246e: 40 ec ldi r20, 0xC0 ; 192 32470: 51 e4 ldi r21, 0x41 ; 65 32472: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 32476: 20 e0 ldi r18, 0x00 ; 0 32478: 30 e0 ldi r19, 0x00 ; 0 3247a: 48 e0 ldi r20, 0x08 ; 8 3247c: 52 e4 ldi r21, 0x42 ; 66 3247e: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 32482: 6b 01 movw r12, r22 32484: 7c 01 movw r14, r24 32486: 0f 94 50 a7 call 0x34ea0 ; 0x34ea0 3248a: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> if (i < 0) { i = 0; 3248e: 31 2c mov r3, r1 32490: 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) { 32492: 77 fd sbrc r23, 7 32494: 1e c0 rjmp .+60 ; 0x324d2 32496: 1b 01 movw r2, r22 32498: 66 30 cpi r22, 0x06 ; 6 3249a: 71 05 cpc r23, r1 3249c: 1c f0 brlt .+6 ; 0x324a4 3249e: 45 e0 ldi r20, 0x05 ; 5 324a0: 24 2e mov r2, r20 324a2: 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; } 324a4: 82 2d mov r24, r2 324a6: 0e 94 31 5f call 0xbe62 ; 0xbe62 324aa: 20 e0 ldi r18, 0x00 ; 0 324ac: 30 e0 ldi r19, 0x00 ; 0 324ae: 48 eb ldi r20, 0xB8 ; 184 324b0: 51 e4 ldi r21, 0x41 ; 65 324b2: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 324b6: 9b 01 movw r18, r22 324b8: 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; 324ba: c3 01 movw r24, r6 324bc: b2 01 movw r22, r4 324be: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 324c2: 20 e0 ldi r18, 0x00 ; 0 324c4: 30 e0 ldi r19, 0x00 ; 0 324c6: 48 e0 ldi r20, 0x08 ; 8 324c8: 52 e4 ldi r21, 0x42 ; 66 324ca: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 324ce: 6b 01 movw r12, r22 324d0: 7c 01 movw r14, r24 } j = int(floor((y - (BED_Y0 + Y_PROBE_OFFSET_FROM_EXTRUDER)) / y_mesh_density)); 324d2: 20 e0 ldi r18, 0x00 ; 0 324d4: 30 e0 ldi r19, 0x00 ; 0 324d6: 40 ec ldi r20, 0xC0 ; 192 324d8: 50 e4 ldi r21, 0x40 ; 64 324da: c5 01 movw r24, r10 324dc: b4 01 movw r22, r8 324de: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 324e2: 20 e0 ldi r18, 0x00 ; 0 324e4: 30 e0 ldi r19, 0x00 ; 0 324e6: 48 e0 ldi r20, 0x08 ; 8 324e8: 52 e4 ldi r21, 0x42 ; 66 324ea: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 324ee: 69 83 std Y+1, r22 ; 0x01 324f0: 7a 83 std Y+2, r23 ; 0x02 324f2: 8b 83 std Y+3, r24 ; 0x03 324f4: 9c 83 std Y+4, r25 ; 0x04 324f6: 0f 94 50 a7 call 0x34ea0 ; 0x34ea0 324fa: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> if (j < 0) { 324fe: 77 fd sbrc r23, 7 32500: da c0 rjmp .+436 ; 0x326b6 32502: 7a 87 std Y+10, r23 ; 0x0a 32504: 69 87 std Y+9, r22 ; 0x09 32506: 66 30 cpi r22, 0x06 ; 6 32508: 71 05 cpc r23, r1 3250a: 24 f0 brlt .+8 ; 0x32514 3250c: e5 e0 ldi r30, 0x05 ; 5 3250e: f0 e0 ldi r31, 0x00 ; 0 32510: fa 87 std Y+10, r31 ; 0x0a 32512: e9 87 std Y+9, r30 ; 0x09 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 32514: 89 85 ldd r24, Y+9 ; 0x09 32516: 0e 94 31 5f call 0xbe62 ; 0xbe62 3251a: 20 e0 ldi r18, 0x00 ; 0 3251c: 30 e0 ldi r19, 0x00 ; 0 3251e: 40 ea ldi r20, 0xA0 ; 160 32520: 50 e4 ldi r21, 0x40 ; 64 32522: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 32526: 9b 01 movw r18, r22 32528: 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; 3252a: c5 01 movw r24, r10 3252c: b4 01 movw r22, r8 3252e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 32532: 20 e0 ldi r18, 0x00 ; 0 32534: 30 e0 ldi r19, 0x00 ; 0 32536: 48 e0 ldi r20, 0x08 ; 8 32538: 52 e4 ldi r21, 0x42 ; 66 3253a: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 3253e: 69 83 std Y+1, r22 ; 0x01 32540: 7a 83 std Y+2, r23 ; 0x02 32542: 8b 83 std Y+3, r24 ; 0x03 32544: 9c 83 std Y+4, r25 ; 0x04 } float si = 1.f-s; 32546: a7 01 movw r20, r14 32548: 96 01 movw r18, r12 3254a: 60 e0 ldi r22, 0x00 ; 0 3254c: 70 e0 ldi r23, 0x00 ; 0 3254e: 80 e8 ldi r24, 0x80 ; 128 32550: 9f e3 ldi r25, 0x3F ; 63 32552: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 32556: 2b 01 movw r4, r22 32558: 3c 01 movw r6, r24 float z0 = si * z_values[j ][i] + s * z_values[j ][i+1]; 3255a: 91 01 movw r18, r2 3255c: 2f 5f subi r18, 0xFF ; 255 3255e: 3f 4f sbci r19, 0xFF ; 255 32560: 3e 83 std Y+6, r19 ; 0x06 32562: 2d 83 std Y+5, r18 ; 0x05 float z1 = si * z_values[j+1][i] + s * z_values[j+1][i+1]; 32564: 89 85 ldd r24, Y+9 ; 0x09 32566: 9a 85 ldd r25, Y+10 ; 0x0a 32568: 01 96 adiw r24, 0x01 ; 1 3256a: 98 87 std Y+8, r25 ; 0x08 3256c: 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]; 3256e: 27 e0 ldi r18, 0x07 ; 7 32570: e9 85 ldd r30, Y+9 ; 0x09 32572: fa 85 ldd r31, Y+10 ; 0x0a 32574: 2e 9f mul r18, r30 32576: 80 01 movw r16, r0 32578: 2f 9f mul r18, r31 3257a: 10 0d add r17, r0 3257c: 11 24 eor r1, r1 3257e: f8 01 movw r30, r16 32580: e2 0d add r30, r2 32582: f3 1d adc r31, r3 32584: ee 0f add r30, r30 32586: ff 1f adc r31, r31 32588: ee 0f add r30, r30 3258a: ff 1f adc r31, r31 3258c: e7 5f subi r30, 0xF7 ; 247 3258e: fc 4e sbci r31, 0xEC ; 236 32590: 21 81 ldd r18, Z+1 ; 0x01 32592: 32 81 ldd r19, Z+2 ; 0x02 32594: 43 81 ldd r20, Z+3 ; 0x03 32596: 54 81 ldd r21, Z+4 ; 0x04 32598: c3 01 movw r24, r6 3259a: b2 01 movw r22, r4 3259c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 325a0: 4b 01 movw r8, r22 325a2: 5c 01 movw r10, r24 325a4: ed 81 ldd r30, Y+5 ; 0x05 325a6: fe 81 ldd r31, Y+6 ; 0x06 325a8: e0 0f add r30, r16 325aa: f1 1f adc r31, r17 325ac: ee 0f add r30, r30 325ae: ff 1f adc r31, r31 325b0: ee 0f add r30, r30 325b2: ff 1f adc r31, r31 325b4: e7 5f subi r30, 0xF7 ; 247 325b6: fc 4e sbci r31, 0xEC ; 236 325b8: 21 81 ldd r18, Z+1 ; 0x01 325ba: 32 81 ldd r19, Z+2 ; 0x02 325bc: 43 81 ldd r20, Z+3 ; 0x03 325be: 54 81 ldd r21, Z+4 ; 0x04 325c0: c7 01 movw r24, r14 325c2: b6 01 movw r22, r12 325c4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 325c8: 9b 01 movw r18, r22 325ca: ac 01 movw r20, r24 325cc: c5 01 movw r24, r10 325ce: b4 01 movw r22, r8 325d0: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 325d4: 4b 01 movw r8, r22 325d6: 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; 325d8: 29 81 ldd r18, Y+1 ; 0x01 325da: 3a 81 ldd r19, Y+2 ; 0x02 325dc: 4b 81 ldd r20, Y+3 ; 0x03 325de: 5c 81 ldd r21, Y+4 ; 0x04 325e0: 60 e0 ldi r22, 0x00 ; 0 325e2: 70 e0 ldi r23, 0x00 ; 0 325e4: 80 e8 ldi r24, 0x80 ; 128 325e6: 9f e3 ldi r25, 0x3F ; 63 325e8: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 325ec: 9b 01 movw r18, r22 325ee: ac 01 movw r20, r24 325f0: c5 01 movw r24, r10 325f2: b4 01 movw r22, r8 325f4: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 325f8: 4b 01 movw r8, r22 325fa: 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]; 325fc: 27 e0 ldi r18, 0x07 ; 7 325fe: ef 81 ldd r30, Y+7 ; 0x07 32600: f8 85 ldd r31, Y+8 ; 0x08 32602: 2e 9f mul r18, r30 32604: c0 01 movw r24, r0 32606: 2f 9f mul r18, r31 32608: 90 0d add r25, r0 3260a: 11 24 eor r1, r1 3260c: 9a 87 std Y+10, r25 ; 0x0a 3260e: 89 87 std Y+9, r24 ; 0x09 32610: fc 01 movw r30, r24 32612: e2 0d add r30, r2 32614: f3 1d adc r31, r3 32616: ee 0f add r30, r30 32618: ff 1f adc r31, r31 3261a: ee 0f add r30, r30 3261c: ff 1f adc r31, r31 3261e: e7 5f subi r30, 0xF7 ; 247 32620: fc 4e sbci r31, 0xEC ; 236 32622: 21 81 ldd r18, Z+1 ; 0x01 32624: 32 81 ldd r19, Z+2 ; 0x02 32626: 43 81 ldd r20, Z+3 ; 0x03 32628: 54 81 ldd r21, Z+4 ; 0x04 3262a: c3 01 movw r24, r6 3262c: b2 01 movw r22, r4 3262e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 32632: 2b 01 movw r4, r22 32634: 3c 01 movw r6, r24 32636: 89 85 ldd r24, Y+9 ; 0x09 32638: 9a 85 ldd r25, Y+10 ; 0x0a 3263a: ed 81 ldd r30, Y+5 ; 0x05 3263c: fe 81 ldd r31, Y+6 ; 0x06 3263e: 8e 0f add r24, r30 32640: 9f 1f adc r25, r31 32642: 88 0f add r24, r24 32644: 99 1f adc r25, r25 32646: 88 0f add r24, r24 32648: 99 1f adc r25, r25 3264a: 87 5f subi r24, 0xF7 ; 247 3264c: 9c 4e sbci r25, 0xEC ; 236 3264e: fc 01 movw r30, r24 32650: 21 81 ldd r18, Z+1 ; 0x01 32652: 32 81 ldd r19, Z+2 ; 0x02 32654: 43 81 ldd r20, Z+3 ; 0x03 32656: 54 81 ldd r21, Z+4 ; 0x04 32658: c7 01 movw r24, r14 3265a: b6 01 movw r22, r12 3265c: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 32660: 9b 01 movw r18, r22 32662: ac 01 movw r20, r24 32664: c3 01 movw r24, r6 32666: b2 01 movw r22, r4 32668: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> return (1.f-t) * z0 + t * z1; 3266c: 29 81 ldd r18, Y+1 ; 0x01 3266e: 3a 81 ldd r19, Y+2 ; 0x02 32670: 4b 81 ldd r20, Y+3 ; 0x03 32672: 5c 81 ldd r21, Y+4 ; 0x04 32674: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 32678: 9b 01 movw r18, r22 3267a: ac 01 movw r20, r24 3267c: c5 01 movw r24, r10 3267e: b4 01 movw r22, r8 32680: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> } 32684: 2a 96 adiw r28, 0x0a ; 10 32686: 0f b6 in r0, 0x3f ; 63 32688: f8 94 cli 3268a: de bf out 0x3e, r29 ; 62 3268c: 0f be out 0x3f, r0 ; 63 3268e: cd bf out 0x3d, r28 ; 61 32690: df 91 pop r29 32692: cf 91 pop r28 32694: 1f 91 pop r17 32696: 0f 91 pop r16 32698: ff 90 pop r15 3269a: ef 90 pop r14 3269c: df 90 pop r13 3269e: cf 90 pop r12 326a0: bf 90 pop r11 326a2: af 90 pop r10 326a4: 9f 90 pop r9 326a6: 8f 90 pop r8 326a8: 7f 90 pop r7 326aa: 6f 90 pop r6 326ac: 5f 90 pop r5 326ae: 4f 90 pop r4 326b0: 3f 90 pop r3 326b2: 2f 90 pop r2 326b4: 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; 326b6: 1a 86 std Y+10, r1 ; 0x0a 326b8: 19 86 std Y+9, r1 ; 0x09 326ba: 45 cf rjmp .-374 ; 0x32546 000326bc : 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() 326bc: 2f 92 push r2 326be: 3f 92 push r3 326c0: 4f 92 push r4 326c2: 5f 92 push r5 326c4: 6f 92 push r6 326c6: 7f 92 push r7 326c8: 8f 92 push r8 326ca: 9f 92 push r9 326cc: af 92 push r10 326ce: bf 92 push r11 326d0: cf 92 push r12 326d2: df 92 push r13 326d4: ef 92 push r14 326d6: ff 92 push r15 326d8: 0f 93 push r16 326da: 1f 93 push r17 326dc: cf 93 push r28 326de: df 93 push r29 326e0: 00 d0 rcall .+0 ; 0x326e2 326e2: 00 d0 rcall .+0 ; 0x326e4 326e4: 00 d0 rcall .+0 ; 0x326e6 326e6: cd b7 in r28, 0x3d ; 61 326e8: de b7 in r29, 0x3e ; 62 326ea: 09 e0 ldi r16, 0x09 ; 9 326ec: 13 e1 ldi r17, 0x13 ; 19 326ee: 1f 83 std Y+7, r17 ; 0x07 326f0: 0e 83 std Y+6, r16 ; 0x06 326f2: 2e 80 ldd r2, Y+6 ; 0x06 326f4: 3f 80 ldd r3, Y+7 ; 0x07 326f6: 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])) 326f8: f1 01 movw r30, r2 326fa: 61 81 ldd r22, Z+1 ; 0x01 326fc: 72 81 ldd r23, Z+2 ; 0x02 326fe: 83 81 ldd r24, Z+3 ; 0x03 32700: 94 81 ldd r25, Z+4 ; 0x04 32702: 9b 01 movw r18, r22 32704: ac 01 movw r20, r24 32706: 0f 94 b7 a9 call 0x3536e ; 0x3536e <__unordsf2> 3270a: 88 23 and r24, r24 3270c: 09 f4 brne .+2 ; 0x32710 3270e: 7c c0 rjmp .+248 ; 0x32808 mesh_bed_leveling() { reset(); } void reset(); static float get_x(int i) { return BED_X(i) + X_PROBE_OFFSET_FROM_EXTRUDER; } 32710: 89 81 ldd r24, Y+1 ; 0x01 32712: 0e 94 31 5f call 0xbe62 ; 0xbe62 32716: 20 e0 ldi r18, 0x00 ; 0 32718: 30 e0 ldi r19, 0x00 ; 0 3271a: 48 eb ldi r20, 0xB8 ; 184 3271c: 51 e4 ldi r21, 0x41 ; 65 3271e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 32722: 6b 01 movw r12, r22 32724: 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)) + 32726: 20 e0 ldi r18, 0x00 ; 0 32728: 30 e0 ldi r19, 0x00 ; 0 3272a: 4c ef ldi r20, 0xFC ; 252 3272c: 52 e4 ldi r21, 0x42 ; 66 3272e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 32732: 2b 01 movw r4, r22 32734: 3c 01 movw r6, r24 32736: 20 e0 ldi r18, 0x00 ; 0 32738: 30 e0 ldi r19, 0x00 ; 0 3273a: 44 e6 ldi r20, 0x64 ; 100 3273c: 53 e4 ldi r21, 0x43 ; 67 3273e: c7 01 movw r24, r14 32740: b6 01 movw r22, r12 32742: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 32746: 4b 01 movw r8, r22 32748: 5c 01 movw r10, r24 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 3274a: 20 e0 ldi r18, 0x00 ; 0 3274c: 30 e0 ldi r19, 0x00 ; 0 3274e: 40 ec ldi r20, 0xC0 ; 192 32750: 51 e4 ldi r21, 0x41 ; 65 32752: c7 01 movw r24, r14 32754: b6 01 movw r22, r12 32756: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 3275a: 6b 01 movw r12, r22 3275c: 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)) + 3275e: ee 81 ldd r30, Y+6 ; 0x06 32760: ff 81 ldd r31, Y+7 ; 0x07 32762: 21 81 ldd r18, Z+1 ; 0x01 32764: 32 81 ldd r19, Z+2 ; 0x02 32766: 43 81 ldd r20, Z+3 ; 0x03 32768: 54 81 ldd r21, Z+4 ; 0x04 3276a: c3 01 movw r24, r6 3276c: b2 01 movw r22, r4 3276e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 32772: a5 01 movw r20, r10 32774: 94 01 movw r18, r8 32776: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3277a: 20 e0 ldi r18, 0x00 ; 0 3277c: 30 e9 ldi r19, 0x90 ; 144 3277e: 42 ea ldi r20, 0xA2 ; 162 32780: 56 e4 ldi r21, 0x46 ; 70 32782: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 32786: 6a 83 std Y+2, r22 ; 0x02 32788: 7b 83 std Y+3, r23 ; 0x03 3278a: 8c 83 std Y+4, r24 ; 0x04 3278c: 9d 83 std Y+5, r25 ; 0x05 z_values[j][idx1] * (x - x0) * (x - x2) / ((x1 - x0) * (x1 - x2)) + 3278e: ee 81 ldd r30, Y+6 ; 0x06 32790: ff 81 ldd r31, Y+7 ; 0x07 32792: 25 85 ldd r18, Z+13 ; 0x0d 32794: 36 85 ldd r19, Z+14 ; 0x0e 32796: 47 85 ldd r20, Z+15 ; 0x0f 32798: 50 89 ldd r21, Z+16 ; 0x10 3279a: c7 01 movw r24, r14 3279c: b6 01 movw r22, r12 3279e: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 327a2: a5 01 movw r20, r10 327a4: 94 01 movw r18, r8 327a6: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 327aa: 20 e0 ldi r18, 0x00 ; 0 327ac: 30 e9 ldi r19, 0x90 ; 144 327ae: 42 e2 ldi r20, 0x22 ; 34 327b0: 56 ec ldi r21, 0xC6 ; 198 327b2: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 327b6: 9b 01 movw r18, r22 327b8: 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)) + 327ba: 6a 81 ldd r22, Y+2 ; 0x02 327bc: 7b 81 ldd r23, Y+3 ; 0x03 327be: 8c 81 ldd r24, Y+4 ; 0x04 327c0: 9d 81 ldd r25, Y+5 ; 0x05 327c2: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 327c6: 4b 01 movw r8, r22 327c8: 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)); 327ca: ee 81 ldd r30, Y+6 ; 0x06 327cc: ff 81 ldd r31, Y+7 ; 0x07 327ce: 21 8d ldd r18, Z+25 ; 0x19 327d0: 32 8d ldd r19, Z+26 ; 0x1a 327d2: 43 8d ldd r20, Z+27 ; 0x1b 327d4: 54 8d ldd r21, Z+28 ; 0x1c 327d6: c7 01 movw r24, r14 327d8: b6 01 movw r22, r12 327da: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 327de: a3 01 movw r20, r6 327e0: 92 01 movw r18, r4 327e2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 327e6: 20 e0 ldi r18, 0x00 ; 0 327e8: 30 e9 ldi r19, 0x90 ; 144 327ea: 42 ea ldi r20, 0xA2 ; 162 327ec: 56 e4 ldi r21, 0x46 ; 70 327ee: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 327f2: 9b 01 movw r18, r22 327f4: 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)) + 327f6: c5 01 movw r24, r10 327f8: b4 01 movw r22, r8 327fa: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__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] = 327fe: f1 01 movw r30, r2 32800: 61 83 std Z+1, r22 ; 0x01 32802: 72 83 std Z+2, r23 ; 0x02 32804: 83 83 std Z+3, r24 ; 0x03 32806: 94 83 std Z+4, r25 ; 0x04 32808: f4 e0 ldi r31, 0x04 ; 4 3280a: 2f 0e add r2, r31 3280c: 31 1c adc r3, r1 3280e: 29 81 ldd r18, Y+1 ; 0x01 32810: 2f 5f subi r18, 0xFF ; 255 32812: 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) { 32814: 27 30 cpi r18, 0x07 ; 7 32816: 09 f0 breq .+2 ; 0x3281a 32818: 6f cf rjmp .-290 ; 0x326f8 3281a: 8e 81 ldd r24, Y+6 ; 0x06 3281c: 9f 81 ldd r25, Y+7 ; 0x07 3281e: 4c 96 adiw r24, 0x1c ; 28 32820: 9f 83 std Y+7, r25 ; 0x07 32822: 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) { 32824: 8d 5c subi r24, 0xCD ; 205 32826: 93 41 sbci r25, 0x13 ; 19 32828: 09 f0 breq .+2 ; 0x3282c 3282a: 63 cf rjmp .-314 ; 0x326f2 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() 3282c: 19 87 std Y+9, r17 ; 0x09 3282e: 08 87 std Y+8, r16 ; 0x08 32830: f1 e0 ldi r31, 0x01 ; 1 32832: 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)) + 32834: c8 01 movw r24, r16 32836: 8b 5a subi r24, 0xAB ; 171 32838: 9f 4f sbci r25, 0xFF ; 255 3283a: 9f 83 std Y+7, r25 ; 0x07 3283c: 8e 83 std Y+6, r24 ; 0x06 z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); 3283e: 18 01 movw r2, r16 32840: 99 ea ldi r25, 0xA9 ; 169 32842: 29 0e add r2, r25 32844: 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])) 32846: e8 85 ldd r30, Y+8 ; 0x08 32848: f9 85 ldd r31, Y+9 ; 0x09 3284a: 65 8d ldd r22, Z+29 ; 0x1d 3284c: 76 8d ldd r23, Z+30 ; 0x1e 3284e: 87 8d ldd r24, Z+31 ; 0x1f 32850: 90 a1 ldd r25, Z+32 ; 0x20 32852: 9b 01 movw r18, r22 32854: ac 01 movw r20, r24 32856: 0f 94 b7 a9 call 0x3536e ; 0x3536e <__unordsf2> 3285a: 88 23 and r24, r24 3285c: 09 f4 brne .+2 ; 0x32860 3285e: 79 c0 rjmp .+242 ; 0x32952 static float get_y(int i) { return BED_Y(i) + Y_PROBE_OFFSET_FROM_EXTRUDER; } 32860: 89 81 ldd r24, Y+1 ; 0x01 32862: 0e 94 31 5f call 0xbe62 ; 0xbe62 32866: 20 e0 ldi r18, 0x00 ; 0 32868: 30 e0 ldi r19, 0x00 ; 0 3286a: 40 ea ldi r20, 0xA0 ; 160 3286c: 50 e4 ldi r21, 0x40 ; 64 3286e: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 32872: 6b 01 movw r12, r22 32874: 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)) + 32876: 20 e0 ldi r18, 0x00 ; 0 32878: 30 e0 ldi r19, 0x00 ; 0 3287a: 48 ed ldi r20, 0xD8 ; 216 3287c: 52 e4 ldi r21, 0x42 ; 66 3287e: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 32882: 2b 01 movw r4, r22 32884: 3c 01 movw r6, r24 32886: 20 e0 ldi r18, 0x00 ; 0 32888: 30 e0 ldi r19, 0x00 ; 0 3288a: 42 e5 ldi r20, 0x52 ; 82 3288c: 53 e4 ldi r21, 0x43 ; 67 3288e: c7 01 movw r24, r14 32890: b6 01 movw r22, r12 32892: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 32896: 4b 01 movw r8, r22 32898: 5c 01 movw r10, r24 z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + 3289a: 20 e0 ldi r18, 0x00 ; 0 3289c: 30 e0 ldi r19, 0x00 ; 0 3289e: 40 ec ldi r20, 0xC0 ; 192 328a0: 50 e4 ldi r21, 0x40 ; 64 328a2: c7 01 movw r24, r14 328a4: b6 01 movw r22, r12 328a6: 0f 94 a8 a5 call 0x34b50 ; 0x34b50 <__subsf3> 328aa: 6b 01 movw r12, r22 328ac: 7c 01 movw r14, r24 328ae: ee 81 ldd r30, Y+6 ; 0x06 328b0: ff 81 ldd r31, Y+7 ; 0x07 328b2: 20 81 ld r18, Z 328b4: 31 81 ldd r19, Z+1 ; 0x01 328b6: 42 81 ldd r20, Z+2 ; 0x02 328b8: 53 81 ldd r21, Z+3 ; 0x03 328ba: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 328be: a5 01 movw r20, r10 328c0: 94 01 movw r18, r8 328c2: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 328c6: 20 e0 ldi r18, 0x00 ; 0 328c8: 30 e9 ldi r19, 0x90 ; 144 328ca: 42 e2 ldi r20, 0x22 ; 34 328cc: 56 ec ldi r21, 0xC6 ; 198 328ce: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 328d2: 6a 83 std Y+2, r22 ; 0x02 328d4: 7b 83 std Y+3, r23 ; 0x03 328d6: 8c 83 std Y+4, r24 ; 0x04 328d8: 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)) + 328da: f8 01 movw r30, r16 328dc: 21 81 ldd r18, Z+1 ; 0x01 328de: 32 81 ldd r19, Z+2 ; 0x02 328e0: 43 81 ldd r20, Z+3 ; 0x03 328e2: 54 81 ldd r21, Z+4 ; 0x04 328e4: c3 01 movw r24, r6 328e6: b2 01 movw r22, r4 328e8: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 328ec: a5 01 movw r20, r10 328ee: 94 01 movw r18, r8 328f0: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 328f4: 20 e0 ldi r18, 0x00 ; 0 328f6: 30 e9 ldi r19, 0x90 ; 144 328f8: 42 ea ldi r20, 0xA2 ; 162 328fa: 56 e4 ldi r21, 0x46 ; 70 328fc: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 32900: 9b 01 movw r18, r22 32902: ac 01 movw r20, r24 32904: 6a 81 ldd r22, Y+2 ; 0x02 32906: 7b 81 ldd r23, Y+3 ; 0x03 32908: 8c 81 ldd r24, Y+4 ; 0x04 3290a: 9d 81 ldd r25, Y+5 ; 0x05 3290c: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 32910: 4b 01 movw r8, r22 32912: 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)); 32914: f1 01 movw r30, r2 32916: 20 81 ld r18, Z 32918: 31 81 ldd r19, Z+1 ; 0x01 3291a: 42 81 ldd r20, Z+2 ; 0x02 3291c: 53 81 ldd r21, Z+3 ; 0x03 3291e: c7 01 movw r24, r14 32920: b6 01 movw r22, r12 32922: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 32926: a3 01 movw r20, r6 32928: 92 01 movw r18, r4 3292a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3292e: 20 e0 ldi r18, 0x00 ; 0 32930: 30 e9 ldi r19, 0x90 ; 144 32932: 42 ea ldi r20, 0xA2 ; 162 32934: 56 e4 ldi r21, 0x46 ; 70 32936: 0f 94 a8 a6 call 0x34d50 ; 0x34d50 <__divsf3> 3293a: 9b 01 movw r18, r22 3293c: 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)) + 3293e: c5 01 movw r24, r10 32940: b4 01 movw r22, r8 32942: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__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] = 32946: e8 85 ldd r30, Y+8 ; 0x08 32948: f9 85 ldd r31, Y+9 ; 0x09 3294a: 65 8f std Z+29, r22 ; 0x1d 3294c: 76 8f std Z+30, r23 ; 0x1e 3294e: 87 8f std Z+31, r24 ; 0x1f 32950: 90 a3 std Z+32, r25 ; 0x20 32952: 88 85 ldd r24, Y+8 ; 0x08 32954: 99 85 ldd r25, Y+9 ; 0x09 32956: 4c 96 adiw r24, 0x1c ; 28 32958: 99 87 std Y+9, r25 ; 0x09 3295a: 88 87 std Y+8, r24 ; 0x08 3295c: 99 81 ldd r25, Y+1 ; 0x01 3295e: 9f 5f subi r25, 0xFF ; 255 32960: 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) { 32962: 96 30 cpi r25, 0x06 ; 6 32964: 09 f0 breq .+2 ; 0x32968 32966: 6f cf rjmp .-290 ; 0x32846 32968: 0c 5f subi r16, 0xFC ; 252 3296a: 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) { 3296c: e3 e1 ldi r30, 0x13 ; 19 3296e: 05 32 cpi r16, 0x25 ; 37 32970: 1e 07 cpc r17, r30 32972: 09 f0 breq .+2 ; 0x32976 32974: 5b cf rjmp .-330 ; 0x3282c z_values[idx1][i] * (y - y0) * (y - y2) / ((y1 - y0) * (y1 - y2)) + z_values[idx2][i] * (y - y0) * (y - y1) / ((y2 - y0) * (y2 - y1)); } } } } 32976: 29 96 adiw r28, 0x09 ; 9 32978: 0f b6 in r0, 0x3f ; 63 3297a: f8 94 cli 3297c: de bf out 0x3e, r29 ; 62 3297e: 0f be out 0x3f, r0 ; 63 32980: cd bf out 0x3d, r28 ; 61 32982: df 91 pop r29 32984: cf 91 pop r28 32986: 1f 91 pop r17 32988: 0f 91 pop r16 3298a: ff 90 pop r15 3298c: ef 90 pop r14 3298e: df 90 pop r13 32990: cf 90 pop r12 32992: bf 90 pop r11 32994: af 90 pop r10 32996: 9f 90 pop r9 32998: 8f 90 pop r8 3299a: 7f 90 pop r7 3299c: 6f 90 pop r6 3299e: 5f 90 pop r5 329a0: 4f 90 pop r4 329a2: 3f 90 pop r3 329a4: 2f 90 pop r2 329a6: 08 95 ret 000329a8 : 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) { 329a8: 1f 93 push r17 329aa: cf 93 push r28 329ac: df 93 push r29 329ae: 00 d0 rcall .+0 ; 0x329b0 329b0: 1f 92 push r1 329b2: 1f 92 push r1 329b4: cd b7 in r28, 0x3d ; 61 329b6: de b7 in r29, 0x3e ; 62 329b8: 16 2f mov r17, r22 SendMsg(RequestMsg(RequestMsgCodes::Read, index)); 329ba: 48 2f mov r20, r24 329bc: 62 e5 ldi r22, 0x52 ; 82 329be: ce 01 movw r24, r28 329c0: 01 96 adiw r24, 0x01 ; 1 329c2: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 329c6: 49 81 ldd r20, Y+1 ; 0x01 329c8: 5a 81 ldd r21, Y+2 ; 0x02 329ca: 6b 81 ldd r22, Y+3 ; 0x03 329cc: 7c 81 ldd r23, Y+4 ; 0x04 329ce: 8d 81 ldd r24, Y+5 ; 0x05 329d0: 0f 94 f6 56 call 0x2adec ; 0x2adec scopeState = nextState; 329d4: 10 93 95 12 sts 0x1295, r17 ; 0x801295 } 329d8: 0f 90 pop r0 329da: 0f 90 pop r0 329dc: 0f 90 pop r0 329de: 0f 90 pop r0 329e0: 0f 90 pop r0 329e2: df 91 pop r29 329e4: cf 91 pop r28 329e6: 1f 91 pop r17 329e8: 08 95 ret 000329ea : SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); scopeState = ScopeState::QuerySent; } void ProtocolLogic::StartReading8bitRegisters() { regIndex = 0; 329ea: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); 329ee: e2 e7 ldi r30, 0x72 ; 114 329f0: f2 ea ldi r31, 0xA2 ; 162 329f2: 84 91 lpm r24, Z 329f4: 67 e0 ldi r22, 0x07 ; 7 329f6: 0d 94 d4 94 jmp 0x329a8 ; 0x329a8 000329fa : regIndex = 0; SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); } ProtocolLogic::ScopeState __attribute__((noinline)) ProtocolLogic::ProcessRead16bitRegister(ProtocolLogic::ScopeState stateAtEnd) { regs16[regIndex] = rsp.paramValue; 329fa: e0 91 e0 12 lds r30, 0x12E0 ; 0x8012e0 329fe: ae 2f mov r26, r30 32a00: b0 e0 ldi r27, 0x00 ; 0 32a02: aa 0f add r26, r26 32a04: bb 1f adc r27, r27 32a06: a6 52 subi r26, 0x26 ; 38 32a08: bd 4e sbci r27, 0xED ; 237 32a0a: 20 91 ad 12 lds r18, 0x12AD ; 0x8012ad 32a0e: 30 91 ae 12 lds r19, 0x12AE ; 0x8012ae 32a12: 2d 93 st X+, r18 32a14: 3c 93 st X, r19 ++regIndex; 32a16: ef 5f subi r30, 0xFF ; 255 32a18: e0 93 e0 12 sts 0x12E0, r30 ; 0x8012e0 if (regIndex >= regs16Count) { 32a1c: e2 30 cpi r30, 0x02 ; 2 32a1e: 40 f4 brcc .+16 ; 0x32a30 return stateAtEnd; } else { SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32a20: f0 e0 ldi r31, 0x00 ; 0 32a22: e7 5a subi r30, 0xA7 ; 167 32a24: fd 45 sbci r31, 0x5D ; 93 32a26: 84 91 lpm r24, Z 32a28: 68 e0 ldi r22, 0x08 ; 8 32a2a: 0f 94 d4 94 call 0x329a8 ; 0x329a8 } return ScopeState::Reading16bitRegisters; 32a2e: 88 e0 ldi r24, 0x08 ; 8 } 32a30: 08 95 ret 00032a32 : regIndex = 0; SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } void ProtocolLogic::ProcessRead8bitRegister() { regs8[regIndex] = rsp.paramValue; 32a32: e0 91 e0 12 lds r30, 0x12E0 ; 0x8012e0 32a36: ae 2f mov r26, r30 32a38: b0 e0 ldi r27, 0x00 ; 0 32a3a: a9 52 subi r26, 0x29 ; 41 32a3c: bd 4e sbci r27, 0xED ; 237 32a3e: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 32a42: 8c 93 st X, r24 ++regIndex; 32a44: ef 5f subi r30, 0xFF ; 255 32a46: e0 93 e0 12 sts 0x12E0, r30 ; 0x8012e0 if (regIndex >= regs8Count) { 32a4a: e3 30 cpi r30, 0x03 ; 3 32a4c: 40 f0 brcs .+16 ; 0x32a5e SendReadRegister(pgm_read_byte(regs8Addrs + regIndex), ScopeState::Reading8bitRegisters); } } void ProtocolLogic::StartReading16bitRegisters() { regIndex = 0; 32a4e: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 SendReadRegister(pgm_read_byte(regs16Addrs + regIndex), ScopeState::Reading16bitRegisters); 32a52: e9 e5 ldi r30, 0x59 ; 89 32a54: f2 ea ldi r31, 0xA2 ; 162 32a56: 84 91 lpm r24, Z 32a58: 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); 32a5a: 0d 94 d4 94 jmp 0x329a8 ; 0x329a8 32a5e: f0 e0 ldi r31, 0x00 ; 0 32a60: ee 58 subi r30, 0x8E ; 142 32a62: fd 45 sbci r31, 0x5D ; 93 32a64: 84 91 lpm r24, Z 32a66: 67 e0 ldi r22, 0x07 ; 7 32a68: f8 cf rjmp .-16 ; 0x32a5a 00032a6a : if (!ExpectsResponse()) { ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { 32a6a: cf 93 push r28 32a6c: df 93 push r29 32a6e: 00 d0 rcall .+0 ; 0x32a70 32a70: 00 d0 rcall .+0 ; 0x32a72 32a72: 00 d0 rcall .+0 ; 0x32a74 32a74: 1f 92 push r1 32a76: cd b7 in r28, 0x3d ; 61 32a78: de b7 in r29, 0x3e ; 62 switch (plannedRq.code) { 32a7a: 80 91 9c 12 lds r24, 0x129C ; 0x80129c 32a7e: 82 34 cpi r24, 0x42 ; 66 32a80: 09 f4 brne .+2 ; 0x32a84 32a82: 46 c0 rjmp .+140 ; 0x32b10 32a84: b8 f5 brcc .+110 ; 0x32af4 32a86: 88 23 and r24, r24 32a88: 09 f4 brne .+2 ; 0x32a8c 32a8a: 72 c0 rjmp .+228 ; 0x32b70 plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; default: // commands currentScope = Scope::Command; 32a8c: 84 e0 ldi r24, 0x04 ; 4 32a8e: 80 93 94 12 sts 0x1294, r24 ; 0x801294 32a92: 85 e0 ldi r24, 0x05 ; 5 32a94: ec e9 ldi r30, 0x9C ; 156 32a96: f2 e1 ldi r31, 0x12 ; 18 32a98: de 01 movw r26, r28 32a9a: 16 96 adiw r26, 0x06 ; 6 32a9c: 01 90 ld r0, Z+ 32a9e: 0d 92 st X+, r0 32aa0: 8a 95 dec r24 32aa2: e1 f7 brne .-8 ; 0x32a9c StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 32aa4: 85 e0 ldi r24, 0x05 ; 5 32aa6: fe 01 movw r30, r28 32aa8: 36 96 adiw r30, 0x06 ; 6 32aaa: a7 e9 ldi r26, 0x97 ; 151 32aac: b2 e1 ldi r27, 0x12 ; 18 32aae: 01 90 ld r0, Z+ 32ab0: 0d 92 st X+, r0 32ab2: 8a 95 dec r24 32ab4: e1 f7 brne .-8 ; 0x32aae SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); 32ab6: 40 e0 ldi r20, 0x00 ; 0 32ab8: 60 e0 ldi r22, 0x00 ; 0 32aba: ce 01 movw r24, r28 32abc: 01 96 adiw r24, 0x01 ; 1 32abe: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 32ac2: 85 e0 ldi r24, 0x05 ; 5 32ac4: fe 01 movw r30, r28 32ac6: 31 96 adiw r30, 0x01 ; 1 32ac8: ac e9 ldi r26, 0x9C ; 156 32aca: b2 e1 ldi r27, 0x12 ; 18 32acc: 01 90 ld r0, Z+ 32ace: 0d 92 st X+, r0 32ad0: 8a 95 dec r24 32ad2: e1 f7 brne .-8 ; 0x32acc void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 32ad4: 85 e0 ldi r24, 0x05 ; 5 32ad6: 80 93 95 12 sts 0x1295, r24 ; 0x801295 SendMsg(rq); 32ada: 40 91 97 12 lds r20, 0x1297 ; 0x801297 32ade: 50 91 98 12 lds r21, 0x1298 ; 0x801298 32ae2: 60 91 99 12 lds r22, 0x1299 ; 0x801299 32ae6: 70 91 9a 12 lds r23, 0x129A ; 0x80129a 32aea: 80 91 9b 12 lds r24, 0x129B ; 0x80129b 32aee: 0f 94 f6 56 call 0x2adec ; 0x2adec 32af2: 2e c0 rjmp .+92 ; 0x32b50 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } bool ProtocolLogic::ActivatePlannedRequest() { switch (plannedRq.code) { 32af4: 82 35 cpi r24, 0x52 ; 82 32af6: b1 f1 breq .+108 ; 0x32b64 32af8: 87 35 cpi r24, 0x57 ; 87 32afa: 41 f6 brne .-112 ; 0x32a8c 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); 32afc: 60 91 9e 12 lds r22, 0x129E ; 0x80129e 32b00: 70 91 9f 12 lds r23, 0x129F ; 0x80129f 32b04: 4c e0 ldi r20, 0x0C ; 12 32b06: 80 91 9d 12 lds r24, 0x129D ; 0x80129d 32b0a: 0f 94 61 57 call 0x2aec2 ; 0x2aec2 32b0e: 11 c0 rjmp .+34 ; 0x32b32 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); scopeState = ScopeState::FilamentSensorStateSent; } void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); 32b10: 40 91 9d 12 lds r20, 0x129D ; 0x80129d 32b14: 62 e4 ldi r22, 0x42 ; 66 32b16: ce 01 movw r24, r28 32b18: 01 96 adiw r24, 0x01 ; 1 32b1a: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 32b1e: 49 81 ldd r20, Y+1 ; 0x01 32b20: 5a 81 ldd r21, Y+2 ; 0x02 32b22: 6b 81 ldd r22, Y+3 ; 0x03 32b24: 7c 81 ldd r23, Y+4 ; 0x04 32b26: 8d 81 ldd r24, Y+5 ; 0x05 32b28: 0f 94 f6 56 call 0x2adec ; 0x2adec scopeState = ScopeState::ButtonSent; 32b2c: 8a e0 ldi r24, 0x0A ; 10 32b2e: 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); 32b32: 40 e0 ldi r20, 0x00 ; 0 32b34: 60 e0 ldi r22, 0x00 ; 0 32b36: ce 01 movw r24, r28 32b38: 01 96 adiw r24, 0x01 ; 1 32b3a: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 32b3e: 85 e0 ldi r24, 0x05 ; 5 32b40: fe 01 movw r30, r28 32b42: 31 96 adiw r30, 0x01 ; 1 32b44: ac e9 ldi r26, 0x9C ; 156 32b46: b2 e1 ldi r27, 0x12 ; 18 32b48: 01 90 ld r0, Z+ 32b4a: 0d 92 st X+, r0 32b4c: 8a 95 dec r24 32b4e: e1 f7 brne .-8 ; 0x32b48 default: // commands currentScope = Scope::Command; SetRequestMsg(plannedRq); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); CommandRestart(); return true; 32b50: 81 e0 ldi r24, 0x01 ; 1 } } 32b52: 2a 96 adiw r28, 0x0a ; 10 32b54: 0f b6 in r0, 0x3f ; 63 32b56: f8 94 cli 32b58: de bf out 0x3e, r29 ; 62 32b5a: 0f be out 0x3f, r0 ; 63 32b5c: cd bf out 0x3d, r28 ; 61 32b5e: df 91 pop r29 32b60: cf 91 pop r28 32b62: 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); 32b64: 6b e0 ldi r22, 0x0B ; 11 32b66: 80 91 9d 12 lds r24, 0x129D ; 0x80129d 32b6a: 0f 94 d4 94 call 0x329a8 ; 0x329a8 32b6e: e1 cf rjmp .-62 ; 0x32b32 case RequestMsgCodes::Write: SendWriteRegister(plannedRq.value, plannedRq.value2, ScopeState::WriteRegisterSent); plannedRq = RequestMsg(RequestMsgCodes::unknown, 0); return true; case RequestMsgCodes::unknown: return false; 32b70: 80 e0 ldi r24, 0x00 ; 0 32b72: ef cf rjmp .-34 ; 0x32b52 00032b74 : void ProtocolLogic::WriteRegister(uint8_t address, uint16_t data) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Write, address, data)); } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { 32b74: cf 93 push r28 32b76: df 93 push r29 32b78: 00 d0 rcall .+0 ; 0x32b7a 32b7a: 1f 92 push r1 32b7c: 1f 92 push r1 32b7e: cd b7 in r28, 0x3d ; 61 32b80: de b7 in r29, 0x3e ; 62 32b82: 49 83 std Y+1, r20 ; 0x01 32b84: 5a 83 std Y+2, r21 ; 0x02 32b86: 6b 83 std Y+3, r22 ; 0x03 32b88: 7c 83 std Y+4, r23 ; 0x04 32b8a: 8d 83 std Y+5, r24 ; 0x05 plannedRq = rq; 32b8c: 85 e0 ldi r24, 0x05 ; 5 32b8e: fe 01 movw r30, r28 32b90: 31 96 adiw r30, 0x01 ; 1 32b92: ac e9 ldi r26, 0x9C ; 156 32b94: b2 e1 ldi r27, 0x12 ; 18 32b96: 01 90 ld r0, Z+ 32b98: 0d 92 st X+, r0 32b9a: 8a 95 dec r24 32b9c: e1 f7 brne .-8 ; 0x32b96 if (!ExpectsResponse()) { 32b9e: 80 91 95 12 lds r24, 0x1295 ; 0x801295 32ba2: 87 ff sbrs r24, 7 32ba4: 09 c0 rjmp .+18 ; 0x32bb8 ActivatePlannedRequest(); } // otherwise wait for an empty window to activate the request } 32ba6: 0f 90 pop r0 32ba8: 0f 90 pop r0 32baa: 0f 90 pop r0 32bac: 0f 90 pop r0 32bae: 0f 90 pop r0 32bb0: df 91 pop r29 32bb2: cf 91 pop r28 } void ProtocolLogic::PlanGenericRequest(RequestMsg rq) { plannedRq = rq; if (!ExpectsResponse()) { ActivatePlannedRequest(); 32bb4: 0d 94 35 95 jmp 0x32a6a ; 0x32a6a } // otherwise wait for an empty window to activate the request } 32bb8: 0f 90 pop r0 32bba: 0f 90 pop r0 32bbc: 0f 90 pop r0 32bbe: 0f 90 pop r0 32bc0: 0f 90 pop r0 32bc2: df 91 pop r29 32bc4: cf 91 pop r28 32bc6: 08 95 ret 00032bc8 : void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); } void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { 32bc8: cf 93 push r28 32bca: df 93 push r29 32bcc: 00 d0 rcall .+0 ; 0x32bce 32bce: 1f 92 push r1 32bd0: 1f 92 push r1 32bd2: cd b7 in r28, 0x3d ; 61 32bd4: de b7 in r29, 0x3e ; 62 PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); 32bd6: 48 2f mov r20, r24 32bd8: 68 e5 ldi r22, 0x58 ; 88 32bda: ce 01 movw r24, r28 32bdc: 01 96 adiw r24, 0x01 ; 1 32bde: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 32be2: 49 81 ldd r20, Y+1 ; 0x01 32be4: 5a 81 ldd r21, Y+2 ; 0x02 32be6: 6b 81 ldd r22, Y+3 ; 0x03 32be8: 7c 81 ldd r23, Y+4 ; 0x04 32bea: 8d 81 ldd r24, Y+5 ; 0x05 32bec: 0f 94 ba 95 call 0x32b74 ; 0x32b74 } 32bf0: 0f 90 pop r0 32bf2: 0f 90 pop r0 32bf4: 0f 90 pop r0 32bf6: 0f 90 pop r0 32bf8: 0f 90 pop r0 32bfa: df 91 pop r29 32bfc: cf 91 pop r28 32bfe: 08 95 ret 00032c00 : void ProtocolLogic::SendButton(uint8_t btn) { SendMsg(RequestMsg(RequestMsgCodes::Button, btn)); scopeState = ScopeState::ButtonSent; } void ProtocolLogic::SendVersion(uint8_t stage) { 32c00: 1f 93 push r17 32c02: cf 93 push r28 32c04: df 93 push r29 32c06: 00 d0 rcall .+0 ; 0x32c08 32c08: 1f 92 push r1 32c0a: 1f 92 push r1 32c0c: cd b7 in r28, 0x3d ; 61 32c0e: de b7 in r29, 0x3e ; 62 32c10: 18 2f mov r17, r24 SendMsg(RequestMsg(RequestMsgCodes::Version, stage)); 32c12: 48 2f mov r20, r24 32c14: 63 e5 ldi r22, 0x53 ; 83 32c16: ce 01 movw r24, r28 32c18: 01 96 adiw r24, 0x01 ; 1 32c1a: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 32c1e: 49 81 ldd r20, Y+1 ; 0x01 32c20: 5a 81 ldd r21, Y+2 ; 0x02 32c22: 6b 81 ldd r22, Y+3 ; 0x03 32c24: 7c 81 ldd r23, Y+4 ; 0x04 32c26: 8d 81 ldd r24, Y+5 ; 0x05 32c28: 0f 94 f6 56 call 0x2adec ; 0x2adec scopeState = (ScopeState)((uint_fast8_t)ScopeState::S0Sent + stage); 32c2c: 10 93 95 12 sts 0x1295, r17 ; 0x801295 } 32c30: 0f 90 pop r0 32c32: 0f 90 pop r0 32c34: 0f 90 pop r0 32c36: 0f 90 pop r0 32c38: 0f 90 pop r0 32c3a: df 91 pop r29 32c3c: cf 91 pop r28 32c3e: 1f 91 pop r17 32c40: 08 95 ret 00032c42 : } else { SERIAL_ECHOLNRPGM(_O(MSG_OFF)); } } void MMU2::Start() { 32c42: 1f 93 push r17 32c44: cf 93 push r28 32c46: df 93 push r29 } //uart init (io + FILE stream) void uart2_init(uint32_t baudRate) { DDRH &= ~0x01; 32c48: e1 e0 ldi r30, 0x01 ; 1 32c4a: f1 e0 ldi r31, 0x01 ; 1 32c4c: 80 81 ld r24, Z 32c4e: 8e 7f andi r24, 0xFE ; 254 32c50: 80 83 st Z, r24 PORTH |= 0x01; 32c52: e2 e0 ldi r30, 0x02 ; 2 32c54: f1 e0 ldi r31, 0x01 ; 1 32c56: 80 81 ld r24, Z 32c58: 81 60 ori r24, 0x01 ; 1 32c5a: 80 83 st Z, r24 //#include void rbuf_ini(uint8_t* ptr, uint8_t l) { ptr[0] = l; 32c5c: e5 e4 ldi r30, 0x45 ; 69 32c5e: fd e0 ldi r31, 0x0D ; 13 32c60: 90 e1 ldi r25, 0x10 ; 16 32c62: 90 83 st Z, r25 ptr[1] = 0; 32c64: 11 82 std Z+1, r1 ; 0x01 ptr[2] = 0; 32c66: 12 82 std Z+2, r1 ; 0x02 rbuf_ini(uart2_ibuf, sizeof(uart2_ibuf) - 4); UCSR2A |= (1 << U2X2); // baudrate multiplier 32c68: e0 ed ldi r30, 0xD0 ; 208 32c6a: f0 e0 ldi r31, 0x00 ; 0 32c6c: 80 81 ld r24, Z 32c6e: 82 60 ori r24, 0x02 ; 2 32c70: 80 83 st Z, r24 UBRR2L = UART_BAUD_SELECT(baudRate, F_CPU); // select baudrate 32c72: 90 93 d4 00 sts 0x00D4, r25 ; 0x8000d4 <__TEXT_REGION_LENGTH__+0x7c20d4> UCSR2B = (1 << RXEN2) | (1 << TXEN2); // enable receiver and transmitter 32c76: e1 ed ldi r30, 0xD1 ; 209 32c78: f0 e0 ldi r31, 0x00 ; 0 32c7a: 88 e1 ldi r24, 0x18 ; 24 32c7c: 80 83 st Z, r24 UCSR2B |= (1 << RXCIE2); // enable rx interrupt 32c7e: 80 81 ld r24, Z 32c80: 80 68 ori r24, 0x80 ; 128 32c82: 80 83 st Z, r24 fdev_setup_stream(uart2io, uart2_putchar, uart2_getchar, _FDEV_SETUP_WRITE | _FDEV_SETUP_READ); //setup uart2 i/o stream 32c84: e4 e7 ldi r30, 0x74 ; 116 32c86: f2 e1 ldi r31, 0x12 ; 18 32c88: 8c ee ldi r24, 0xEC ; 236 32c8a: 9c ef ldi r25, 0xFC ; 252 32c8c: 91 87 std Z+9, r25 ; 0x09 32c8e: 80 87 std Z+8, r24 ; 0x08 32c90: 84 ed ldi r24, 0xD4 ; 212 32c92: 9c ef ldi r25, 0xFC ; 252 32c94: 93 87 std Z+11, r25 ; 0x0b 32c96: 82 87 std Z+10, r24 ; 0x0a 32c98: 13 e0 ldi r17, 0x03 ; 3 32c9a: 13 83 std Z+3, r17 ; 0x03 32c9c: 15 86 std Z+13, r1 ; 0x0d 32c9e: 14 86 std Z+12, r1 ; 0x0c break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 32ca0: 80 e0 ldi r24, 0x00 ; 0 32ca2: 0f 94 e4 95 call 0x32bc8 ; 0x32bc8 mmu2Serial.begin(MMU_BAUD); PowerOn(); mmu2Serial.flush(); // make sure the UART buffer is clear before starting communication SetCurrentTool(MMU2_NO_TOOL); 32ca6: 83 e6 ldi r24, 0x63 ; 99 32ca8: 0f 94 65 65 call 0x2caca ; 0x2caca retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 32cac: 8e ea ldi r24, 0xAE ; 174 32cae: 90 ea ldi r25, 0xA0 ; 160 32cb0: 0e 94 0e 7d call 0xfa1c ; 0xfa1c retryAttempts = MAX_RETRIES; 32cb4: c2 e9 ldi r28, 0x92 ; 146 32cb6: d2 e1 ldi r29, 0x12 ; 18 32cb8: 10 93 e6 12 sts 0x12E6, r17 ; 0x8012e6 } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 32cbc: 87 e7 ldi r24, 0x77 ; 119 32cbe: 92 ea ldi r25, 0xA2 ; 162 32cc0: 0e 94 0e 7d call 0xfa1c ; 0xfa1c /// @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; } 32cc4: 8a e0 ldi r24, 0x0A ; 10 32cc6: 8c 8b std Y+20, r24 ; 0x14 // start the communication logic.ResetRetryAttempts(); logic.ResetCommunicationTimeoutAttempts(); state = xState::Connecting; 32cc8: 82 e0 ldi r24, 0x02 ; 2 32cca: 80 93 01 13 sts 0x1301, r24 ; 0x801301 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 32cce: 81 e0 ldi r24, 0x01 ; 1 32cd0: 8d 8f std Y+29, r24 ; 0x1d currentScope = Scope::StartSeq; 32cd2: 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; 32cd4: 1c a2 std Y+36, r1 ; 0x24 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 32cd6: 86 e0 ldi r24, 0x06 ; 6 32cd8: 8c 83 std Y+4, r24 ; 0x04 SendVersion(0); 32cda: 80 e0 ldi r24, 0x00 ; 0 logic.Start(); } 32cdc: df 91 pop r29 32cde: cf 91 pop r28 32ce0: 1f 91 pop r17 32ce2: 0d 94 00 96 jmp 0x32c00 ; 0x32c00 00032ce6 : if (fs != lastFSensor) { SendAndUpdateFilamentSensor(); } } void ProtocolLogic::SendQuery() { 32ce6: cf 93 push r28 32ce8: df 93 push r29 32cea: 00 d0 rcall .+0 ; 0x32cec 32cec: 1f 92 push r1 32cee: 1f 92 push r1 32cf0: cd b7 in r28, 0x3d ; 61 32cf2: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::Query, 0)); 32cf4: 40 e0 ldi r20, 0x00 ; 0 32cf6: 61 e5 ldi r22, 0x51 ; 81 32cf8: ce 01 movw r24, r28 32cfa: 01 96 adiw r24, 0x01 ; 1 32cfc: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 32d00: 49 81 ldd r20, Y+1 ; 0x01 32d02: 5a 81 ldd r21, Y+2 ; 0x02 32d04: 6b 81 ldd r22, Y+3 ; 0x03 32d06: 7c 81 ldd r23, Y+4 ; 0x04 32d08: 8d 81 ldd r24, Y+5 ; 0x05 32d0a: 0f 94 f6 56 call 0x2adec ; 0x2adec scopeState = ScopeState::QuerySent; 32d0e: 84 e0 ldi r24, 0x04 ; 4 32d10: 80 93 95 12 sts 0x1295, r24 ; 0x801295 } 32d14: 0f 90 pop r0 32d16: 0f 90 pop r0 32d18: 0f 90 pop r0 32d1a: 0f 90 pop r0 32d1c: 0f 90 pop r0 32d1e: df 91 pop r29 32d20: cf 91 pop r28 32d22: 08 95 ret 00032d24 : SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); } return false; } void ProtocolLogic::SendAndUpdateFilamentSensor() { 32d24: cf 93 push r28 32d26: df 93 push r29 32d28: 00 d0 rcall .+0 ; 0x32d2a 32d2a: 1f 92 push r1 32d2c: 1f 92 push r1 32d2e: cd b7 in r28, 0x3d ; 61 32d30: de b7 in r29, 0x3e ; 62 SendMsg(RequestMsg(RequestMsgCodes::FilamentSensor, lastFSensor = (uint8_t)WhereIsFilament())); 32d32: 0f 94 96 4e call 0x29d2c ; 0x29d2c 32d36: 80 93 d6 12 sts 0x12D6, r24 ; 0x8012d6 32d3a: 48 2f mov r20, r24 32d3c: 66 e6 ldi r22, 0x66 ; 102 32d3e: ce 01 movw r24, r28 32d40: 01 96 adiw r24, 0x01 ; 1 32d42: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 32d46: 49 81 ldd r20, Y+1 ; 0x01 32d48: 5a 81 ldd r21, Y+2 ; 0x02 32d4a: 6b 81 ldd r22, Y+3 ; 0x03 32d4c: 7c 81 ldd r23, Y+4 ; 0x04 32d4e: 8d 81 ldd r24, Y+5 ; 0x05 32d50: 0f 94 f6 56 call 0x2adec ; 0x2adec scopeState = ScopeState::FilamentSensorStateSent; 32d54: 86 e0 ldi r24, 0x06 ; 6 32d56: 80 93 95 12 sts 0x1295, r24 ; 0x801295 } 32d5a: 0f 90 pop r0 32d5c: 0f 90 pop r0 32d5e: 0f 90 pop r0 32d60: 0f 90 pop r0 32d62: 0f 90 pop r0 32d64: df 91 pop r29 32d66: cf 91 pop r28 32d68: 08 95 ret 00032d6a : CheckAndReportAsyncEvents(); } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { 32d6a: cf 93 push r28 32d6c: df 93 push r29 32d6e: 00 d0 rcall .+0 ; 0x32d70 32d70: 1f 92 push r1 32d72: 1f 92 push r1 32d74: cd b7 in r28, 0x3d ; 61 32d76: de b7 in r29, 0x3e ; 62 switch (rsp.paramCode) { 32d78: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 32d7c: 85 34 cpi r24, 0x45 ; 69 32d7e: f1 f0 breq .+60 ; 0x32dbc 32d80: 20 f4 brcc .+8 ; 0x32d8a 32d82: 82 34 cpi r24, 0x42 ; 66 32d84: 51 f1 breq .+84 ; 0x32dda } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; } default: return ProtocolError; 32d86: 85 e0 ldi r24, 0x05 ; 5 32d88: 11 c0 rjmp .+34 ; 0x32dac } return Processing; } StepStatus ProtocolLogic::ProcessCommandQueryResponse() { switch (rsp.paramCode) { 32d8a: 86 34 cpi r24, 0x46 ; 70 32d8c: 71 f1 breq .+92 ; 0x32dea 32d8e: 80 35 cpi r24, 0x50 ; 80 32d90: d1 f7 brne .-12 ; 0x32d86 case ResponseMsgParamCodes::Processing: progressCode = static_cast(rsp.paramValue); 32d92: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 32d96: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = ErrorCode::OK; 32d9a: 81 e0 ldi r24, 0x01 ; 1 32d9c: 90 e0 ldi r25, 0x00 ; 0 32d9e: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 32da2: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 SendAndUpdateFilamentSensor(); // keep on reporting the state of fsensor regularly 32da6: 0f 94 92 96 call 0x32d24 ; 0x32d24 return Processing; 32daa: 80 e0 ldi r24, 0x00 ; 0 return Interrupted; } default: return ProtocolError; } } 32dac: 0f 90 pop r0 32dae: 0f 90 pop r0 32db0: 0f 90 pop r0 32db2: 0f 90 pop r0 32db4: 0f 90 pop r0 32db6: df 91 pop r29 32db8: cf 91 pop r28 32dba: 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; 32dbc: 8c e0 ldi r24, 0x0C ; 12 32dbe: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = static_cast(rsp.paramValue); 32dc2: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 32dc6: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae 32dca: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 32dce: 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(); 32dd2: 0f 94 92 96 call 0x32d24 ; 0x32d24 return CommandError; 32dd6: 87 e0 ldi r24, 0x07 ; 7 32dd8: e9 cf rjmp .-46 ; 0x32dac 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); 32dda: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 32dde: 80 93 d5 12 sts 0x12D5, r24 ; 0x8012d5 SendAndUpdateFilamentSensor(); 32de2: 0f 94 92 96 call 0x32d24 ; 0x32d24 return ButtonPushed; 32de6: 8b e0 ldi r24, 0x0B ; 11 32de8: e1 cf rjmp .-62 ; 0x32dac 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) { 32dea: 90 91 97 12 lds r25, 0x1297 ; 0x801297 32dee: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 32df2: 98 13 cpse r25, r24 32df4: 22 c0 rjmp .+68 ; 0x32e3a 32df6: 90 91 98 12 lds r25, 0x1298 ; 0x801298 32dfa: 80 91 a8 12 lds r24, 0x12A8 ; 0x8012a8 32dfe: 98 13 cpse r25, r24 32e00: 1c c0 rjmp .+56 ; 0x32e3a progressCode = ProgressCode::OK; 32e02: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 errorCode = ErrorCode::OK; 32e06: 81 e0 ldi r24, 0x01 ; 1 32e08: 90 e0 ldi r25, 0x00 ; 0 32e0a: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 32e0e: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 scopeState = ScopeState::Ready; 32e12: 82 e8 ldi r24, 0x82 ; 130 32e14: 80 93 95 12 sts 0x1295, r24 ; 0x801295 rq = RequestMsg(RequestMsgCodes::unknown, 0); // clear the successfully finished request 32e18: 40 e0 ldi r20, 0x00 ; 0 32e1a: 60 e0 ldi r22, 0x00 ; 0 32e1c: ce 01 movw r24, r28 32e1e: 01 96 adiw r24, 0x01 ; 1 32e20: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 32e24: 85 e0 ldi r24, 0x05 ; 5 32e26: fe 01 movw r30, r28 32e28: 31 96 adiw r30, 0x01 ; 1 32e2a: a7 e9 ldi r26, 0x97 ; 151 32e2c: b2 e1 ldi r27, 0x12 ; 18 32e2e: 01 90 ld r0, Z+ 32e30: 0d 92 st X+, r0 32e32: 8a 95 dec r24 32e34: e1 f7 brne .-8 ; 0x32e2e 32e36: 82 e0 ldi r24, 0x02 ; 2 32e38: b9 cf rjmp .-142 ; 0x32dac return Finished; } else { // got response to some other command - the originally issued command was interrupted! return Interrupted; 32e3a: 83 e0 ldi r24, 0x03 ; 3 32e3c: b7 cf rjmp .-146 ; 0x32dac 00032e3e : mmu_print_saved &= ~(SavedState::ParkExtruder); } } void MMU2::CheckUserInput() { 32e3e: 1f 93 push r17 32e40: cf 93 push r28 32e42: df 93 push r29 32e44: 00 d0 rcall .+0 ; 0x32e46 32e46: 1f 92 push r1 32e48: 1f 92 push r1 32e4a: cd b7 in r28, 0x3d ; 61 32e4c: de b7 in r29, 0x3e ; 62 const char *PrusaErrorButtonMore() { return MSG_BTN_MORE; } Buttons ButtonPressed(ErrorCode ec) { if (buttonSelectedOperation == ButtonOperations::NoOperation) { 32e4e: 80 91 44 0d lds r24, 0x0D44 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 32e52: 81 11 cpse r24, r1 32e54: 2a c0 rjmp .+84 ; 0x32eaa auto btn = ButtonPressed(lastErrorCode); // Was a button pressed on the MMU itself instead of the LCD? if (btn == Buttons::NoButton && lastButton != Buttons::NoButton) { 32e56: 10 91 fc 12 lds r17, 0x12FC ; 0x8012fc 32e5a: 1f 3f cpi r17, 0xFF ; 255 32e5c: 91 f5 brne .+100 ; 0x32ec2 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. } if (mmu2.MMULastErrorSource() == ErrorSourcePrinter && btn != Buttons::NoButton) { 32e5e: 80 91 fb 12 lds r24, 0x12FB ; 0x8012fb 32e62: 81 11 cpse r24, r1 32e64: 60 c0 rjmp .+192 ; 0x32f26 32e66: 1f 3f cpi r17, 0xFF ; 255 32e68: b9 f0 breq .+46 ; 0x32e98 inline void SetPrinterError(ErrorCode ec) { explicitPrinterError = ec; } inline void ClearPrinterError() { explicitPrinterError = ErrorCode::OK; 32e6a: 81 e0 ldi r24, 0x01 ; 1 32e6c: 90 e0 ldi r25, 0x00 ; 0 32e6e: 90 93 93 12 sts 0x1293, r25 ; 0x801293 32e72: 80 93 92 12 sts 0x1292, r24 ; 0x801292 } } void ClearPrinterError() { logic.ClearPrinterError(); lastErrorCode = ErrorCode::OK; 32e76: 90 93 fa 12 sts 0x12FA, r25 ; 0x8012fa 32e7a: 80 93 f9 12 sts 0x12F9, r24 ; 0x8012f9 lastErrorSource = ErrorSource::ErrorSourceNone; 32e7e: 8f ef ldi r24, 0xFF ; 255 32e80: 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) { 32e84: 13 30 cpi r17, 0x03 ; 3 32e86: 09 f4 brne .+2 ; 0x32e8a 32e88: 82 c0 rjmp .+260 ; 0x32f8e 32e8a: f8 f0 brcs .+62 ; 0x32eca 32e8c: 16 30 cpi r17, 0x06 ; 6 32e8e: 08 f4 brcc .+2 ; 0x32e92 32e90: 7b c0 rjmp .+246 ; 0x32f88 32e92: 17 30 cpi r17, 0x07 ; 7 32e94: 09 f4 brne .+2 ; 0x32e98 32e96: 7f c0 rjmp .+254 ; 0x32f96 // @@TODO not sure if we shall handle this high level operation at this spot break; default: break; } } 32e98: 0f 90 pop r0 32e9a: 0f 90 pop r0 32e9c: 0f 90 pop r0 32e9e: 0f 90 pop r0 32ea0: 0f 90 pop r0 32ea2: df 91 pop r29 32ea4: cf 91 pop r28 32ea6: 1f 91 pop r17 32ea8: 08 95 ret return Buttons::NoButton; // no button } const auto result = ButtonAvailable(ec); 32eaa: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 32eae: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 32eb2: 0f 94 28 51 call 0x2a250 ; 0x2a250 32eb6: 18 2f mov r17, r24 buttonSelectedOperation = ButtonOperations::NoOperation; // Reset operation 32eb8: 10 92 44 0d sts 0x0D44, r1 ; 0x800d44 <_ZN4MMU2L23buttonSelectedOperationE.lto_priv.448> 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) { 32ebc: 8f 3f cpi r24, 0xFF ; 255 32ebe: 79 f6 brne .-98 ; 0x32e5e 32ec0: ca cf rjmp .-108 ; 0x32e56 btn = lastButton; lastButton = Buttons::NoButton; // Clear it. 32ec2: 8f ef ldi r24, 0xFF ; 255 32ec4: 80 93 fc 12 sts 0x12FC, r24 ; 0x8012fc 32ec8: ca cf rjmp .-108 ; 0x32e5e switch (btn) { case Buttons::Left: case Buttons::Middle: case Buttons::Right: SERIAL_ECHOPGM("CheckUserInput-btnLMR "); 32eca: 87 e9 ldi r24, 0x97 ; 151 32ecc: 90 ea ldi r25, 0xA0 ; 160 32ece: 0e 94 15 7b call 0xf62a ; 0xf62a SERIAL_ECHOLN((int)buttons_to_uint8t(btn)); 32ed2: 81 2f mov r24, r17 32ed4: 90 e0 ldi r25, 0x00 ; 0 32ed6: 0f 94 5d 65 call 0x2caba ; 0x2caba ResumeHotendTemp(); // Recover the hotend temp before we attempt to do anything else... 32eda: 0f 94 e9 9c call 0x339d2 ; 0x339d2 if (mmu2.MMULastErrorSource() == ErrorSourceMMU) { 32ede: 80 91 fb 12 lds r24, 0x12FB ; 0x8012fb 32ee2: 81 30 cpi r24, 0x01 ; 1 32ee4: 89 f4 brne .+34 ; 0x32f08 ScreenUpdateEnable(); return true; } void MMU2::Button(uint8_t index) { LogEchoEvent_P(PSTR("Button")); 32ee6: 80 e9 ldi r24, 0x90 ; 144 32ee8: 90 ea ldi r25, 0xA0 ; 160 32eea: 0f 94 86 4e call 0x29d0c ; 0x29d0c void ProtocolLogic::ResetMMU(uint8_t mode /* = 0 */) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Reset, mode)); } void ProtocolLogic::Button(uint8_t index) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Button, index)); 32eee: 41 2f mov r20, r17 32ef0: 62 e4 ldi r22, 0x42 ; 66 32ef2: ce 01 movw r24, r28 32ef4: 01 96 adiw r24, 0x01 ; 1 32ef6: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 32efa: 49 81 ldd r20, Y+1 ; 0x01 32efc: 5a 81 ldd r21, Y+2 ; 0x02 32efe: 6b 81 ldd r22, Y+3 ; 0x03 32f00: 7c 81 ldd r23, Y+4 ; 0x04 32f02: 8d 81 ldd r24, Y+5 ; 0x05 32f04: 0f 94 ba 95 call 0x32b74 ; 0x32b74 } // 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) { 32f08: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 32f0c: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 32f10: 84 30 cpi r24, 0x04 ; 4 32f12: 20 e8 ldi r18, 0x80 ; 128 32f14: 92 07 cpc r25, r18 32f16: 21 f0 breq .+8 ; 0x32f20 32f18: 89 30 cpi r24, 0x09 ; 9 32f1a: 90 48 sbci r25, 0x80 ; 128 32f1c: 09 f0 breq .+2 ; 0x32f20 32f1e: bc cf rjmp .-136 ; 0x32e98 case ErrorCode::FSENSOR_DIDNT_SWITCH_OFF: case ErrorCode::FSENSOR_TOO_EARLY: HelpUnloadToFinda(); 32f20: 0f 94 a6 5a call 0x2b54c ; 0x2b54c 32f24: b9 cf rjmp .-142 ; 0x32e98 // 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) { 32f26: 19 30 cpi r17, 0x09 ; 9 32f28: 08 f0 brcs .+2 ; 0x32f2c 32f2a: b6 cf rjmp .-148 ; 0x32e98 32f2c: e1 2f mov r30, r17 32f2e: f0 e0 ldi r31, 0x00 ; 0 32f30: 88 27 eor r24, r24 32f32: e2 56 subi r30, 0x62 ; 98 32f34: f8 46 sbci r31, 0x68 ; 104 32f36: 8e 4f sbci r24, 0xFE ; 254 32f38: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> 32f3c: 00 39 cpi r16, 0x90 ; 144 32f3e: 00 39 cpi r16, 0x90 ; 144 32f40: 00 39 cpi r16, 0x90 ; 144 32f42: b6 37 cpi r27, 0x76 ; 118 32f44: be 37 cpi r27, 0x7E ; 126 32f46: be 37 cpi r27, 0x7E ; 126 32f48: 58 37 cpi r21, 0x78 ; 120 32f4a: a2 38 cpi r26, 0x82 ; 130 32f4c: b8 37 cpi r27, 0x78 ; 120 logic.Stop(); mmu2Serial.close(); } void MMU2::Tune() { switch (lastErrorCode) { 32f4e: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 32f52: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 32f56: 87 38 cpi r24, 0x87 ; 135 32f58: 20 e8 ldi r18, 0x80 ; 128 32f5a: 92 07 cpc r25, r18 32f5c: 21 f0 breq .+8 ; 0x32f66 32f5e: 87 30 cpi r24, 0x07 ; 7 32f60: 91 48 sbci r25, 0x81 ; 129 32f62: 09 f0 breq .+2 ; 0x32f66 32f64: 99 cf rjmp .-206 ; 0x32e98 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 32f66: 80 91 94 12 lds r24, 0x1294 ; 0x801294 32f6a: 84 30 cpi r24, 0x04 ; 4 32f6c: 21 f4 brne .+8 ; 0x32f76 ); MENU_END(); } void tuneIdlerStallguardThreshold() { if ((CommandInProgress)mmu2.GetCommandInProgress() != NoCommand) 32f6e: 80 91 97 12 lds r24, 0x1297 ; 0x801297 32f72: 81 11 cpse r24, r1 32f74: 91 cf rjmp .-222 ; 0x32e98 // homing fails during toolchange. // To save the print, make the Tune button unresponsive for now. return; } putErrorScreenToSleep = true; 32f76: 81 e0 ldi r24, 0x01 ; 1 32f78: 80 93 43 0d sts 0x0D43, r24 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.449> menu_submenu(tuneIdlerStallguardThresholdMenu); 32f7c: 60 e0 ldi r22, 0x00 ; 0 32f7e: 8c e1 ldi r24, 0x1C ; 28 32f80: 97 e3 ldi r25, 0x37 ; 55 32f82: 0e 94 2e 63 call 0xc65c ; 0xc65c 32f86: 88 cf rjmp .-240 ; 0x32e98 } /// @brief Queue a button operation which the printer can act upon /// @param btn Button operation inline void SetPrinterButtonOperation(Buttons btn) { printerButtonOperation = btn; 32f88: 10 93 ff 12 sts 0x12FF, r17 ; 0x8012ff 32f8c: 85 cf rjmp .-246 ; 0x32e98 break; } } void MMU2::ResetX0() { logic.ResetMMU(); // Send soft reset 32f8e: 80 e0 ldi r24, 0x00 ; 0 32f90: 0f 94 e4 95 call 0x32bc8 ; 0x32bc8 32f94: 81 cf rjmp .-254 ; 0x32e98 StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 32f96: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 32f9a: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 32f9e: 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); 32fa2: 60 e0 ldi r22, 0x00 ; 0 32fa4: 8c ea ldi r24, 0xAC ; 172 32fa6: 9c e0 ldi r25, 0x0C ; 12 32fa8: 0f 94 a5 a4 call 0x3494a ; 0x3494a } /// Disables MMU in EEPROM void DisableMMUInSettings() { eeprom_update_byte_notify((uint8_t *)EEPROM_MMU_ENABLED, false); mmu2.Status(); 32fac: 0f 94 4b 65 call 0x2ca96 ; 0x2ca96 32fb0: 73 cf rjmp .-282 ; 0x32e98 00032fb2 : avoidRecursion = true; mmu_loop_inner(true); avoidRecursion = false; } void __attribute__((noinline)) MMU2::mmu_loop_inner(bool reportErrors) { 32fb2: 4f 92 push r4 32fb4: 5f 92 push r5 32fb6: 6f 92 push r6 32fb8: 7f 92 push r7 32fba: 8f 92 push r8 32fbc: 9f 92 push r9 32fbe: af 92 push r10 32fc0: bf 92 push r11 32fc2: cf 92 push r12 32fc4: df 92 push r13 32fc6: ef 92 push r14 32fc8: ff 92 push r15 32fca: 0f 93 push r16 32fcc: 1f 93 push r17 32fce: cf 93 push r28 32fd0: df 93 push r29 32fd2: cd b7 in r28, 0x3d ; 61 32fd4: de b7 in r29, 0x3e ; 62 32fd6: a0 97 sbiw r28, 0x20 ; 32 32fd8: 0f b6 in r0, 0x3f ; 63 32fda: f8 94 cli 32fdc: de bf out 0x3e, r29 ; 62 32fde: 0f be out 0x3f, r0 ; 63 32fe0: cd bf out 0x3d, r28 ; 61 32fe2: 08 2f mov r16, r24 } } StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); 32fe4: 0f 94 1f 97 call 0x32e3e ; 0x32e3e DelayedRestartRestart(); return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError); } StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately 32fe8: 80 91 95 12 lds r24, 0x1295 ; 0x801295 32fec: 87 fd sbrc r24, 7 ActivatePlannedRequest(); 32fee: 0f 94 35 95 call 0x32a6a ; 0x32a6a 32ff2: 90 91 95 12 lds r25, 0x1295 ; 0x801295 } return Processing; } StepStatus ProtocolLogic::ScopeStep() { if (!ExpectsResponse()) { 32ff6: 97 ff sbrs r25, 7 32ff8: 7d c0 rjmp .+250 ; 0x330f4 // we are waiting for something switch (currentScope) { 32ffa: 80 91 94 12 lds r24, 0x1294 ; 0x801294 32ffe: 82 30 cpi r24, 0x02 ; 2 33000: b1 f0 breq .+44 ; 0x3302e 33002: 08 f4 brcc .+2 ; 0x33006 33004: 75 c0 rjmp .+234 ; 0x330f0 33006: 83 30 cpi r24, 0x03 ; 3 33008: e1 f1 breq .+120 ; 0x33082 3300a: 84 30 cpi r24, 0x04 ; 4 3300c: 09 f4 brne .+2 ; 0x33010 3300e: 54 c0 rjmp .+168 ; 0x330b8 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 33010: 0f 94 35 95 call 0x32a6a ; 0x32a6a 33014: 81 11 cpse r24, r1 33016: 6b c3 rjmp .+1750 ; 0x336ee // and we have just received a response to a Q0 message about a command progress return ProcessCommandQueryResponse(); } void ProtocolLogic::SwitchToIdle() { state = State::Running; 33018: 82 e0 ldi r24, 0x02 ; 2 3301a: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::Idle; 3301e: 83 e0 ldi r24, 0x03 ; 3 33020: 80 93 94 12 sts 0x1294, r24 ; 0x801294 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33024: 82 e8 ldi r24, 0x82 ; 130 33026: 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()) { 3302a: 12 e0 ldi r17, 0x02 ; 2 3302c: db c2 rjmp .+1462 ; 0x335e4 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 3302e: 0f 94 89 0b call 0x21712 ; 0x21712 33032: ab 01 movw r20, r22 33034: bc 01 movw r22, r24 33036: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 3303a: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 3303e: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 33042: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 33046: 88 51 subi r24, 0x18 ; 24 33048: 9c 4f sbci r25, 0xFC ; 252 3304a: af 4f sbci r26, 0xFF ; 255 3304c: 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 3304e: 48 17 cp r20, r24 33050: 59 07 cpc r21, r25 33052: 6a 07 cpc r22, r26 33054: 7b 07 cpc r23, r27 33056: 08 f4 brcc .+2 ; 0x3305a 33058: 4b c0 rjmp .+150 ; 0x330f0 void MMU2Serial::close() { // @@TODO - probably turn off the UART } int MMU2Serial::read() { return fgetc(uart2io); 3305a: 84 e7 ldi r24, 0x74 ; 116 3305c: 92 e1 ldi r25, 0x12 ; 18 3305e: 0f 94 ad a2 call 0x3455a ; 0x3455a while (uart->read() != -1) 33062: 01 96 adiw r24, 0x01 ; 1 33064: d1 f7 brne .-12 ; 0x3305a initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 33066: 81 e0 ldi r24, 0x01 ; 1 33068: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::StartSeq; 3306c: 80 93 94 12 sts 0x1294, r24 ; 0x801294 33070: 10 92 b6 12 sts 0x12B6, r1 ; 0x8012b6 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 33074: 86 e0 ldi r24, 0x06 ; 6 33076: 80 93 96 12 sts 0x1296, r24 ; 0x801296 SendVersion(0); 3307a: 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); 3307c: 0f 94 00 96 call 0x32c00 ; 0x32c00 33080: 37 c0 rjmp .+110 ; 0x330f0 } return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout 33082: 92 38 cpi r25, 0x82 ; 130 33084: 29 f6 brne .-118 ; 0x33010 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 33086: 0f 94 89 0b call 0x21712 ; 0x21712 3308a: ab 01 movw r20, r22 3308c: bc 01 movw r22, r24 3308e: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 33092: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 33096: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 3309a: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 3309e: 88 51 subi r24, 0x18 ; 24 330a0: 9c 4f sbci r25, 0xFC ; 252 330a2: af 4f sbci r26, 0xFF ; 255 330a4: bf 4f sbci r27, 0xFF ; 255 return Processing; } StepStatus ProtocolLogic::IdleWait() { if (scopeState == ScopeState::Ready) { // check timeout if (Elapsed(heartBeatPeriod)) { 330a6: 48 17 cp r20, r24 330a8: 59 07 cpc r21, r25 330aa: 6a 07 cpc r22, r26 330ac: 7b 07 cpc r23, r27 330ae: 08 f4 brcc .+2 ; 0x330b2 330b0: af cf rjmp .-162 ; 0x33010 void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; currentScope = Scope::Idle; IdleRestart(); SendQuery(); // force sending Q0 immediately 330b2: 0f 94 73 96 call 0x32ce6 ; 0x32ce6 330b6: 1c c0 rjmp .+56 ; 0x330f0 } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 330b8: 0f 94 89 0b call 0x21712 ; 0x21712 330bc: ab 01 movw r20, r22 330be: bc 01 movw r22, r24 330c0: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 330c4: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 330c8: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 330cc: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 330d0: 88 51 subi r24, 0x18 ; 24 330d2: 9c 4f sbci r25, 0xFC ; 252 330d4: af 4f sbci r26, 0xFF ; 255 330d6: bf 4f sbci r27, 0xFF ; 255 } return Processing; } StepStatus ProtocolLogic::CommandWait() { if (Elapsed(heartBeatPeriod)) { 330d8: 48 17 cp r20, r24 330da: 59 07 cpc r21, r25 330dc: 6a 07 cpc r22, r26 330de: 7b 07 cpc r23, r27 330e0: 40 f7 brcc .-48 ; 0x330b2 }; 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(); 330e2: 0f 94 96 4e call 0x29d2c ; 0x29d2c if (fs != lastFSensor) { 330e6: 90 91 d6 12 lds r25, 0x12D6 ; 0x8012d6 330ea: 89 13 cpse r24, r25 SendAndUpdateFilamentSensor(); 330ec: 0f 94 92 96 call 0x32d24 ; 0x32d24 // 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; 330f0: 10 e0 ldi r17, 0x00 ; 0 330f2: 78 c2 rjmp .+1264 ; 0x335e4 StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; int c = -1; OldMMUFWDetector oldMMUh4x0r; // old MMU FW hacker ;) 330f4: a1 2c mov r10, r1 return State::SomethingElse; } }; StepStatus ProtocolLogic::ExpectingMessage() { int bytesConsumed = 0; 330f6: d1 2c mov r13, r1 330f8: 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; 330fa: 99 24 eor r9, r9 330fc: 93 94 inc r9 responseMsg.paramCode = (ResponseMsgParamCodes)c; responseMsg.paramValue = 0; return DecodeStatus::NeedMoreData; default: responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 330fe: 55 e0 ldi r21, 0x05 ; 5 33100: b5 2e mov r11, r21 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 33102: 63 e0 ldi r22, 0x03 ; 3 33104: 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; 33106: 74 e0 ldi r23, 0x04 ; 4 33108: 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; 3310a: e2 e0 ldi r30, 0x02 ; 2 3310c: 6e 2e mov r6, r30 3310e: 66 c0 rjmp .+204 ; 0x331dc ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 33110: 23 30 cpi r18, 0x03 ; 3 33112: 09 f4 brne .+2 ; 0x33116 33114: e0 c0 rjmp .+448 ; 0x332d6 33116: 24 30 cpi r18, 0x04 ; 4 33118: 09 f0 breq .+2 ; 0x3311c 3311a: 83 c0 rjmp .+262 ; 0x33222 } 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'); 3311c: 20 ed ldi r18, 0xD0 ; 208 3311e: 28 0f add r18, r24 33120: 2a 30 cpi r18, 0x0A ; 10 33122: 08 f4 brcc .+2 ; 0x33126 33124: f8 c0 rjmp .+496 ; 0x33316 33126: 2f e9 ldi r18, 0x9F ; 159 33128: 28 0f add r18, r24 3312a: 26 30 cpi r18, 0x06 ; 6 3312c: 08 f4 brcc .+2 ; 0x33130 3312e: f3 c0 rjmp .+486 ; 0x33316 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 33130: 8a 30 cpi r24, 0x0A ; 10 33132: 09 f0 breq .+2 ; 0x33136 33134: fa c0 rjmp .+500 ; 0x3332a 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()) { 33136: 40 90 bb 12 lds r4, 0x12BB ; 0x8012bb 3313a: 87 eb ldi r24, 0xB7 ; 183 3313c: 92 e1 ldi r25, 0x12 ; 18 3313e: 0f 94 42 4e call 0x29c84 ; 0x29c84 33142: 48 12 cpse r4, r24 33144: b8 c0 rjmp .+368 ; 0x332b6 // CRC mismatch responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; return DecodeStatus::Error; } else { rspState = ResponseStates::RequestCode; 33146: 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; } 3314a: 88 e0 ldi r24, 0x08 ; 8 3314c: e7 eb ldi r30, 0xB7 ; 183 3314e: f2 e1 ldi r31, 0x12 ; 18 33150: de 01 movw r26, r28 33152: 51 96 adiw r26, 0x11 ; 17 33154: 01 90 ld r0, Z+ 33156: 0d 92 st X+, r0 33158: 8a 95 dec r24 3315a: e1 f7 brne .-8 ; 0x33154 3315c: 88 e0 ldi r24, 0x08 ; 8 3315e: fe 01 movw r30, r28 33160: 71 96 adiw r30, 0x11 ; 17 33162: de 01 movw r26, r28 33164: 59 96 adiw r26, 0x19 ; 25 33166: 01 90 ld r0, Z+ 33168: 0d 92 st X+, r0 3316a: 8a 95 dec r24 3316c: e1 f7 brne .-8 ; 0x33166 while ((c = uart->read()) >= 0) { ++bytesConsumed; RecordReceivedByte(c); switch (protocol.DecodeResponse(c)) { case DecodeStatus::MessageCompleted: rsp = protocol.GetResponseMsg(); 3316e: 88 e0 ldi r24, 0x08 ; 8 33170: fe 01 movw r30, r28 33172: 79 96 adiw r30, 0x19 ; 25 33174: a7 ea ldi r26, 0xA7 ; 167 33176: b2 e1 ldi r27, 0x12 ; 18 33178: 01 90 ld r0, Z+ 3317a: 0d 92 st X+, r0 3317c: 8a 95 dec r24 3317e: e1 f7 brne .-8 ; 0x33178 } dst[(lastReceivedBytes.size() - 1) * 3 + 2] = 0; // terminate properly } void ProtocolLogic::FormatLastResponseMsgAndClearLRB(char *dst) { *dst++ = '<'; 33180: 8c e3 ldi r24, 0x3C ; 60 33182: 89 83 std Y+1, r24 ; 0x01 33184: fe 01 movw r30, r28 33186: 32 96 adiw r30, 0x02 ; 2 33188: af eb ldi r26, 0xBF ; 191 3318a: b2 e1 ldi r27, 0x12 ; 18 for (uint8_t i = 0; i < lrb; ++i) { 3318c: 20 e0 ldi r18, 0x00 ; 0 3318e: cf 01 movw r24, r30 33190: 52 16 cp r5, r18 33192: 09 f4 brne .+2 ; 0x33196 33194: cd c0 rjmp .+410 ; 0x33330 uint8_t b = lastReceivedBytes[i]; 33196: 3d 91 ld r19, X+ // Check for printable character, including space if (b < 32 || b > 127) { 33198: 40 ee ldi r20, 0xE0 ; 224 3319a: 43 0f add r20, r19 3319c: 40 36 cpi r20, 0x60 ; 96 3319e: 08 f0 brcs .+2 ; 0x331a2 b = '.'; 331a0: 3e e2 ldi r19, 0x2E ; 46 } *dst++ = b; 331a2: 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) { 331a4: 2f 5f subi r18, 0xFF ; 255 331a6: f4 cf rjmp .-24 ; 0x33190 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 331a8: 8e 34 cpi r24, 0x4E ; 78 331aa: 08 f0 brcs .+2 ; 0x331ae 331ac: 56 c0 rjmp .+172 ; 0x3325a 331ae: 8b 34 cpi r24, 0x4B ; 75 331b0: 08 f0 brcs .+2 ; 0x331b4 331b2: 46 c0 rjmp .+140 ; 0x33240 331b4: 82 34 cpi r24, 0x42 ; 66 331b6: 09 f4 brne .+2 ; 0x331ba 331b8: 43 c0 rjmp .+134 ; 0x33240 331ba: e0 f5 brcc .+120 ; 0x33234 331bc: 8a 30 cpi r24, 0x0A ; 10 331be: 59 f0 breq .+22 ; 0x331d6 331c0: 8d 30 cpi r24, 0x0D ; 13 331c2: 49 f0 breq .+18 ; 0x331d6 } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; rspState = ResponseStates::Error; 331c4: 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') { 331c8: a1 10 cpse r10, r1 331ca: 05 c1 rjmp .+522 ; 0x333d6 331cc: 1f 36 cpi r17, 0x6F ; 111 331ce: 09 f0 breq .+2 ; 0x331d2 331d0: fa c3 rjmp .+2036 ; 0x339c6 ++ok; 331d2: aa 24 eor r10, r10 331d4: 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; 331d6: 4f ef ldi r20, 0xFF ; 255 331d8: c4 1a sub r12, r20 331da: d4 0a sbc r13, r20 331dc: 84 e7 ldi r24, 0x74 ; 116 331de: 92 e1 ldi r25, 0x12 ; 18 331e0: 0f 94 ad a2 call 0x3455a ; 0x3455a 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) { 331e4: 97 fd sbrc r25, 7 331e6: 00 c1 rjmp .+512 ; 0x333e8 ++bytesConsumed; RecordReceivedByte(c); 331e8: 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]; 331ea: 20 91 cf 12 lds r18, 0x12CF ; 0x8012cf 331ee: 30 e0 ldi r19, 0x00 ; 0 void ProtocolLogic::RecordUARTActivity() { lastUARTActivityMs = _millis(); } void ProtocolLogic::RecordReceivedByte(uint8_t c) { lastReceivedBytes[lrb] = c; 331f0: f9 01 movw r30, r18 331f2: ee 56 subi r30, 0x6E ; 110 331f4: fd 4e sbci r31, 0xED ; 237 331f6: 85 a7 std Z+45, r24 ; 0x2d lrb = (lrb + 1) % lastReceivedBytes.size(); 331f8: 79 01 movw r14, r18 331fa: ef ef ldi r30, 0xFF ; 255 331fc: ee 1a sub r14, r30 331fe: fe 0a sbc r15, r30 33200: ff e0 ldi r31, 0x0F ; 15 33202: ef 22 and r14, r31 33204: ff 24 eor r15, r15 33206: 5e 2c mov r5, r14 33208: e0 92 cf 12 sts 0x12CF, r14 ; 0x8012cf ++i; return i; } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { 3320c: 20 91 b6 12 lds r18, 0x12B6 ; 0x8012b6 33210: 22 30 cpi r18, 0x02 ; 2 33212: 09 f4 brne .+2 ; 0x33216 33214: 48 c0 rjmp .+144 ; 0x332a6 33216: 08 f0 brcs .+2 ; 0x3321a 33218: 7b cf rjmp .-266 ; 0x33110 3321a: 22 23 and r18, r18 3321c: 29 f2 breq .-118 ; 0x331a8 3321e: 21 30 cpi r18, 0x01 ; 1 33220: 51 f1 breq .+84 ; 0x33276 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 33222: 1a 30 cpi r17, 0x0A ; 10 33224: 09 f4 brne .+2 ; 0x33228 33226: 8f cf rjmp .-226 ; 0x33146 33228: 1d 30 cpi r17, 0x0D ; 13 3322a: 09 f4 brne .+2 ; 0x3322e 3322c: 8c cf rjmp .-232 ; 0x33146 default: //case error: if (IsNewLine(c)) { rspState = ResponseStates::RequestCode; return DecodeStatus::MessageCompleted; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 3322e: 10 92 bc 12 sts 0x12BC, r1 ; 0x8012bc 33232: ca cf rjmp .-108 ; 0x331c8 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 33234: 85 34 cpi r24, 0x45 ; 69 33236: 30 f2 brcs .-116 ; 0x331c4 33238: 87 34 cpi r24, 0x47 ; 71 3323a: 10 f0 brcs .+4 ; 0x33240 3323c: 88 34 cpi r24, 0x48 ; 72 3323e: 11 f6 brne .-124 ; 0x331c4 case 'K': case 'F': case 'f': case 'H': case 'R': responseMsg.request.code = (RequestMsgCodes)c; 33240: 80 93 b7 12 sts 0x12B7, r24 ; 0x8012b7 responseMsg.request.value = 0; 33244: 10 92 b8 12 sts 0x12B8, r1 ; 0x8012b8 responseMsg.request.value2 = 0; 33248: 10 92 ba 12 sts 0x12BA, r1 ; 0x8012ba 3324c: 10 92 b9 12 sts 0x12B9, r1 ; 0x8012b9 responseMsg.request.crc8 = 0; 33250: 10 92 bb 12 sts 0x12BB, r1 ; 0x8012bb rspState = ResponseStates::RequestValue; 33254: 90 92 b6 12 sts 0x12B6, r9 ; 0x8012b6 33258: be cf rjmp .-132 ; 0x331d6 } DecodeStatus Protocol::DecodeResponse(uint8_t c) { switch (rspState) { case ResponseStates::RequestCode: switch (c) { 3325a: 89 35 cpi r24, 0x59 ; 89 3325c: 40 f4 brcc .+16 ; 0x3326e 3325e: 87 35 cpi r24, 0x57 ; 87 33260: 78 f7 brcc .-34 ; 0x33240 33262: 20 eb ldi r18, 0xB0 ; 176 33264: 28 0f add r18, r24 33266: 26 30 cpi r18, 0x06 ; 6 33268: 08 f0 brcs .+2 ; 0x3326c 3326a: ac cf rjmp .-168 ; 0x331c4 3326c: e9 cf rjmp .-46 ; 0x33240 3326e: 86 36 cpi r24, 0x66 ; 102 33270: 09 f0 breq .+2 ; 0x33274 33272: a8 cf rjmp .-176 ; 0x331c4 33274: e5 cf rjmp .-54 ; 0x33240 } 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'); 33276: 20 ed ldi r18, 0xD0 ; 208 33278: 28 0f add r18, r24 3327a: 2a 30 cpi r18, 0x0A ; 10 3327c: 50 f0 brcs .+20 ; 0x33292 3327e: 2f e9 ldi r18, 0x9F ; 159 33280: 28 0f add r18, r24 33282: 26 30 cpi r18, 0x06 ; 6 33284: 30 f0 brcs .+12 ; 0x33292 case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (c == ' ') { 33286: 80 32 cpi r24, 0x20 ; 32 33288: 09 f0 breq .+2 ; 0x3328c 3328a: 9c cf rjmp .-200 ; 0x331c4 rspState = ResponseStates::ParamCode; 3328c: 60 92 b6 12 sts 0x12B6, r6 ; 0x8012b6 33290: a2 cf rjmp .-188 ; 0x331d6 return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; responseMsg.request.value += Char2Nibble(c); 33292: 0f 94 21 4e call 0x29c42 ; 0x29c42 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::RequestValue: if (IsHexDigit(c)) { responseMsg.request.value <<= 4U; 33296: 90 91 b8 12 lds r25, 0x12B8 ; 0x8012b8 3329a: 92 95 swap r25 3329c: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.value += Char2Nibble(c); 3329e: 89 0f add r24, r25 332a0: 80 93 b8 12 sts 0x12B8, r24 ; 0x8012b8 332a4: 98 cf rjmp .-208 ; 0x331d6 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 332a6: 87 34 cpi r24, 0x47 ; 71 332a8: 48 f4 brcc .+18 ; 0x332bc 332aa: 85 34 cpi r24, 0x45 ; 69 332ac: 58 f4 brcc .+22 ; 0x332c4 332ae: 2f eb ldi r18, 0xBF ; 191 332b0: 28 0f add r18, r24 332b2: 22 30 cpi r18, 0x02 ; 2 332b4: 38 f0 brcs .+14 ; 0x332c4 return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { rspState = ResponseStates::CRC; return DecodeStatus::NeedMoreData; } else { responseMsg.paramCode = ResponseMsgParamCodes::unknown; 332b6: 10 92 bc 12 sts 0x12BC, r1 ; 0x8012bc 332ba: 84 cf rjmp .-248 ; 0x331c4 } else { rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamCode: switch (c) { 332bc: 80 35 cpi r24, 0x50 ; 80 332be: 11 f0 breq .+4 ; 0x332c4 332c0: 82 35 cpi r24, 0x52 ; 82 332c2: c9 f7 brne .-14 ; 0x332b6 case 'E': case 'F': case 'A': case 'R': case 'B': rspState = ResponseStates::ParamValue; 332c4: 80 92 b6 12 sts 0x12B6, r8 ; 0x8012b6 responseMsg.paramCode = (ResponseMsgParamCodes)c; 332c8: 80 93 bc 12 sts 0x12BC, r24 ; 0x8012bc responseMsg.paramValue = 0; 332cc: 10 92 be 12 sts 0x12BE, r1 ; 0x8012be 332d0: 10 92 bd 12 sts 0x12BD, r1 ; 0x8012bd 332d4: 80 cf rjmp .-256 ; 0x331d6 332d6: 20 ed ldi r18, 0xD0 ; 208 332d8: 28 0f add r18, r24 332da: 2a 30 cpi r18, 0x0A ; 10 332dc: 48 f0 brcs .+18 ; 0x332f0 332de: 2f e9 ldi r18, 0x9F ; 159 332e0: 28 0f add r18, r24 332e2: 26 30 cpi r18, 0x06 ; 6 332e4: 28 f0 brcs .+10 ; 0x332f0 case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); return DecodeStatus::NeedMoreData; } else if (IsCRCSeparator(c)) { 332e6: 8a 32 cpi r24, 0x2A ; 42 332e8: 31 f7 brne .-52 ; 0x332b6 rspState = ResponseStates::CRC; 332ea: 70 92 b6 12 sts 0x12B6, r7 ; 0x8012b6 332ee: 73 cf rjmp .-282 ; 0x331d6 return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; responseMsg.paramValue += Char2Nibble(c); 332f0: 0f 94 21 4e call 0x29c42 ; 0x29c42 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::ParamValue: if (IsHexDigit(c)) { responseMsg.paramValue <<= 4U; 332f4: 20 91 bd 12 lds r18, 0x12BD ; 0x8012bd 332f8: 30 91 be 12 lds r19, 0x12BE ; 0x8012be 332fc: 44 e0 ldi r20, 0x04 ; 4 332fe: 22 0f add r18, r18 33300: 33 1f adc r19, r19 33302: 4a 95 dec r20 33304: e1 f7 brne .-8 ; 0x332fe responseMsg.paramValue += Char2Nibble(c); 33306: 82 0f add r24, r18 33308: 93 2f mov r25, r19 3330a: 91 1d adc r25, r1 3330c: 90 93 be 12 sts 0x12BE, r25 ; 0x8012be 33310: 80 93 bd 12 sts 0x12BD, r24 ; 0x8012bd 33314: 60 cf rjmp .-320 ; 0x331d6 return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; responseMsg.request.crc8 += Char2Nibble(c); 33316: 0f 94 21 4e call 0x29c42 ; 0x29c42 rspState = ResponseStates::Error; return DecodeStatus::Error; } case ResponseStates::CRC: if (IsHexDigit(c)) { responseMsg.request.crc8 <<= 4U; 3331a: 90 91 bb 12 lds r25, 0x12BB ; 0x8012bb 3331e: 92 95 swap r25 33320: 90 7f andi r25, 0xF0 ; 240 responseMsg.request.crc8 += Char2Nibble(c); 33322: 89 0f add r24, r25 33324: 80 93 bb 12 sts 0x12BB, r24 ; 0x8012bb 33328: 56 cf rjmp .-340 ; 0x331d6 ResponseStates rspState; ResponseMsg responseMsg; static constexpr bool IsNewLine(uint8_t c) { return c == '\n' || c == '\r'; 3332a: 8d 30 cpi r24, 0x0D ; 13 3332c: 21 f6 brne .-120 ; 0x332b6 3332e: 03 cf rjmp .-506 ; 0x33136 if (b < 32 || b > 127) { b = '.'; } *dst++ = b; } *dst = 0; // terminate properly 33330: e8 0e add r14, r24 33332: f9 1e adc r15, r25 33334: f7 01 movw r30, r14 33336: 10 82 st Z, r1 lrb = 0; // reset the input buffer index in case of a clean message 33338: 10 92 cf 12 sts 0x12CF, r1 ; 0x8012cf } void ProtocolLogic::LogResponse() { char lrb[lastReceivedBytes.size()]; FormatLastResponseMsgAndClearLRB(lrb); MMU2_ECHO_MSGLN(lrb); 3333c: 84 ee ldi r24, 0xE4 ; 228 3333e: 92 ea ldi r25, 0xA2 ; 162 33340: 0e 94 15 7b call 0xf62a ; 0xf62a 33344: 8e ed ldi r24, 0xDE ; 222 33346: 92 ea ldi r25, 0xA2 ; 162 33348: 0e 94 15 7b call 0xf62a ; 0xf62a 3334c: ce 01 movw r24, r28 3334e: 01 96 adiw r24, 0x01 ; 1 33350: 0e 94 1a 86 call 0x10c34 ; 0x10c34 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 33354: 0f 94 f0 55 call 0x2abe0 ; 0x2abe0 if (auto expmsg = ExpectingMessage(); expmsg != MessageReady) { // this whole statement takes 12B return expmsg; } // process message switch (currentScope) { 33358: 80 91 94 12 lds r24, 0x1294 ; 0x801294 3335c: 81 30 cpi r24, 0x01 ; 1 3335e: 09 f4 brne .+2 ; 0x33362 33360: 74 c0 rjmp .+232 ; 0x3344a 33362: 08 f4 brcc .+2 ; 0x33366 33364: c5 ce rjmp .-630 ; 0x330f0 33366: 83 30 cpi r24, 0x03 ; 3 33368: 09 f4 brne .+2 ; 0x3336c 3336a: d1 c0 rjmp .+418 ; 0x3350e 3336c: 84 30 cpi r24, 0x04 ; 4 3336e: 09 f0 breq .+2 ; 0x33372 33370: 4f ce rjmp .-866 ; 0x33010 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 33372: 80 91 95 12 lds r24, 0x1295 ; 0x801295 33376: 86 30 cpi r24, 0x06 ; 6 33378: 09 f4 brne .+2 ; 0x3337c 3337a: 6c c1 rjmp .+728 ; 0x33654 3337c: 08 f0 brcs .+2 ; 0x33380 3337e: 93 c1 rjmp .+806 ; 0x336a6 33380: 84 30 cpi r24, 0x04 ; 4 33382: 09 f4 brne .+2 ; 0x33386 33384: 09 c1 rjmp .+530 ; 0x33598 33386: 85 30 cpi r24, 0x05 ; 5 33388: 09 f0 breq .+2 ; 0x3338c 3338a: cc c0 rjmp .+408 ; 0x33524 case ScopeState::CommandSent: { switch (rsp.paramCode) { // the response should be either accepted or rejected 3338c: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 33390: 81 34 cpi r24, 0x41 ; 65 33392: 09 f4 brne .+2 ; 0x33396 33394: 96 c1 rjmp .+812 ; 0x336c2 33396: 82 35 cpi r24, 0x52 ; 82 33398: 09 f0 breq .+2 ; 0x3339c 3339a: c4 c0 rjmp .+392 ; 0x33524 errorCode = ErrorCode::RUNNING; scopeState = ScopeState::Wait; break; case ResponseMsgParamCodes::Rejected: // rejected - should normally not happen, but report the error up progressCode = ProgressCode::OK; 3339c: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 errorCode = ErrorCode::PROTOCOL_ERROR; 333a0: 8d e2 ldi r24, 0x2D ; 45 333a2: 90 e8 ldi r25, 0x80 ; 128 333a4: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 333a8: 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")); 333ac: 80 e0 ldi r24, 0x00 ; 0 333ae: 90 ea ldi r25, 0xA0 ; 160 333b0: 0f 94 0d 56 call 0x2ac1a ; 0x2ac1a void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; } void ProtocolLogic::CommandRestart() { scopeState = ScopeState::CommandSent; 333b4: 85 e0 ldi r24, 0x05 ; 5 333b6: 80 93 95 12 sts 0x1295, r24 ; 0x801295 SendMsg(rq); 333ba: 40 91 97 12 lds r20, 0x1297 ; 0x801297 333be: 50 91 98 12 lds r21, 0x1298 ; 0x801298 333c2: 60 91 99 12 lds r22, 0x1299 ; 0x801299 333c6: 70 91 9a 12 lds r23, 0x129A ; 0x80129a 333ca: 80 91 9b 12 lds r24, 0x129B ; 0x80129b 333ce: 0f 94 f6 56 call 0x2adec ; 0x2adec 333d2: 16 e0 ldi r17, 0x06 ; 6 333d4: 07 c1 rjmp .+526 ; 0x335e4 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') { 333d6: 1b 36 cpi r17, 0x6B ; 107 333d8: 09 f0 breq .+2 ; 0x333dc 333da: f5 c2 rjmp .+1514 ; 0x339c6 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")); 333dc: 81 ee ldi r24, 0xE1 ; 225 333de: 9f e9 ldi r25, 0x9F ; 159 333e0: 0f 94 0d 56 call 0x2ac1a ; 0x2ac1a 333e4: 18 e0 ldi r17, 0x08 ; 8 333e6: fe c0 rjmp .+508 ; 0x335e4 default: RecordUARTActivity(); // something has happened on the UART, update the timeout record return ProtocolError; } } if (bytesConsumed != 0) { 333e8: cd 28 or r12, r13 333ea: 19 f0 breq .+6 ; 0x333f2 RecordUARTActivity(); // something has happened on the UART, update the timeout record 333ec: 0f 94 f0 55 call 0x2abe0 ; 0x2abe0 333f0: 7f ce rjmp .-770 ; 0x330f0 IdleRestart(); SendQuery(); // force sending Q0 immediately } bool ProtocolLogic::Elapsed(uint32_t timeout) const { return _millis() >= (lastUARTActivityMs + timeout); 333f2: 0f 94 89 0b call 0x21712 ; 0x21712 333f6: ab 01 movw r20, r22 333f8: bc 01 movw r22, r24 333fa: 80 91 a1 12 lds r24, 0x12A1 ; 0x8012a1 333fe: 90 91 a2 12 lds r25, 0x12A2 ; 0x8012a2 33402: a0 91 a3 12 lds r26, 0x12A3 ; 0x8012a3 33406: b0 91 a4 12 lds r27, 0x12A4 ; 0x8012a4 3340a: 80 53 subi r24, 0x30 ; 48 3340c: 98 4f sbci r25, 0xF8 ; 248 3340e: af 4f sbci r26, 0xFF ; 255 33410: 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) { 33412: 48 17 cp r20, r24 33414: 59 07 cpc r21, r25 33416: 6a 07 cpc r22, r26 33418: 7b 07 cpc r23, r27 3341a: 08 f4 brcc .+2 ; 0x3341e 3341c: 69 ce rjmp .-814 ; 0x330f0 3341e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 33422: 88 23 and r24, r24 33424: 09 f4 brne .+2 ; 0x33428 33426: 64 ce rjmp .-824 ; 0x330f0 rqState = RequestStates::Code; } /// resets the internal response decoding state (typically after an error) void ResetResponseDecoder() { rspState = ResponseStates::RequestCode; 33428: 10 92 b6 12 sts 0x12B6, r1 ; 0x8012b6 initRegs8[0] = extraLoadDistance; initRegs8[1] = pulleySlowFeedrate; } void ProtocolLogic::Start() { state = State::InitSequence; 3342c: 81 e0 ldi r24, 0x01 ; 1 3342e: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::StartSeq; 33432: 80 93 94 12 sts 0x1294, r24 ; 0x801294 LogRequestMsg(txbuff, len); RecordUARTActivity(); } void ProtocolLogic::StartSeqRestart() { retries = maxRetries; 33436: 86 e0 ldi r24, 0x06 ; 6 33438: 80 93 96 12 sts 0x1296, r24 ; 0x801296 SendVersion(0); 3343c: 80 e0 ldi r24, 0x00 ; 0 3343e: 0f 94 00 96 call 0x32c00 ; 0x32c00 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 33442: 64 e0 ldi r22, 0x04 ; 4 33444: 89 eb ldi r24, 0xB9 ; 185 33446: 9f e9 ldi r25, 0x9F ; 159 33448: 79 c0 rjmp .+242 ; 0x3353c return Finished; } StepStatus ProtocolLogic::StartSeqStep() { // solve initial handshake switch (scopeState) { 3344a: 10 91 95 12 lds r17, 0x1295 ; 0x801295 3344e: 13 30 cpi r17, 0x03 ; 3 33450: b1 f1 breq .+108 ; 0x334be 33452: 60 f0 brcs .+24 ; 0x3346c 33454: 16 30 cpi r17, 0x06 ; 6 33456: 09 f4 brne .+2 ; 0x3345a 33458: 50 c0 rjmp .+160 ; 0x334fa 3345a: 19 30 cpi r17, 0x09 ; 9 3345c: 09 f0 breq .+2 ; 0x33460 3345e: be cf rjmp .-132 ; 0x333dc // Start General Interrogation after line up - initial parametrization is started StartWritingInitRegisters(); } return Processing; case ScopeState::WritingInitRegisters: if (ProcessWritingInitRegister()) { 33460: 0f 94 20 58 call 0x2b040 ; 0x2b040 33464: 88 23 and r24, r24 33466: 09 f4 brne .+2 ; 0x3346a 33468: 43 ce rjmp .-890 ; 0x330f0 3346a: 40 ce rjmp .-896 ; 0x330ec void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; } StepStatus ProtocolLogic::ProcessVersionResponse(uint8_t stage) { if (rsp.request.code != RequestMsgCodes::Version || rsp.request.value != stage) { 3346c: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 33470: 83 35 cpi r24, 0x53 ; 83 33472: 21 f4 brne .+8 ; 0x3347c 33474: 80 91 a8 12 lds r24, 0x12A8 ; 0x8012a8 33478: 18 17 cp r17, r24 3347a: 11 f0 breq .+4 ; 0x33480 mmuFwVersion[stage] = rsp.paramValue; if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { if (--retries == 0) { return VersionMismatch; } else { SendVersion(stage); 3347c: 81 2f mov r24, r17 3347e: fe cd rjmp .-1028 ; 0x3307c 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; 33480: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 33484: e1 2f mov r30, r17 33486: f0 e0 ldi r31, 0x00 ; 0 33488: df 01 movw r26, r30 3348a: af 51 subi r26, 0x1F ; 31 3348c: bd 4e sbci r27, 0xED ; 237 3348e: 8c 93 st X, r24 if (mmuFwVersion[stage] != pgm_read_byte(supportedMmuFWVersion + stage)) { 33490: e2 52 subi r30, 0x22 ; 34 33492: f0 46 sbci r31, 0x60 ; 96 33494: e4 91 lpm r30, Z 33496: 8e 17 cp r24, r30 33498: 41 f0 breq .+16 ; 0x334aa if (--retries == 0) { 3349a: 80 91 96 12 lds r24, 0x1296 ; 0x801296 3349e: 81 50 subi r24, 0x01 ; 1 334a0: 80 93 96 12 sts 0x1296, r24 ; 0x801296 334a4: 81 11 cpse r24, r1 334a6: ea cf rjmp .-44 ; 0x3347c 334a8: 99 cf rjmp .-206 ; 0x333dc SERIAL_ECHOLNPGM("ResetRetryAttempts"); retryAttempts = MAX_RETRIES; } void ProtocolLogic::ResetCommunicationTimeoutAttempts() { SERIAL_ECHOLNPGM("RSTCommTimeout"); 334aa: 87 e7 ldi r24, 0x77 ; 119 334ac: 92 ea ldi r25, 0xA2 ; 162 334ae: 0e 94 0e 7d call 0xfa1c ; 0xfa1c /// @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; } 334b2: 8a e0 ldi r24, 0x0A ; 10 334b4: 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); 334b8: 81 e0 ldi r24, 0x01 ; 1 334ba: 81 0f add r24, r17 334bc: df cd rjmp .-1090 ; 0x3307c 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) { 334be: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 334c2: 83 35 cpi r24, 0x53 ; 83 334c4: 21 f4 brne .+8 ; 0x334ce 334c6: 80 91 a8 12 lds r24, 0x12A8 ; 0x8012a8 334ca: 83 30 cpi r24, 0x03 ; 3 334cc: 11 f0 breq .+4 ; 0x334d2 // got a response to something else - protocol corruption probably, repeat the query OR restart the comm by issuing S0? SendVersion(3); 334ce: 83 e0 ldi r24, 0x03 ; 3 334d0: d5 cd rjmp .-1110 ; 0x3307c } else { mmuFwVersionBuild = rsp.paramValue; // just register the build number 334d2: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 334d6: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae 334da: 90 93 e5 12 sts 0x12E5, r25 ; 0x8012e5 334de: 80 93 e4 12 sts 0x12E4, r24 ; 0x8012e4 } return ScopeState::Reading16bitRegisters; } void ProtocolLogic::StartWritingInitRegisters() { regIndex = 0; 334e2: 10 92 e0 12 sts 0x12E0, r1 ; 0x8012e0 SendWriteRegister(pgm_read_byte(initRegs8Addrs + regIndex), initRegs8[regIndex], ScopeState::WritingInitRegisters); 334e6: e5 e7 ldi r30, 0x75 ; 117 334e8: f2 ea ldi r31, 0xA2 ; 162 334ea: 84 91 lpm r24, Z 334ec: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 334f0: 70 e0 ldi r23, 0x00 ; 0 334f2: 49 e0 ldi r20, 0x09 ; 9 334f4: 0f 94 61 57 call 0x2aec2 ; 0x2aec2 334f8: fb cd rjmp .-1034 ; 0x330f0 currentScope = Scope::Idle; IdleRestart(); } void ProtocolLogic::SwitchFromStartToIdle() { state = State::Running; 334fa: 82 e0 ldi r24, 0x02 ; 2 334fc: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::Idle; 33500: 83 e0 ldi r24, 0x03 ; 3 33502: 80 93 94 12 sts 0x1294, r24 ; 0x801294 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33506: 82 e8 ldi r24, 0x82 ; 130 33508: 80 93 95 12 sts 0x1295, r24 ; 0x801295 3350c: d2 cd rjmp .-1116 ; 0x330b2 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 3350e: 80 91 95 12 lds r24, 0x1295 ; 0x801295 33512: 88 30 cpi r24, 0x08 ; 8 33514: 09 f4 brne .+2 ; 0x33518 33516: b7 c0 rjmp .+366 ; 0x33686 33518: a8 f4 brcc .+42 ; 0x33544 3351a: 84 30 cpi r24, 0x04 ; 4 3351c: d9 f0 breq .+54 ; 0x33554 3351e: 87 30 cpi r24, 0x07 ; 7 33520: 09 f4 brne .+2 ; 0x33524 33522: ae c0 rjmp .+348 ; 0x33680 return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); } StepStatus ProtocolLogic::HandleProtocolError() { uart->flush(); // clear the output buffer state = State::InitSequence; 33524: 81 e0 ldi r24, 0x01 ; 1 33526: 80 93 af 12 sts 0x12AF, r24 ; 0x8012af currentScope = Scope::DelayedRestart; 3352a: 82 e0 ldi r24, 0x02 ; 2 3352c: 80 93 94 12 sts 0x1294, r24 ; 0x801294 retries = maxRetries; SendVersion(0); } void ProtocolLogic::DelayedRestartRestart() { scopeState = ScopeState::RecoveringProtocolError; 33530: 83 e8 ldi r24, 0x83 ; 131 33532: 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); 33536: 65 e0 ldi r22, 0x05 ; 5 33538: 8f ec ldi r24, 0xCF ; 207 3353a: 9f e9 ldi r25, 0x9F ; 159 StepStatus ProtocolLogic::HandleCommunicationTimeout() { uart->flush(); // clear the output buffer protocol.ResetResponseDecoder(); Start(); return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout); 3353c: 0f 94 7e 56 call 0x2acfc ; 0x2acfc 33540: 18 2f mov r17, r24 33542: 50 c0 rjmp .+160 ; 0x335e4 } return Finished; } StepStatus ProtocolLogic::IdleStep() { switch (scopeState) { 33544: 8a 30 cpi r24, 0x0A ; 10 33546: 09 f4 brne .+2 ; 0x3354a 33548: a7 c0 rjmp .+334 ; 0x33698 3354a: 60 f3 brcs .-40 ; 0x33524 3354c: 8d 30 cpi r24, 0x0D ; 13 3354e: 08 f4 brcc .+2 ; 0x33552 33550: 5f cd rjmp .-1346 ; 0x33010 33552: e8 cf rjmp .-48 ; 0x33524 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) { 33554: 80 91 a7 12 lds r24, 0x12A7 ; 0x8012a7 33558: 8e 34 cpi r24, 0x4E ; 78 3355a: 60 f5 brcc .+88 ; 0x335b4 3355c: 8b 34 cpi r24, 0x4B ; 75 3355e: 10 f4 brcc .+4 ; 0x33564 33560: 85 34 cpi r24, 0x45 ; 69 33562: 01 f7 brne .-64 ; 0x33524 case RequestMsgCodes::Eject: case RequestMsgCodes::Load: case RequestMsgCodes::Mode: case RequestMsgCodes::Tool: case RequestMsgCodes::Unload: if (rsp.paramCode != ResponseMsgParamCodes::Finished) { 33564: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 33568: 86 34 cpi r24, 0x46 ; 70 3356a: 09 f4 brne .+2 ; 0x3356e 3356c: 73 c0 rjmp .+230 ; 0x33654 return true; } } StepStatus ProtocolLogic::SwitchFromIdleToCommand() { currentScope = Scope::Command; 3356e: 84 e0 ldi r24, 0x04 ; 4 33570: 80 93 94 12 sts 0x1294, r24 ; 0x801294 33574: 85 e0 ldi r24, 0x05 ; 5 33576: e7 ea ldi r30, 0xA7 ; 167 33578: f2 e1 ldi r31, 0x12 ; 18 3357a: de 01 movw r26, r28 3357c: 11 96 adiw r26, 0x01 ; 1 3357e: 01 90 ld r0, Z+ 33580: 0d 92 st X+, r0 33582: 8a 95 dec r24 33584: e1 f7 brne .-8 ; 0x3357e StepStatus StoppedStep() { return Processing; } StepStatus ProcessCommandQueryResponse(); inline void SetRequestMsg(RequestMsg msg) { rq = msg; 33586: 85 e0 ldi r24, 0x05 ; 5 33588: fe 01 movw r30, r28 3358a: 31 96 adiw r30, 0x01 ; 1 3358c: a7 e9 ldi r26, 0x97 ; 151 3358e: b2 e1 ldi r27, 0x12 ; 18 33590: 01 90 ld r0, Z+ 33592: 0d 92 st X+, r0 33594: 8a 95 dec r24 33596: e1 f7 brne .-8 ; 0x33590 default: return ProtocolError; } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); 33598: 0f 94 b5 96 call 0x32d6a ; 0x32d6a 3359c: 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) { 3359e: 85 30 cpi r24, 0x05 ; 5 335a0: 09 f2 breq .-126 ; 0x33524 335a2: 08 f0 brcs .+2 ; 0x335a6 335a4: 9c c0 rjmp .+312 ; 0x336de 335a6: 82 30 cpi r24, 0x02 ; 2 335a8: 09 f4 brne .+2 ; 0x335ac 335aa: 32 cd rjmp .-1436 ; 0x33010 335ac: 84 30 cpi r24, 0x04 ; 4 335ae: 09 f4 brne .+2 ; 0x335b2 335b0: 3b cf rjmp .-394 ; 0x33428 335b2: 18 c0 rjmp .+48 ; 0x335e4 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) { 335b4: 84 35 cpi r24, 0x54 ; 84 335b6: 08 f4 brcc .+2 ; 0x335ba 335b8: b5 cf rjmp .-150 ; 0x33524 335ba: 86 35 cpi r24, 0x56 ; 86 335bc: 98 f2 brcs .-90 ; 0x33564 335be: 88 35 cpi r24, 0x58 ; 88 335c0: 09 f0 breq .+2 ; 0x335c4 335c2: b0 cf rjmp .-160 ; 0x33524 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) { 335c4: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 335c8: 86 34 cpi r24, 0x46 ; 70 335ca: 89 f1 breq .+98 ; 0x3362e 335cc: 80 35 cpi r24, 0x50 ; 80 335ce: c1 f1 breq .+112 ; 0x33640 335d0: 82 34 cpi r24, 0x42 ; 66 335d2: 09 f0 breq .+2 ; 0x335d6 335d4: 42 c0 rjmp .+132 ; 0x3365a 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); 335d6: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 335da: 80 93 d5 12 sts 0x12D5, r24 ; 0x8012d5 StartReading8bitRegisters(); 335de: 0f 94 f5 94 call 0x329ea ; 0x329ea return ButtonPushed; 335e2: 1b e0 ldi r17, 0x0B ; 11 335e4: 80 91 92 12 lds r24, 0x1292 ; 0x801292 335e8: 90 91 93 12 lds r25, 0x1293 ; 0x801293 break; default: break; } // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; 335ec: 81 30 cpi r24, 0x01 ; 1 335ee: 91 05 cpc r25, r1 335f0: 09 f0 breq .+2 ; 0x335f4 335f2: ec c1 rjmp .+984 ; 0x339cc const StepStatus ss = logic.Step(); switch (ss) { 335f4: 12 30 cpi r17, 0x02 ; 2 335f6: 09 f4 brne .+2 ; 0x335fa 335f8: 90 c0 rjmp .+288 ; 0x3371a 335fa: 08 f0 brcs .+2 ; 0x335fe 335fc: 7d c0 rjmp .+250 ; 0x336f8 335fe: 11 23 and r17, r17 33600: 09 f4 brne .+2 ; 0x33604 33602: 16 c1 rjmp .+556 ; 0x33830 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 33604: 00 23 and r16, r16 33606: 09 f4 brne .+2 ; 0x3360a 33608: e2 c0 rjmp .+452 ; 0x337ce switch (ss) { 3360a: 17 30 cpi r17, 0x07 ; 7 3360c: 09 f4 brne .+2 ; 0x33610 3360e: c2 c1 rjmp .+900 ; 0x33994 33610: 08 f0 brcs .+2 ; 0x33614 33612: b6 c1 rjmp .+876 ; 0x33980 33614: 14 30 cpi r17, 0x04 ; 4 33616: 09 f4 brne .+2 ; 0x3361a 33618: c5 c1 rjmp .+906 ; 0x339a4 3361a: 15 30 cpi r17, 0x05 ; 5 3361c: 09 f0 breq .+2 ; 0x33620 3361e: d7 c0 rjmp .+430 ; 0x337ce state = xState::Connecting; ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); break; case ProtocolError: state = xState::Connecting; 33620: 82 e0 ldi r24, 0x02 ; 2 33622: 80 93 01 13 sts 0x1301, r24 ; 0x801301 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); 33626: 60 e0 ldi r22, 0x00 ; 0 33628: 8d e2 ldi r24, 0x2D ; 45 3362a: 90 e8 ldi r25, 0x80 ; 128 3362c: b8 c1 rjmp .+880 ; 0x3399e // 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) { 3362e: 80 91 97 12 lds r24, 0x1297 ; 0x801297 33632: 88 23 and r24, r24 33634: 29 f0 breq .+10 ; 0x33640 scopeState = ScopeState::CommandSent; SendMsg(rq); } void ProtocolLogic::IdleRestart() { scopeState = ScopeState::Ready; 33636: 82 e8 ldi r24, 0x82 ; 130 33638: 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; 3363c: 13 e0 ldi r17, 0x03 ; 3 3363e: d2 cf rjmp .-92 ; 0x335e4 } [[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); 33640: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 33644: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = ErrorCode::OK; 33648: 81 e0 ldi r24, 0x01 ; 1 3364a: 90 e0 ldi r25, 0x00 ; 0 3364c: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 33650: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 } } break; case ScopeState::QuerySent: return ProcessCommandQueryResponse(); case ScopeState::FilamentSensorStateSent: StartReading8bitRegisters(); 33654: 0f 94 f5 94 call 0x329ea ; 0x329ea 33658: 4b cd rjmp .-1386 ; 0x330f0 // 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; 3365a: 8c e0 ldi r24, 0x0C ; 12 3365c: 80 93 d4 12 sts 0x12D4, r24 ; 0x8012d4 errorCode = static_cast(rsp.paramValue); 33660: 80 91 ad 12 lds r24, 0x12AD ; 0x8012ad 33664: 90 91 ae 12 lds r25, 0x12AE ; 0x8012ae 33668: 90 93 d3 12 sts 0x12D3, r25 ; 0x8012d3 3366c: 80 93 d2 12 sts 0x12D2, r24 ; 0x8012d2 StartReading8bitRegisters(); // continue Idle state without restarting the communication 33670: 0f 94 f5 94 call 0x329ea ; 0x329ea // @@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")); 33674: 82 ef ldi r24, 0xF2 ; 242 33676: 9f e9 ldi r25, 0x9F ; 159 33678: 0f 94 0d 56 call 0x2ac1a ; 0x2ac1a 3367c: 17 e0 ldi r17, 0x07 ; 7 3367e: b2 cf rjmp .-156 ; 0x335e4 return ProtocolError; } StartReading8bitRegisters(); return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); 33680: 0f 94 19 95 call 0x32a32 ; 0x32a32 33684: 35 cd rjmp .-1430 ; 0x330f0 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Ready); 33686: 82 e8 ldi r24, 0x82 ; 130 33688: 0f 94 fd 94 call 0x329fa ; 0x329fa 3368c: 80 93 95 12 sts 0x1295, r24 ; 0x801295 return scopeState == ScopeState::Ready ? Finished : Processing; 33690: 82 38 cpi r24, 0x82 ; 130 33692: 09 f0 breq .+2 ; 0x33696 33694: 2d cd rjmp .-1446 ; 0x330f0 33696: bc cc rjmp .-1672 ; 0x33010 case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 33698: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 3369c: 81 34 cpi r24, 0x41 ; 65 3369e: d1 f6 brne .-76 ; 0x33654 // Button was accepted, decrement the retry. DecrementRetryAttempts(); 336a0: 0f 94 fb 55 call 0x2abf6 ; 0x2abf6 336a4: d7 cf rjmp .-82 ; 0x33654 return ProtocolError; } } StepStatus ProtocolLogic::CommandStep() { switch (scopeState) { 336a6: 88 30 cpi r24, 0x08 ; 8 336a8: b1 f0 breq .+44 ; 0x336d6 336aa: 50 f3 brcs .-44 ; 0x33680 336ac: 8a 30 cpi r24, 0x0A ; 10 336ae: 09 f0 breq .+2 ; 0x336b2 336b0: 39 cf rjmp .-398 ; 0x33524 return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); return Processing; case ScopeState::ButtonSent: if (rsp.paramCode == ResponseMsgParamCodes::Accepted) { 336b2: 80 91 ac 12 lds r24, 0x12AC ; 0x8012ac 336b6: 81 34 cpi r24, 0x41 ; 65 336b8: 09 f0 breq .+2 ; 0x336bc 336ba: 18 cd rjmp .-1488 ; 0x330ec // Button was accepted, decrement the retry. DecrementRetryAttempts(); 336bc: 0f 94 fb 55 call 0x2abf6 ; 0x2abf6 336c0: 15 cd rjmp .-1494 ; 0x330ec 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; 336c2: 10 92 d4 12 sts 0x12D4, r1 ; 0x8012d4 errorCode = ErrorCode::RUNNING; 336c6: 10 92 d3 12 sts 0x12D3, r1 ; 0x8012d3 336ca: 10 92 d2 12 sts 0x12D2, r1 ; 0x8012d2 scopeState = ScopeState::Wait; 336ce: 81 e8 ldi r24, 0x81 ; 129 return Processing; case ScopeState::Reading8bitRegisters: ProcessRead8bitRegister(); return Processing; case ScopeState::Reading16bitRegisters: scopeState = ProcessRead16bitRegister(ScopeState::Wait); 336d0: 80 93 95 12 sts 0x1295, r24 ; 0x801295 336d4: 0d cd rjmp .-1510 ; 0x330f0 336d6: 81 e8 ldi r24, 0x81 ; 129 336d8: 0f 94 fd 94 call 0x329fa ; 0x329fa 336dc: f9 cf rjmp .-14 ; 0x336d0 StepStatus ProtocolLogic::Step() { if (!ExpectsResponse()) { // if not waiting for a response, activate a planned request immediately ActivatePlannedRequest(); } auto currentStatus = ScopeStep(); switch (currentStatus) { 336de: 87 30 cpi r24, 0x07 ; 7 336e0: 49 f2 breq .-110 ; 0x33674 336e2: 08 f4 brcc .+2 ; 0x336e6 336e4: 63 ce rjmp .-826 ; 0x333ac 336e6: 88 30 cpi r24, 0x08 ; 8 336e8: 09 f4 brne .+2 ; 0x336ec 336ea: 78 ce rjmp .-784 ; 0x333dc 336ec: 7b cf rjmp .-266 ; 0x335e4 // 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()) { 336ee: 80 91 95 12 lds r24, 0x1295 ; 0x801295 336f2: 87 fd sbrc r24, 7 336f4: 9a cc rjmp .-1740 ; 0x3302a 336f6: fc cc rjmp .-1544 ; 0x330f0 StepStatus MMU2::LogicStep(bool reportErrors) { // Process any buttons before proceeding with another MMU Query CheckUserInput(); const StepStatus ss = logic.Step(); switch (ss) { 336f8: 13 30 cpi r17, 0x03 ; 3 336fa: 09 f4 brne .+2 ; 0x336fe 336fc: 68 c0 rjmp .+208 ; 0x337ce 336fe: 1b 30 cpi r17, 0x0B ; 11 33700: 09 f0 breq .+2 ; 0x33704 33702: 80 cf rjmp .-256 ; 0x33604 case Processing: OnMMUProgressMsg(logic.Progress()); break; case ButtonPushed: lastButton = logic.Button(); 33704: 80 91 d5 12 lds r24, 0x12D5 ; 0x8012d5 33708: 80 93 fc 12 sts 0x12FC, r24 ; 0x8012fc LogEchoEvent_P(PSTR("MMU Button pushed")); 3370c: 81 e1 ldi r24, 0x11 ; 17 3370e: 90 ea ldi r25, 0xA0 ; 160 33710: 0f 94 86 4e call 0x29d0c ; 0x29d0c CheckUserInput(); // Process the button immediately 33714: 0f 94 1f 97 call 0x32e3e ; 0x32e3e 33718: 5a c0 rjmp .+180 ; 0x337ce CheckErrorScreenUserInput(); } void MMU2::CheckFINDARunout() { // Check for FINDA filament runout if (!FindaDetectsFilament() && check_fsensor()) { // Check if we have filament runout detected from sensors 3371a: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 3371e: 81 11 cpse r24, r1 33720: 56 c0 rjmp .+172 ; 0x337ce 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() 33722: 0e 94 91 66 call 0xcd22 ; 0xcd22 && mcode_in_progress != 600 && !saved_printing && !mesh_bed_leveling_flag && !homing_flag && e_active(); 33726: 88 23 and r24, r24 33728: 09 f4 brne .+2 ; 0x3372c 3372a: 51 c0 rjmp .+162 ; 0x337ce } // Currently only used in one place, allowed to be inlined bool check_fsensor() { return printJobOngoing() && mcode_in_progress != 600 3372c: 80 91 40 0d lds r24, 0x0D40 ; 0x800d40 <_ZL17mcode_in_progress.lto_priv.486> 33730: 90 91 41 0d lds r25, 0x0D41 ; 0x800d41 <_ZL17mcode_in_progress.lto_priv.486+0x1> 33734: 88 35 cpi r24, 0x58 ; 88 33736: 92 40 sbci r25, 0x02 ; 2 33738: 09 f4 brne .+2 ; 0x3373c 3373a: 49 c0 rjmp .+146 ; 0x337ce && !saved_printing 3373c: 80 91 73 12 lds r24, 0x1273 ; 0x801273 33740: 81 11 cpse r24, r1 33742: 45 c0 rjmp .+138 ; 0x337ce && !mesh_bed_leveling_flag 33744: 80 91 72 12 lds r24, 0x1272 ; 0x801272 33748: 81 11 cpse r24, r1 3374a: 41 c0 rjmp .+130 ; 0x337ce && !homing_flag 3374c: 80 91 71 12 lds r24, 0x1271 ; 0x801271 33750: 81 11 cpse r24, r1 33752: 3d c0 rjmp .+122 ; 0x337ce bool e_active() { unsigned char e_active = 0; block_t *block; if(block_buffer_tail != block_buffer_head) 33754: 90 91 3f 0d lds r25, 0x0D3F ; 0x800d3f 33758: 80 91 3e 0d lds r24, 0x0D3E ; 0x800d3e 3375c: 98 17 cp r25, r24 3375e: b9 f1 breq .+110 ; 0x337ce { uint8_t block_index = block_buffer_tail; 33760: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f } #endif bool e_active() { unsigned char e_active = 0; 33764: 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++; 33766: 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) 33768: 30 91 3e 0d lds r19, 0x0D3E ; 0x800d3e 3376c: 38 17 cp r19, r24 3376e: 89 f0 breq .+34 ; 0x33792 { block = &block_buffer[block_index]; if(block->steps[E_AXIS].wide != 0) e_active++; 33770: 28 9f mul r18, r24 33772: f0 01 movw r30, r0 33774: 11 24 eor r1, r1 33776: e2 5a subi r30, 0xA2 ; 162 33778: f9 4f sbci r31, 0xF9 ; 249 3377a: 44 85 ldd r20, Z+12 ; 0x0c 3377c: 55 85 ldd r21, Z+13 ; 0x0d 3377e: 66 85 ldd r22, Z+14 ; 0x0e 33780: 77 85 ldd r23, Z+15 ; 0x0f 33782: 45 2b or r20, r21 33784: 46 2b or r20, r22 33786: 47 2b or r20, r23 33788: 09 f0 breq .+2 ; 0x3378c 3378a: 9f 5f subi r25, 0xFF ; 255 block_index = (block_index+1) & (BLOCK_BUFFER_SIZE - 1); 3378c: 8f 5f subi r24, 0xFF ; 255 3378e: 8f 70 andi r24, 0x0F ; 15 33790: eb cf rjmp .-42 ; 0x33768 && e_active(); 33792: 99 23 and r25, r25 33794: e1 f0 breq .+56 ; 0x337ce SERIAL_ECHOLNPGM("FINDA filament runout!"); 33796: 82 ea ldi r24, 0xA2 ; 162 33798: 9f e9 ldi r25, 0x9F ; 159 3379a: 0e 94 0e 7d call 0xfa1c ; 0xfa1c 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); 3379e: 60 e0 ldi r22, 0x00 ; 0 337a0: 70 e0 ldi r23, 0x00 ; 0 337a2: cb 01 movw r24, r22 337a4: 0f 94 a4 65 call 0x2cb48 ; 0x2cb48 marlin_stop_and_save_print_to_ram(); restore_print_from_ram_and_continue(0); 337a8: 60 e0 ldi r22, 0x00 ; 0 337aa: 70 e0 ldi r23, 0x00 ; 0 337ac: cb 01 movw r24, r22 337ae: 0e 94 09 67 call 0xce12 ; 0xce12 } } bool SpoolJoin::isSpoolJoinEnabled() { if(eeprom_read_byte((uint8_t*)EEPROM_SPOOL_JOIN) == (uint8_t)EEPROM::Enabled) { 337b2: 86 ed ldi r24, 0xD6 ; 214 337b4: 9e e0 ldi r25, 0x0E ; 14 337b6: 0f 94 81 a4 call 0x34902 ; 0x34902 337ba: 81 30 cpi r24, 0x01 ; 1 337bc: 21 f4 brne .+8 ; 0x337c6 if (SpoolJoin::spooljoin.isSpoolJoinEnabled() && get_current_tool() != (uint8_t)FILAMENT_UNKNOWN){ // Can't auto if F=? 337be: 0f 94 45 65 call 0x2ca8a ; 0x2ca8a 337c2: 8f 3f cpi r24, 0xFF ; 255 337c4: 91 f5 brne .+100 ; 0x3382a enquecommand_front_P(PSTR("M600 AUTO")); // save print and run M600 command } else { enquecommand_front_P(MSG_M600); // save print and run M600 command 337c6: 82 e0 ldi r24, 0x02 ; 2 337c8: 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 337ca: 0f 94 16 67 call 0x2ce2c ; 0x2ce2c break; } } } if (logic.Running()) { 337ce: 80 91 af 12 lds r24, 0x12AF ; 0x8012af 337d2: 82 30 cpi r24, 0x02 ; 2 337d4: 19 f4 brne .+6 ; 0x337dc state = xState::Active; 337d6: 81 e0 ldi r24, 0x01 ; 1 337d8: 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 337dc: 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) { 337e0: 80 91 5c 06 lds r24, 0x065C ; 0x80065c <_ZN4MMU2L27is_mmu_error_monitor_activeE.lto_priv.445> 337e4: 88 23 and r24, r24 337e6: 51 f0 breq .+20 ; 0x337fc bool TuneMenuEntered() { return putErrorScreenToSleep; } void ReportErrorHook(CommandInProgress /*cip*/, ErrorCode ec, uint8_t /*es*/) { if (putErrorScreenToSleep) return; 337e8: 80 91 43 0d lds r24, 0x0D43 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.449> 337ec: 81 11 cpse r24, r1 337ee: 06 c0 rjmp .+12 ; 0x337fc 337f0: 80 91 f9 12 lds r24, 0x12F9 ; 0x8012f9 337f4: 90 91 fa 12 lds r25, 0x12FA ; 0x8012fa 337f8: 0f 94 ee 4f call 0x29fdc ; 0x29fdc CheckErrorScreenUserInput(); } 337fc: a0 96 adiw r28, 0x20 ; 32 337fe: 0f b6 in r0, 0x3f ; 63 33800: f8 94 cli 33802: de bf out 0x3e, r29 ; 62 33804: 0f be out 0x3f, r0 ; 63 33806: cd bf out 0x3d, r28 ; 61 33808: df 91 pop r29 3380a: cf 91 pop r28 3380c: 1f 91 pop r17 3380e: 0f 91 pop r16 33810: ff 90 pop r15 33812: ef 90 pop r14 33814: df 90 pop r13 33816: cf 90 pop r12 33818: bf 90 pop r11 3381a: af 90 pop r10 3381c: 9f 90 pop r9 3381e: 8f 90 pop r8 33820: 7f 90 pop r7 33822: 6f 90 pop r6 33824: 5f 90 pop r5 33826: 4f 90 pop r4 33828: 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 3382a: 88 e9 ldi r24, 0x98 ; 152 3382c: 9f e9 ldi r25, 0x9F ; 159 3382e: cd cf rjmp .-102 ; 0x337ca 33830: 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) { 33834: 80 91 f8 12 lds r24, 0x12F8 ; 0x8012f8 33838: 08 17 cp r16, r24 3383a: 09 f4 brne .+2 ; 0x3383e 3383c: 49 c0 rjmp .+146 ; 0x338d0 // special handling of explicit printer errors return IsPrinterError() ? StepStatus::PrinterError : currentStatus; } uint8_t ProtocolLogic::CommandInProgress() const { if (currentScope != Scope::Command) { 3383e: 80 91 94 12 lds r24, 0x1294 ; 0x801294 33842: 84 30 cpi r24, 0x04 ; 4 33844: b9 f4 brne .+46 ; 0x33874 break; } } void ReportProgressHook(CommandInProgress cip, ProgressCode ec) { if (cip != CommandInProgress::NoCommand) { 33846: 80 91 97 12 lds r24, 0x1297 ; 0x801297 3384a: 88 23 and r24, r24 3384c: 99 f0 breq .+38 ; 0x33874 custom_message_type = CustomMsg::MMUProgress; 3384e: 89 e0 ldi r24, 0x09 ; 9 33850: 80 93 5d 06 sts 0x065D, r24 ; 0x80065d : static_cast(pgm_read_ptr(&progressTexts[0])); 33854: ee e5 ldi r30, 0x5E ; 94 33856: 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])) 33858: 0e 31 cpi r16, 0x1E ; 30 3385a: 30 f4 brcc .+12 ; 0x33868 3385c: e0 2f mov r30, r16 3385e: f0 e0 ldi r31, 0x00 ; 0 33860: ee 0f add r30, r30 33862: ff 1f adc r31, r31 33864: e2 5a subi r30, 0xA2 ; 162 33866: f0 46 sbci r31, 0x60 ; 96 : static_cast(pgm_read_ptr(&progressTexts[0])); 33868: 85 91 lpm r24, Z+ 3386a: 94 91 lpm r25, Z lcd_setstatuspgm( _T(ProgressCodeToText(ec)) ); 3386c: 0e 94 8b 75 call 0xeb16 ; 0xeb16 33870: 0e 94 7c dc call 0x1b8f8 ; 0x1b8f8 33874: ee e5 ldi r30, 0x5E ; 94 33876: 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])) 33878: 0e 31 cpi r16, 0x1E ; 30 3387a: 30 f4 brcc .+12 ; 0x33888 3387c: e0 2f mov r30, r16 3387e: f0 e0 ldi r31, 0x00 ; 0 33880: ee 0f add r30, r30 33882: ff 1f adc r31, r31 33884: e2 5a subi r30, 0xA2 ; 162 33886: f0 46 sbci r31, 0x60 ; 96 : static_cast(pgm_read_ptr(&progressTexts[0])); 33888: 85 91 lpm r24, Z+ 3388a: 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))); 3388c: 02 96 adiw r24, 0x02 ; 2 3388e: 0f 94 86 4e call 0x29d0c ; 0x29d0c } } void MMU2::OnMMUProgressMsgChanged(ProgressCode pc) { ReportProgress(pc); lastProgressCode = pc; 33892: 00 93 f8 12 sts 0x12F8, r16 ; 0x8012f8 switch (pc) { 33896: 03 30 cpi r16, 0x03 ; 3 33898: 49 f0 breq .+18 ; 0x338ac 3389a: 0c 31 cpi r16, 0x1C ; 28 3389c: 09 f0 breq .+2 ; 0x338a0 3389e: 97 cf rjmp .-210 ; 0x337ce bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 338a0: 0f 94 94 18 call 0x23128 ; 0x23128 } break; case ProgressCode::FeedingToFSensor: // prepare for the movement of the E-motor planner_synchronize(); loadFilamentStarted = true; 338a4: 81 e0 ldi r24, 0x01 ; 1 338a6: 80 93 03 13 sts 0x1303, r24 ; 0x801303 338aa: 91 cf rjmp .-222 ; 0x337ce 338ac: 80 91 94 12 lds r24, 0x1294 ; 0x801294 338b0: 84 30 cpi r24, 0x04 ; 4 338b2: 31 f4 brne .+12 ; 0x338c0 ReportProgress(pc); lastProgressCode = pc; switch (pc) { case ProgressCode::UnloadingToFinda: if ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::UnloadFilament || ((CommandInProgress)logic.CommandInProgress() == CommandInProgress::ToolChange)) { 338b4: 80 91 97 12 lds r24, 0x1297 ; 0x801297 338b8: 84 55 subi r24, 0x54 ; 84 338ba: 82 30 cpi r24, 0x02 ; 2 338bc: 08 f4 brcc .+2 ; 0x338c0 338be: 87 cf rjmp .-242 ; 0x337ce 338c0: 0f 94 94 18 call 0x23128 ; 0x23128 // 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; 338c4: 81 e0 ldi r24, 0x01 ; 1 338c6: 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(); 338ca: 0f 94 a6 5a call 0x2b54c ; 0x2b54c 338ce: 7f cf rjmp .-258 ; 0x337ce 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) { 338d0: 03 30 cpi r16, 0x03 ; 3 338d2: 71 f1 breq .+92 ; 0x33930 338d4: 0c 31 cpi r16, 0x1C ; 28 338d6: 09 f0 breq .+2 ; 0x338da 338d8: 7a cf rjmp .-268 ; 0x337ce unloadFilamentStarted = false; } } break; case ProgressCode::FeedingToFSensor: if (loadFilamentStarted) { 338da: 80 91 03 13 lds r24, 0x1303 ; 0x801303 338de: 88 23 and r24, r24 338e0: 09 f4 brne .+2 ; 0x338e4 338e2: 75 cf rjmp .-278 ; 0x337ce switch (WhereIsFilament()) { 338e4: 0f 94 96 4e call 0x29d2c ; 0x29d2c 338e8: 88 23 and r24, r24 338ea: b1 f1 breq .+108 ; 0x33958 338ec: 81 30 cpi r24, 0x01 ; 1 338ee: 09 f0 breq .+2 ; 0x338f2 338f0: 6e cf rjmp .-292 ; 0x337ce case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; 338f2: 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(); 338f6: 0f 94 87 4c call 0x2990e ; 0x2990e // 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; 338fa: 10 92 42 0d sts 0x0D42, r1 ; 0x800d42 planner_abort_queued_moves(); { extruder_move(logic.ExtraLoadDistance() + 2, logic.PulleySlowFeedRate()); 338fe: 60 91 df 12 lds r22, 0x12DF ; 0x8012df 33902: 70 e0 ldi r23, 0x00 ; 0 33904: 90 e0 ldi r25, 0x00 ; 0 33906: 80 e0 ldi r24, 0x00 ; 0 33908: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 3390c: 6b 01 movw r12, r22 3390e: 7c 01 movw r14, r24 33910: 60 91 de 12 lds r22, 0x12DE ; 0x8012de 33914: 70 e0 ldi r23, 0x00 ; 0 33916: 6e 5f subi r22, 0xFE ; 254 33918: 7f 4f sbci r23, 0xFF ; 255 3391a: 07 2e mov r0, r23 3391c: 00 0c add r0, r0 3391e: 88 0b sbc r24, r24 33920: 99 0b sbc r25, r25 33922: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 33926: a7 01 movw r20, r14 33928: 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()); 3392a: 0f 94 62 4e call 0x29cc4 ; 0x29cc4 3392e: 4f cf rjmp .-354 ; 0x337ce } 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 33930: 80 91 04 13 lds r24, 0x1304 ; 0x801304 33934: 88 23 and r24, r24 33936: 09 f4 brne .+2 ; 0x3393a 33938: 4a cf rjmp .-364 ; 0x337ce 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); 3393a: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 3393e: 80 91 3f 0d lds r24, 0x0D3F ; 0x800d3f 33942: 98 13 cpse r25, r24 33944: 44 cf rjmp .-376 ; 0x337ce switch (WhereIsFilament()) { 33946: 0f 94 96 4e call 0x29d2c ; 0x29d2c 3394a: 81 50 subi r24, 0x01 ; 1 3394c: 83 30 cpi r24, 0x03 ; 3 3394e: 08 f4 brcc .+2 ; 0x33952 33950: bc cf rjmp .-136 ; 0x338ca 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; 33952: 10 92 04 13 sts 0x1304, r1 ; 0x801304 33956: 3b cf rjmp .-394 ; 0x337ce 33958: 90 91 3e 0d lds r25, 0x0D3E ; 0x800d3e 3395c: 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 33960: 98 13 cpse r25, r24 33962: 35 cf rjmp .-406 ; 0x337ce // 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()); 33964: 60 91 df 12 lds r22, 0x12DF ; 0x8012df 33968: 70 e0 ldi r23, 0x00 ; 0 3396a: 90 e0 ldi r25, 0x00 ; 0 3396c: 80 e0 ldi r24, 0x00 ; 0 3396e: 0f 94 0d 9f call 0x33e1a ; 0x33e1a <__floatunsisf> 33972: 9b 01 movw r18, r22 33974: ac 01 movw r20, r24 33976: 60 e0 ldi r22, 0x00 ; 0 33978: 70 e0 ldi r23, 0x00 ; 0 3397a: 8f ea ldi r24, 0xAF ; 175 3397c: 93 e4 ldi r25, 0x43 ; 67 3397e: d5 cf rjmp .-86 ; 0x3392a // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { switch (ss) { 33980: 18 30 cpi r17, 0x08 ; 8 33982: b9 f0 breq .+46 ; 0x339b2 33984: 19 30 cpi r17, 0x09 ; 9 33986: 09 f0 breq .+2 ; 0x3398a 33988: 22 cf rjmp .-444 ; 0x337ce StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); break; case PrinterError: ReportError(logic.PrinterError(), ErrorSourcePrinter); 3398a: 60 e0 ldi r22, 0x00 ; 0 3398c: 0f 94 35 75 call 0x2ea6a ; 0x2ea6a 33990: 19 e0 ldi r17, 0x09 ; 9 33992: 1d cf rjmp .-454 ; 0x337ce default: if (reportErrors) { switch (ss) { case CommandError: ReportError(logic.Error(), ErrorSourceMMU); 33994: 61 e0 ldi r22, 0x01 ; 1 33996: 80 91 d2 12 lds r24, 0x12D2 ; 0x8012d2 3399a: 90 91 d3 12 lds r25, 0x12D3 ; 0x8012d3 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 3399e: 0f 94 35 75 call 0x2ea6a ; 0x2ea6a 339a2: 15 cf rjmp .-470 ; 0x337ce case CommandError: ReportError(logic.Error(), ErrorSourceMMU); break; case CommunicationTimeout: state = xState::Connecting; 339a4: 82 e0 ldi r24, 0x02 ; 2 339a6: 80 93 01 13 sts 0x1301, r24 ; 0x801301 ReportError(ErrorCode::MMU_NOT_RESPONDING, ErrorSourcePrinter); 339aa: 60 e0 ldi r22, 0x00 ; 0 339ac: 8e e2 ldi r24, 0x2E ; 46 339ae: 90 e8 ldi r25, 0x80 ; 128 339b0: f6 cf rjmp .-20 ; 0x3399e StopKeepPowered(); PowerOff(); } void MMU2::StopKeepPowered() { state = xState::Stopped; 339b2: 10 92 01 13 sts 0x1301, r1 ; 0x801301 protocol.ResetResponseDecoder(); // important - finished delayed restart relies on this StartSeqRestart(); } void ProtocolLogic::Stop() { state = State::Stopped; 339b6: 10 92 af 12 sts 0x12AF, r1 ; 0x8012af currentScope = Scope::Stopped; 339ba: 10 92 94 12 sts 0x1294, r1 ; 0x801294 ReportError(ErrorCode::PROTOCOL_ERROR, ErrorSourcePrinter); break; case VersionMismatch: StopKeepPowered(); ReportError(ErrorCode::VERSION_MISMATCH, ErrorSourcePrinter); 339be: 60 e0 ldi r22, 0x00 ; 0 339c0: 8c e2 ldi r24, 0x2C ; 44 339c2: 90 e8 ldi r25, 0x80 ; 128 339c4: ec cf rjmp .-40 ; 0x3399e break; } } [[fallthrough]]; // otherwise default: RecordUARTActivity(); // something has happened on the UART, update the timeout record 339c6: 0f 94 f0 55 call 0x2abe0 ; 0x2abe0 339ca: ac cd rjmp .-1192 ; 0x33524 case Interrupted: // can be silently handed over to a higher layer, no processing necessary at this spot break; default: if (reportErrors) { 339cc: 00 23 and r16, r16 339ce: 01 f3 breq .-64 ; 0x33990 339d0: dc cf rjmp .-72 ; 0x3398a 000339d2 : } } } void MMU2::ResumeHotendTemp() { if ((mmu_print_saved & SavedState::CooldownPending)) { 339d2: 80 91 02 13 lds r24, 0x1302 ; 0x801302 339d6: 82 ff sbrs r24, 2 339d8: 07 c0 rjmp .+14 ; 0x339e8 // Clear the "pending" flag if we haven't cooled yet. mmu_print_saved &= ~(SavedState::CooldownPending); 339da: 8b 7f andi r24, 0xFB ; 251 339dc: 80 93 02 13 sts 0x1302, r24 ; 0x801302 LogEchoEvent_P(PSTR("Cooldown flag cleared")); 339e0: 8f ef ldi r24, 0xFF ; 255 339e2: 90 ea ldi r25, 0xA0 ; 160 339e4: 0f 94 86 4e call 0x29d0c ; 0x29d0c } if ((mmu_print_saved & SavedState::Cooldown) && resume_hotend_temp) { 339e8: 80 91 02 13 lds r24, 0x1302 ; 0x801302 339ec: 81 ff sbrs r24, 1 339ee: 52 c0 rjmp .+164 ; 0x33a94 339f0: 80 91 f6 12 lds r24, 0x12F6 ; 0x8012f6 339f4: 90 91 f7 12 lds r25, 0x12F7 ; 0x8012f7 339f8: 89 2b or r24, r25 339fa: 09 f4 brne .+2 ; 0x339fe 339fc: 4b c0 rjmp .+150 ; 0x33a94 LogEchoEvent_P(PSTR("Resuming Temp")); 339fe: 81 ef ldi r24, 0xF1 ; 241 33a00: 90 ea ldi r25, 0xA0 ; 160 33a02: 0f 94 86 4e call 0x29d0c ; 0x29d0c // @@TODO MMU2_ECHO_MSGRPGM(PSTR("Restoring hotend temperature ")); SERIAL_ECHOLN(resume_hotend_temp); 33a06: 80 91 f6 12 lds r24, 0x12F6 ; 0x8012f6 33a0a: 90 91 f7 12 lds r25, 0x12F7 ; 0x8012f7 33a0e: 0f 94 5d 65 call 0x2caba ; 0x2caba mmu_print_saved &= ~(SavedState::Cooldown); 33a12: 80 91 02 13 lds r24, 0x1302 ; 0x801302 33a16: 8d 7f andi r24, 0xFD ; 253 33a18: 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; 33a1c: 80 91 f6 12 lds r24, 0x12F6 ; 0x8012f6 33a20: 90 91 f7 12 lds r25, 0x12F7 ; 0x8012f7 33a24: 90 93 5e 12 sts 0x125E, r25 ; 0x80125e 33a28: 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)); 33a2c: 82 ec ldi r24, 0xC2 ; 194 33a2e: 92 e6 ldi r25, 0x62 ; 98 33a30: 0e 94 8b 75 call 0xeb16 ; 0xeb16 33a34: 0e 94 91 de call 0x1bd22 ; 0x1bd22 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)); 33a38: 41 ec ldi r20, 0xC1 ; 193 33a3a: 50 ea ldi r21, 0xA0 ; 160 33a3c: 62 e0 ldi r22, 0x02 ; 2 33a3e: 80 e0 ldi r24, 0x00 ; 0 33a40: 0e 94 58 70 call 0xe0b0 ; 0xe0b0 int16_t thermal_degTargetHotend() { return degTargetHotend(0); } int16_t thermal_degHotend() { return degHotend(0); 33a44: 60 91 5a 0d lds r22, 0x0D5A ; 0x800d5a 33a48: 70 91 5b 0d lds r23, 0x0D5B ; 0x800d5b 33a4c: 80 91 5c 0d lds r24, 0x0D5C ; 0x800d5c 33a50: 90 91 5d 0d lds r25, 0x0D5D ; 0x800d5d 33a54: 0f 94 1a a7 call 0x34e34 ; 0x34e34 <__fixsfsi> namespace MMU2 { template void waitForHotendTargetTemp(uint16_t delay, F f) { while (((thermal_degTargetHotend() - thermal_degHotend()) > 5)) { 33a58: 20 91 5d 12 lds r18, 0x125D ; 0x80125d 33a5c: 30 91 5e 12 lds r19, 0x125E ; 0x80125e 33a60: c9 01 movw r24, r18 33a62: 86 1b sub r24, r22 33a64: 97 0b sbc r25, r23 33a66: 06 97 sbiw r24, 0x06 ; 6 33a68: 6c f0 brlt .+26 ; 0x33a84 void marlin_manage_heater() { manage_heater(); } void marlin_manage_inactivity(bool ignore_stepper_queue) { manage_inactivity(ignore_stepper_queue); 33a6a: 81 e0 ldi r24, 0x01 ; 1 33a6c: 0e 94 ad 8a call 0x1155a ; 0x1155a 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); 33a70: 80 e0 ldi r24, 0x00 ; 0 33a72: 0f 94 d9 97 call 0x32fb2 ; 0x32fb2 ReportErrorHookDynamicRender(); 33a76: 0f 94 bc 4d call 0x29b78 ; 0x29b78 void thermal_setTargetHotend(int16_t t) { setTargetHotend(t); } void safe_delay_keep_alive(uint16_t t) { delay_keep_alive(t); 33a7a: 84 e6 ldi r24, 0x64 ; 100 33a7c: 90 e0 ldi r25, 0x00 ; 0 33a7e: 0e 94 07 8d call 0x11a0e ; 0x11a0e 33a82: e0 cf rjmp .-64 ; 0x33a44 }); ScreenUpdateEnable(); // temporary hack to stop this locking the printer... 33a84: 0f 94 92 4d call 0x29b24 ; 0x29b24 LogEchoEvent_P(PSTR("Hotend temperature reached")); 33a88: 86 ed ldi r24, 0xD6 ; 214 33a8a: 90 ea ldi r25, 0xA0 ; 160 33a8c: 0f 94 86 4e call 0x29d0c ; 0x29d0c void ScreenUpdateEnable(){ lcd_update_enable(true); } void ScreenClear(){ lcd_clear(); 33a90: 0c 94 77 70 jmp 0xe0ee ; 0xe0ee ScreenClear(); } } 33a94: 08 95 ret 00033a96 : /// 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) { 33a96: 0f 93 push r16 33a98: 1f 93 push r17 33a9a: cf 93 push r28 33a9c: df 93 push r29 33a9e: 00 d0 rcall .+0 ; 0x33aa0 33aa0: 1f 92 push r1 33aa2: 1f 92 push r1 33aa4: cd b7 in r28, 0x3d ; 61 33aa6: de b7 in r29, 0x3e ; 62 33aa8: 18 2f mov r17, r24 33aaa: 06 2f mov r16, r22 mmu_print_saved = SavedState::None; 33aac: 10 92 02 13 sts 0x1302, r1 ; 0x801302 MARLIN_KEEPALIVE_STATE_IN_PROCESS; 33ab0: 83 e0 ldi r24, 0x03 ; 3 33ab2: 80 93 78 02 sts 0x0278, r24 ; 0x800278 LongTimer nozzleTimeout; 33ab6: 19 82 std Y+1, r1 ; 0x01 33ab8: 1a 82 std Y+2, r1 ; 0x02 33aba: 1b 82 std Y+3, r1 ; 0x03 33abc: 1c 82 std Y+4, r1 ; 0x04 33abe: 1d 82 std Y+5, r1 ; 0x05 33ac0: 90 e0 ldi r25, 0x00 ; 0 33ac2: 80 e0 ldi r24, 0x00 ; 0 33ac4: 0e 94 07 8d call 0x11a0e ; 0x11a0e // - 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) { 33ac8: 90 91 02 13 lds r25, 0x1302 ; 0x801302 33acc: 89 81 ldd r24, Y+1 ; 0x01 33ace: 92 ff sbrs r25, 2 33ad0: 37 c0 rjmp .+110 ; 0x33b40 if (!nozzleTimeout.running()) { 33ad2: 81 11 cpse r24, r1 33ad4: 1e c0 rjmp .+60 ; 0x33b12 nozzleTimeout.start(); 33ad6: ce 01 movw r24, r28 33ad8: 01 96 adiw r24, 0x01 ; 1 33ada: 0f 94 e0 0d call 0x21bc0 ; 0x21bc0 ::start()> LogEchoEvent_P(PSTR("Cooling Timeout started")); 33ade: 83 ed ldi r24, 0xD3 ; 211 33ae0: 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")); 33ae2: 0f 94 86 4e call 0x29d0c ; 0x29d0c } switch (logicStepLastStatus) { 33ae6: e0 91 00 13 lds r30, 0x1300 ; 0x801300 33aea: e2 50 subi r30, 0x02 ; 2 33aec: ea 30 cpi r30, 0x0A ; 10 33aee: 40 f7 brcc .-48 ; 0x33ac0 33af0: f0 e0 ldi r31, 0x00 ; 0 33af2: 88 27 eor r24, r24 33af4: e1 58 subi r30, 0x81 ; 129 33af6: f2 46 sbci r31, 0x62 ; 98 33af8: 8e 4f sbci r24, 0xFE ; 254 33afa: 0d 94 91 a5 jmp 0x34b22 ; 0x34b22 <__tablejump2__> 33afe: 14 37 cpi r17, 0x74 ; 116 33b00: 84 38 cpi r24, 0x84 ; 132 33b02: f2 37 cpi r31, 0x72 ; 114 33b04: f2 37 cpi r31, 0x72 ; 114 33b06: 6e 38 cpi r22, 0x8E ; 142 33b08: f2 37 cpi r31, 0x72 ; 114 33b0a: 3e 37 cpi r19, 0x7E ; 126 33b0c: fc 38 cpi r31, 0x8C ; 140 33b0e: ba 38 cpi r27, 0x8A ; 138 33b10: f2 37 cpi r31, 0x72 ; 114 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. 33b12: 40 e4 ldi r20, 0x40 ; 64 33b14: 57 e7 ldi r21, 0x77 ; 119 33b16: 6b e1 ldi r22, 0x1B ; 27 33b18: 70 e0 ldi r23, 0x00 ; 0 33b1a: ce 01 movw r24, r28 33b1c: 01 96 adiw r24, 0x01 ; 1 33b1e: 0f 94 21 0c call 0x21842 ; 0x21842 ::expired(unsigned long)> 33b22: 88 23 and r24, r24 33b24: 01 f3 breq .-64 ; 0x33ae6 mmu_print_saved &= ~(SavedState::CooldownPending); 33b26: 80 91 02 13 lds r24, 0x1302 ; 0x801302 33b2a: 8b 7f andi r24, 0xFB ; 251 mmu_print_saved |= SavedState::Cooldown; 33b2c: 82 60 ori r24, 0x02 ; 2 33b2e: 80 93 02 13 sts 0x1302, r24 ; 0x801302 33b32: 10 92 5e 12 sts 0x125E, r1 ; 0x80125e 33b36: 10 92 5d 12 sts 0x125D, r1 ; 0x80125d thermal_setTargetHotend(0); LogEchoEvent_P(PSTR("Heater cooldown")); 33b3a: 83 ec ldi r24, 0xC3 ; 195 33b3c: 9e e9 ldi r25, 0x9E ; 158 33b3e: d1 cf rjmp .-94 ; 0x33ae2 } } else if (nozzleTimeout.running()) { 33b40: 88 23 and r24, r24 33b42: 89 f2 breq .-94 ; 0x33ae6 33b44: 19 82 std Y+1, r1 ; 0x01 nozzleTimeout.stop(); LogEchoEvent_P(PSTR("Cooling timer stopped")); 33b46: 8d ea ldi r24, 0xAD ; 173 33b48: 9e e9 ldi r25, 0x9E ; 158 33b4a: cb cf rjmp .-106 ; 0x33ae2 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(); 33b4c: 0f 94 e9 9c call 0x339d2 ; 0x339d2 ResumeUnpark(); // We can now travel back to the tower or wherever we were when we saved. 33b50: 0f 94 cc 5a call 0x2b598 ; 0x2b598 if (!TuneMenuEntered()) { 33b54: 80 91 43 0d lds r24, 0x0D43 ; 0x800d43 <_ZN4MMU2L21putErrorScreenToSleepE.lto_priv.449> 33b58: 81 11 cpse r24, r1 33b5a: 07 c0 rjmp .+14 ; 0x33b6a retryAttempts--; } } void ProtocolLogic::ResetRetryAttempts() { SERIAL_ECHOLNPGM("ResetRetryAttempts"); 33b5c: 8e ea ldi r24, 0xAE ; 174 33b5e: 90 ea ldi r25, 0xA0 ; 160 33b60: 0e 94 0e 7d call 0xfa1c ; 0xfa1c retryAttempts = MAX_RETRIES; 33b64: 83 e0 ldi r24, 0x03 ; 3 33b66: 80 93 e6 12 sts 0x12E6, r24 ; 0x8012e6 bool planner_draining() { return planner_aborted; } void planner_synchronize() { st_synchronize(); 33b6a: 0f 94 94 18 call 0x23128 ; 0x23128 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; 33b6e: 81 e0 ldi r24, 0x01 ; 1 case Processing: // wait for the MMU to respond default: break; } } } 33b70: 0f 90 pop r0 33b72: 0f 90 pop r0 33b74: 0f 90 pop r0 33b76: 0f 90 pop r0 33b78: 0f 90 pop r0 33b7a: df 91 pop r29 33b7c: cf 91 pop r28 33b7e: 1f 91 pop r17 33b80: 0f 91 pop r16 33b82: 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(); 33b84: 0f 94 1f 97 call 0x32e3e ; 0x32e3e 33b88: f2 cf rjmp .-28 ; 0x33b6e break; case CommandError: case CommunicationTimeout: case ProtocolError: case ButtonPushed: if (!logic.InAutoRetry()) { 33b8a: 80 91 e7 12 lds r24, 0x12E7 ; 0x8012e7 33b8e: 81 11 cpse r24, r1 33b90: 97 cf rjmp .-210 ; 0x33ac0 // Don't proceed to the park/save if we are doing an autoretry. SaveAndPark(move_axes); 33b92: 81 2f mov r24, r17 33b94: 0f 94 16 5b call 0x2b62c ; 0x2b62c SaveHotendTemp(turn_off_nozzle); 33b98: 80 2f mov r24, r16 33b9a: 0f 94 b0 5a call 0x2b560 ; 0x2b560 CheckUserInput(); 33b9e: 0f 94 1f 97 call 0x32e3e ; 0x32e3e 33ba2: 8e cf rjmp .-228 ; 0x33ac0 } 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(); 33ba4: 0f 94 e9 9c call 0x339d2 ; 0x339d2 ResumeUnpark(); 33ba8: 0f 94 cc 5a call 0x2b598 ; 0x2b598 33bac: 89 cf rjmp .-238 ; 0x33ac0 } planner_synchronize(); return true; case Interrupted: // now what :D ... big bad ... ramming, unload, retry the whole command originally issued return false; 33bae: 80 e0 ldi r24, 0x00 ; 0 33bb0: df cf rjmp .-66 ; 0x33b70 00033bb2 : } // true, true); -- Comment: how is it possible for a filament type set to fail? return true; } void MMU2::UnloadInner() { 33bb2: cf 93 push r28 33bb4: df 93 push r29 33bb6: 00 d0 rcall .+0 ; 0x33bb8 33bb8: 1f 92 push r1 33bba: 1f 92 push r1 33bbc: cd b7 in r28, 0x3d ; 61 33bbe: de b7 in r29, 0x3e ; 62 FSensorBlockRunout blockRunout; 33bc0: 0f 94 c9 78 call 0x2f192 ; 0x2f192 return ss; } void MMU2::filament_ramming() { execute_extruder_sequence(ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); 33bc4: 62 e1 ldi r22, 0x12 ; 18 33bc6: 8d e1 ldi r24, 0x1D ; 29 33bc8: 9e e9 ldi r25, 0x9E ; 158 33bca: 0f 94 1e 7a call 0x2f43c ; 0x2f43c 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(); 33bce: 0f 94 60 4e call 0x29cc0 ; 0x29cc0 void ProtocolLogic::Statistics() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Version, 3)); } void ProtocolLogic::UnloadFilament() { PlanGenericRequest(RequestMsg(RequestMsgCodes::Unload, 0)); 33bd2: 40 e0 ldi r20, 0x00 ; 0 33bd4: 65 e5 ldi r22, 0x55 ; 85 33bd6: ce 01 movw r24, r28 33bd8: 01 96 adiw r24, 0x01 ; 1 33bda: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 33bde: 49 81 ldd r20, Y+1 ; 0x01 33be0: 5a 81 ldd r21, Y+2 ; 0x02 33be2: 6b 81 ldd r22, Y+3 ; 0x03 33be4: 7c 81 ldd r23, Y+4 ; 0x04 33be6: 8d 81 ldd r24, Y+5 ; 0x05 33be8: 0f 94 ba 95 call 0x32b74 ; 0x32b74 logic.UnloadFilament(); if (manage_response(false, true)) { 33bec: 61 e0 ldi r22, 0x01 ; 1 33bee: 80 e0 ldi r24, 0x00 ; 0 33bf0: 0f 94 4b 9d call 0x33a96 ; 0x33a96 33bf4: 81 11 cpse r24, r1 33bf6: 03 c0 rjmp .+6 ; 0x33bfe break; } IncrementMMUFails(); 33bf8: 0f 94 b4 4d call 0x29b68 ; 0x29b68 33bfc: e8 cf rjmp .-48 ; 0x33bce 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); 33bfe: 83 e0 ldi r24, 0x03 ; 3 33c00: 0f 94 3f 23 call 0x2467e ; 0x2467e } MakeSound(Confirm); // no active tool SetCurrentTool(MMU2_NO_TOOL); 33c04: 83 e6 ldi r24, 0x63 ; 99 33c06: 0f 94 65 65 call 0x2caca ; 0x2caca tool_change_extruder = MMU2_NO_TOOL; 33c0a: 83 e6 ldi r24, 0x63 ; 99 33c0c: 80 93 e9 12 sts 0x12E9, r24 ; 0x8012e9 FSensorBlockRunout::~FSensorBlockRunout() { fsensor.settings_init(); // restore filament runout state. 33c10: 0f 94 33 6d call 0x2da66 ; 0x2da66 } 33c14: 0f 90 pop r0 33c16: 0f 90 pop r0 33c18: 0f 90 pop r0 33c1a: 0f 90 pop r0 33c1c: 0f 90 pop r0 33c1e: df 91 pop r29 33c20: cf 91 pop r28 33c22: 08 95 ret 00033c24 : bool MMU2::unload() { 33c24: cf 93 push r28 if (!WaitForMMUReady()) { 33c26: 0f 94 47 7a call 0x2f48e ; 0x2f48e 33c2a: c8 2f mov r28, r24 33c2c: 88 23 and r24, r24 33c2e: 79 f0 breq .+30 ; 0x33c4e safe_delay_keep_alive(delay); } } void WaitForHotendTargetTempBeep() { waitForHotendTargetTemp(200, [] {}); 33c30: 88 ec ldi r24, 0xC8 ; 200 33c32: 90 e0 ldi r25, 0x00 ; 0 33c34: 0f 94 e4 51 call 0x2a3c8 ; 0x2a3c8 (unsigned int, MMU2::WaitForHotendTargetTempBeep()::{lambda()#1}) [clone .isra.0] [clone .lto_priv.372]> 33c38: 82 e0 ldi r24, 0x02 ; 2 33c3a: 0f 94 3f 23 call 0x2467e ; 0x2467e struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33c3e: 0f 94 13 7a call 0x2f426 ; 0x2f426 WaitForHotendTargetTempBeep(); { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); 33c42: 0f 94 d9 9d call 0x33bb2 ; 0x33bb2 explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33c46: 0f 94 3c 7a call 0x2f478 ; 0x2f478 { ReportingRAII rep(CommandInProgress::UnloadFilament); UnloadInner(); } ScreenUpdateEnable(); 33c4a: 0f 94 92 4d call 0x29b24 ; 0x29b24 return true; } 33c4e: 8c 2f mov r24, r28 33c50: cf 91 pop r28 33c52: 08 95 ret 00033c54 : unload(); ScreenUpdateEnable(); return true; } bool MMU2::load_filament(uint8_t slot) { 33c54: 0f 93 push r16 33c56: 1f 93 push r17 33c58: cf 93 push r28 33c5a: df 93 push r29 33c5c: 00 d0 rcall .+0 ; 0x33c5e 33c5e: 1f 92 push r1 33c60: 1f 92 push r1 33c62: cd b7 in r28, 0x3d ; 61 33c64: de b7 in r29, 0x3e ; 62 33c66: 08 2f mov r16, r24 if (!WaitForMMUReady()) { 33c68: 0f 94 47 7a call 0x2f48e ; 0x2f48e 33c6c: 18 2f mov r17, r24 33c6e: 88 23 and r24, r24 33c70: 49 f1 breq .+82 ; 0x33cc4 void FullScreenMsgTest(uint8_t slot){ FullScreenMsg(_T(MSG_TESTING_FILAMENT), slot); } void FullScreenMsgLoad(uint8_t slot){ FullScreenMsg(_T(MSG_LOADING_FILAMENT), slot); 33c72: 8f ea ldi r24, 0xAF ; 175 33c74: 92 e6 ldi r25, 0x62 ; 98 33c76: 0e 94 8b 75 call 0xeb16 ; 0xeb16 33c7a: 60 2f mov r22, r16 33c7c: 0f 94 95 4d call 0x29b2a ; 0x29b2a struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33c80: 0f 94 13 7a call 0x2f426 ; 0x2f426 FullScreenMsgLoad(slot); { ReportingRAII rep(CommandInProgress::LoadFilament); for (;;) { Disable_E0(); 33c84: 0f 94 60 4e call 0x29cc0 ; 0x29cc0 } void ProtocolLogic::LoadFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Load, slot)); 33c88: 40 2f mov r20, r16 33c8a: 6c e4 ldi r22, 0x4C ; 76 33c8c: ce 01 movw r24, r28 33c8e: 01 96 adiw r24, 0x01 ; 1 33c90: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 33c94: 49 81 ldd r20, Y+1 ; 0x01 33c96: 5a 81 ldd r21, Y+2 ; 0x02 33c98: 6b 81 ldd r22, Y+3 ; 0x03 33c9a: 7c 81 ldd r23, Y+4 ; 0x04 33c9c: 8d 81 ldd r24, Y+5 ; 0x05 33c9e: 0f 94 ba 95 call 0x32b74 ; 0x32b74 logic.LoadFilament(slot); if (manage_response(false, false)) { 33ca2: 60 e0 ldi r22, 0x00 ; 0 33ca4: 80 e0 ldi r24, 0x00 ; 0 33ca6: 0f 94 4b 9d call 0x33a96 ; 0x33a96 33caa: 18 2f mov r17, r24 33cac: 81 11 cpse r24, r1 33cae: 03 c0 rjmp .+6 ; 0x33cb6 break; } IncrementMMUFails(); 33cb0: 0f 94 b4 4d call 0x29b68 ; 0x29b68 33cb4: e7 cf rjmp .-50 ; 0x33c84 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); 33cb6: 83 e0 ldi r24, 0x03 ; 3 33cb8: 0f 94 3f 23 call 0x2467e ; 0x2467e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33cbc: 0f 94 3c 7a call 0x2f478 ; 0x2f478 } IncrementMMUFails(); } MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 33cc0: 0f 94 92 4d call 0x29b24 ; 0x29b24 return true; } 33cc4: 81 2f mov r24, r17 33cc6: 0f 90 pop r0 33cc8: 0f 90 pop r0 33cca: 0f 90 pop r0 33ccc: 0f 90 pop r0 33cce: 0f 90 pop r0 33cd0: df 91 pop r29 33cd2: cf 91 pop r28 33cd4: 1f 91 pop r17 33cd6: 0f 91 pop r16 33cd8: 08 95 ret 00033cda : } ScreenUpdateEnable(); return true; } bool MMU2::eject_filament(uint8_t slot, bool enableFullScreenMsg /* = true */) { 33cda: ff 92 push r15 33cdc: 0f 93 push r16 33cde: 1f 93 push r17 33ce0: cf 93 push r28 33ce2: df 93 push r29 33ce4: 00 d0 rcall .+0 ; 0x33ce6 33ce6: 1f 92 push r1 33ce8: 1f 92 push r1 33cea: cd b7 in r28, 0x3d ; 61 33cec: de b7 in r29, 0x3e ; 62 33cee: 08 2f mov r16, r24 33cf0: f6 2e mov r15, r22 if (!WaitForMMUReady()) { 33cf2: 0f 94 47 7a call 0x2f48e ; 0x2f48e 33cf6: 18 2f mov r17, r24 33cf8: 88 23 and r24, r24 33cfa: b1 f1 breq .+108 ; 0x33d68 return false; } if (enableFullScreenMsg) { 33cfc: ff 20 and r15, r15 33cfe: 39 f0 breq .+14 ; 0x33d0e void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); } void FullScreenMsgEject(uint8_t slot){ FullScreenMsg(_T(MSG_EJECT_FROM_MMU), slot); 33d00: 8e e9 ldi r24, 0x9E ; 158 33d02: 92 e6 ldi r25, 0x62 ; 98 33d04: 0e 94 8b 75 call 0xeb16 ; 0xeb16 33d08: 60 2f mov r22, r16 33d0a: 0f 94 95 4d call 0x29b2a ; 0x29b2a FullScreenMsgEject(slot); } { if (FindaDetectsFilament()) { 33d0e: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 33d12: 81 11 cpse r24, r1 unload(); 33d14: 0f 94 12 9e call 0x33c24 ; 0x33c24 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33d18: 0f 94 13 7a call 0x2f426 ; 0x2f426 unload(); } ReportingRAII rep(CommandInProgress::EjectFilament); for (;;) { Disable_E0(); 33d1c: 0f 94 60 4e call 0x29cc0 ; 0x29cc0 } void ProtocolLogic::EjectFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Eject, slot)); 33d20: 40 2f mov r20, r16 33d22: 65 e4 ldi r22, 0x45 ; 69 33d24: ce 01 movw r24, r28 33d26: 01 96 adiw r24, 0x01 ; 1 33d28: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 33d2c: 49 81 ldd r20, Y+1 ; 0x01 33d2e: 5a 81 ldd r21, Y+2 ; 0x02 33d30: 6b 81 ldd r22, Y+3 ; 0x03 33d32: 7c 81 ldd r23, Y+4 ; 0x04 33d34: 8d 81 ldd r24, Y+5 ; 0x05 33d36: 0f 94 ba 95 call 0x32b74 ; 0x32b74 logic.EjectFilament(slot); if (manage_response(false, true)) { 33d3a: 61 e0 ldi r22, 0x01 ; 1 33d3c: 80 e0 ldi r24, 0x00 ; 0 33d3e: 0f 94 4b 9d call 0x33a96 ; 0x33a96 33d42: 18 2f mov r17, r24 33d44: 81 11 cpse r24, r1 33d46: 03 c0 rjmp .+6 ; 0x33d4e break; } IncrementMMUFails(); 33d48: 0f 94 b4 4d call 0x29b68 ; 0x29b68 33d4c: e7 cf rjmp .-50 ; 0x33d1c } SetCurrentTool(MMU2_NO_TOOL); 33d4e: 83 e6 ldi r24, 0x63 ; 99 33d50: 0f 94 65 65 call 0x2caca ; 0x2caca tool_change_extruder = MMU2_NO_TOOL; 33d54: 83 e6 ldi r24, 0x63 ; 99 33d56: 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); 33d5a: 83 e0 ldi r24, 0x03 ; 3 33d5c: 0f 94 3f 23 call 0x2467e ; 0x2467e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33d60: 0f 94 3c 7a call 0x2f478 ; 0x2f478 } SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(Confirm); } ScreenUpdateEnable(); 33d64: 0f 94 92 4d call 0x29b24 ; 0x29b24 return true; } 33d68: 81 2f mov r24, r17 33d6a: 0f 90 pop r0 33d6c: 0f 90 pop r0 33d6e: 0f 90 pop r0 33d70: 0f 90 pop r0 33d72: 0f 90 pop r0 33d74: df 91 pop r29 33d76: cf 91 pop r28 33d78: 1f 91 pop r17 33d7a: 0f 91 pop r16 33d7c: ff 90 pop r15 33d7e: 08 95 ret 00033d80 : ScreenUpdateEnable(); return true; } void MMU2::CutFilamentInner(uint8_t slot) { 33d80: 1f 93 push r17 33d82: cf 93 push r28 33d84: df 93 push r29 33d86: 00 d0 rcall .+0 ; 0x33d88 33d88: 1f 92 push r1 33d8a: 1f 92 push r1 33d8c: cd b7 in r28, 0x3d ; 61 33d8e: de b7 in r29, 0x3e ; 62 33d90: 18 2f mov r17, r24 for (;;) { Disable_E0(); 33d92: 0f 94 60 4e call 0x29cc0 ; 0x29cc0 } void ProtocolLogic::CutFilament(uint8_t slot) { PlanGenericRequest(RequestMsg(RequestMsgCodes::Cut, slot)); 33d96: 41 2f mov r20, r17 33d98: 6b e4 ldi r22, 0x4B ; 75 33d9a: ce 01 movw r24, r28 33d9c: 01 96 adiw r24, 0x01 ; 1 33d9e: 0f 94 53 4e call 0x29ca6 ; 0x29ca6 33da2: 49 81 ldd r20, Y+1 ; 0x01 33da4: 5a 81 ldd r21, Y+2 ; 0x02 33da6: 6b 81 ldd r22, Y+3 ; 0x03 33da8: 7c 81 ldd r23, Y+4 ; 0x04 33daa: 8d 81 ldd r24, Y+5 ; 0x05 33dac: 0f 94 ba 95 call 0x32b74 ; 0x32b74 logic.CutFilament(slot); if (manage_response(false, true)) { 33db0: 61 e0 ldi r22, 0x01 ; 1 33db2: 80 e0 ldi r24, 0x00 ; 0 33db4: 0f 94 4b 9d call 0x33a96 ; 0x33a96 33db8: 81 11 cpse r24, r1 33dba: 03 c0 rjmp .+6 ; 0x33dc2 break; } IncrementMMUFails(); 33dbc: 0f 94 b4 4d call 0x29b68 ; 0x29b68 33dc0: e8 cf rjmp .-48 ; 0x33d92 } } 33dc2: 0f 90 pop r0 33dc4: 0f 90 pop r0 33dc6: 0f 90 pop r0 33dc8: 0f 90 pop r0 33dca: 0f 90 pop r0 33dcc: df 91 pop r29 33dce: cf 91 pop r28 33dd0: 1f 91 pop r17 33dd2: 08 95 ret 00033dd4 : bool MMU2::cut_filament(uint8_t slot, bool enableFullScreenMsg /*= true*/) { 33dd4: cf 93 push r28 33dd6: c8 2f mov r28, r24 lcd_print(' '); lcd_print(slot + 1); } void FullScreenMsgCut(uint8_t slot){ FullScreenMsg(_T(MSG_CUT_FILAMENT), slot); 33dd8: 8f e8 ldi r24, 0x8F ; 143 33dda: 92 e6 ldi r25, 0x62 ; 98 33ddc: 0e 94 8b 75 call 0xeb16 ; 0xeb16 33de0: 6c 2f mov r22, r28 33de2: 0f 94 95 4d call 0x29b2a ; 0x29b2a if (enableFullScreenMsg) { FullScreenMsgCut(slot); } { if (FindaDetectsFilament()) { 33de6: 80 91 d7 12 lds r24, 0x12D7 ; 0x8012d7 33dea: 81 11 cpse r24, r1 unload(); 33dec: 0f 94 12 9e call 0x33c24 ; 0x33c24 struct ReportingRAII { CommandInProgress cip; explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); 33df0: 0f 94 13 7a call 0x2f426 ; 0x2f426 if (FindaDetectsFilament()) { unload(); } ReportingRAII rep(CommandInProgress::CutFilament); CutFilamentInner(slot); 33df4: 8c 2f mov r24, r28 33df6: 0f 94 c0 9e call 0x33d80 ; 0x33d80 SetCurrentTool(MMU2_NO_TOOL); 33dfa: 83 e6 ldi r24, 0x63 ; 99 33dfc: 0f 94 65 65 call 0x2caca ; 0x2caca tool_change_extruder = MMU2_NO_TOOL; 33e00: 83 e6 ldi r24, 0x63 ; 99 33e02: 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); 33e06: 83 e0 ldi r24, 0x03 ; 3 33e08: 0f 94 3f 23 call 0x2467e ; 0x2467e explicit inline __attribute__((always_inline)) ReportingRAII(CommandInProgress cip) : cip(cip) { BeginReport(cip, ProgressCode::EngagingIdler); } inline __attribute__((always_inline)) ~ReportingRAII() { EndReport(cip, ProgressCode::OK); 33e0c: 0f 94 3c 7a call 0x2f478 ; 0x2f478 CutFilamentInner(slot); SetCurrentTool(MMU2_NO_TOOL); tool_change_extruder = MMU2_NO_TOOL; MakeSound(SoundType::Confirm); } ScreenUpdateEnable(); 33e10: 0f 94 92 4d call 0x29b24 ; 0x29b24 return true; } 33e14: 81 e0 ldi r24, 0x01 ; 1 33e16: cf 91 pop r28 33e18: 08 95 ret 00033e1a <__floatunsisf>: 33e1a: e8 94 clt 33e1c: 09 c0 rjmp .+18 ; 0x33e30 <__floatsisf+0x12> 00033e1e <__floatsisf>: 33e1e: 97 fb bst r25, 7 33e20: 3e f4 brtc .+14 ; 0x33e30 <__floatsisf+0x12> 33e22: 90 95 com r25 33e24: 80 95 com r24 33e26: 70 95 com r23 33e28: 61 95 neg r22 33e2a: 7f 4f sbci r23, 0xFF ; 255 33e2c: 8f 4f sbci r24, 0xFF ; 255 33e2e: 9f 4f sbci r25, 0xFF ; 255 33e30: 99 23 and r25, r25 33e32: a9 f0 breq .+42 ; 0x33e5e <__floatsisf+0x40> 33e34: f9 2f mov r31, r25 33e36: 96 e9 ldi r25, 0x96 ; 150 33e38: bb 27 eor r27, r27 33e3a: 93 95 inc r25 33e3c: f6 95 lsr r31 33e3e: 87 95 ror r24 33e40: 77 95 ror r23 33e42: 67 95 ror r22 33e44: b7 95 ror r27 33e46: f1 11 cpse r31, r1 33e48: f8 cf rjmp .-16 ; 0x33e3a <__floatsisf+0x1c> 33e4a: fa f4 brpl .+62 ; 0x33e8a <__floatsisf+0x6c> 33e4c: bb 0f add r27, r27 33e4e: 11 f4 brne .+4 ; 0x33e54 <__floatsisf+0x36> 33e50: 60 ff sbrs r22, 0 33e52: 1b c0 rjmp .+54 ; 0x33e8a <__floatsisf+0x6c> 33e54: 6f 5f subi r22, 0xFF ; 255 33e56: 7f 4f sbci r23, 0xFF ; 255 33e58: 8f 4f sbci r24, 0xFF ; 255 33e5a: 9f 4f sbci r25, 0xFF ; 255 33e5c: 16 c0 rjmp .+44 ; 0x33e8a <__floatsisf+0x6c> 33e5e: 88 23 and r24, r24 33e60: 11 f0 breq .+4 ; 0x33e66 <__floatsisf+0x48> 33e62: 96 e9 ldi r25, 0x96 ; 150 33e64: 11 c0 rjmp .+34 ; 0x33e88 <__floatsisf+0x6a> 33e66: 77 23 and r23, r23 33e68: 21 f0 breq .+8 ; 0x33e72 <__floatsisf+0x54> 33e6a: 9e e8 ldi r25, 0x8E ; 142 33e6c: 87 2f mov r24, r23 33e6e: 76 2f mov r23, r22 33e70: 05 c0 rjmp .+10 ; 0x33e7c <__floatsisf+0x5e> 33e72: 66 23 and r22, r22 33e74: 71 f0 breq .+28 ; 0x33e92 <__floatsisf+0x74> 33e76: 96 e8 ldi r25, 0x86 ; 134 33e78: 86 2f mov r24, r22 33e7a: 70 e0 ldi r23, 0x00 ; 0 33e7c: 60 e0 ldi r22, 0x00 ; 0 33e7e: 2a f0 brmi .+10 ; 0x33e8a <__floatsisf+0x6c> 33e80: 9a 95 dec r25 33e82: 66 0f add r22, r22 33e84: 77 1f adc r23, r23 33e86: 88 1f adc r24, r24 33e88: da f7 brpl .-10 ; 0x33e80 <__floatsisf+0x62> 33e8a: 88 0f add r24, r24 33e8c: 96 95 lsr r25 33e8e: 87 95 ror r24 33e90: 97 f9 bld r25, 7 33e92: 08 95 ret 00033e94 : 33e94: 9b 01 movw r18, r22 33e96: ac 01 movw r20, r24 33e98: 0d 94 4e 9f jmp 0x33e9c ; 0x33e9c <__mulsf3> 00033e9c <__mulsf3>: 33e9c: 0f 94 61 9f call 0x33ec2 ; 0x33ec2 <__mulsf3x> 33ea0: 0d 94 d2 9f jmp 0x33fa4 ; 0x33fa4 <__fp_round> 33ea4: 0f 94 c4 9f call 0x33f88 ; 0x33f88 <__fp_pscA> 33ea8: 38 f0 brcs .+14 ; 0x33eb8 <__mulsf3+0x1c> 33eaa: 0f 94 cb 9f call 0x33f96 ; 0x33f96 <__fp_pscB> 33eae: 20 f0 brcs .+8 ; 0x33eb8 <__mulsf3+0x1c> 33eb0: 95 23 and r25, r21 33eb2: 11 f0 breq .+4 ; 0x33eb8 <__mulsf3+0x1c> 33eb4: 0d 94 bb 9f jmp 0x33f76 ; 0x33f76 <__fp_inf> 33eb8: 0d 94 c1 9f jmp 0x33f82 ; 0x33f82 <__fp_nan> 33ebc: 11 24 eor r1, r1 33ebe: 0d 94 06 a0 jmp 0x3400c ; 0x3400c <__fp_szero> 00033ec2 <__mulsf3x>: 33ec2: 0f 94 e3 9f call 0x33fc6 ; 0x33fc6 <__fp_split3> 33ec6: 70 f3 brcs .-36 ; 0x33ea4 <__mulsf3+0x8> 00033ec8 <__mulsf3_pse>: 33ec8: 95 9f mul r25, r21 33eca: c1 f3 breq .-16 ; 0x33ebc <__mulsf3+0x20> 33ecc: 95 0f add r25, r21 33ece: 50 e0 ldi r21, 0x00 ; 0 33ed0: 55 1f adc r21, r21 33ed2: 62 9f mul r22, r18 33ed4: f0 01 movw r30, r0 33ed6: 72 9f mul r23, r18 33ed8: bb 27 eor r27, r27 33eda: f0 0d add r31, r0 33edc: b1 1d adc r27, r1 33ede: 63 9f mul r22, r19 33ee0: aa 27 eor r26, r26 33ee2: f0 0d add r31, r0 33ee4: b1 1d adc r27, r1 33ee6: aa 1f adc r26, r26 33ee8: 64 9f mul r22, r20 33eea: 66 27 eor r22, r22 33eec: b0 0d add r27, r0 33eee: a1 1d adc r26, r1 33ef0: 66 1f adc r22, r22 33ef2: 82 9f mul r24, r18 33ef4: 22 27 eor r18, r18 33ef6: b0 0d add r27, r0 33ef8: a1 1d adc r26, r1 33efa: 62 1f adc r22, r18 33efc: 73 9f mul r23, r19 33efe: b0 0d add r27, r0 33f00: a1 1d adc r26, r1 33f02: 62 1f adc r22, r18 33f04: 83 9f mul r24, r19 33f06: a0 0d add r26, r0 33f08: 61 1d adc r22, r1 33f0a: 22 1f adc r18, r18 33f0c: 74 9f mul r23, r20 33f0e: 33 27 eor r19, r19 33f10: a0 0d add r26, r0 33f12: 61 1d adc r22, r1 33f14: 23 1f adc r18, r19 33f16: 84 9f mul r24, r20 33f18: 60 0d add r22, r0 33f1a: 21 1d adc r18, r1 33f1c: 82 2f mov r24, r18 33f1e: 76 2f mov r23, r22 33f20: 6a 2f mov r22, r26 33f22: 11 24 eor r1, r1 33f24: 9f 57 subi r25, 0x7F ; 127 33f26: 50 40 sbci r21, 0x00 ; 0 33f28: 9a f0 brmi .+38 ; 0x33f50 <__mulsf3_pse+0x88> 33f2a: f1 f0 breq .+60 ; 0x33f68 <__mulsf3_pse+0xa0> 33f2c: 88 23 and r24, r24 33f2e: 4a f0 brmi .+18 ; 0x33f42 <__mulsf3_pse+0x7a> 33f30: ee 0f add r30, r30 33f32: ff 1f adc r31, r31 33f34: bb 1f adc r27, r27 33f36: 66 1f adc r22, r22 33f38: 77 1f adc r23, r23 33f3a: 88 1f adc r24, r24 33f3c: 91 50 subi r25, 0x01 ; 1 33f3e: 50 40 sbci r21, 0x00 ; 0 33f40: a9 f7 brne .-22 ; 0x33f2c <__mulsf3_pse+0x64> 33f42: 9e 3f cpi r25, 0xFE ; 254 33f44: 51 05 cpc r21, r1 33f46: 80 f0 brcs .+32 ; 0x33f68 <__mulsf3_pse+0xa0> 33f48: 0d 94 bb 9f jmp 0x33f76 ; 0x33f76 <__fp_inf> 33f4c: 0d 94 06 a0 jmp 0x3400c ; 0x3400c <__fp_szero> 33f50: 5f 3f cpi r21, 0xFF ; 255 33f52: e4 f3 brlt .-8 ; 0x33f4c <__mulsf3_pse+0x84> 33f54: 98 3e cpi r25, 0xE8 ; 232 33f56: d4 f3 brlt .-12 ; 0x33f4c <__mulsf3_pse+0x84> 33f58: 86 95 lsr r24 33f5a: 77 95 ror r23 33f5c: 67 95 ror r22 33f5e: b7 95 ror r27 33f60: f7 95 ror r31 33f62: e7 95 ror r30 33f64: 9f 5f subi r25, 0xFF ; 255 33f66: c1 f7 brne .-16 ; 0x33f58 <__mulsf3_pse+0x90> 33f68: fe 2b or r31, r30 33f6a: 88 0f add r24, r24 33f6c: 91 1d adc r25, r1 33f6e: 96 95 lsr r25 33f70: 87 95 ror r24 33f72: 97 f9 bld r25, 7 33f74: 08 95 ret 00033f76 <__fp_inf>: 33f76: 97 f9 bld r25, 7 33f78: 9f 67 ori r25, 0x7F ; 127 33f7a: 80 e8 ldi r24, 0x80 ; 128 33f7c: 70 e0 ldi r23, 0x00 ; 0 33f7e: 60 e0 ldi r22, 0x00 ; 0 33f80: 08 95 ret 00033f82 <__fp_nan>: 33f82: 9f ef ldi r25, 0xFF ; 255 33f84: 80 ec ldi r24, 0xC0 ; 192 33f86: 08 95 ret 00033f88 <__fp_pscA>: 33f88: 00 24 eor r0, r0 33f8a: 0a 94 dec r0 33f8c: 16 16 cp r1, r22 33f8e: 17 06 cpc r1, r23 33f90: 18 06 cpc r1, r24 33f92: 09 06 cpc r0, r25 33f94: 08 95 ret 00033f96 <__fp_pscB>: 33f96: 00 24 eor r0, r0 33f98: 0a 94 dec r0 33f9a: 12 16 cp r1, r18 33f9c: 13 06 cpc r1, r19 33f9e: 14 06 cpc r1, r20 33fa0: 05 06 cpc r0, r21 33fa2: 08 95 ret 00033fa4 <__fp_round>: 33fa4: 09 2e mov r0, r25 33fa6: 03 94 inc r0 33fa8: 00 0c add r0, r0 33faa: 11 f4 brne .+4 ; 0x33fb0 <__fp_round+0xc> 33fac: 88 23 and r24, r24 33fae: 52 f0 brmi .+20 ; 0x33fc4 <__fp_round+0x20> 33fb0: bb 0f add r27, r27 33fb2: 40 f4 brcc .+16 ; 0x33fc4 <__fp_round+0x20> 33fb4: bf 2b or r27, r31 33fb6: 11 f4 brne .+4 ; 0x33fbc <__fp_round+0x18> 33fb8: 60 ff sbrs r22, 0 33fba: 04 c0 rjmp .+8 ; 0x33fc4 <__fp_round+0x20> 33fbc: 6f 5f subi r22, 0xFF ; 255 33fbe: 7f 4f sbci r23, 0xFF ; 255 33fc0: 8f 4f sbci r24, 0xFF ; 255 33fc2: 9f 4f sbci r25, 0xFF ; 255 33fc4: 08 95 ret 00033fc6 <__fp_split3>: 33fc6: 57 fd sbrc r21, 7 33fc8: 90 58 subi r25, 0x80 ; 128 33fca: 44 0f add r20, r20 33fcc: 55 1f adc r21, r21 33fce: 59 f0 breq .+22 ; 0x33fe6 <__fp_splitA+0x10> 33fd0: 5f 3f cpi r21, 0xFF ; 255 33fd2: 71 f0 breq .+28 ; 0x33ff0 <__fp_splitA+0x1a> 33fd4: 47 95 ror r20 00033fd6 <__fp_splitA>: 33fd6: 88 0f add r24, r24 33fd8: 97 fb bst r25, 7 33fda: 99 1f adc r25, r25 33fdc: 61 f0 breq .+24 ; 0x33ff6 <__fp_splitA+0x20> 33fde: 9f 3f cpi r25, 0xFF ; 255 33fe0: 79 f0 breq .+30 ; 0x34000 <__fp_splitA+0x2a> 33fe2: 87 95 ror r24 33fe4: 08 95 ret 33fe6: 12 16 cp r1, r18 33fe8: 13 06 cpc r1, r19 33fea: 14 06 cpc r1, r20 33fec: 55 1f adc r21, r21 33fee: f2 cf rjmp .-28 ; 0x33fd4 <__fp_split3+0xe> 33ff0: 46 95 lsr r20 33ff2: f1 df rcall .-30 ; 0x33fd6 <__fp_splitA> 33ff4: 08 c0 rjmp .+16 ; 0x34006 <__fp_splitA+0x30> 33ff6: 16 16 cp r1, r22 33ff8: 17 06 cpc r1, r23 33ffa: 18 06 cpc r1, r24 33ffc: 99 1f adc r25, r25 33ffe: f1 cf rjmp .-30 ; 0x33fe2 <__fp_splitA+0xc> 34000: 86 95 lsr r24 34002: 71 05 cpc r23, r1 34004: 61 05 cpc r22, r1 34006: 08 94 sec 34008: 08 95 ret 0003400a <__fp_zero>: 3400a: e8 94 clt 0003400c <__fp_szero>: 3400c: bb 27 eor r27, r27 3400e: 66 27 eor r22, r22 34010: 77 27 eor r23, r23 34012: cb 01 movw r24, r22 34014: 97 f9 bld r25, 7 34016: 08 95 ret 00034018 : 34018: 3f 92 push r3 3401a: 4f 92 push r4 3401c: 5f 92 push r5 3401e: 6f 92 push r6 34020: 7f 92 push r7 34022: 8f 92 push r8 34024: 9f 92 push r9 34026: af 92 push r10 34028: bf 92 push r11 3402a: cf 92 push r12 3402c: df 92 push r13 3402e: ef 92 push r14 34030: ff 92 push r15 34032: 0f 93 push r16 34034: 1f 93 push r17 34036: cf 93 push r28 34038: df 93 push r29 3403a: 5c 01 movw r10, r24 3403c: 6b 01 movw r12, r22 3403e: 7a 01 movw r14, r20 34040: 61 15 cp r22, r1 34042: 71 05 cpc r23, r1 34044: 19 f0 breq .+6 ; 0x3404c 34046: fb 01 movw r30, r22 34048: 91 83 std Z+1, r25 ; 0x01 3404a: 80 83 st Z, r24 3404c: e1 14 cp r14, r1 3404e: f1 04 cpc r15, r1 34050: 51 f0 breq .+20 ; 0x34066 34052: c7 01 movw r24, r14 34054: 02 97 sbiw r24, 0x02 ; 2 34056: 83 97 sbiw r24, 0x23 ; 35 34058: 30 f0 brcs .+12 ; 0x34066 3405a: 40 e0 ldi r20, 0x00 ; 0 3405c: 30 e0 ldi r19, 0x00 ; 0 3405e: 20 e0 ldi r18, 0x00 ; 0 34060: 90 e0 ldi r25, 0x00 ; 0 34062: 6b c0 rjmp .+214 ; 0x3413a 34064: 5e 01 movw r10, r28 34066: e5 01 movw r28, r10 34068: 21 96 adiw r28, 0x01 ; 1 3406a: f5 01 movw r30, r10 3406c: 10 81 ld r17, Z 3406e: 81 2f mov r24, r17 34070: 90 e0 ldi r25, 0x00 ; 0 34072: 0f 94 12 a2 call 0x34424 ; 0x34424 34076: 89 2b or r24, r25 34078: a9 f7 brne .-22 ; 0x34064 3407a: 1d 32 cpi r17, 0x2D ; 45 3407c: 01 f5 brne .+64 ; 0x340be 3407e: 21 96 adiw r28, 0x01 ; 1 34080: f5 01 movw r30, r10 34082: 11 81 ldd r17, Z+1 ; 0x01 34084: 01 e0 ldi r16, 0x01 ; 1 34086: e1 14 cp r14, r1 34088: f1 04 cpc r15, r1 3408a: 09 f4 brne .+2 ; 0x3408e 3408c: e6 c0 rjmp .+460 ; 0x3425a 3408e: f0 e1 ldi r31, 0x10 ; 16 34090: ef 16 cp r14, r31 34092: f1 04 cpc r15, r1 34094: 09 f0 breq .+2 ; 0x34098 34096: 88 c0 rjmp .+272 ; 0x341a8 34098: 10 33 cpi r17, 0x30 ; 48 3409a: 59 f4 brne .+22 ; 0x340b2 3409c: 88 81 ld r24, Y 3409e: 8f 7d andi r24, 0xDF ; 223 340a0: 88 35 cpi r24, 0x58 ; 88 340a2: 09 f0 breq .+2 ; 0x340a6 340a4: 7c c0 rjmp .+248 ; 0x3419e 340a6: 19 81 ldd r17, Y+1 ; 0x01 340a8: 22 96 adiw r28, 0x02 ; 2 340aa: 02 60 ori r16, 0x02 ; 2 340ac: f0 e1 ldi r31, 0x10 ; 16 340ae: ef 2e mov r14, r31 340b0: f1 2c mov r15, r1 340b2: 81 2c mov r8, r1 340b4: 91 2c mov r9, r1 340b6: a1 2c mov r10, r1 340b8: 88 e0 ldi r24, 0x08 ; 8 340ba: b8 2e mov r11, r24 340bc: 92 c0 rjmp .+292 ; 0x341e2 340be: 1b 32 cpi r17, 0x2B ; 43 340c0: 21 f4 brne .+8 ; 0x340ca 340c2: e5 01 movw r28, r10 340c4: 22 96 adiw r28, 0x02 ; 2 340c6: f5 01 movw r30, r10 340c8: 11 81 ldd r17, Z+1 ; 0x01 340ca: 00 e0 ldi r16, 0x00 ; 0 340cc: dc cf rjmp .-72 ; 0x34086 340ce: ea e0 ldi r30, 0x0A ; 10 340d0: ee 16 cp r14, r30 340d2: f1 04 cpc r15, r1 340d4: 09 f4 brne .+2 ; 0x340d8 340d6: c7 c0 rjmp .+398 ; 0x34266 340d8: f0 e1 ldi r31, 0x10 ; 16 340da: ef 16 cp r14, r31 340dc: f1 04 cpc r15, r1 340de: 09 f0 breq .+2 ; 0x340e2 340e0: 73 c0 rjmp .+230 ; 0x341c8 340e2: e7 cf rjmp .-50 ; 0x340b2 340e4: 78 e0 ldi r23, 0x08 ; 8 340e6: e7 2e mov r14, r23 340e8: f1 2c mov r15, r1 340ea: 81 2c mov r8, r1 340ec: 91 2c mov r9, r1 340ee: a1 2c mov r10, r1 340f0: 60 e1 ldi r22, 0x10 ; 16 340f2: b6 2e mov r11, r22 340f4: 76 c0 rjmp .+236 ; 0x341e2 340f6: 21 e0 ldi r18, 0x01 ; 1 340f8: ad c0 rjmp .+346 ; 0x34254 340fa: 30 2f mov r19, r16 340fc: 31 70 andi r19, 0x01 ; 1 340fe: c1 14 cp r12, r1 34100: d1 04 cpc r13, r1 34102: 31 f0 breq .+12 ; 0x34110 34104: 22 23 and r18, r18 34106: 71 f1 breq .+92 ; 0x34164 34108: 21 97 sbiw r28, 0x01 ; 1 3410a: f6 01 movw r30, r12 3410c: d1 83 std Z+1, r29 ; 0x01 3410e: c0 83 st Z, r28 34110: 27 ff sbrs r18, 7 34112: 2e c0 rjmp .+92 ; 0x34170 34114: 60 e0 ldi r22, 0x00 ; 0 34116: 70 e0 ldi r23, 0x00 ; 0 34118: 80 e0 ldi r24, 0x00 ; 0 3411a: 90 e8 ldi r25, 0x80 ; 128 3411c: 31 11 cpse r19, r1 3411e: 04 c0 rjmp .+8 ; 0x34128 34120: 6f ef ldi r22, 0xFF ; 255 34122: 7f ef ldi r23, 0xFF ; 255 34124: 8f ef ldi r24, 0xFF ; 255 34126: 9f e7 ldi r25, 0x7F ; 127 34128: 22 e2 ldi r18, 0x22 ; 34 3412a: 30 e0 ldi r19, 0x00 ; 0 3412c: 30 93 0c 17 sts 0x170C, r19 ; 0x80170c 34130: 20 93 0b 17 sts 0x170B, r18 ; 0x80170b 34134: 46 2f mov r20, r22 34136: 37 2f mov r19, r23 34138: 28 2f mov r18, r24 3413a: 64 2f mov r22, r20 3413c: 73 2f mov r23, r19 3413e: 82 2f mov r24, r18 34140: df 91 pop r29 34142: cf 91 pop r28 34144: 1f 91 pop r17 34146: 0f 91 pop r16 34148: ff 90 pop r15 3414a: ef 90 pop r14 3414c: df 90 pop r13 3414e: cf 90 pop r12 34150: bf 90 pop r11 34152: af 90 pop r10 34154: 9f 90 pop r9 34156: 8f 90 pop r8 34158: 7f 90 pop r7 3415a: 6f 90 pop r6 3415c: 5f 90 pop r5 3415e: 4f 90 pop r4 34160: 3f 90 pop r3 34162: 08 95 ret 34164: 01 ff sbrs r16, 1 34166: 04 c0 rjmp .+8 ; 0x34170 34168: 22 97 sbiw r28, 0x02 ; 2 3416a: f6 01 movw r30, r12 3416c: d1 83 std Z+1, r29 ; 0x01 3416e: c0 83 st Z, r28 34170: 33 23 and r19, r19 34172: 41 f0 breq .+16 ; 0x34184 34174: 90 95 com r25 34176: 80 95 com r24 34178: 70 95 com r23 3417a: 61 95 neg r22 3417c: 7f 4f sbci r23, 0xFF ; 255 3417e: 8f 4f sbci r24, 0xFF ; 255 34180: 9f 4f sbci r25, 0xFF ; 255 34182: d8 cf rjmp .-80 ; 0x34134 34184: 97 ff sbrs r25, 7 34186: d6 cf rjmp .-84 ; 0x34134 34188: 82 e2 ldi r24, 0x22 ; 34 3418a: 90 e0 ldi r25, 0x00 ; 0 3418c: 90 93 0c 17 sts 0x170C, r25 ; 0x80170c 34190: 80 93 0b 17 sts 0x170B, r24 ; 0x80170b 34194: 6f ef ldi r22, 0xFF ; 255 34196: 7f ef ldi r23, 0xFF ; 255 34198: 8f ef ldi r24, 0xFF ; 255 3419a: 9f e7 ldi r25, 0x7F ; 127 3419c: cb cf rjmp .-106 ; 0x34134 3419e: 10 e3 ldi r17, 0x30 ; 48 341a0: e1 14 cp r14, r1 341a2: f1 04 cpc r15, r1 341a4: 09 f4 brne .+2 ; 0x341a8 341a6: 9e cf rjmp .-196 ; 0x340e4 341a8: 28 e0 ldi r18, 0x08 ; 8 341aa: e2 16 cp r14, r18 341ac: f1 04 cpc r15, r1 341ae: 09 f4 brne .+2 ; 0x341b2 341b0: 9c cf rjmp .-200 ; 0x340ea 341b2: 0c f0 brlt .+2 ; 0x341b6 341b4: 8c cf rjmp .-232 ; 0x340ce 341b6: 81 2c mov r8, r1 341b8: 91 2c mov r9, r1 341ba: a1 2c mov r10, r1 341bc: e0 e4 ldi r30, 0x40 ; 64 341be: be 2e mov r11, r30 341c0: 82 e0 ldi r24, 0x02 ; 2 341c2: e8 16 cp r14, r24 341c4: f1 04 cpc r15, r1 341c6: 69 f0 breq .+26 ; 0x341e2 341c8: 60 e0 ldi r22, 0x00 ; 0 341ca: 70 e0 ldi r23, 0x00 ; 0 341cc: 80 e0 ldi r24, 0x00 ; 0 341ce: 90 e8 ldi r25, 0x80 ; 128 341d0: 97 01 movw r18, r14 341d2: 0f 2c mov r0, r15 341d4: 00 0c add r0, r0 341d6: 44 0b sbc r20, r20 341d8: 55 0b sbc r21, r21 341da: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 341de: 49 01 movw r8, r18 341e0: 5a 01 movw r10, r20 341e2: 20 e0 ldi r18, 0x00 ; 0 341e4: 60 e0 ldi r22, 0x00 ; 0 341e6: 70 e0 ldi r23, 0x00 ; 0 341e8: cb 01 movw r24, r22 341ea: 27 01 movw r4, r14 341ec: 0f 2c mov r0, r15 341ee: 00 0c add r0, r0 341f0: 66 08 sbc r6, r6 341f2: 77 08 sbc r7, r7 341f4: fe 01 movw r30, r28 341f6: 50 ed ldi r21, 0xD0 ; 208 341f8: 35 2e mov r3, r21 341fa: 31 0e add r3, r17 341fc: 39 e0 ldi r19, 0x09 ; 9 341fe: 33 15 cp r19, r3 34200: 70 f4 brcc .+28 ; 0x3421e 34202: 3f eb ldi r19, 0xBF ; 191 34204: 31 0f add r19, r17 34206: 49 ec ldi r20, 0xC9 ; 201 34208: 34 2e mov r3, r20 3420a: 3a 31 cpi r19, 0x1A ; 26 3420c: 38 f0 brcs .+14 ; 0x3421c 3420e: 3f e9 ldi r19, 0x9F ; 159 34210: 31 0f add r19, r17 34212: 3a 31 cpi r19, 0x1A ; 26 34214: 08 f0 brcs .+2 ; 0x34218 34216: 71 cf rjmp .-286 ; 0x340fa 34218: 39 ea ldi r19, 0xA9 ; 169 3421a: 33 2e mov r3, r19 3421c: 31 0e add r3, r17 3421e: 3e 14 cp r3, r14 34220: 1f 04 cpc r1, r15 34222: 0c f0 brlt .+2 ; 0x34226 34224: 6a cf rjmp .-300 ; 0x340fa 34226: 27 fd sbrc r18, 7 34228: 15 c0 rjmp .+42 ; 0x34254 3422a: 86 16 cp r8, r22 3422c: 97 06 cpc r9, r23 3422e: a8 06 cpc r10, r24 34230: b9 06 cpc r11, r25 34232: 78 f0 brcs .+30 ; 0x34252 34234: a3 01 movw r20, r6 34236: 92 01 movw r18, r4 34238: 0f 94 e4 a4 call 0x349c8 ; 0x349c8 <__mulsi3> 3423c: 63 0d add r22, r3 3423e: 71 1d adc r23, r1 34240: 81 1d adc r24, r1 34242: 91 1d adc r25, r1 34244: 61 30 cpi r22, 0x01 ; 1 34246: 71 05 cpc r23, r1 34248: 81 05 cpc r24, r1 3424a: 20 e8 ldi r18, 0x80 ; 128 3424c: 92 07 cpc r25, r18 3424e: 08 f4 brcc .+2 ; 0x34252 34250: 52 cf rjmp .-348 ; 0x340f6 34252: 2f ef ldi r18, 0xFF ; 255 34254: 21 96 adiw r28, 0x01 ; 1 34256: 10 81 ld r17, Z 34258: cd cf rjmp .-102 ; 0x341f4 3425a: 10 33 cpi r17, 0x30 ; 48 3425c: 09 f4 brne .+2 ; 0x34260 3425e: 1e cf rjmp .-452 ; 0x3409c 34260: 2a e0 ldi r18, 0x0A ; 10 34262: e2 2e mov r14, r18 34264: f1 2c mov r15, r1 34266: 9c ec ldi r25, 0xCC ; 204 34268: 89 2e mov r8, r25 3426a: 98 2c mov r9, r8 3426c: a8 2c mov r10, r8 3426e: 9c e0 ldi r25, 0x0C ; 12 34270: b9 2e mov r11, r25 34272: b7 cf rjmp .-146 ; 0x341e2 00034274 <__ftoa_engine>: 34274: 28 30 cpi r18, 0x08 ; 8 34276: 08 f0 brcs .+2 ; 0x3427a <__ftoa_engine+0x6> 34278: 27 e0 ldi r18, 0x07 ; 7 3427a: 33 27 eor r19, r19 3427c: da 01 movw r26, r20 3427e: 99 0f add r25, r25 34280: 31 1d adc r19, r1 34282: 87 fd sbrc r24, 7 34284: 91 60 ori r25, 0x01 ; 1 34286: 00 96 adiw r24, 0x00 ; 0 34288: 61 05 cpc r22, r1 3428a: 71 05 cpc r23, r1 3428c: 39 f4 brne .+14 ; 0x3429c <__ftoa_engine+0x28> 3428e: 32 60 ori r19, 0x02 ; 2 34290: 2e 5f subi r18, 0xFE ; 254 34292: 3d 93 st X+, r19 34294: 30 e3 ldi r19, 0x30 ; 48 34296: 2a 95 dec r18 34298: e1 f7 brne .-8 ; 0x34292 <__ftoa_engine+0x1e> 3429a: 08 95 ret 3429c: 9f 3f cpi r25, 0xFF ; 255 3429e: 30 f0 brcs .+12 ; 0x342ac <__ftoa_engine+0x38> 342a0: 80 38 cpi r24, 0x80 ; 128 342a2: 71 05 cpc r23, r1 342a4: 61 05 cpc r22, r1 342a6: 09 f0 breq .+2 ; 0x342aa <__ftoa_engine+0x36> 342a8: 3c 5f subi r19, 0xFC ; 252 342aa: 3c 5f subi r19, 0xFC ; 252 342ac: 3d 93 st X+, r19 342ae: 91 30 cpi r25, 0x01 ; 1 342b0: 08 f0 brcs .+2 ; 0x342b4 <__ftoa_engine+0x40> 342b2: 80 68 ori r24, 0x80 ; 128 342b4: 91 1d adc r25, r1 342b6: df 93 push r29 342b8: cf 93 push r28 342ba: 1f 93 push r17 342bc: 0f 93 push r16 342be: ff 92 push r15 342c0: ef 92 push r14 342c2: 19 2f mov r17, r25 342c4: 98 7f andi r25, 0xF8 ; 248 342c6: 96 95 lsr r25 342c8: e9 2f mov r30, r25 342ca: 96 95 lsr r25 342cc: 96 95 lsr r25 342ce: e9 0f add r30, r25 342d0: ff 27 eor r31, r31 342d2: e6 57 subi r30, 0x76 ; 118 342d4: fd 48 sbci r31, 0x8D ; 141 342d6: 99 27 eor r25, r25 342d8: 33 27 eor r19, r19 342da: ee 24 eor r14, r14 342dc: ff 24 eor r15, r15 342de: a7 01 movw r20, r14 342e0: e7 01 movw r28, r14 342e2: 05 90 lpm r0, Z+ 342e4: 08 94 sec 342e6: 07 94 ror r0 342e8: 28 f4 brcc .+10 ; 0x342f4 <__ftoa_engine+0x80> 342ea: 36 0f add r19, r22 342ec: e7 1e adc r14, r23 342ee: f8 1e adc r15, r24 342f0: 49 1f adc r20, r25 342f2: 51 1d adc r21, r1 342f4: 66 0f add r22, r22 342f6: 77 1f adc r23, r23 342f8: 88 1f adc r24, r24 342fa: 99 1f adc r25, r25 342fc: 06 94 lsr r0 342fe: a1 f7 brne .-24 ; 0x342e8 <__ftoa_engine+0x74> 34300: 05 90 lpm r0, Z+ 34302: 07 94 ror r0 34304: 28 f4 brcc .+10 ; 0x34310 <__ftoa_engine+0x9c> 34306: e7 0e add r14, r23 34308: f8 1e adc r15, r24 3430a: 49 1f adc r20, r25 3430c: 56 1f adc r21, r22 3430e: c1 1d adc r28, r1 34310: 77 0f add r23, r23 34312: 88 1f adc r24, r24 34314: 99 1f adc r25, r25 34316: 66 1f adc r22, r22 34318: 06 94 lsr r0 3431a: a1 f7 brne .-24 ; 0x34304 <__ftoa_engine+0x90> 3431c: 05 90 lpm r0, Z+ 3431e: 07 94 ror r0 34320: 28 f4 brcc .+10 ; 0x3432c <__ftoa_engine+0xb8> 34322: f8 0e add r15, r24 34324: 49 1f adc r20, r25 34326: 56 1f adc r21, r22 34328: c7 1f adc r28, r23 3432a: d1 1d adc r29, r1 3432c: 88 0f add r24, r24 3432e: 99 1f adc r25, r25 34330: 66 1f adc r22, r22 34332: 77 1f adc r23, r23 34334: 06 94 lsr r0 34336: a1 f7 brne .-24 ; 0x34320 <__ftoa_engine+0xac> 34338: 05 90 lpm r0, Z+ 3433a: 07 94 ror r0 3433c: 20 f4 brcc .+8 ; 0x34346 <__ftoa_engine+0xd2> 3433e: 49 0f add r20, r25 34340: 56 1f adc r21, r22 34342: c7 1f adc r28, r23 34344: d8 1f adc r29, r24 34346: 99 0f add r25, r25 34348: 66 1f adc r22, r22 3434a: 77 1f adc r23, r23 3434c: 88 1f adc r24, r24 3434e: 06 94 lsr r0 34350: a9 f7 brne .-22 ; 0x3433c <__ftoa_engine+0xc8> 34352: 84 91 lpm r24, Z 34354: 10 95 com r17 34356: 17 70 andi r17, 0x07 ; 7 34358: 41 f0 breq .+16 ; 0x3436a <__ftoa_engine+0xf6> 3435a: d6 95 lsr r29 3435c: c7 95 ror r28 3435e: 57 95 ror r21 34360: 47 95 ror r20 34362: f7 94 ror r15 34364: e7 94 ror r14 34366: 1a 95 dec r17 34368: c1 f7 brne .-16 ; 0x3435a <__ftoa_engine+0xe6> 3436a: e0 e3 ldi r30, 0x30 ; 48 3436c: f2 e7 ldi r31, 0x72 ; 114 3436e: 68 94 set 34370: 15 90 lpm r1, Z+ 34372: 15 91 lpm r17, Z+ 34374: 35 91 lpm r19, Z+ 34376: 65 91 lpm r22, Z+ 34378: 95 91 lpm r25, Z+ 3437a: 05 90 lpm r0, Z+ 3437c: 7f e2 ldi r23, 0x2F ; 47 3437e: 73 95 inc r23 34380: e1 18 sub r14, r1 34382: f1 0a sbc r15, r17 34384: 43 0b sbc r20, r19 34386: 56 0b sbc r21, r22 34388: c9 0b sbc r28, r25 3438a: d0 09 sbc r29, r0 3438c: c0 f7 brcc .-16 ; 0x3437e <__ftoa_engine+0x10a> 3438e: e1 0c add r14, r1 34390: f1 1e adc r15, r17 34392: 43 1f adc r20, r19 34394: 56 1f adc r21, r22 34396: c9 1f adc r28, r25 34398: d0 1d adc r29, r0 3439a: 7e f4 brtc .+30 ; 0x343ba <__ftoa_engine+0x146> 3439c: 70 33 cpi r23, 0x30 ; 48 3439e: 11 f4 brne .+4 ; 0x343a4 <__ftoa_engine+0x130> 343a0: 8a 95 dec r24 343a2: e6 cf rjmp .-52 ; 0x34370 <__ftoa_engine+0xfc> 343a4: e8 94 clt 343a6: 01 50 subi r16, 0x01 ; 1 343a8: 30 f0 brcs .+12 ; 0x343b6 <__ftoa_engine+0x142> 343aa: 08 0f add r16, r24 343ac: 0a f4 brpl .+2 ; 0x343b0 <__ftoa_engine+0x13c> 343ae: 00 27 eor r16, r16 343b0: 02 17 cp r16, r18 343b2: 08 f4 brcc .+2 ; 0x343b6 <__ftoa_engine+0x142> 343b4: 20 2f mov r18, r16 343b6: 23 95 inc r18 343b8: 02 2f mov r16, r18 343ba: 7a 33 cpi r23, 0x3A ; 58 343bc: 28 f0 brcs .+10 ; 0x343c8 <__ftoa_engine+0x154> 343be: 79 e3 ldi r23, 0x39 ; 57 343c0: 7d 93 st X+, r23 343c2: 2a 95 dec r18 343c4: e9 f7 brne .-6 ; 0x343c0 <__ftoa_engine+0x14c> 343c6: 10 c0 rjmp .+32 ; 0x343e8 <__ftoa_engine+0x174> 343c8: 7d 93 st X+, r23 343ca: 2a 95 dec r18 343cc: 89 f6 brne .-94 ; 0x34370 <__ftoa_engine+0xfc> 343ce: 06 94 lsr r0 343d0: 97 95 ror r25 343d2: 67 95 ror r22 343d4: 37 95 ror r19 343d6: 17 95 ror r17 343d8: 17 94 ror r1 343da: e1 18 sub r14, r1 343dc: f1 0a sbc r15, r17 343de: 43 0b sbc r20, r19 343e0: 56 0b sbc r21, r22 343e2: c9 0b sbc r28, r25 343e4: d0 09 sbc r29, r0 343e6: 98 f0 brcs .+38 ; 0x3440e <__ftoa_engine+0x19a> 343e8: 23 95 inc r18 343ea: 7e 91 ld r23, -X 343ec: 73 95 inc r23 343ee: 7a 33 cpi r23, 0x3A ; 58 343f0: 08 f0 brcs .+2 ; 0x343f4 <__ftoa_engine+0x180> 343f2: 70 e3 ldi r23, 0x30 ; 48 343f4: 7c 93 st X, r23 343f6: 20 13 cpse r18, r16 343f8: b8 f7 brcc .-18 ; 0x343e8 <__ftoa_engine+0x174> 343fa: 7e 91 ld r23, -X 343fc: 70 61 ori r23, 0x10 ; 16 343fe: 7d 93 st X+, r23 34400: 30 f0 brcs .+12 ; 0x3440e <__ftoa_engine+0x19a> 34402: 83 95 inc r24 34404: 71 e3 ldi r23, 0x31 ; 49 34406: 7d 93 st X+, r23 34408: 70 e3 ldi r23, 0x30 ; 48 3440a: 2a 95 dec r18 3440c: e1 f7 brne .-8 ; 0x34406 <__ftoa_engine+0x192> 3440e: 11 24 eor r1, r1 34410: ef 90 pop r14 34412: ff 90 pop r15 34414: 0f 91 pop r16 34416: 1f 91 pop r17 34418: cf 91 pop r28 3441a: df 91 pop r29 3441c: 99 27 eor r25, r25 3441e: 87 fd sbrc r24, 7 34420: 90 95 com r25 34422: 08 95 ret 00034424 : 34424: 91 11 cpse r25, r1 34426: 0d 94 6e a4 jmp 0x348dc ; 0x348dc <__ctype_isfalse> 3442a: 80 32 cpi r24, 0x20 ; 32 3442c: 19 f0 breq .+6 ; 0x34434 3442e: 89 50 subi r24, 0x09 ; 9 34430: 85 50 subi r24, 0x05 ; 5 34432: c8 f7 brcc .-14 ; 0x34426 34434: 08 95 ret 00034436 : 34436: fb 01 movw r30, r22 34438: dc 01 movw r26, r24 3443a: 02 c0 rjmp .+4 ; 0x34440 3443c: 05 90 lpm r0, Z+ 3443e: 0d 92 st X+, r0 34440: 41 50 subi r20, 0x01 ; 1 34442: 50 40 sbci r21, 0x00 ; 0 34444: d8 f7 brcc .-10 ; 0x3443c 34446: 08 95 ret 00034448 : 34448: fb 01 movw r30, r22 3444a: dc 01 movw r26, r24 3444c: 0d 90 ld r0, X+ 3444e: 00 20 and r0, r0 34450: e9 f7 brne .-6 ; 0x3444c 34452: 11 97 sbiw r26, 0x01 ; 1 34454: 05 90 lpm r0, Z+ 34456: 0d 92 st X+, r0 34458: 00 20 and r0, r0 3445a: e1 f7 brne .-8 ; 0x34454 3445c: 08 95 ret 0003445e : 3445e: fb 01 movw r30, r22 34460: dc 01 movw r26, r24 34462: 8d 91 ld r24, X+ 34464: 05 90 lpm r0, Z+ 34466: 80 19 sub r24, r0 34468: 01 10 cpse r0, r1 3446a: d9 f3 breq .-10 ; 0x34462 3446c: 99 0b sbc r25, r25 3446e: 08 95 ret 00034470 : 34470: fb 01 movw r30, r22 34472: dc 01 movw r26, r24 34474: 05 90 lpm r0, Z+ 34476: 0d 92 st X+, r0 34478: 00 20 and r0, r0 3447a: e1 f7 brne .-8 ; 0x34474 3447c: 08 95 ret 0003447e <__strlen_P>: 3447e: fc 01 movw r30, r24 34480: 05 90 lpm r0, Z+ 34482: 00 20 and r0, r0 34484: e9 f7 brne .-6 ; 0x34480 <__strlen_P+0x2> 34486: 80 95 com r24 34488: 90 95 com r25 3448a: 8e 0f add r24, r30 3448c: 9f 1f adc r25, r31 3448e: 08 95 ret 00034490 : 34490: fb 01 movw r30, r22 34492: dc 01 movw r26, r24 34494: 41 50 subi r20, 0x01 ; 1 34496: 50 40 sbci r21, 0x00 ; 0 34498: 88 f0 brcs .+34 ; 0x344bc 3449a: 8d 91 ld r24, X+ 3449c: 81 34 cpi r24, 0x41 ; 65 3449e: 1c f0 brlt .+6 ; 0x344a6 344a0: 8b 35 cpi r24, 0x5B ; 91 344a2: 0c f4 brge .+2 ; 0x344a6 344a4: 80 5e subi r24, 0xE0 ; 224 344a6: 65 91 lpm r22, Z+ 344a8: 61 34 cpi r22, 0x41 ; 65 344aa: 1c f0 brlt .+6 ; 0x344b2 344ac: 6b 35 cpi r22, 0x5B ; 91 344ae: 0c f4 brge .+2 ; 0x344b2 344b0: 60 5e subi r22, 0xE0 ; 224 344b2: 86 1b sub r24, r22 344b4: 61 11 cpse r22, r1 344b6: 71 f3 breq .-36 ; 0x34494 344b8: 99 0b sbc r25, r25 344ba: 08 95 ret 344bc: 88 1b sub r24, r24 344be: fc cf rjmp .-8 ; 0x344b8 000344c0 : 344c0: fb 01 movw r30, r22 344c2: dc 01 movw r26, r24 344c4: 41 50 subi r20, 0x01 ; 1 344c6: 50 40 sbci r21, 0x00 ; 0 344c8: 30 f0 brcs .+12 ; 0x344d6 344ca: 8d 91 ld r24, X+ 344cc: 05 90 lpm r0, Z+ 344ce: 80 19 sub r24, r0 344d0: 19 f4 brne .+6 ; 0x344d8 344d2: 00 20 and r0, r0 344d4: b9 f7 brne .-18 ; 0x344c4 344d6: 88 1b sub r24, r24 344d8: 99 0b sbc r25, r25 344da: 08 95 ret 000344dc : 344dc: fb 01 movw r30, r22 344de: dc 01 movw r26, r24 344e0: 41 50 subi r20, 0x01 ; 1 344e2: 50 40 sbci r21, 0x00 ; 0 344e4: 48 f0 brcs .+18 ; 0x344f8 344e6: 05 90 lpm r0, Z+ 344e8: 0d 92 st X+, r0 344ea: 00 20 and r0, r0 344ec: c9 f7 brne .-14 ; 0x344e0 344ee: 01 c0 rjmp .+2 ; 0x344f2 344f0: 1d 92 st X+, r1 344f2: 41 50 subi r20, 0x01 ; 1 344f4: 50 40 sbci r21, 0x00 ; 0 344f6: e0 f7 brcc .-8 ; 0x344f0 344f8: 08 95 ret 000344fa : 344fa: fc 01 movw r30, r24 344fc: 05 90 lpm r0, Z+ 344fe: 61 50 subi r22, 0x01 ; 1 34500: 70 40 sbci r23, 0x00 ; 0 34502: 01 10 cpse r0, r1 34504: d8 f7 brcc .-10 ; 0x344fc 34506: 80 95 com r24 34508: 90 95 com r25 3450a: 8e 0f add r24, r30 3450c: 9f 1f adc r25, r31 3450e: 08 95 ret 00034510 : 34510: fb 01 movw r30, r22 34512: 55 91 lpm r21, Z+ 34514: 55 23 and r21, r21 34516: a9 f0 breq .+42 ; 0x34542 34518: bf 01 movw r22, r30 3451a: dc 01 movw r26, r24 3451c: 4d 91 ld r20, X+ 3451e: 45 17 cp r20, r21 34520: 41 11 cpse r20, r1 34522: e1 f7 brne .-8 ; 0x3451c 34524: 59 f4 brne .+22 ; 0x3453c 34526: cd 01 movw r24, r26 34528: 05 90 lpm r0, Z+ 3452a: 00 20 and r0, r0 3452c: 49 f0 breq .+18 ; 0x34540 3452e: 4d 91 ld r20, X+ 34530: 40 15 cp r20, r0 34532: 41 11 cpse r20, r1 34534: c9 f3 breq .-14 ; 0x34528 34536: fb 01 movw r30, r22 34538: 41 11 cpse r20, r1 3453a: ef cf rjmp .-34 ; 0x3451a 3453c: 81 e0 ldi r24, 0x01 ; 1 3453e: 90 e0 ldi r25, 0x00 ; 0 34540: 01 97 sbiw r24, 0x01 ; 1 34542: 08 95 ret 00034544 : 34544: fc 01 movw r30, r24 34546: 61 50 subi r22, 0x01 ; 1 34548: 70 40 sbci r23, 0x00 ; 0 3454a: 01 90 ld r0, Z+ 3454c: 01 10 cpse r0, r1 3454e: d8 f7 brcc .-10 ; 0x34546 34550: 80 95 com r24 34552: 90 95 com r25 34554: 8e 0f add r24, r30 34556: 9f 1f adc r25, r31 34558: 08 95 ret 0003455a : 3455a: cf 93 push r28 3455c: df 93 push r29 3455e: ec 01 movw r28, r24 34560: 2b 81 ldd r18, Y+3 ; 0x03 34562: 20 ff sbrs r18, 0 34564: 1a c0 rjmp .+52 ; 0x3459a 34566: 26 ff sbrs r18, 6 34568: 0c c0 rjmp .+24 ; 0x34582 3456a: 2f 7b andi r18, 0xBF ; 191 3456c: 2b 83 std Y+3, r18 ; 0x03 3456e: 8e 81 ldd r24, Y+6 ; 0x06 34570: 9f 81 ldd r25, Y+7 ; 0x07 34572: 01 96 adiw r24, 0x01 ; 1 34574: 9f 83 std Y+7, r25 ; 0x07 34576: 8e 83 std Y+6, r24 ; 0x06 34578: 8a 81 ldd r24, Y+2 ; 0x02 3457a: 90 e0 ldi r25, 0x00 ; 0 3457c: df 91 pop r29 3457e: cf 91 pop r28 34580: 08 95 ret 34582: 22 ff sbrs r18, 2 34584: 18 c0 rjmp .+48 ; 0x345b6 34586: e8 81 ld r30, Y 34588: f9 81 ldd r31, Y+1 ; 0x01 3458a: 80 81 ld r24, Z 3458c: 08 2e mov r0, r24 3458e: 00 0c add r0, r0 34590: 99 0b sbc r25, r25 34592: 00 97 sbiw r24, 0x00 ; 0 34594: 29 f4 brne .+10 ; 0x345a0 34596: 20 62 ori r18, 0x20 ; 32 34598: 2b 83 std Y+3, r18 ; 0x03 3459a: 8f ef ldi r24, 0xFF ; 255 3459c: 9f ef ldi r25, 0xFF ; 255 3459e: ee cf rjmp .-36 ; 0x3457c 345a0: 31 96 adiw r30, 0x01 ; 1 345a2: f9 83 std Y+1, r31 ; 0x01 345a4: e8 83 st Y, r30 345a6: 2e 81 ldd r18, Y+6 ; 0x06 345a8: 3f 81 ldd r19, Y+7 ; 0x07 345aa: 2f 5f subi r18, 0xFF ; 255 345ac: 3f 4f sbci r19, 0xFF ; 255 345ae: 3f 83 std Y+7, r19 ; 0x07 345b0: 2e 83 std Y+6, r18 ; 0x06 345b2: 99 27 eor r25, r25 345b4: e3 cf rjmp .-58 ; 0x3457c 345b6: ea 85 ldd r30, Y+10 ; 0x0a 345b8: fb 85 ldd r31, Y+11 ; 0x0b 345ba: 19 95 eicall 345bc: 97 ff sbrs r25, 7 345be: f3 cf rjmp .-26 ; 0x345a6 345c0: 2b 81 ldd r18, Y+3 ; 0x03 345c2: 01 96 adiw r24, 0x01 ; 1 345c4: 21 f0 breq .+8 ; 0x345ce 345c6: 80 e2 ldi r24, 0x20 ; 32 345c8: 82 2b or r24, r18 345ca: 8b 83 std Y+3, r24 ; 0x03 345cc: e6 cf rjmp .-52 ; 0x3459a 345ce: 80 e1 ldi r24, 0x10 ; 16 345d0: fb cf rjmp .-10 ; 0x345c8 000345d2 : 345d2: 0f 93 push r16 345d4: 1f 93 push r17 345d6: cf 93 push r28 345d8: df 93 push r29 345da: 18 2f mov r17, r24 345dc: 09 2f mov r16, r25 345de: eb 01 movw r28, r22 345e0: 8b 81 ldd r24, Y+3 ; 0x03 345e2: 81 fd sbrc r24, 1 345e4: 09 c0 rjmp .+18 ; 0x345f8 345e6: 1f ef ldi r17, 0xFF ; 255 345e8: 0f ef ldi r16, 0xFF ; 255 345ea: 81 2f mov r24, r17 345ec: 90 2f mov r25, r16 345ee: df 91 pop r29 345f0: cf 91 pop r28 345f2: 1f 91 pop r17 345f4: 0f 91 pop r16 345f6: 08 95 ret 345f8: 82 ff sbrs r24, 2 345fa: 14 c0 rjmp .+40 ; 0x34624 345fc: 2e 81 ldd r18, Y+6 ; 0x06 345fe: 3f 81 ldd r19, Y+7 ; 0x07 34600: 8c 81 ldd r24, Y+4 ; 0x04 34602: 9d 81 ldd r25, Y+5 ; 0x05 34604: 28 17 cp r18, r24 34606: 39 07 cpc r19, r25 34608: 3c f4 brge .+14 ; 0x34618 3460a: e8 81 ld r30, Y 3460c: f9 81 ldd r31, Y+1 ; 0x01 3460e: cf 01 movw r24, r30 34610: 01 96 adiw r24, 0x01 ; 1 34612: 99 83 std Y+1, r25 ; 0x01 34614: 88 83 st Y, r24 34616: 10 83 st Z, r17 34618: 8e 81 ldd r24, Y+6 ; 0x06 3461a: 9f 81 ldd r25, Y+7 ; 0x07 3461c: 01 96 adiw r24, 0x01 ; 1 3461e: 9f 83 std Y+7, r25 ; 0x07 34620: 8e 83 std Y+6, r24 ; 0x06 34622: e3 cf rjmp .-58 ; 0x345ea 34624: e8 85 ldd r30, Y+8 ; 0x08 34626: f9 85 ldd r31, Y+9 ; 0x09 34628: 81 2f mov r24, r17 3462a: 19 95 eicall 3462c: 89 2b or r24, r25 3462e: a1 f3 breq .-24 ; 0x34618 34630: da cf rjmp .-76 ; 0x345e6 00034632 : 34632: ef 92 push r14 34634: ff 92 push r15 34636: 0f 93 push r16 34638: 1f 93 push r17 3463a: cf 93 push r28 3463c: df 93 push r29 3463e: 8c 01 movw r16, r24 34640: 7b 01 movw r14, r22 34642: db 01 movw r26, r22 34644: 13 96 adiw r26, 0x03 ; 3 34646: 8c 91 ld r24, X 34648: d0 e0 ldi r29, 0x00 ; 0 3464a: c0 e0 ldi r28, 0x00 ; 0 3464c: 81 fd sbrc r24, 1 3464e: 0f c0 rjmp .+30 ; 0x3466e 34650: cf ef ldi r28, 0xFF ; 255 34652: df ef ldi r29, 0xFF ; 255 34654: 10 c0 rjmp .+32 ; 0x34676 34656: d7 01 movw r26, r14 34658: 18 96 adiw r26, 0x08 ; 8 3465a: ed 91 ld r30, X+ 3465c: fc 91 ld r31, X 3465e: b7 01 movw r22, r14 34660: 19 95 eicall 34662: 89 2b or r24, r25 34664: 11 f0 breq .+4 ; 0x3466a 34666: cf ef ldi r28, 0xFF ; 255 34668: df ef ldi r29, 0xFF ; 255 3466a: 0f 5f subi r16, 0xFF ; 255 3466c: 1f 4f sbci r17, 0xFF ; 255 3466e: f8 01 movw r30, r16 34670: 84 91 lpm r24, Z 34672: 81 11 cpse r24, r1 34674: f0 cf rjmp .-32 ; 0x34656 34676: ce 01 movw r24, r28 34678: df 91 pop r29 3467a: cf 91 pop r28 3467c: 1f 91 pop r17 3467e: 0f 91 pop r16 34680: ff 90 pop r15 34682: ef 90 pop r14 34684: 08 95 ret 00034686 : 34686: 0f 93 push r16 34688: 1f 93 push r17 3468a: cf 93 push r28 3468c: df 93 push r29 3468e: cd b7 in r28, 0x3d ; 61 34690: de b7 in r29, 0x3e ; 62 34692: ae 01 movw r20, r28 34694: 48 5f subi r20, 0xF8 ; 248 34696: 5f 4f sbci r21, 0xFF ; 255 34698: da 01 movw r26, r20 3469a: 6d 91 ld r22, X+ 3469c: 7d 91 ld r23, X+ 3469e: ad 01 movw r20, r26 346a0: 01 e1 ldi r16, 0x11 ; 17 346a2: 17 e1 ldi r17, 0x17 ; 23 346a4: f8 01 movw r30, r16 346a6: 82 81 ldd r24, Z+2 ; 0x02 346a8: 93 81 ldd r25, Z+3 ; 0x03 346aa: dc 01 movw r26, r24 346ac: 13 96 adiw r26, 0x03 ; 3 346ae: 2c 91 ld r18, X 346b0: 13 97 sbiw r26, 0x03 ; 3 346b2: 28 60 ori r18, 0x08 ; 8 346b4: 13 96 adiw r26, 0x03 ; 3 346b6: 2c 93 st X, r18 346b8: 0e 94 b2 51 call 0xa364 ; 0xa364 346bc: d8 01 movw r26, r16 346be: 12 96 adiw r26, 0x02 ; 2 346c0: ed 91 ld r30, X+ 346c2: fc 91 ld r31, X 346c4: 23 81 ldd r18, Z+3 ; 0x03 346c6: 27 7f andi r18, 0xF7 ; 247 346c8: 23 83 std Z+3, r18 ; 0x03 346ca: df 91 pop r29 346cc: cf 91 pop r28 346ce: 1f 91 pop r17 346d0: 0f 91 pop r16 346d2: 08 95 ret 000346d4 : 346d4: 0f 93 push r16 346d6: 1f 93 push r17 346d8: cf 93 push r28 346da: df 93 push r29 346dc: 8c 01 movw r16, r24 346de: e0 91 13 17 lds r30, 0x1713 ; 0x801713 <__iob+0x2> 346e2: f0 91 14 17 lds r31, 0x1714 ; 0x801714 <__iob+0x3> 346e6: 83 81 ldd r24, Z+3 ; 0x03 346e8: d0 e0 ldi r29, 0x00 ; 0 346ea: c0 e0 ldi r28, 0x00 ; 0 346ec: 81 fd sbrc r24, 1 346ee: 0a c0 rjmp .+20 ; 0x34704 346f0: cf ef ldi r28, 0xFF ; 255 346f2: df ef ldi r29, 0xFF ; 255 346f4: 17 c0 rjmp .+46 ; 0x34724 346f6: 19 95 eicall 346f8: 89 2b or r24, r25 346fa: 11 f0 breq .+4 ; 0x34700 346fc: cf ef ldi r28, 0xFF ; 255 346fe: df ef ldi r29, 0xFF ; 255 34700: 0f 5f subi r16, 0xFF ; 255 34702: 1f 4f sbci r17, 0xFF ; 255 34704: f8 01 movw r30, r16 34706: 84 91 lpm r24, Z 34708: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 3470c: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 34710: db 01 movw r26, r22 34712: 18 96 adiw r26, 0x08 ; 8 34714: ed 91 ld r30, X+ 34716: fc 91 ld r31, X 34718: 81 11 cpse r24, r1 3471a: ed cf rjmp .-38 ; 0x346f6 3471c: 8a e0 ldi r24, 0x0A ; 10 3471e: 19 95 eicall 34720: 89 2b or r24, r25 34722: 31 f7 brne .-52 ; 0x346f0 34724: ce 01 movw r24, r28 34726: df 91 pop r29 34728: cf 91 pop r28 3472a: 1f 91 pop r17 3472c: 0f 91 pop r16 3472e: 08 95 ret 00034730 : 34730: 0f 93 push r16 34732: 1f 93 push r17 34734: cf 93 push r28 34736: df 93 push r29 34738: cd b7 in r28, 0x3d ; 61 3473a: de b7 in r29, 0x3e ; 62 3473c: 2e 97 sbiw r28, 0x0e ; 14 3473e: 0f b6 in r0, 0x3f ; 63 34740: f8 94 cli 34742: de bf out 0x3e, r29 ; 62 34744: 0f be out 0x3f, r0 ; 63 34746: cd bf out 0x3d, r28 ; 61 34748: 0e 89 ldd r16, Y+22 ; 0x16 3474a: 1f 89 ldd r17, Y+23 ; 0x17 3474c: 8e e0 ldi r24, 0x0E ; 14 3474e: 8c 83 std Y+4, r24 ; 0x04 34750: 1a 83 std Y+2, r17 ; 0x02 34752: 09 83 std Y+1, r16 ; 0x01 34754: 8f ef ldi r24, 0xFF ; 255 34756: 9f e7 ldi r25, 0x7F ; 127 34758: 9e 83 std Y+6, r25 ; 0x06 3475a: 8d 83 std Y+5, r24 ; 0x05 3475c: ae 01 movw r20, r28 3475e: 46 5e subi r20, 0xE6 ; 230 34760: 5f 4f sbci r21, 0xFF ; 255 34762: 68 8d ldd r22, Y+24 ; 0x18 34764: 79 8d ldd r23, Y+25 ; 0x19 34766: ce 01 movw r24, r28 34768: 01 96 adiw r24, 0x01 ; 1 3476a: 0e 94 b2 51 call 0xa364 ; 0xa364 3476e: 2f 81 ldd r18, Y+7 ; 0x07 34770: 38 85 ldd r19, Y+8 ; 0x08 34772: 02 0f add r16, r18 34774: 13 1f adc r17, r19 34776: f8 01 movw r30, r16 34778: 10 82 st Z, r1 3477a: 2e 96 adiw r28, 0x0e ; 14 3477c: 0f b6 in r0, 0x3f ; 63 3477e: f8 94 cli 34780: de bf out 0x3e, r29 ; 62 34782: 0f be out 0x3f, r0 ; 63 34784: cd bf out 0x3d, r28 ; 61 34786: df 91 pop r29 34788: cf 91 pop r28 3478a: 1f 91 pop r17 3478c: 0f 91 pop r16 3478e: 08 95 ret 00034790 : 34790: cf 93 push r28 34792: df 93 push r29 34794: ec 01 movw r28, r24 34796: 8b 81 ldd r24, Y+3 ; 0x03 34798: 88 60 ori r24, 0x08 ; 8 3479a: 8b 83 std Y+3, r24 ; 0x03 3479c: ce 01 movw r24, r28 3479e: 0e 94 b2 51 call 0xa364 ; 0xa364 347a2: 2b 81 ldd r18, Y+3 ; 0x03 347a4: 27 7f andi r18, 0xF7 ; 247 347a6: 2b 83 std Y+3, r18 ; 0x03 347a8: df 91 pop r29 347aa: cf 91 pop r28 347ac: 08 95 ret 000347ae : 347ae: 0f 93 push r16 347b0: 1f 93 push r17 347b2: cf 93 push r28 347b4: df 93 push r29 347b6: cd b7 in r28, 0x3d ; 61 347b8: de b7 in r29, 0x3e ; 62 347ba: 2e 97 sbiw r28, 0x0e ; 14 347bc: 0f b6 in r0, 0x3f ; 63 347be: f8 94 cli 347c0: de bf out 0x3e, r29 ; 62 347c2: 0f be out 0x3f, r0 ; 63 347c4: cd bf out 0x3d, r28 ; 61 347c6: 8c 01 movw r16, r24 347c8: fa 01 movw r30, r20 347ca: 8e e0 ldi r24, 0x0E ; 14 347cc: 8c 83 std Y+4, r24 ; 0x04 347ce: 1a 83 std Y+2, r17 ; 0x02 347d0: 09 83 std Y+1, r16 ; 0x01 347d2: 77 ff sbrs r23, 7 347d4: 02 c0 rjmp .+4 ; 0x347da 347d6: 60 e0 ldi r22, 0x00 ; 0 347d8: 70 e8 ldi r23, 0x80 ; 128 347da: 61 50 subi r22, 0x01 ; 1 347dc: 71 09 sbc r23, r1 347de: 7e 83 std Y+6, r23 ; 0x06 347e0: 6d 83 std Y+5, r22 ; 0x05 347e2: a9 01 movw r20, r18 347e4: bf 01 movw r22, r30 347e6: ce 01 movw r24, r28 347e8: 01 96 adiw r24, 0x01 ; 1 347ea: 0e 94 b2 51 call 0xa364 ; 0xa364 347ee: 4d 81 ldd r20, Y+5 ; 0x05 347f0: 5e 81 ldd r21, Y+6 ; 0x06 347f2: 57 fd sbrc r21, 7 347f4: 0a c0 rjmp .+20 ; 0x3480a 347f6: 2f 81 ldd r18, Y+7 ; 0x07 347f8: 38 85 ldd r19, Y+8 ; 0x08 347fa: 42 17 cp r20, r18 347fc: 53 07 cpc r21, r19 347fe: 0c f4 brge .+2 ; 0x34802 34800: 9a 01 movw r18, r20 34802: 02 0f add r16, r18 34804: 13 1f adc r17, r19 34806: f8 01 movw r30, r16 34808: 10 82 st Z, r1 3480a: 2e 96 adiw r28, 0x0e ; 14 3480c: 0f b6 in r0, 0x3f ; 63 3480e: f8 94 cli 34810: de bf out 0x3e, r29 ; 62 34812: 0f be out 0x3f, r0 ; 63 34814: cd bf out 0x3d, r28 ; 61 34816: df 91 pop r29 34818: cf 91 pop r28 3481a: 1f 91 pop r17 3481c: 0f 91 pop r16 3481e: 08 95 ret 00034820 <__ultoa_invert>: 34820: fa 01 movw r30, r20 34822: aa 27 eor r26, r26 34824: 28 30 cpi r18, 0x08 ; 8 34826: 51 f1 breq .+84 ; 0x3487c <__ultoa_invert+0x5c> 34828: 20 31 cpi r18, 0x10 ; 16 3482a: 81 f1 breq .+96 ; 0x3488c <__ultoa_invert+0x6c> 3482c: e8 94 clt 3482e: 6f 93 push r22 34830: 6e 7f andi r22, 0xFE ; 254 34832: 6e 5f subi r22, 0xFE ; 254 34834: 7f 4f sbci r23, 0xFF ; 255 34836: 8f 4f sbci r24, 0xFF ; 255 34838: 9f 4f sbci r25, 0xFF ; 255 3483a: af 4f sbci r26, 0xFF ; 255 3483c: b1 e0 ldi r27, 0x01 ; 1 3483e: 3e d0 rcall .+124 ; 0x348bc <__ultoa_invert+0x9c> 34840: b4 e0 ldi r27, 0x04 ; 4 34842: 3c d0 rcall .+120 ; 0x348bc <__ultoa_invert+0x9c> 34844: 67 0f add r22, r23 34846: 78 1f adc r23, r24 34848: 89 1f adc r24, r25 3484a: 9a 1f adc r25, r26 3484c: a1 1d adc r26, r1 3484e: 68 0f add r22, r24 34850: 79 1f adc r23, r25 34852: 8a 1f adc r24, r26 34854: 91 1d adc r25, r1 34856: a1 1d adc r26, r1 34858: 6a 0f add r22, r26 3485a: 71 1d adc r23, r1 3485c: 81 1d adc r24, r1 3485e: 91 1d adc r25, r1 34860: a1 1d adc r26, r1 34862: 20 d0 rcall .+64 ; 0x348a4 <__ultoa_invert+0x84> 34864: 09 f4 brne .+2 ; 0x34868 <__ultoa_invert+0x48> 34866: 68 94 set 34868: 3f 91 pop r19 3486a: 2a e0 ldi r18, 0x0A ; 10 3486c: 26 9f mul r18, r22 3486e: 11 24 eor r1, r1 34870: 30 19 sub r19, r0 34872: 30 5d subi r19, 0xD0 ; 208 34874: 31 93 st Z+, r19 34876: de f6 brtc .-74 ; 0x3482e <__ultoa_invert+0xe> 34878: cf 01 movw r24, r30 3487a: 08 95 ret 3487c: 46 2f mov r20, r22 3487e: 47 70 andi r20, 0x07 ; 7 34880: 40 5d subi r20, 0xD0 ; 208 34882: 41 93 st Z+, r20 34884: b3 e0 ldi r27, 0x03 ; 3 34886: 0f d0 rcall .+30 ; 0x348a6 <__ultoa_invert+0x86> 34888: c9 f7 brne .-14 ; 0x3487c <__ultoa_invert+0x5c> 3488a: f6 cf rjmp .-20 ; 0x34878 <__ultoa_invert+0x58> 3488c: 46 2f mov r20, r22 3488e: 4f 70 andi r20, 0x0F ; 15 34890: 40 5d subi r20, 0xD0 ; 208 34892: 4a 33 cpi r20, 0x3A ; 58 34894: 18 f0 brcs .+6 ; 0x3489c <__ultoa_invert+0x7c> 34896: 49 5d subi r20, 0xD9 ; 217 34898: 31 fd sbrc r19, 1 3489a: 40 52 subi r20, 0x20 ; 32 3489c: 41 93 st Z+, r20 3489e: 02 d0 rcall .+4 ; 0x348a4 <__ultoa_invert+0x84> 348a0: a9 f7 brne .-22 ; 0x3488c <__ultoa_invert+0x6c> 348a2: ea cf rjmp .-44 ; 0x34878 <__ultoa_invert+0x58> 348a4: b4 e0 ldi r27, 0x04 ; 4 348a6: a6 95 lsr r26 348a8: 97 95 ror r25 348aa: 87 95 ror r24 348ac: 77 95 ror r23 348ae: 67 95 ror r22 348b0: ba 95 dec r27 348b2: c9 f7 brne .-14 ; 0x348a6 <__ultoa_invert+0x86> 348b4: 00 97 sbiw r24, 0x00 ; 0 348b6: 61 05 cpc r22, r1 348b8: 71 05 cpc r23, r1 348ba: 08 95 ret 348bc: 9b 01 movw r18, r22 348be: ac 01 movw r20, r24 348c0: 0a 2e mov r0, r26 348c2: 06 94 lsr r0 348c4: 57 95 ror r21 348c6: 47 95 ror r20 348c8: 37 95 ror r19 348ca: 27 95 ror r18 348cc: ba 95 dec r27 348ce: c9 f7 brne .-14 ; 0x348c2 <__ultoa_invert+0xa2> 348d0: 62 0f add r22, r18 348d2: 73 1f adc r23, r19 348d4: 84 1f adc r24, r20 348d6: 95 1f adc r25, r21 348d8: a0 1d adc r26, r0 348da: 08 95 ret 000348dc <__ctype_isfalse>: 348dc: 99 27 eor r25, r25 348de: 88 27 eor r24, r24 000348e0 <__ctype_istrue>: 348e0: 08 95 ret 000348e2 : 348e2: dc 01 movw r26, r24 348e4: cb 01 movw r24, r22 000348e6 : 348e6: fc 01 movw r30, r24 348e8: f9 99 sbic 0x1f, 1 ; 31 348ea: fe cf rjmp .-4 ; 0x348e8 348ec: 06 c0 rjmp .+12 ; 0x348fa 348ee: f2 bd out 0x22, r31 ; 34 348f0: e1 bd out 0x21, r30 ; 33 348f2: f8 9a sbi 0x1f, 0 ; 31 348f4: 31 96 adiw r30, 0x01 ; 1 348f6: 00 b4 in r0, 0x20 ; 32 348f8: 0d 92 st X+, r0 348fa: 41 50 subi r20, 0x01 ; 1 348fc: 50 40 sbci r21, 0x00 ; 0 348fe: b8 f7 brcc .-18 ; 0x348ee 34900: 08 95 ret 00034902 : 34902: f9 99 sbic 0x1f, 1 ; 31 34904: fe cf rjmp .-4 ; 0x34902 34906: 92 bd out 0x22, r25 ; 34 34908: 81 bd out 0x21, r24 ; 33 3490a: f8 9a sbi 0x1f, 0 ; 31 3490c: 99 27 eor r25, r25 3490e: 80 b5 in r24, 0x20 ; 32 34910: 08 95 ret 00034912 : 34912: a6 e1 ldi r26, 0x16 ; 22 34914: b0 e0 ldi r27, 0x00 ; 0 34916: 44 e0 ldi r20, 0x04 ; 4 34918: 50 e0 ldi r21, 0x00 ; 0 3491a: 0d 94 73 a4 jmp 0x348e6 ; 0x348e6 0003491e : 3491e: a8 e1 ldi r26, 0x18 ; 24 34920: b0 e0 ldi r27, 0x00 ; 0 34922: 42 e0 ldi r20, 0x02 ; 2 34924: 50 e0 ldi r21, 0x00 ; 0 34926: 0d 94 73 a4 jmp 0x348e6 ; 0x348e6 0003492a : 3492a: dc 01 movw r26, r24 3492c: a4 0f add r26, r20 3492e: b5 1f adc r27, r21 34930: 41 50 subi r20, 0x01 ; 1 34932: 50 40 sbci r21, 0x00 ; 0 34934: 48 f0 brcs .+18 ; 0x34948 34936: cb 01 movw r24, r22 34938: 84 0f add r24, r20 3493a: 95 1f adc r25, r21 3493c: 2e 91 ld r18, -X 3493e: 0f 94 a6 a4 call 0x3494c ; 0x3494c 34942: 41 50 subi r20, 0x01 ; 1 34944: 50 40 sbci r21, 0x00 ; 0 34946: d0 f7 brcc .-12 ; 0x3493c 34948: 08 95 ret 0003494a : 3494a: 26 2f mov r18, r22 0003494c : 3494c: f9 99 sbic 0x1f, 1 ; 31 3494e: fe cf rjmp .-4 ; 0x3494c 34950: 92 bd out 0x22, r25 ; 34 34952: 81 bd out 0x21, r24 ; 33 34954: f8 9a sbi 0x1f, 0 ; 31 34956: 01 97 sbiw r24, 0x01 ; 1 34958: 00 b4 in r0, 0x20 ; 32 3495a: 02 16 cp r0, r18 3495c: 39 f0 breq .+14 ; 0x3496c 3495e: 1f ba out 0x1f, r1 ; 31 34960: 20 bd out 0x20, r18 ; 32 34962: 0f b6 in r0, 0x3f ; 63 34964: f8 94 cli 34966: fa 9a sbi 0x1f, 2 ; 31 34968: f9 9a sbi 0x1f, 1 ; 31 3496a: 0f be out 0x3f, r0 ; 63 3496c: 08 95 ret 0003496e : 3496e: 03 96 adiw r24, 0x03 ; 3 34970: 27 2f mov r18, r23 34972: 0f 94 a6 a4 call 0x3494c ; 0x3494c 34976: 0f 94 a5 a4 call 0x3494a ; 0x3494a 3497a: 25 2f mov r18, r21 3497c: 0f 94 a6 a4 call 0x3494c ; 0x3494c 34980: 24 2f mov r18, r20 34982: 0d 94 a6 a4 jmp 0x3494c ; 0x3494c 00034986 : 34986: 01 96 adiw r24, 0x01 ; 1 34988: 27 2f mov r18, r23 3498a: 0f 94 a6 a4 call 0x3494c ; 0x3494c 3498e: 0d 94 a5 a4 jmp 0x3494a ; 0x3494a 00034992 : 34992: 26 2f mov r18, r22 00034994 : 34994: f9 99 sbic 0x1f, 1 ; 31 34996: fe cf rjmp .-4 ; 0x34994 34998: 1f ba out 0x1f, r1 ; 31 3499a: 92 bd out 0x22, r25 ; 34 3499c: 81 bd out 0x21, r24 ; 33 3499e: 20 bd out 0x20, r18 ; 32 349a0: 0f b6 in r0, 0x3f ; 63 349a2: f8 94 cli 349a4: fa 9a sbi 0x1f, 2 ; 31 349a6: f9 9a sbi 0x1f, 1 ; 31 349a8: 0f be out 0x3f, r0 ; 63 349aa: 01 96 adiw r24, 0x01 ; 1 349ac: 08 95 ret 000349ae : 349ae: 24 2f mov r18, r20 349b0: 0f 94 ca a4 call 0x34994 ; 0x34994 349b4: 25 2f mov r18, r21 349b6: 0f 94 ca a4 call 0x34994 ; 0x34994 349ba: 0d 94 df a4 jmp 0x349be ; 0x349be 000349be : 349be: 0f 94 c9 a4 call 0x34992 ; 0x34992 349c2: 27 2f mov r18, r23 349c4: 0d 94 ca a4 jmp 0x34994 ; 0x34994 000349c8 <__mulsi3>: 349c8: db 01 movw r26, r22 349ca: 8f 93 push r24 349cc: 9f 93 push r25 349ce: 0f 94 16 a5 call 0x34a2c ; 0x34a2c <__muluhisi3> 349d2: bf 91 pop r27 349d4: af 91 pop r26 349d6: a2 9f mul r26, r18 349d8: 80 0d add r24, r0 349da: 91 1d adc r25, r1 349dc: a3 9f mul r26, r19 349de: 90 0d add r25, r0 349e0: b2 9f mul r27, r18 349e2: 90 0d add r25, r0 349e4: 11 24 eor r1, r1 349e6: 08 95 ret 000349e8 <__udivmodsi4>: 349e8: a1 e2 ldi r26, 0x21 ; 33 349ea: 1a 2e mov r1, r26 349ec: aa 1b sub r26, r26 349ee: bb 1b sub r27, r27 349f0: fd 01 movw r30, r26 349f2: 0d c0 rjmp .+26 ; 0x34a0e <__udivmodsi4_ep> 000349f4 <__udivmodsi4_loop>: 349f4: aa 1f adc r26, r26 349f6: bb 1f adc r27, r27 349f8: ee 1f adc r30, r30 349fa: ff 1f adc r31, r31 349fc: a2 17 cp r26, r18 349fe: b3 07 cpc r27, r19 34a00: e4 07 cpc r30, r20 34a02: f5 07 cpc r31, r21 34a04: 20 f0 brcs .+8 ; 0x34a0e <__udivmodsi4_ep> 34a06: a2 1b sub r26, r18 34a08: b3 0b sbc r27, r19 34a0a: e4 0b sbc r30, r20 34a0c: f5 0b sbc r31, r21 00034a0e <__udivmodsi4_ep>: 34a0e: 66 1f adc r22, r22 34a10: 77 1f adc r23, r23 34a12: 88 1f adc r24, r24 34a14: 99 1f adc r25, r25 34a16: 1a 94 dec r1 34a18: 69 f7 brne .-38 ; 0x349f4 <__udivmodsi4_loop> 34a1a: 60 95 com r22 34a1c: 70 95 com r23 34a1e: 80 95 com r24 34a20: 90 95 com r25 34a22: 9b 01 movw r18, r22 34a24: ac 01 movw r20, r24 34a26: bd 01 movw r22, r26 34a28: cf 01 movw r24, r30 34a2a: 08 95 ret 00034a2c <__muluhisi3>: 34a2c: 0f 94 21 a5 call 0x34a42 ; 0x34a42 <__umulhisi3> 34a30: a5 9f mul r26, r21 34a32: 90 0d add r25, r0 34a34: b4 9f mul r27, r20 34a36: 90 0d add r25, r0 34a38: a4 9f mul r26, r20 34a3a: 80 0d add r24, r0 34a3c: 91 1d adc r25, r1 34a3e: 11 24 eor r1, r1 34a40: 08 95 ret 00034a42 <__umulhisi3>: 34a42: a2 9f mul r26, r18 34a44: b0 01 movw r22, r0 34a46: b3 9f mul r27, r19 34a48: c0 01 movw r24, r0 34a4a: a3 9f mul r26, r19 34a4c: 70 0d add r23, r0 34a4e: 81 1d adc r24, r1 34a50: 11 24 eor r1, r1 34a52: 91 1d adc r25, r1 34a54: b2 9f mul r27, r18 34a56: 70 0d add r23, r0 34a58: 81 1d adc r24, r1 34a5a: 11 24 eor r1, r1 34a5c: 91 1d adc r25, r1 34a5e: 08 95 ret 00034a60 <__udivmodqi4>: 34a60: 99 1b sub r25, r25 34a62: 79 e0 ldi r23, 0x09 ; 9 34a64: 04 c0 rjmp .+8 ; 0x34a6e <__udivmodqi4_ep> 00034a66 <__udivmodqi4_loop>: 34a66: 99 1f adc r25, r25 34a68: 96 17 cp r25, r22 34a6a: 08 f0 brcs .+2 ; 0x34a6e <__udivmodqi4_ep> 34a6c: 96 1b sub r25, r22 00034a6e <__udivmodqi4_ep>: 34a6e: 88 1f adc r24, r24 34a70: 7a 95 dec r23 34a72: c9 f7 brne .-14 ; 0x34a66 <__udivmodqi4_loop> 34a74: 80 95 com r24 34a76: 08 95 ret 00034a78 <__divmodqi4>: 34a78: 87 fb bst r24, 7 34a7a: 08 2e mov r0, r24 34a7c: 06 26 eor r0, r22 34a7e: 87 fd sbrc r24, 7 34a80: 81 95 neg r24 34a82: 67 fd sbrc r22, 7 34a84: 61 95 neg r22 34a86: 0f 94 30 a5 call 0x34a60 ; 0x34a60 <__udivmodqi4> 34a8a: 0e f4 brtc .+2 ; 0x34a8e <__divmodqi4_1> 34a8c: 91 95 neg r25 00034a8e <__divmodqi4_1>: 34a8e: 07 fc sbrc r0, 7 34a90: 81 95 neg r24 00034a92 <__divmodqi4_exit>: 34a92: 08 95 ret 00034a94 <__udivmodhi4>: 34a94: aa 1b sub r26, r26 34a96: bb 1b sub r27, r27 34a98: 51 e1 ldi r21, 0x11 ; 17 34a9a: 07 c0 rjmp .+14 ; 0x34aaa <__udivmodhi4_ep> 00034a9c <__udivmodhi4_loop>: 34a9c: aa 1f adc r26, r26 34a9e: bb 1f adc r27, r27 34aa0: a6 17 cp r26, r22 34aa2: b7 07 cpc r27, r23 34aa4: 10 f0 brcs .+4 ; 0x34aaa <__udivmodhi4_ep> 34aa6: a6 1b sub r26, r22 34aa8: b7 0b sbc r27, r23 00034aaa <__udivmodhi4_ep>: 34aaa: 88 1f adc r24, r24 34aac: 99 1f adc r25, r25 34aae: 5a 95 dec r21 34ab0: a9 f7 brne .-22 ; 0x34a9c <__udivmodhi4_loop> 34ab2: 80 95 com r24 34ab4: 90 95 com r25 34ab6: bc 01 movw r22, r24 34ab8: cd 01 movw r24, r26 34aba: 08 95 ret 00034abc <__divmodhi4>: 34abc: 97 fb bst r25, 7 34abe: 07 2e mov r0, r23 34ac0: 16 f4 brtc .+4 ; 0x34ac6 <__divmodhi4+0xa> 34ac2: 00 94 com r0 34ac4: 07 d0 rcall .+14 ; 0x34ad4 <__divmodhi4_neg1> 34ac6: 77 fd sbrc r23, 7 34ac8: 09 d0 rcall .+18 ; 0x34adc <__divmodhi4_neg2> 34aca: 0f 94 4a a5 call 0x34a94 ; 0x34a94 <__udivmodhi4> 34ace: 07 fc sbrc r0, 7 34ad0: 05 d0 rcall .+10 ; 0x34adc <__divmodhi4_neg2> 34ad2: 3e f4 brtc .+14 ; 0x34ae2 <__divmodhi4_exit> 00034ad4 <__divmodhi4_neg1>: 34ad4: 90 95 com r25 34ad6: 81 95 neg r24 34ad8: 9f 4f sbci r25, 0xFF ; 255 34ada: 08 95 ret 00034adc <__divmodhi4_neg2>: 34adc: 70 95 com r23 34ade: 61 95 neg r22 34ae0: 7f 4f sbci r23, 0xFF ; 255 00034ae2 <__divmodhi4_exit>: 34ae2: 08 95 ret 00034ae4 <__divmodsi4>: 34ae4: 05 2e mov r0, r21 34ae6: 97 fb bst r25, 7 34ae8: 1e f4 brtc .+6 ; 0x34af0 <__divmodsi4+0xc> 34aea: 00 94 com r0 34aec: 0f 94 89 a5 call 0x34b12 ; 0x34b12 <__negsi2> 34af0: 57 fd sbrc r21, 7 34af2: 07 d0 rcall .+14 ; 0x34b02 <__divmodsi4_neg2> 34af4: 0f 94 f4 a4 call 0x349e8 ; 0x349e8 <__udivmodsi4> 34af8: 07 fc sbrc r0, 7 34afa: 03 d0 rcall .+6 ; 0x34b02 <__divmodsi4_neg2> 34afc: 4e f4 brtc .+18 ; 0x34b10 <__divmodsi4_exit> 34afe: 0d 94 89 a5 jmp 0x34b12 ; 0x34b12 <__negsi2> 00034b02 <__divmodsi4_neg2>: 34b02: 50 95 com r21 34b04: 40 95 com r20 34b06: 30 95 com r19 34b08: 21 95 neg r18 34b0a: 3f 4f sbci r19, 0xFF ; 255 34b0c: 4f 4f sbci r20, 0xFF ; 255 34b0e: 5f 4f sbci r21, 0xFF ; 255 00034b10 <__divmodsi4_exit>: 34b10: 08 95 ret 00034b12 <__negsi2>: 34b12: 90 95 com r25 34b14: 80 95 com r24 34b16: 70 95 com r23 34b18: 61 95 neg r22 34b1a: 7f 4f sbci r23, 0xFF ; 255 34b1c: 8f 4f sbci r24, 0xFF ; 255 34b1e: 9f 4f sbci r25, 0xFF ; 255 34b20: 08 95 ret 00034b22 <__tablejump2__>: 34b22: ee 0f add r30, r30 34b24: ff 1f adc r31, r31 34b26: 88 1f adc r24, r24 34b28: 8b bf out 0x3b, r24 ; 59 34b2a: 07 90 elpm r0, Z+ 34b2c: f6 91 elpm r31, Z 34b2e: e0 2d mov r30, r0 34b30: 19 94 eijmp 00034b32 <__mulhisi3>: 34b32: 0f 94 21 a5 call 0x34a42 ; 0x34a42 <__umulhisi3> 34b36: 33 23 and r19, r19 34b38: 12 f4 brpl .+4 ; 0x34b3e <__mulhisi3+0xc> 34b3a: 8a 1b sub r24, r26 34b3c: 9b 0b sbc r25, r27 34b3e: 0d 94 a3 a5 jmp 0x34b46 ; 0x34b46 <__usmulhisi3_tail> 00034b42 <__usmulhisi3>: 34b42: 0f 94 21 a5 call 0x34a42 ; 0x34a42 <__umulhisi3> 00034b46 <__usmulhisi3_tail>: 34b46: b7 ff sbrs r27, 7 34b48: 08 95 ret 34b4a: 82 1b sub r24, r18 34b4c: 93 0b sbc r25, r19 34b4e: 08 95 ret 00034b50 <__subsf3>: 34b50: 50 58 subi r21, 0x80 ; 128 00034b52 <__addsf3>: 34b52: bb 27 eor r27, r27 34b54: aa 27 eor r26, r26 34b56: 0f 94 c0 a5 call 0x34b80 ; 0x34b80 <__addsf3x> 34b5a: 0d 94 d2 9f jmp 0x33fa4 ; 0x33fa4 <__fp_round> 34b5e: 0f 94 c4 9f call 0x33f88 ; 0x33f88 <__fp_pscA> 34b62: 38 f0 brcs .+14 ; 0x34b72 <__addsf3+0x20> 34b64: 0f 94 cb 9f call 0x33f96 ; 0x33f96 <__fp_pscB> 34b68: 20 f0 brcs .+8 ; 0x34b72 <__addsf3+0x20> 34b6a: 39 f4 brne .+14 ; 0x34b7a <__addsf3+0x28> 34b6c: 9f 3f cpi r25, 0xFF ; 255 34b6e: 19 f4 brne .+6 ; 0x34b76 <__addsf3+0x24> 34b70: 26 f4 brtc .+8 ; 0x34b7a <__addsf3+0x28> 34b72: 0d 94 c1 9f jmp 0x33f82 ; 0x33f82 <__fp_nan> 34b76: 0e f4 brtc .+2 ; 0x34b7a <__addsf3+0x28> 34b78: e0 95 com r30 34b7a: e7 fb bst r30, 7 34b7c: 0d 94 bb 9f jmp 0x33f76 ; 0x33f76 <__fp_inf> 00034b80 <__addsf3x>: 34b80: e9 2f mov r30, r25 34b82: 0f 94 e3 9f call 0x33fc6 ; 0x33fc6 <__fp_split3> 34b86: 58 f3 brcs .-42 ; 0x34b5e <__addsf3+0xc> 34b88: ba 17 cp r27, r26 34b8a: 62 07 cpc r22, r18 34b8c: 73 07 cpc r23, r19 34b8e: 84 07 cpc r24, r20 34b90: 95 07 cpc r25, r21 34b92: 20 f0 brcs .+8 ; 0x34b9c <__addsf3x+0x1c> 34b94: 79 f4 brne .+30 ; 0x34bb4 <__addsf3x+0x34> 34b96: a6 f5 brtc .+104 ; 0x34c00 <__addsf3x+0x80> 34b98: 0d 94 05 a0 jmp 0x3400a ; 0x3400a <__fp_zero> 34b9c: 0e f4 brtc .+2 ; 0x34ba0 <__addsf3x+0x20> 34b9e: e0 95 com r30 34ba0: 0b 2e mov r0, r27 34ba2: ba 2f mov r27, r26 34ba4: a0 2d mov r26, r0 34ba6: 0b 01 movw r0, r22 34ba8: b9 01 movw r22, r18 34baa: 90 01 movw r18, r0 34bac: 0c 01 movw r0, r24 34bae: ca 01 movw r24, r20 34bb0: a0 01 movw r20, r0 34bb2: 11 24 eor r1, r1 34bb4: ff 27 eor r31, r31 34bb6: 59 1b sub r21, r25 34bb8: 99 f0 breq .+38 ; 0x34be0 <__addsf3x+0x60> 34bba: 59 3f cpi r21, 0xF9 ; 249 34bbc: 50 f4 brcc .+20 ; 0x34bd2 <__addsf3x+0x52> 34bbe: 50 3e cpi r21, 0xE0 ; 224 34bc0: 68 f1 brcs .+90 ; 0x34c1c <__addsf3x+0x9c> 34bc2: 1a 16 cp r1, r26 34bc4: f0 40 sbci r31, 0x00 ; 0 34bc6: a2 2f mov r26, r18 34bc8: 23 2f mov r18, r19 34bca: 34 2f mov r19, r20 34bcc: 44 27 eor r20, r20 34bce: 58 5f subi r21, 0xF8 ; 248 34bd0: f3 cf rjmp .-26 ; 0x34bb8 <__addsf3x+0x38> 34bd2: 46 95 lsr r20 34bd4: 37 95 ror r19 34bd6: 27 95 ror r18 34bd8: a7 95 ror r26 34bda: f0 40 sbci r31, 0x00 ; 0 34bdc: 53 95 inc r21 34bde: c9 f7 brne .-14 ; 0x34bd2 <__addsf3x+0x52> 34be0: 7e f4 brtc .+30 ; 0x34c00 <__addsf3x+0x80> 34be2: 1f 16 cp r1, r31 34be4: ba 0b sbc r27, r26 34be6: 62 0b sbc r22, r18 34be8: 73 0b sbc r23, r19 34bea: 84 0b sbc r24, r20 34bec: ba f0 brmi .+46 ; 0x34c1c <__addsf3x+0x9c> 34bee: 91 50 subi r25, 0x01 ; 1 34bf0: a1 f0 breq .+40 ; 0x34c1a <__addsf3x+0x9a> 34bf2: ff 0f add r31, r31 34bf4: bb 1f adc r27, r27 34bf6: 66 1f adc r22, r22 34bf8: 77 1f adc r23, r23 34bfa: 88 1f adc r24, r24 34bfc: c2 f7 brpl .-16 ; 0x34bee <__addsf3x+0x6e> 34bfe: 0e c0 rjmp .+28 ; 0x34c1c <__addsf3x+0x9c> 34c00: ba 0f add r27, r26 34c02: 62 1f adc r22, r18 34c04: 73 1f adc r23, r19 34c06: 84 1f adc r24, r20 34c08: 48 f4 brcc .+18 ; 0x34c1c <__addsf3x+0x9c> 34c0a: 87 95 ror r24 34c0c: 77 95 ror r23 34c0e: 67 95 ror r22 34c10: b7 95 ror r27 34c12: f7 95 ror r31 34c14: 9e 3f cpi r25, 0xFE ; 254 34c16: 08 f0 brcs .+2 ; 0x34c1a <__addsf3x+0x9a> 34c18: b0 cf rjmp .-160 ; 0x34b7a <__addsf3+0x28> 34c1a: 93 95 inc r25 34c1c: 88 0f add r24, r24 34c1e: 08 f0 brcs .+2 ; 0x34c22 <__addsf3x+0xa2> 34c20: 99 27 eor r25, r25 34c22: ee 0f add r30, r30 34c24: 97 95 ror r25 34c26: 87 95 ror r24 34c28: 08 95 ret 34c2a: 0f 94 c4 9f call 0x33f88 ; 0x33f88 <__fp_pscA> 34c2e: 60 f0 brcs .+24 ; 0x34c48 <__addsf3x+0xc8> 34c30: 80 e8 ldi r24, 0x80 ; 128 34c32: 91 e0 ldi r25, 0x01 ; 1 34c34: 09 f4 brne .+2 ; 0x34c38 <__addsf3x+0xb8> 34c36: 9e ef ldi r25, 0xFE ; 254 34c38: 0f 94 cb 9f call 0x33f96 ; 0x33f96 <__fp_pscB> 34c3c: 28 f0 brcs .+10 ; 0x34c48 <__addsf3x+0xc8> 34c3e: 40 e8 ldi r20, 0x80 ; 128 34c40: 51 e0 ldi r21, 0x01 ; 1 34c42: 71 f4 brne .+28 ; 0x34c60 34c44: 5e ef ldi r21, 0xFE ; 254 34c46: 0c c0 rjmp .+24 ; 0x34c60 34c48: 0d 94 c1 9f jmp 0x33f82 ; 0x33f82 <__fp_nan> 34c4c: 0d 94 05 a0 jmp 0x3400a ; 0x3400a <__fp_zero> 00034c50 : 34c50: e9 2f mov r30, r25 34c52: e0 78 andi r30, 0x80 ; 128 34c54: 0f 94 e3 9f call 0x33fc6 ; 0x33fc6 <__fp_split3> 34c58: 40 f3 brcs .-48 ; 0x34c2a <__addsf3x+0xaa> 34c5a: 09 2e mov r0, r25 34c5c: 05 2a or r0, r21 34c5e: b1 f3 breq .-20 ; 0x34c4c <__addsf3x+0xcc> 34c60: 26 17 cp r18, r22 34c62: 37 07 cpc r19, r23 34c64: 48 07 cpc r20, r24 34c66: 59 07 cpc r21, r25 34c68: 38 f0 brcs .+14 ; 0x34c78 34c6a: 0e 2e mov r0, r30 34c6c: 07 f8 bld r0, 7 34c6e: e0 25 eor r30, r0 34c70: 69 f0 breq .+26 ; 0x34c8c 34c72: e0 25 eor r30, r0 34c74: e0 64 ori r30, 0x40 ; 64 34c76: 0a c0 rjmp .+20 ; 0x34c8c 34c78: ef 63 ori r30, 0x3F ; 63 34c7a: 07 f8 bld r0, 7 34c7c: 00 94 com r0 34c7e: 07 fa bst r0, 7 34c80: db 01 movw r26, r22 34c82: b9 01 movw r22, r18 34c84: 9d 01 movw r18, r26 34c86: dc 01 movw r26, r24 34c88: ca 01 movw r24, r20 34c8a: ad 01 movw r20, r26 34c8c: ef 93 push r30 34c8e: 0f 94 bf a6 call 0x34d7e ; 0x34d7e <__divsf3_pse> 34c92: 0f 94 d2 9f call 0x33fa4 ; 0x33fa4 <__fp_round> 34c96: 0f 94 58 a6 call 0x34cb0 ; 0x34cb0 34c9a: 5f 91 pop r21 34c9c: 55 23 and r21, r21 34c9e: 39 f0 breq .+14 ; 0x34cae 34ca0: 2b ed ldi r18, 0xDB ; 219 34ca2: 3f e0 ldi r19, 0x0F ; 15 34ca4: 49 e4 ldi r20, 0x49 ; 73 34ca6: 50 fd sbrc r21, 0 34ca8: 49 ec ldi r20, 0xC9 ; 201 34caa: 0d 94 a9 a5 jmp 0x34b52 ; 0x34b52 <__addsf3> 34cae: 08 95 ret 00034cb0 : 34cb0: df 93 push r29 34cb2: dd 27 eor r29, r29 34cb4: b9 2f mov r27, r25 34cb6: bf 77 andi r27, 0x7F ; 127 34cb8: 40 e8 ldi r20, 0x80 ; 128 34cba: 5f e3 ldi r21, 0x3F ; 63 34cbc: 16 16 cp r1, r22 34cbe: 17 06 cpc r1, r23 34cc0: 48 07 cpc r20, r24 34cc2: 5b 07 cpc r21, r27 34cc4: 18 f4 brcc .+6 ; 0x34ccc 34cc6: d9 2f mov r29, r25 34cc8: 0f 94 a4 a8 call 0x35148 ; 0x35148 34ccc: 9f 93 push r25 34cce: 8f 93 push r24 34cd0: 7f 93 push r23 34cd2: 6f 93 push r22 34cd4: 0f 94 4a 9f call 0x33e94 ; 0x33e94 34cd8: eb e5 ldi r30, 0x5B ; 91 34cda: fd e6 ldi r31, 0x6D ; 109 34cdc: 0f 94 b4 a7 call 0x34f68 ; 0x34f68 <__fp_powser> 34ce0: 0f 94 d2 9f call 0x33fa4 ; 0x33fa4 <__fp_round> 34ce4: 2f 91 pop r18 34ce6: 3f 91 pop r19 34ce8: 4f 91 pop r20 34cea: 5f 91 pop r21 34cec: 0f 94 61 9f call 0x33ec2 ; 0x33ec2 <__mulsf3x> 34cf0: dd 23 and r29, r29 34cf2: 51 f0 breq .+20 ; 0x34d08 34cf4: 90 58 subi r25, 0x80 ; 128 34cf6: a2 ea ldi r26, 0xA2 ; 162 34cf8: 2a ed ldi r18, 0xDA ; 218 34cfa: 3f e0 ldi r19, 0x0F ; 15 34cfc: 49 ec ldi r20, 0xC9 ; 201 34cfe: 5f e3 ldi r21, 0x3F ; 63 34d00: d0 78 andi r29, 0x80 ; 128 34d02: 5d 27 eor r21, r29 34d04: 0f 94 c0 a5 call 0x34b80 ; 0x34b80 <__addsf3x> 34d08: df 91 pop r29 34d0a: 0d 94 d2 9f jmp 0x33fa4 ; 0x33fa4 <__fp_round> 00034d0e : 34d0e: 0f 94 1a a8 call 0x35034 ; 0x35034 <__fp_trunc> 34d12: 90 f0 brcs .+36 ; 0x34d38 34d14: 9f 37 cpi r25, 0x7F ; 127 34d16: 48 f4 brcc .+18 ; 0x34d2a 34d18: 91 11 cpse r25, r1 34d1a: 16 f4 brtc .+4 ; 0x34d20 34d1c: 0d 94 06 a0 jmp 0x3400c ; 0x3400c <__fp_szero> 34d20: 60 e0 ldi r22, 0x00 ; 0 34d22: 70 e0 ldi r23, 0x00 ; 0 34d24: 80 e8 ldi r24, 0x80 ; 128 34d26: 9f e3 ldi r25, 0x3F ; 63 34d28: 08 95 ret 34d2a: 26 f0 brts .+8 ; 0x34d34 34d2c: 1b 16 cp r1, r27 34d2e: 61 1d adc r22, r1 34d30: 71 1d adc r23, r1 34d32: 81 1d adc r24, r1 34d34: 0d 94 8b a7 jmp 0x34f16 ; 0x34f16 <__fp_mintl> 34d38: 0d 94 a6 a7 jmp 0x34f4c ; 0x34f4c <__fp_mpack> 00034d3c <__cmpsf2>: 34d3c: 0f 94 67 a7 call 0x34ece ; 0x34ece <__fp_cmp> 34d40: 08 f4 brcc .+2 ; 0x34d44 <__cmpsf2+0x8> 34d42: 81 e0 ldi r24, 0x01 ; 1 34d44: 08 95 ret 00034d46 : 34d46: 0f 94 dd a7 call 0x34fba ; 0x34fba <__fp_rempio2> 34d4a: e3 95 inc r30 34d4c: 0d 94 06 a8 jmp 0x3500c ; 0x3500c <__fp_sinus> 00034d50 <__divsf3>: 34d50: 0f 94 bc a6 call 0x34d78 ; 0x34d78 <__divsf3x> 34d54: 0d 94 d2 9f jmp 0x33fa4 ; 0x33fa4 <__fp_round> 34d58: 0f 94 cb 9f call 0x33f96 ; 0x33f96 <__fp_pscB> 34d5c: 58 f0 brcs .+22 ; 0x34d74 <__divsf3+0x24> 34d5e: 0f 94 c4 9f call 0x33f88 ; 0x33f88 <__fp_pscA> 34d62: 40 f0 brcs .+16 ; 0x34d74 <__divsf3+0x24> 34d64: 29 f4 brne .+10 ; 0x34d70 <__divsf3+0x20> 34d66: 5f 3f cpi r21, 0xFF ; 255 34d68: 29 f0 breq .+10 ; 0x34d74 <__divsf3+0x24> 34d6a: 0d 94 bb 9f jmp 0x33f76 ; 0x33f76 <__fp_inf> 34d6e: 51 11 cpse r21, r1 34d70: 0d 94 06 a0 jmp 0x3400c ; 0x3400c <__fp_szero> 34d74: 0d 94 c1 9f jmp 0x33f82 ; 0x33f82 <__fp_nan> 00034d78 <__divsf3x>: 34d78: 0f 94 e3 9f call 0x33fc6 ; 0x33fc6 <__fp_split3> 34d7c: 68 f3 brcs .-38 ; 0x34d58 <__divsf3+0x8> 00034d7e <__divsf3_pse>: 34d7e: 99 23 and r25, r25 34d80: b1 f3 breq .-20 ; 0x34d6e <__divsf3+0x1e> 34d82: 55 23 and r21, r21 34d84: 91 f3 breq .-28 ; 0x34d6a <__divsf3+0x1a> 34d86: 95 1b sub r25, r21 34d88: 55 0b sbc r21, r21 34d8a: bb 27 eor r27, r27 34d8c: aa 27 eor r26, r26 34d8e: 62 17 cp r22, r18 34d90: 73 07 cpc r23, r19 34d92: 84 07 cpc r24, r20 34d94: 38 f0 brcs .+14 ; 0x34da4 <__divsf3_pse+0x26> 34d96: 9f 5f subi r25, 0xFF ; 255 34d98: 5f 4f sbci r21, 0xFF ; 255 34d9a: 22 0f add r18, r18 34d9c: 33 1f adc r19, r19 34d9e: 44 1f adc r20, r20 34da0: aa 1f adc r26, r26 34da2: a9 f3 breq .-22 ; 0x34d8e <__divsf3_pse+0x10> 34da4: 35 d0 rcall .+106 ; 0x34e10 <__divsf3_pse+0x92> 34da6: 0e 2e mov r0, r30 34da8: 3a f0 brmi .+14 ; 0x34db8 <__divsf3_pse+0x3a> 34daa: e0 e8 ldi r30, 0x80 ; 128 34dac: 32 d0 rcall .+100 ; 0x34e12 <__divsf3_pse+0x94> 34dae: 91 50 subi r25, 0x01 ; 1 34db0: 50 40 sbci r21, 0x00 ; 0 34db2: e6 95 lsr r30 34db4: 00 1c adc r0, r0 34db6: ca f7 brpl .-14 ; 0x34daa <__divsf3_pse+0x2c> 34db8: 2b d0 rcall .+86 ; 0x34e10 <__divsf3_pse+0x92> 34dba: fe 2f mov r31, r30 34dbc: 29 d0 rcall .+82 ; 0x34e10 <__divsf3_pse+0x92> 34dbe: 66 0f add r22, r22 34dc0: 77 1f adc r23, r23 34dc2: 88 1f adc r24, r24 34dc4: bb 1f adc r27, r27 34dc6: 26 17 cp r18, r22 34dc8: 37 07 cpc r19, r23 34dca: 48 07 cpc r20, r24 34dcc: ab 07 cpc r26, r27 34dce: b0 e8 ldi r27, 0x80 ; 128 34dd0: 09 f0 breq .+2 ; 0x34dd4 <__divsf3_pse+0x56> 34dd2: bb 0b sbc r27, r27 34dd4: 80 2d mov r24, r0 34dd6: bf 01 movw r22, r30 34dd8: ff 27 eor r31, r31 34dda: 93 58 subi r25, 0x83 ; 131 34ddc: 5f 4f sbci r21, 0xFF ; 255 34dde: 3a f0 brmi .+14 ; 0x34dee <__divsf3_pse+0x70> 34de0: 9e 3f cpi r25, 0xFE ; 254 34de2: 51 05 cpc r21, r1 34de4: 78 f0 brcs .+30 ; 0x34e04 <__divsf3_pse+0x86> 34de6: 0d 94 bb 9f jmp 0x33f76 ; 0x33f76 <__fp_inf> 34dea: 0d 94 06 a0 jmp 0x3400c ; 0x3400c <__fp_szero> 34dee: 5f 3f cpi r21, 0xFF ; 255 34df0: e4 f3 brlt .-8 ; 0x34dea <__divsf3_pse+0x6c> 34df2: 98 3e cpi r25, 0xE8 ; 232 34df4: d4 f3 brlt .-12 ; 0x34dea <__divsf3_pse+0x6c> 34df6: 86 95 lsr r24 34df8: 77 95 ror r23 34dfa: 67 95 ror r22 34dfc: b7 95 ror r27 34dfe: f7 95 ror r31 34e00: 9f 5f subi r25, 0xFF ; 255 34e02: c9 f7 brne .-14 ; 0x34df6 <__divsf3_pse+0x78> 34e04: 88 0f add r24, r24 34e06: 91 1d adc r25, r1 34e08: 96 95 lsr r25 34e0a: 87 95 ror r24 34e0c: 97 f9 bld r25, 7 34e0e: 08 95 ret 34e10: e1 e0 ldi r30, 0x01 ; 1 34e12: 66 0f add r22, r22 34e14: 77 1f adc r23, r23 34e16: 88 1f adc r24, r24 34e18: bb 1f adc r27, r27 34e1a: 62 17 cp r22, r18 34e1c: 73 07 cpc r23, r19 34e1e: 84 07 cpc r24, r20 34e20: ba 07 cpc r27, r26 34e22: 20 f0 brcs .+8 ; 0x34e2c <__divsf3_pse+0xae> 34e24: 62 1b sub r22, r18 34e26: 73 0b sbc r23, r19 34e28: 84 0b sbc r24, r20 34e2a: ba 0b sbc r27, r26 34e2c: ee 1f adc r30, r30 34e2e: 88 f7 brcc .-30 ; 0x34e12 <__divsf3_pse+0x94> 34e30: e0 95 com r30 34e32: 08 95 ret 00034e34 <__fixsfsi>: 34e34: 0f 94 21 a7 call 0x34e42 ; 0x34e42 <__fixunssfsi> 34e38: 68 94 set 34e3a: b1 11 cpse r27, r1 34e3c: 0d 94 06 a0 jmp 0x3400c ; 0x3400c <__fp_szero> 34e40: 08 95 ret 00034e42 <__fixunssfsi>: 34e42: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 <__fp_splitA> 34e46: 88 f0 brcs .+34 ; 0x34e6a <__fixunssfsi+0x28> 34e48: 9f 57 subi r25, 0x7F ; 127 34e4a: 98 f0 brcs .+38 ; 0x34e72 <__fixunssfsi+0x30> 34e4c: b9 2f mov r27, r25 34e4e: 99 27 eor r25, r25 34e50: b7 51 subi r27, 0x17 ; 23 34e52: b0 f0 brcs .+44 ; 0x34e80 <__fixunssfsi+0x3e> 34e54: e1 f0 breq .+56 ; 0x34e8e <__fixunssfsi+0x4c> 34e56: 66 0f add r22, r22 34e58: 77 1f adc r23, r23 34e5a: 88 1f adc r24, r24 34e5c: 99 1f adc r25, r25 34e5e: 1a f0 brmi .+6 ; 0x34e66 <__fixunssfsi+0x24> 34e60: ba 95 dec r27 34e62: c9 f7 brne .-14 ; 0x34e56 <__fixunssfsi+0x14> 34e64: 14 c0 rjmp .+40 ; 0x34e8e <__fixunssfsi+0x4c> 34e66: b1 30 cpi r27, 0x01 ; 1 34e68: 91 f0 breq .+36 ; 0x34e8e <__fixunssfsi+0x4c> 34e6a: 0f 94 05 a0 call 0x3400a ; 0x3400a <__fp_zero> 34e6e: b1 e0 ldi r27, 0x01 ; 1 34e70: 08 95 ret 34e72: 0d 94 05 a0 jmp 0x3400a ; 0x3400a <__fp_zero> 34e76: 67 2f mov r22, r23 34e78: 78 2f mov r23, r24 34e7a: 88 27 eor r24, r24 34e7c: b8 5f subi r27, 0xF8 ; 248 34e7e: 39 f0 breq .+14 ; 0x34e8e <__fixunssfsi+0x4c> 34e80: b9 3f cpi r27, 0xF9 ; 249 34e82: cc f3 brlt .-14 ; 0x34e76 <__fixunssfsi+0x34> 34e84: 86 95 lsr r24 34e86: 77 95 ror r23 34e88: 67 95 ror r22 34e8a: b3 95 inc r27 34e8c: d9 f7 brne .-10 ; 0x34e84 <__fixunssfsi+0x42> 34e8e: 3e f4 brtc .+14 ; 0x34e9e <__fixunssfsi+0x5c> 34e90: 90 95 com r25 34e92: 80 95 com r24 34e94: 70 95 com r23 34e96: 61 95 neg r22 34e98: 7f 4f sbci r23, 0xFF ; 255 34e9a: 8f 4f sbci r24, 0xFF ; 255 34e9c: 9f 4f sbci r25, 0xFF ; 255 34e9e: 08 95 ret 00034ea0 : 34ea0: 0f 94 1a a8 call 0x35034 ; 0x35034 <__fp_trunc> 34ea4: 90 f0 brcs .+36 ; 0x34eca 34ea6: 9f 37 cpi r25, 0x7F ; 127 34ea8: 48 f4 brcc .+18 ; 0x34ebc 34eaa: 91 11 cpse r25, r1 34eac: 16 f0 brts .+4 ; 0x34eb2 34eae: 0d 94 06 a0 jmp 0x3400c ; 0x3400c <__fp_szero> 34eb2: 60 e0 ldi r22, 0x00 ; 0 34eb4: 70 e0 ldi r23, 0x00 ; 0 34eb6: 80 e8 ldi r24, 0x80 ; 128 34eb8: 9f eb ldi r25, 0xBF ; 191 34eba: 08 95 ret 34ebc: 26 f4 brtc .+8 ; 0x34ec6 34ebe: 1b 16 cp r1, r27 34ec0: 61 1d adc r22, r1 34ec2: 71 1d adc r23, r1 34ec4: 81 1d adc r24, r1 34ec6: 0d 94 8b a7 jmp 0x34f16 ; 0x34f16 <__fp_mintl> 34eca: 0d 94 a6 a7 jmp 0x34f4c ; 0x34f4c <__fp_mpack> 00034ece <__fp_cmp>: 34ece: 99 0f add r25, r25 34ed0: 00 08 sbc r0, r0 34ed2: 55 0f add r21, r21 34ed4: aa 0b sbc r26, r26 34ed6: e0 e8 ldi r30, 0x80 ; 128 34ed8: fe ef ldi r31, 0xFE ; 254 34eda: 16 16 cp r1, r22 34edc: 17 06 cpc r1, r23 34ede: e8 07 cpc r30, r24 34ee0: f9 07 cpc r31, r25 34ee2: c0 f0 brcs .+48 ; 0x34f14 <__fp_cmp+0x46> 34ee4: 12 16 cp r1, r18 34ee6: 13 06 cpc r1, r19 34ee8: e4 07 cpc r30, r20 34eea: f5 07 cpc r31, r21 34eec: 98 f0 brcs .+38 ; 0x34f14 <__fp_cmp+0x46> 34eee: 62 1b sub r22, r18 34ef0: 73 0b sbc r23, r19 34ef2: 84 0b sbc r24, r20 34ef4: 95 0b sbc r25, r21 34ef6: 39 f4 brne .+14 ; 0x34f06 <__fp_cmp+0x38> 34ef8: 0a 26 eor r0, r26 34efa: 61 f0 breq .+24 ; 0x34f14 <__fp_cmp+0x46> 34efc: 23 2b or r18, r19 34efe: 24 2b or r18, r20 34f00: 25 2b or r18, r21 34f02: 21 f4 brne .+8 ; 0x34f0c <__fp_cmp+0x3e> 34f04: 08 95 ret 34f06: 0a 26 eor r0, r26 34f08: 09 f4 brne .+2 ; 0x34f0c <__fp_cmp+0x3e> 34f0a: a1 40 sbci r26, 0x01 ; 1 34f0c: a6 95 lsr r26 34f0e: 8f ef ldi r24, 0xFF ; 255 34f10: 81 1d adc r24, r1 34f12: 81 1d adc r24, r1 34f14: 08 95 ret 00034f16 <__fp_mintl>: 34f16: 88 23 and r24, r24 34f18: 71 f4 brne .+28 ; 0x34f36 <__fp_mintl+0x20> 34f1a: 77 23 and r23, r23 34f1c: 21 f0 breq .+8 ; 0x34f26 <__fp_mintl+0x10> 34f1e: 98 50 subi r25, 0x08 ; 8 34f20: 87 2b or r24, r23 34f22: 76 2f mov r23, r22 34f24: 07 c0 rjmp .+14 ; 0x34f34 <__fp_mintl+0x1e> 34f26: 66 23 and r22, r22 34f28: 11 f4 brne .+4 ; 0x34f2e <__fp_mintl+0x18> 34f2a: 99 27 eor r25, r25 34f2c: 0d c0 rjmp .+26 ; 0x34f48 <__fp_mintl+0x32> 34f2e: 90 51 subi r25, 0x10 ; 16 34f30: 86 2b or r24, r22 34f32: 70 e0 ldi r23, 0x00 ; 0 34f34: 60 e0 ldi r22, 0x00 ; 0 34f36: 2a f0 brmi .+10 ; 0x34f42 <__fp_mintl+0x2c> 34f38: 9a 95 dec r25 34f3a: 66 0f add r22, r22 34f3c: 77 1f adc r23, r23 34f3e: 88 1f adc r24, r24 34f40: da f7 brpl .-10 ; 0x34f38 <__fp_mintl+0x22> 34f42: 88 0f add r24, r24 34f44: 96 95 lsr r25 34f46: 87 95 ror r24 34f48: 97 f9 bld r25, 7 34f4a: 08 95 ret 00034f4c <__fp_mpack>: 34f4c: 9f 3f cpi r25, 0xFF ; 255 34f4e: 31 f0 breq .+12 ; 0x34f5c <__fp_mpack_finite+0xc> 00034f50 <__fp_mpack_finite>: 34f50: 91 50 subi r25, 0x01 ; 1 34f52: 20 f4 brcc .+8 ; 0x34f5c <__fp_mpack_finite+0xc> 34f54: 87 95 ror r24 34f56: 77 95 ror r23 34f58: 67 95 ror r22 34f5a: b7 95 ror r27 34f5c: 88 0f add r24, r24 34f5e: 91 1d adc r25, r1 34f60: 96 95 lsr r25 34f62: 87 95 ror r24 34f64: 97 f9 bld r25, 7 34f66: 08 95 ret 00034f68 <__fp_powser>: 34f68: df 93 push r29 34f6a: cf 93 push r28 34f6c: 1f 93 push r17 34f6e: 0f 93 push r16 34f70: ff 92 push r15 34f72: ef 92 push r14 34f74: df 92 push r13 34f76: 7b 01 movw r14, r22 34f78: 8c 01 movw r16, r24 34f7a: 68 94 set 34f7c: 06 c0 rjmp .+12 ; 0x34f8a <__fp_powser+0x22> 34f7e: da 2e mov r13, r26 34f80: ef 01 movw r28, r30 34f82: 0f 94 61 9f call 0x33ec2 ; 0x33ec2 <__mulsf3x> 34f86: fe 01 movw r30, r28 34f88: e8 94 clt 34f8a: a5 91 lpm r26, Z+ 34f8c: 25 91 lpm r18, Z+ 34f8e: 35 91 lpm r19, Z+ 34f90: 45 91 lpm r20, Z+ 34f92: 55 91 lpm r21, Z+ 34f94: a6 f3 brts .-24 ; 0x34f7e <__fp_powser+0x16> 34f96: ef 01 movw r28, r30 34f98: 0f 94 c0 a5 call 0x34b80 ; 0x34b80 <__addsf3x> 34f9c: fe 01 movw r30, r28 34f9e: 97 01 movw r18, r14 34fa0: a8 01 movw r20, r16 34fa2: da 94 dec r13 34fa4: 69 f7 brne .-38 ; 0x34f80 <__fp_powser+0x18> 34fa6: df 90 pop r13 34fa8: ef 90 pop r14 34faa: ff 90 pop r15 34fac: 0f 91 pop r16 34fae: 1f 91 pop r17 34fb0: cf 91 pop r28 34fb2: df 91 pop r29 34fb4: 08 95 ret 34fb6: 0d 94 c1 9f jmp 0x33f82 ; 0x33f82 <__fp_nan> 00034fba <__fp_rempio2>: 34fba: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 <__fp_splitA> 34fbe: d8 f3 brcs .-10 ; 0x34fb6 <__fp_powser+0x4e> 34fc0: e8 94 clt 34fc2: e0 e0 ldi r30, 0x00 ; 0 34fc4: bb 27 eor r27, r27 34fc6: 9f 57 subi r25, 0x7F ; 127 34fc8: f0 f0 brcs .+60 ; 0x35006 <__fp_rempio2+0x4c> 34fca: 2a ed ldi r18, 0xDA ; 218 34fcc: 3f e0 ldi r19, 0x0F ; 15 34fce: 49 ec ldi r20, 0xC9 ; 201 34fd0: 06 c0 rjmp .+12 ; 0x34fde <__fp_rempio2+0x24> 34fd2: ee 0f add r30, r30 34fd4: bb 0f add r27, r27 34fd6: 66 1f adc r22, r22 34fd8: 77 1f adc r23, r23 34fda: 88 1f adc r24, r24 34fdc: 28 f0 brcs .+10 ; 0x34fe8 <__fp_rempio2+0x2e> 34fde: b2 3a cpi r27, 0xA2 ; 162 34fe0: 62 07 cpc r22, r18 34fe2: 73 07 cpc r23, r19 34fe4: 84 07 cpc r24, r20 34fe6: 28 f0 brcs .+10 ; 0x34ff2 <__fp_rempio2+0x38> 34fe8: b2 5a subi r27, 0xA2 ; 162 34fea: 62 0b sbc r22, r18 34fec: 73 0b sbc r23, r19 34fee: 84 0b sbc r24, r20 34ff0: e3 95 inc r30 34ff2: 9a 95 dec r25 34ff4: 72 f7 brpl .-36 ; 0x34fd2 <__fp_rempio2+0x18> 34ff6: 80 38 cpi r24, 0x80 ; 128 34ff8: 30 f4 brcc .+12 ; 0x35006 <__fp_rempio2+0x4c> 34ffa: 9a 95 dec r25 34ffc: bb 0f add r27, r27 34ffe: 66 1f adc r22, r22 35000: 77 1f adc r23, r23 35002: 88 1f adc r24, r24 35004: d2 f7 brpl .-12 ; 0x34ffa <__fp_rempio2+0x40> 35006: 90 48 sbci r25, 0x80 ; 128 35008: 0d 94 a8 a7 jmp 0x34f50 ; 0x34f50 <__fp_mpack_finite> 0003500c <__fp_sinus>: 3500c: ef 93 push r30 3500e: e0 ff sbrs r30, 0 35010: 07 c0 rjmp .+14 ; 0x35020 <__fp_sinus+0x14> 35012: a2 ea ldi r26, 0xA2 ; 162 35014: 2a ed ldi r18, 0xDA ; 218 35016: 3f e0 ldi r19, 0x0F ; 15 35018: 49 ec ldi r20, 0xC9 ; 201 3501a: 5f eb ldi r21, 0xBF ; 191 3501c: 0f 94 c0 a5 call 0x34b80 ; 0x34b80 <__addsf3x> 35020: 0f 94 d2 9f call 0x33fa4 ; 0x33fa4 <__fp_round> 35024: 0f 90 pop r0 35026: 03 94 inc r0 35028: 01 fc sbrc r0, 1 3502a: 90 58 subi r25, 0x80 ; 128 3502c: e8 e8 ldi r30, 0x88 ; 136 3502e: fd e6 ldi r31, 0x6D ; 109 35030: 0d 94 fd a9 jmp 0x353fa ; 0x353fa <__fp_powsodd> 00035034 <__fp_trunc>: 35034: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 <__fp_splitA> 35038: a0 f0 brcs .+40 ; 0x35062 <__fp_trunc+0x2e> 3503a: be e7 ldi r27, 0x7E ; 126 3503c: b9 17 cp r27, r25 3503e: 88 f4 brcc .+34 ; 0x35062 <__fp_trunc+0x2e> 35040: bb 27 eor r27, r27 35042: 9f 38 cpi r25, 0x8F ; 143 35044: 60 f4 brcc .+24 ; 0x3505e <__fp_trunc+0x2a> 35046: 16 16 cp r1, r22 35048: b1 1d adc r27, r1 3504a: 67 2f mov r22, r23 3504c: 78 2f mov r23, r24 3504e: 88 27 eor r24, r24 35050: 98 5f subi r25, 0xF8 ; 248 35052: f7 cf rjmp .-18 ; 0x35042 <__fp_trunc+0xe> 35054: 86 95 lsr r24 35056: 77 95 ror r23 35058: 67 95 ror r22 3505a: b1 1d adc r27, r1 3505c: 93 95 inc r25 3505e: 96 39 cpi r25, 0x96 ; 150 35060: c8 f3 brcs .-14 ; 0x35054 <__fp_trunc+0x20> 35062: 08 95 ret 00035064 <__gesf2>: 35064: 0f 94 67 a7 call 0x34ece ; 0x34ece <__fp_cmp> 35068: 08 f4 brcc .+2 ; 0x3506c <__gesf2+0x8> 3506a: 8f ef ldi r24, 0xFF ; 255 3506c: 08 95 ret 3506e: 0f 94 c4 9f call 0x33f88 ; 0x33f88 <__fp_pscA> 35072: 29 f0 breq .+10 ; 0x3507e <__gesf2+0x1a> 35074: 0f 94 cb 9f call 0x33f96 ; 0x33f96 <__fp_pscB> 35078: 11 f0 breq .+4 ; 0x3507e <__gesf2+0x1a> 3507a: 0d 94 c1 9f jmp 0x33f82 ; 0x33f82 <__fp_nan> 3507e: 0d 94 bb 9f jmp 0x33f76 ; 0x33f76 <__fp_inf> 35082: b9 01 movw r22, r18 35084: ca 01 movw r24, r20 35086: 0d 94 a6 a7 jmp 0x34f4c ; 0x34f4c <__fp_mpack> 0003508a : 3508a: 9f 77 andi r25, 0x7F ; 127 3508c: 5f 77 andi r21, 0x7F ; 127 3508e: 0f 94 e3 9f call 0x33fc6 ; 0x33fc6 <__fp_split3> 35092: 68 f3 brcs .-38 ; 0x3506e <__gesf2+0xa> 35094: 99 23 and r25, r25 35096: a9 f3 breq .-22 ; 0x35082 <__gesf2+0x1e> 35098: 55 23 and r21, r21 3509a: a9 f3 breq .-22 ; 0x35086 <__gesf2+0x22> 3509c: ff 27 eor r31, r31 3509e: 95 17 cp r25, r21 350a0: 58 f4 brcc .+22 ; 0x350b8 350a2: e5 2f mov r30, r21 350a4: e9 1b sub r30, r25 350a6: ed 30 cpi r30, 0x0D ; 13 350a8: 60 f7 brcc .-40 ; 0x35082 <__gesf2+0x1e> 350aa: 5e 3b cpi r21, 0xBE ; 190 350ac: 10 f0 brcs .+4 ; 0x350b2 350ae: f1 e4 ldi r31, 0x41 ; 65 350b0: 1c c0 rjmp .+56 ; 0x350ea 350b2: 90 34 cpi r25, 0x40 ; 64 350b4: e0 f4 brcc .+56 ; 0x350ee 350b6: 0a c0 rjmp .+20 ; 0x350cc 350b8: e9 2f mov r30, r25 350ba: e5 1b sub r30, r21 350bc: ed 30 cpi r30, 0x0D ; 13 350be: 18 f7 brcc .-58 ; 0x35086 <__gesf2+0x22> 350c0: 9e 3b cpi r25, 0xBE ; 190 350c2: 10 f0 brcs .+4 ; 0x350c8 350c4: f1 e4 ldi r31, 0x41 ; 65 350c6: 11 c0 rjmp .+34 ; 0x350ea 350c8: 50 34 cpi r21, 0x40 ; 64 350ca: 88 f4 brcc .+34 ; 0x350ee 350cc: f9 ea ldi r31, 0xA9 ; 169 350ce: 88 23 and r24, r24 350d0: 2a f0 brmi .+10 ; 0x350dc 350d2: 9a 95 dec r25 350d4: 66 0f add r22, r22 350d6: 77 1f adc r23, r23 350d8: 88 1f adc r24, r24 350da: da f7 brpl .-10 ; 0x350d2 350dc: 44 23 and r20, r20 350de: 2a f0 brmi .+10 ; 0x350ea 350e0: 5a 95 dec r21 350e2: 22 0f add r18, r18 350e4: 33 1f adc r19, r19 350e6: 44 1f adc r20, r20 350e8: da f7 brpl .-10 ; 0x350e0 350ea: 9f 1b sub r25, r31 350ec: 5f 1b sub r21, r31 350ee: ff 93 push r31 350f0: 1f 93 push r17 350f2: 0f 93 push r16 350f4: ff 92 push r15 350f6: ef 92 push r14 350f8: 79 01 movw r14, r18 350fa: 8a 01 movw r16, r20 350fc: bb 27 eor r27, r27 350fe: ab 2f mov r26, r27 35100: 9b 01 movw r18, r22 35102: ac 01 movw r20, r24 35104: 0f 94 64 9f call 0x33ec8 ; 0x33ec8 <__mulsf3_pse> 35108: 97 01 movw r18, r14 3510a: a8 01 movw r20, r16 3510c: bf 93 push r27 3510e: 7b 01 movw r14, r22 35110: 8c 01 movw r16, r24 35112: aa 27 eor r26, r26 35114: ba 2f mov r27, r26 35116: b9 01 movw r22, r18 35118: ca 01 movw r24, r20 3511a: 0f 94 64 9f call 0x33ec8 ; 0x33ec8 <__mulsf3_pse> 3511e: af 91 pop r26 35120: 97 01 movw r18, r14 35122: a8 01 movw r20, r16 35124: ef 90 pop r14 35126: ff 90 pop r15 35128: 0f 91 pop r16 3512a: 1f 91 pop r17 3512c: 0f 94 c0 a5 call 0x34b80 ; 0x34b80 <__addsf3x> 35130: 0f 94 d2 9f call 0x33fa4 ; 0x33fa4 <__fp_round> 35134: 0f 94 77 a9 call 0x352ee ; 0x352ee 35138: 4f 91 pop r20 3513a: 40 ff sbrs r20, 0 3513c: 08 95 ret 3513e: 55 27 eor r21, r21 35140: 47 fd sbrc r20, 7 35142: 50 95 com r21 35144: 0d 94 b0 a8 jmp 0x35160 ; 0x35160 00035148 : 35148: 9b 01 movw r18, r22 3514a: ac 01 movw r20, r24 3514c: 60 e0 ldi r22, 0x00 ; 0 3514e: 70 e0 ldi r23, 0x00 ; 0 35150: 80 e8 ldi r24, 0x80 ; 128 35152: 9f e3 ldi r25, 0x3F ; 63 35154: 0d 94 a8 a6 jmp 0x34d50 ; 0x34d50 <__divsf3> 35158: 0d 94 bb 9f jmp 0x33f76 ; 0x33f76 <__fp_inf> 3515c: 0d 94 a6 a7 jmp 0x34f4c ; 0x34f4c <__fp_mpack> 00035160 : 35160: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 <__fp_splitA> 35164: d8 f3 brcs .-10 ; 0x3515c 35166: 99 23 and r25, r25 35168: c9 f3 breq .-14 ; 0x3515c 3516a: 94 0f add r25, r20 3516c: 51 1d adc r21, r1 3516e: a3 f3 brvs .-24 ; 0x35158 35170: 91 50 subi r25, 0x01 ; 1 35172: 50 40 sbci r21, 0x00 ; 0 35174: 94 f0 brlt .+36 ; 0x3519a 35176: 59 f0 breq .+22 ; 0x3518e 35178: 88 23 and r24, r24 3517a: 32 f0 brmi .+12 ; 0x35188 3517c: 66 0f add r22, r22 3517e: 77 1f adc r23, r23 35180: 88 1f adc r24, r24 35182: 91 50 subi r25, 0x01 ; 1 35184: 50 40 sbci r21, 0x00 ; 0 35186: c1 f7 brne .-16 ; 0x35178 35188: 9e 3f cpi r25, 0xFE ; 254 3518a: 51 05 cpc r21, r1 3518c: 2c f7 brge .-54 ; 0x35158 3518e: 88 0f add r24, r24 35190: 91 1d adc r25, r1 35192: 96 95 lsr r25 35194: 87 95 ror r24 35196: 97 f9 bld r25, 7 35198: 08 95 ret 3519a: 5f 3f cpi r21, 0xFF ; 255 3519c: ac f0 brlt .+42 ; 0x351c8 3519e: 98 3e cpi r25, 0xE8 ; 232 351a0: 9c f0 brlt .+38 ; 0x351c8 351a2: bb 27 eor r27, r27 351a4: 86 95 lsr r24 351a6: 77 95 ror r23 351a8: 67 95 ror r22 351aa: b7 95 ror r27 351ac: 08 f4 brcc .+2 ; 0x351b0 351ae: b1 60 ori r27, 0x01 ; 1 351b0: 93 95 inc r25 351b2: c1 f7 brne .-16 ; 0x351a4 351b4: bb 0f add r27, r27 351b6: 58 f7 brcc .-42 ; 0x3518e 351b8: 11 f4 brne .+4 ; 0x351be 351ba: 60 ff sbrs r22, 0 351bc: e8 cf rjmp .-48 ; 0x3518e 351be: 6f 5f subi r22, 0xFF ; 255 351c0: 7f 4f sbci r23, 0xFF ; 255 351c2: 8f 4f sbci r24, 0xFF ; 255 351c4: 9f 4f sbci r25, 0xFF ; 255 351c6: e3 cf rjmp .-58 ; 0x3518e 351c8: 0d 94 06 a0 jmp 0x3400c ; 0x3400c <__fp_szero> 000351cc : 351cc: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 <__fp_splitA> 351d0: 58 f1 brcs .+86 ; 0x35228 351d2: 9e 57 subi r25, 0x7E ; 126 351d4: 60 f1 brcs .+88 ; 0x3522e 351d6: 98 51 subi r25, 0x18 ; 24 351d8: a0 f0 brcs .+40 ; 0x35202 351da: e9 f0 breq .+58 ; 0x35216 351dc: 98 30 cpi r25, 0x08 ; 8 351de: 20 f5 brcc .+72 ; 0x35228 351e0: 09 2e mov r0, r25 351e2: 99 27 eor r25, r25 351e4: 66 0f add r22, r22 351e6: 77 1f adc r23, r23 351e8: 88 1f adc r24, r24 351ea: 99 1f adc r25, r25 351ec: 0a 94 dec r0 351ee: d1 f7 brne .-12 ; 0x351e4 351f0: 12 c0 rjmp .+36 ; 0x35216 351f2: 06 2e mov r0, r22 351f4: 67 2f mov r22, r23 351f6: 78 2f mov r23, r24 351f8: 88 27 eor r24, r24 351fa: 98 5f subi r25, 0xF8 ; 248 351fc: 11 f4 brne .+4 ; 0x35202 351fe: 00 0c add r0, r0 35200: 07 c0 rjmp .+14 ; 0x35210 35202: 99 3f cpi r25, 0xF9 ; 249 35204: b4 f3 brlt .-20 ; 0x351f2 35206: 86 95 lsr r24 35208: 77 95 ror r23 3520a: 67 95 ror r22 3520c: 93 95 inc r25 3520e: d9 f7 brne .-10 ; 0x35206 35210: 61 1d adc r22, r1 35212: 71 1d adc r23, r1 35214: 81 1d adc r24, r1 35216: 3e f4 brtc .+14 ; 0x35226 35218: 90 95 com r25 3521a: 80 95 com r24 3521c: 70 95 com r23 3521e: 61 95 neg r22 35220: 7f 4f sbci r23, 0xFF ; 255 35222: 8f 4f sbci r24, 0xFF ; 255 35224: 9f 4f sbci r25, 0xFF ; 255 35226: 08 95 ret 35228: 68 94 set 3522a: 0d 94 06 a0 jmp 0x3400c ; 0x3400c <__fp_szero> 3522e: 0d 94 05 a0 jmp 0x3400a ; 0x3400a <__fp_zero> 00035232 : 35232: fa 01 movw r30, r20 35234: ee 0f add r30, r30 35236: ff 1f adc r31, r31 35238: 30 96 adiw r30, 0x00 ; 0 3523a: 21 05 cpc r18, r1 3523c: 31 05 cpc r19, r1 3523e: a1 f1 breq .+104 ; 0x352a8 35240: 61 15 cp r22, r1 35242: 71 05 cpc r23, r1 35244: 61 f4 brne .+24 ; 0x3525e 35246: 80 38 cpi r24, 0x80 ; 128 35248: bf e3 ldi r27, 0x3F ; 63 3524a: 9b 07 cpc r25, r27 3524c: 49 f1 breq .+82 ; 0x352a0 3524e: 68 94 set 35250: 90 38 cpi r25, 0x80 ; 128 35252: 81 05 cpc r24, r1 35254: 61 f0 breq .+24 ; 0x3526e 35256: 80 38 cpi r24, 0x80 ; 128 35258: bf ef ldi r27, 0xFF ; 255 3525a: 9b 07 cpc r25, r27 3525c: 41 f0 breq .+16 ; 0x3526e 3525e: 99 23 and r25, r25 35260: 4a f5 brpl .+82 ; 0x352b4 35262: ff 3f cpi r31, 0xFF ; 255 35264: e1 05 cpc r30, r1 35266: 31 05 cpc r19, r1 35268: 21 05 cpc r18, r1 3526a: 19 f1 breq .+70 ; 0x352b2 3526c: e8 94 clt 3526e: 08 94 sec 35270: e7 95 ror r30 35272: d9 01 movw r26, r18 35274: aa 23 and r26, r26 35276: 29 f4 brne .+10 ; 0x35282 35278: ab 2f mov r26, r27 3527a: be 2f mov r27, r30 3527c: f8 5f subi r31, 0xF8 ; 248 3527e: d0 f3 brcs .-12 ; 0x35274 35280: 10 c0 rjmp .+32 ; 0x352a2 35282: ff 5f subi r31, 0xFF ; 255 35284: 70 f4 brcc .+28 ; 0x352a2 35286: a6 95 lsr r26 35288: e0 f7 brcc .-8 ; 0x35282 3528a: f7 39 cpi r31, 0x97 ; 151 3528c: 50 f0 brcs .+20 ; 0x352a2 3528e: 19 f0 breq .+6 ; 0x35296 35290: ff 3a cpi r31, 0xAF ; 175 35292: 38 f4 brcc .+14 ; 0x352a2 35294: 9f 77 andi r25, 0x7F ; 127 35296: 9f 93 push r25 35298: 0d d0 rcall .+26 ; 0x352b4 3529a: 0f 90 pop r0 3529c: 07 fc sbrc r0, 7 3529e: 90 58 subi r25, 0x80 ; 128 352a0: 08 95 ret 352a2: 46 f0 brts .+16 ; 0x352b4 352a4: 0d 94 c1 9f jmp 0x33f82 ; 0x33f82 <__fp_nan> 352a8: 60 e0 ldi r22, 0x00 ; 0 352aa: 70 e0 ldi r23, 0x00 ; 0 352ac: 80 e8 ldi r24, 0x80 ; 128 352ae: 9f e3 ldi r25, 0x3F ; 63 352b0: 08 95 ret 352b2: 4f e7 ldi r20, 0x7F ; 127 352b4: 9f 77 andi r25, 0x7F ; 127 352b6: 5f 93 push r21 352b8: 4f 93 push r20 352ba: 3f 93 push r19 352bc: 2f 93 push r18 352be: 0f 94 19 aa call 0x35432 ; 0x35432 352c2: 2f 91 pop r18 352c4: 3f 91 pop r19 352c6: 4f 91 pop r20 352c8: 5f 91 pop r21 352ca: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 352ce: 0d 94 c4 a9 jmp 0x35388 ; 0x35388 000352d2 : 352d2: 9f 93 push r25 352d4: 0f 94 dd a7 call 0x34fba ; 0x34fba <__fp_rempio2> 352d8: 0f 90 pop r0 352da: 07 fc sbrc r0, 7 352dc: ee 5f subi r30, 0xFE ; 254 352de: 0d 94 06 a8 jmp 0x3500c ; 0x3500c <__fp_sinus> 352e2: 19 f4 brne .+6 ; 0x352ea 352e4: 16 f4 brtc .+4 ; 0x352ea 352e6: 0d 94 c1 9f jmp 0x33f82 ; 0x33f82 <__fp_nan> 352ea: 0d 94 a6 a7 jmp 0x34f4c ; 0x34f4c <__fp_mpack> 000352ee : 352ee: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 <__fp_splitA> 352f2: b8 f3 brcs .-18 ; 0x352e2 352f4: 99 23 and r25, r25 352f6: c9 f3 breq .-14 ; 0x352ea 352f8: b6 f3 brts .-20 ; 0x352e6 352fa: 9f 57 subi r25, 0x7F ; 127 352fc: 55 0b sbc r21, r21 352fe: 87 ff sbrs r24, 7 35300: 0f 94 f6 a9 call 0x353ec ; 0x353ec <__fp_norm2> 35304: 00 24 eor r0, r0 35306: a0 e6 ldi r26, 0x60 ; 96 35308: 40 ea ldi r20, 0xA0 ; 160 3530a: 90 01 movw r18, r0 3530c: 80 58 subi r24, 0x80 ; 128 3530e: 56 95 lsr r21 35310: 97 95 ror r25 35312: 28 f4 brcc .+10 ; 0x3531e 35314: 80 5c subi r24, 0xC0 ; 192 35316: 66 0f add r22, r22 35318: 77 1f adc r23, r23 3531a: 88 1f adc r24, r24 3531c: 20 f0 brcs .+8 ; 0x35326 3531e: 26 17 cp r18, r22 35320: 37 07 cpc r19, r23 35322: 48 07 cpc r20, r24 35324: 30 f4 brcc .+12 ; 0x35332 35326: 62 1b sub r22, r18 35328: 73 0b sbc r23, r19 3532a: 84 0b sbc r24, r20 3532c: 20 29 or r18, r0 3532e: 31 29 or r19, r1 35330: 4a 2b or r20, r26 35332: a6 95 lsr r26 35334: 17 94 ror r1 35336: 07 94 ror r0 35338: 20 25 eor r18, r0 3533a: 31 25 eor r19, r1 3533c: 4a 27 eor r20, r26 3533e: 58 f7 brcc .-42 ; 0x35316 35340: 66 0f add r22, r22 35342: 77 1f adc r23, r23 35344: 88 1f adc r24, r24 35346: 20 f0 brcs .+8 ; 0x35350 35348: 26 17 cp r18, r22 3534a: 37 07 cpc r19, r23 3534c: 48 07 cpc r20, r24 3534e: 30 f4 brcc .+12 ; 0x3535c 35350: 62 0b sbc r22, r18 35352: 73 0b sbc r23, r19 35354: 84 0b sbc r24, r20 35356: 20 0d add r18, r0 35358: 31 1d adc r19, r1 3535a: 41 1d adc r20, r1 3535c: a0 95 com r26 3535e: 81 f7 brne .-32 ; 0x35340 35360: b9 01 movw r22, r18 35362: 84 2f mov r24, r20 35364: 91 58 subi r25, 0x81 ; 129 35366: 88 0f add r24, r24 35368: 96 95 lsr r25 3536a: 87 95 ror r24 3536c: 08 95 ret 0003536e <__unordsf2>: 3536e: 0f 94 67 a7 call 0x34ece ; 0x34ece <__fp_cmp> 35372: 88 0b sbc r24, r24 35374: 99 0b sbc r25, r25 35376: 08 95 ret 35378: 29 f4 brne .+10 ; 0x35384 <__unordsf2+0x16> 3537a: 16 f0 brts .+4 ; 0x35380 <__unordsf2+0x12> 3537c: 0d 94 bb 9f jmp 0x33f76 ; 0x33f76 <__fp_inf> 35380: 0d 94 05 a0 jmp 0x3400a ; 0x3400a <__fp_zero> 35384: 0d 94 c1 9f jmp 0x33f82 ; 0x33f82 <__fp_nan> 00035388 : 35388: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 <__fp_splitA> 3538c: a8 f3 brcs .-22 ; 0x35378 <__unordsf2+0xa> 3538e: 96 38 cpi r25, 0x86 ; 134 35390: a0 f7 brcc .-24 ; 0x3537a <__unordsf2+0xc> 35392: 07 f8 bld r0, 7 35394: 0f 92 push r0 35396: e8 94 clt 35398: 2b e3 ldi r18, 0x3B ; 59 3539a: 3a ea ldi r19, 0xAA ; 170 3539c: 48 eb ldi r20, 0xB8 ; 184 3539e: 5f e7 ldi r21, 0x7F ; 127 353a0: 0f 94 64 9f call 0x33ec8 ; 0x33ec8 <__mulsf3_pse> 353a4: 0f 92 push r0 353a6: 0f 92 push r0 353a8: 0f 92 push r0 353aa: 4d b7 in r20, 0x3d ; 61 353ac: 5e b7 in r21, 0x3e ; 62 353ae: 0f 92 push r0 353b0: 0f 94 61 aa call 0x354c2 ; 0x354c2 353b4: e6 ea ldi r30, 0xA6 ; 166 353b6: fd e6 ldi r31, 0x6D ; 109 353b8: 0f 94 b4 a7 call 0x34f68 ; 0x34f68 <__fp_powser> 353bc: 4f 91 pop r20 353be: 5f 91 pop r21 353c0: ef 91 pop r30 353c2: ff 91 pop r31 353c4: e5 95 asr r30 353c6: ee 1f adc r30, r30 353c8: ff 1f adc r31, r31 353ca: 49 f0 breq .+18 ; 0x353de 353cc: fe 57 subi r31, 0x7E ; 126 353ce: e0 68 ori r30, 0x80 ; 128 353d0: 44 27 eor r20, r20 353d2: ee 0f add r30, r30 353d4: 44 1f adc r20, r20 353d6: fa 95 dec r31 353d8: e1 f7 brne .-8 ; 0x353d2 353da: 41 95 neg r20 353dc: 55 0b sbc r21, r21 353de: 0f 94 b0 a8 call 0x35160 ; 0x35160 353e2: 0f 90 pop r0 353e4: 07 fe sbrs r0, 7 353e6: 0d 94 a4 a8 jmp 0x35148 ; 0x35148 353ea: 08 95 ret 000353ec <__fp_norm2>: 353ec: 91 50 subi r25, 0x01 ; 1 353ee: 50 40 sbci r21, 0x00 ; 0 353f0: 66 0f add r22, r22 353f2: 77 1f adc r23, r23 353f4: 88 1f adc r24, r24 353f6: d2 f7 brpl .-12 ; 0x353ec <__fp_norm2> 353f8: 08 95 ret 000353fa <__fp_powsodd>: 353fa: 9f 93 push r25 353fc: 8f 93 push r24 353fe: 7f 93 push r23 35400: 6f 93 push r22 35402: ff 93 push r31 35404: ef 93 push r30 35406: 9b 01 movw r18, r22 35408: ac 01 movw r20, r24 3540a: 0f 94 4e 9f call 0x33e9c ; 0x33e9c <__mulsf3> 3540e: ef 91 pop r30 35410: ff 91 pop r31 35412: 0f 94 b4 a7 call 0x34f68 ; 0x34f68 <__fp_powser> 35416: 2f 91 pop r18 35418: 3f 91 pop r19 3541a: 4f 91 pop r20 3541c: 5f 91 pop r21 3541e: 0d 94 4e 9f jmp 0x33e9c ; 0x33e9c <__mulsf3> 35422: 16 f0 brts .+4 ; 0x35428 <__fp_powsodd+0x2e> 35424: 0d 94 a6 a7 jmp 0x34f4c ; 0x34f4c <__fp_mpack> 35428: 0d 94 c1 9f jmp 0x33f82 ; 0x33f82 <__fp_nan> 3542c: 68 94 set 3542e: 0d 94 bb 9f jmp 0x33f76 ; 0x33f76 <__fp_inf> 00035432 : 35432: 0f 94 eb 9f call 0x33fd6 ; 0x33fd6 <__fp_splitA> 35436: a8 f3 brcs .-22 ; 0x35422 <__fp_powsodd+0x28> 35438: 99 23 and r25, r25 3543a: c1 f3 breq .-16 ; 0x3542c <__fp_powsodd+0x32> 3543c: ae f3 brts .-22 ; 0x35428 <__fp_powsodd+0x2e> 3543e: df 93 push r29 35440: cf 93 push r28 35442: 1f 93 push r17 35444: 0f 93 push r16 35446: ff 92 push r15 35448: c9 2f mov r28, r25 3544a: dd 27 eor r29, r29 3544c: 88 23 and r24, r24 3544e: 2a f0 brmi .+10 ; 0x3545a 35450: 21 97 sbiw r28, 0x01 ; 1 35452: 66 0f add r22, r22 35454: 77 1f adc r23, r23 35456: 88 1f adc r24, r24 35458: da f7 brpl .-10 ; 0x35450 3545a: 20 e0 ldi r18, 0x00 ; 0 3545c: 30 e0 ldi r19, 0x00 ; 0 3545e: 40 e8 ldi r20, 0x80 ; 128 35460: 5f eb ldi r21, 0xBF ; 191 35462: 9f e3 ldi r25, 0x3F ; 63 35464: 88 39 cpi r24, 0x98 ; 152 35466: 20 f0 brcs .+8 ; 0x35470 35468: 80 3e cpi r24, 0xE0 ; 224 3546a: 38 f0 brcs .+14 ; 0x3547a 3546c: 21 96 adiw r28, 0x01 ; 1 3546e: 8f 77 andi r24, 0x7F ; 127 35470: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 35474: ee ec ldi r30, 0xCE ; 206 35476: fd e6 ldi r31, 0x6D ; 109 35478: 04 c0 rjmp .+8 ; 0x35482 3547a: 0f 94 a9 a5 call 0x34b52 ; 0x34b52 <__addsf3> 3547e: eb ef ldi r30, 0xFB ; 251 35480: fd e6 ldi r31, 0x6D ; 109 35482: 0f 94 b4 a7 call 0x34f68 ; 0x34f68 <__fp_powser> 35486: 8b 01 movw r16, r22 35488: be 01 movw r22, r28 3548a: ec 01 movw r28, r24 3548c: fb 2e mov r15, r27 3548e: 6f 57 subi r22, 0x7F ; 127 35490: 71 09 sbc r23, r1 35492: 75 95 asr r23 35494: 77 1f adc r23, r23 35496: 88 0b sbc r24, r24 35498: 99 0b sbc r25, r25 3549a: 0f 94 0f 9f call 0x33e1e ; 0x33e1e <__floatsisf> 3549e: 28 e1 ldi r18, 0x18 ; 24 354a0: 32 e7 ldi r19, 0x72 ; 114 354a2: 41 e3 ldi r20, 0x31 ; 49 354a4: 5f e3 ldi r21, 0x3F ; 63 354a6: 0f 94 61 9f call 0x33ec2 ; 0x33ec2 <__mulsf3x> 354aa: af 2d mov r26, r15 354ac: 98 01 movw r18, r16 354ae: ae 01 movw r20, r28 354b0: ff 90 pop r15 354b2: 0f 91 pop r16 354b4: 1f 91 pop r17 354b6: cf 91 pop r28 354b8: df 91 pop r29 354ba: 0f 94 c0 a5 call 0x34b80 ; 0x34b80 <__addsf3x> 354be: 0d 94 d2 9f jmp 0x33fa4 ; 0x33fa4 <__fp_round> 000354c2 : 354c2: fa 01 movw r30, r20 354c4: dc 01 movw r26, r24 354c6: aa 0f add r26, r26 354c8: bb 1f adc r27, r27 354ca: 9b 01 movw r18, r22 354cc: ac 01 movw r20, r24 354ce: bf 57 subi r27, 0x7F ; 127 354d0: 28 f4 brcc .+10 ; 0x354dc 354d2: 22 27 eor r18, r18 354d4: 33 27 eor r19, r19 354d6: 44 27 eor r20, r20 354d8: 50 78 andi r21, 0x80 ; 128 354da: 20 c0 rjmp .+64 ; 0x3551c 354dc: b7 51 subi r27, 0x17 ; 23 354de: 90 f4 brcc .+36 ; 0x35504 354e0: ab 2f mov r26, r27 354e2: 00 24 eor r0, r0 354e4: 46 95 lsr r20 354e6: 37 95 ror r19 354e8: 27 95 ror r18 354ea: 01 1c adc r0, r1 354ec: a3 95 inc r26 354ee: d2 f3 brmi .-12 ; 0x354e4 354f0: 00 20 and r0, r0 354f2: 71 f0 breq .+28 ; 0x35510 354f4: 22 0f add r18, r18 354f6: 33 1f adc r19, r19 354f8: 44 1f adc r20, r20 354fa: b3 95 inc r27 354fc: da f3 brmi .-10 ; 0x354f4 354fe: 0e d0 rcall .+28 ; 0x3551c 35500: 0d 94 a8 a5 jmp 0x34b50 ; 0x34b50 <__subsf3> 35504: 61 30 cpi r22, 0x01 ; 1 35506: 71 05 cpc r23, r1 35508: a0 e8 ldi r26, 0x80 ; 128 3550a: 8a 07 cpc r24, r26 3550c: b9 46 sbci r27, 0x69 ; 105 3550e: 30 f4 brcc .+12 ; 0x3551c 35510: 9b 01 movw r18, r22 35512: ac 01 movw r20, r24 35514: 66 27 eor r22, r22 35516: 77 27 eor r23, r23 35518: 88 27 eor r24, r24 3551a: 90 78 andi r25, 0x80 ; 128 3551c: 30 96 adiw r30, 0x00 ; 0 3551e: 21 f0 breq .+8 ; 0x35528 35520: 20 83 st Z, r18 35522: 31 83 std Z+1, r19 ; 0x01 35524: 42 83 std Z+2, r20 ; 0x02 35526: 53 83 std Z+3, r21 ; 0x03 35528: 08 95 ret 0003552a : 3552a: 91 11 cpse r25, r1 3552c: 08 95 ret 3552e: 81 54 subi r24, 0x41 ; 65 35530: 8a 51 subi r24, 0x1A ; 26 35532: 08 f4 brcc .+2 ; 0x35536 35534: 80 5e subi r24, 0xE0 ; 224 35536: 85 5a subi r24, 0xA5 ; 165 35538: 08 95 ret 0003553a : 3553a: fb 01 movw r30, r22 3553c: dc 01 movw r26, r24 3553e: 04 c0 rjmp .+8 ; 0x35548 35540: 8d 91 ld r24, X+ 35542: 01 90 ld r0, Z+ 35544: 80 19 sub r24, r0 35546: 21 f4 brne .+8 ; 0x35550 35548: 41 50 subi r20, 0x01 ; 1 3554a: 50 40 sbci r21, 0x00 ; 0 3554c: c8 f7 brcc .-14 ; 0x35540 3554e: 88 1b sub r24, r24 35550: 99 0b sbc r25, r25 35552: 08 95 ret 00035554 : 35554: fb 01 movw r30, r22 35556: dc 01 movw r26, r24 35558: 02 c0 rjmp .+4 ; 0x3555e 3555a: 01 90 ld r0, Z+ 3555c: 0d 92 st X+, r0 3555e: 41 50 subi r20, 0x01 ; 1 35560: 50 40 sbci r21, 0x00 ; 0 35562: d8 f7 brcc .-10 ; 0x3555a 35564: 08 95 ret 00035566 : 35566: dc 01 movw r26, r24 35568: 01 c0 rjmp .+2 ; 0x3556c 3556a: 6d 93 st X+, r22 3556c: 41 50 subi r20, 0x01 ; 1 3556e: 50 40 sbci r21, 0x00 ; 0 35570: e0 f7 brcc .-8 ; 0x3556a 35572: 08 95 ret 00035574 : 35574: fb 01 movw r30, r22 35576: dc 01 movw r26, r24 35578: 8d 91 ld r24, X+ 3557a: 81 34 cpi r24, 0x41 ; 65 3557c: 1c f0 brlt .+6 ; 0x35584 3557e: 8b 35 cpi r24, 0x5B ; 91 35580: 0c f4 brge .+2 ; 0x35584 35582: 80 5e subi r24, 0xE0 ; 224 35584: 61 91 ld r22, Z+ 35586: 61 34 cpi r22, 0x41 ; 65 35588: 1c f0 brlt .+6 ; 0x35590 3558a: 6b 35 cpi r22, 0x5B ; 91 3558c: 0c f4 brge .+2 ; 0x35590 3558e: 60 5e subi r22, 0xE0 ; 224 35590: 86 1b sub r24, r22 35592: 61 11 cpse r22, r1 35594: 89 f3 breq .-30 ; 0x35578 35596: 99 0b sbc r25, r25 35598: 08 95 ret 0003559a : 3559a: fb 01 movw r30, r22 3559c: dc 01 movw r26, r24 3559e: 0d 90 ld r0, X+ 355a0: 00 20 and r0, r0 355a2: e9 f7 brne .-6 ; 0x3559e 355a4: 11 97 sbiw r26, 0x01 ; 1 355a6: 01 90 ld r0, Z+ 355a8: 0d 92 st X+, r0 355aa: 00 20 and r0, r0 355ac: e1 f7 brne .-8 ; 0x355a6 355ae: 08 95 ret 000355b0 : 355b0: fc 01 movw r30, r24 355b2: 81 91 ld r24, Z+ 355b4: 86 17 cp r24, r22 355b6: 21 f0 breq .+8 ; 0x355c0 355b8: 88 23 and r24, r24 355ba: d9 f7 brne .-10 ; 0x355b2 355bc: 99 27 eor r25, r25 355be: 08 95 ret 355c0: 31 97 sbiw r30, 0x01 ; 1 355c2: cf 01 movw r24, r30 355c4: 08 95 ret 000355c6 : 355c6: fb 01 movw r30, r22 355c8: dc 01 movw r26, r24 355ca: 8d 91 ld r24, X+ 355cc: 01 90 ld r0, Z+ 355ce: 80 19 sub r24, r0 355d0: 01 10 cpse r0, r1 355d2: d9 f3 breq .-10 ; 0x355ca 355d4: 99 0b sbc r25, r25 355d6: 08 95 ret 000355d8 : 355d8: fb 01 movw r30, r22 355da: dc 01 movw r26, r24 355dc: 01 90 ld r0, Z+ 355de: 0d 92 st X+, r0 355e0: 00 20 and r0, r0 355e2: e1 f7 brne .-8 ; 0x355dc 355e4: 08 95 ret 000355e6 : 355e6: fb 01 movw r30, r22 355e8: dc 01 movw r26, r24 355ea: 41 50 subi r20, 0x01 ; 1 355ec: 50 40 sbci r21, 0x00 ; 0 355ee: 30 f0 brcs .+12 ; 0x355fc 355f0: 8d 91 ld r24, X+ 355f2: 01 90 ld r0, Z+ 355f4: 80 19 sub r24, r0 355f6: 19 f4 brne .+6 ; 0x355fe 355f8: 00 20 and r0, r0 355fa: b9 f7 brne .-18 ; 0x355ea 355fc: 88 1b sub r24, r24 355fe: 99 0b sbc r25, r25 35600: 08 95 ret 00035602 : 35602: fb 01 movw r30, r22 35604: dc 01 movw r26, r24 35606: 41 50 subi r20, 0x01 ; 1 35608: 50 40 sbci r21, 0x00 ; 0 3560a: 48 f0 brcs .+18 ; 0x3561e 3560c: 01 90 ld r0, Z+ 3560e: 0d 92 st X+, r0 35610: 00 20 and r0, r0 35612: c9 f7 brne .-14 ; 0x35606 35614: 01 c0 rjmp .+2 ; 0x35618 35616: 1d 92 st X+, r1 35618: 41 50 subi r20, 0x01 ; 1 3561a: 50 40 sbci r21, 0x00 ; 0 3561c: e0 f7 brcc .-8 ; 0x35616 3561e: 08 95 ret 00035620 : 35620: 0f 93 push r16 35622: 1f 93 push r17 35624: cf 93 push r28 35626: df 93 push r29 35628: e0 91 13 17 lds r30, 0x1713 ; 0x801713 <__iob+0x2> 3562c: f0 91 14 17 lds r31, 0x1714 ; 0x801714 <__iob+0x3> 35630: 23 81 ldd r18, Z+3 ; 0x03 35632: ec 01 movw r28, r24 35634: 10 e0 ldi r17, 0x00 ; 0 35636: 00 e0 ldi r16, 0x00 ; 0 35638: 21 fd sbrc r18, 1 3563a: 08 c0 rjmp .+16 ; 0x3564c 3563c: 0f ef ldi r16, 0xFF ; 255 3563e: 1f ef ldi r17, 0xFF ; 255 35640: 14 c0 rjmp .+40 ; 0x3566a 35642: 19 95 eicall 35644: 89 2b or r24, r25 35646: 11 f0 breq .+4 ; 0x3564c 35648: 0f ef ldi r16, 0xFF ; 255 3564a: 1f ef ldi r17, 0xFF ; 255 3564c: 89 91 ld r24, Y+ 3564e: 60 91 13 17 lds r22, 0x1713 ; 0x801713 <__iob+0x2> 35652: 70 91 14 17 lds r23, 0x1714 ; 0x801714 <__iob+0x3> 35656: db 01 movw r26, r22 35658: 18 96 adiw r26, 0x08 ; 8 3565a: ed 91 ld r30, X+ 3565c: fc 91 ld r31, X 3565e: 81 11 cpse r24, r1 35660: f0 cf rjmp .-32 ; 0x35642 35662: 8a e0 ldi r24, 0x0A ; 10 35664: 19 95 eicall 35666: 89 2b or r24, r25 35668: 49 f7 brne .-46 ; 0x3563c 3566a: c8 01 movw r24, r16 3566c: df 91 pop r29 3566e: cf 91 pop r28 35670: 1f 91 pop r17 35672: 0f 91 pop r16 35674: 08 95 ret 00035676 <__do_global_dtors>: 35676: 11 e5 ldi r17, 0x51 ; 81 35678: ce e7 ldi r28, 0x7E ; 126 3567a: d1 e5 ldi r29, 0x51 ; 81 3567c: 00 e0 ldi r16, 0x00 ; 0 3567e: 06 c0 rjmp .+12 ; 0x3568c <__do_global_dtors+0x16> 35680: 80 2f mov r24, r16 35682: fe 01 movw r30, r28 35684: 0f 94 91 a5 call 0x34b22 ; 0x34b22 <__tablejump2__> 35688: 21 96 adiw r28, 0x01 ; 1 3568a: 01 1d adc r16, r1 3568c: cf 37 cpi r28, 0x7F ; 127 3568e: d1 07 cpc r29, r17 35690: 80 e0 ldi r24, 0x00 ; 0 35692: 08 07 cpc r16, r24 35694: a9 f7 brne .-22 ; 0x35680 <__do_global_dtors+0xa> 35696: f8 94 cli 00035698 <__stop_program>: 35698: ff cf rjmp .-2 ; 0x35698 <__stop_program>