File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -371,6 +371,7 @@ G1 F200 E3 ;подать в экструдер 5мм филамента.
371371 #define MIXING_VIRTUAL_TOOLS 16 // Use the Virtual Tool method with M163 and M164
372372 //#define DIRECT_MIXING_IN_G1 // Allow ABCDHI mix factors in G1 movement commands
373373 //#define GRADIENT_MIX // Support for gradient mixing with M166 and LCD
374+ //#define MIXING_PRESETS // Assign 8 default V-tool presets for 2 or 3 MIXING_STEPPERS
374375 #if ENABLED (GRADIENT_MIX )
375376 //#define GRADIENT_VTOOL // Add M166 T to use a V-tool index as a Gradient alias
376377 #endif
Original file line number Diff line number Diff line change @@ -106,11 +106,32 @@ void Mixer::reset_vtools() {
106106 MIXER_STEPPER_LOOP (i)
107107 color[t][i] = (i == 0 ) ? COLOR_A_MASK : 0 ;
108108 #endif
109+
110+ // MIXING_PRESETS: Set a variety of obvious mixes as presets
111+ #if ENABLED(MIXING_PRESETS) && WITHIN(MIXING_STEPPERS, 2, 3)
112+ #if MIXING_STEPPERS == 2
113+ if (MIXING_VIRTUAL_TOOLS > 2 ) { collector[0 ] = 1 ; collector[1 ] = 1 ; mixer.normalize (2 ); } // 1:1
114+ if (MIXING_VIRTUAL_TOOLS > 3 ) { collector[0 ] = 3 ; mixer.normalize (3 ); } // 3:1
115+ if (MIXING_VIRTUAL_TOOLS > 4 ) { collector[0 ] = 1 ; collector[1 ] = 3 ; mixer.normalize (4 ); } // 1:3
116+ if (MIXING_VIRTUAL_TOOLS > 5 ) { collector[1 ] = 2 ; mixer.normalize (5 ); } // 1:2
117+ if (MIXING_VIRTUAL_TOOLS > 6 ) { collector[0 ] = 2 ; collector[1 ] = 1 ; mixer.normalize (6 ); } // 2:1
118+ if (MIXING_VIRTUAL_TOOLS > 7 ) { collector[0 ] = 3 ; collector[1 ] = 2 ; mixer.normalize (7 ); } // 3:2
119+ #else
120+ if (MIXING_VIRTUAL_TOOLS > 3 ) { collector[0 ] = 1 ; collector[1 ] = 1 ; collector[2 ] = 1 ; mixer.normalize (3 ); } // 1:1:1
121+ if (MIXING_VIRTUAL_TOOLS > 4 ) { collector[1 ] = 3 ; collector[2 ] = 0 ; mixer.normalize (4 ); } // 1:3:0
122+ if (MIXING_VIRTUAL_TOOLS > 5 ) { collector[0 ] = 0 ; collector[2 ] = 1 ; mixer.normalize (5 ); } // 0:3:1
123+ if (MIXING_VIRTUAL_TOOLS > 6 ) { collector[1 ] = 1 ; mixer.normalize (6 ); } // 0:1:1
124+ if (MIXING_VIRTUAL_TOOLS > 7 ) { collector[0 ] = 1 ; collector[2 ] = 0 ; mixer.normalize (7 ); } // 1:1:0
125+ #endif
126+ ZERO (collector);
127+ #endif
109128}
110129
111130// called at boot
112131void Mixer::init () {
113132
133+ ZERO (collector);
134+
114135 reset_vtools ();
115136
116137 #if HAS_MIXER_SYNC_CHANNEL
@@ -119,8 +140,6 @@ void Mixer::init() {
119140 color[MIXER_AUTORETRACT_TOOL][i] = COLOR_A_MASK;
120141 #endif
121142
122- ZERO (collector);
123-
124143 #if EITHER(HAS_DUAL_MIXING, GRADIENT_MIX)
125144 update_mix_from_vtool ();
126145 #endif
You can’t perform that action at this time.
0 commit comments