Optimize target_extruder, ignore T with mixing (#12432)

* Optimize target_extruder, ignore T with mixing
* Give G-code Tn parity with tool_change
This commit is contained in:
Scott Lahteine
2018-11-14 17:33:04 -06:00
committed by GitHub
parent 5e586a6b39
commit d2bb53702a
18 changed files with 150 additions and 138 deletions

View File

@ -54,7 +54,8 @@
void GcodeSuite::M600() {
point_t park_point = NOZZLE_PARK_POINT;
if (get_target_extruder_from_command()) return;
const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return;
#if ENABLED(DUAL_X_CARRIAGE)
int8_t DXC_ext = target_extruder;

View File

@ -43,7 +43,8 @@
*/
void GcodeSuite::M603() {
if (get_target_extruder_from_command()) return;
const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return;
// Unload length
if (parser.seen('U')) {

View File

@ -55,7 +55,9 @@ void GcodeSuite::M701() {
if (axis_unhomed_error()) park_point.z = 0;
#endif
if (get_target_extruder_from_command()) return;
const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return;
// Z axis lift
if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
@ -121,7 +123,8 @@ void GcodeSuite::M702() {
if (axis_unhomed_error()) park_point.z = 0;
#endif
if (get_target_extruder_from_command()) return;
const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return;
// Z axis lift
if (parser.seenval('Z')) park_point.z = parser.linearval('Z');
@ -154,8 +157,8 @@ void GcodeSuite::M702() {
#endif
{
// Unload length
const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) :
fc_settings[target_extruder].unload_length);
const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS)
: fc_settings[target_extruder].unload_length);
unload_filament(unload_length, true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT);
}

View File

@ -73,7 +73,8 @@ void GcodeSuite::M906() {
#endif
break;
case E_AXIS: {
if (get_target_extruder_from_command()) return;
const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return;
switch (target_extruder) {
#if AXIS_IS_TMC(E0)
case 0: TMC_SET_CURRENT(E0); break;

View File

@ -232,7 +232,8 @@
#endif
break;
case E_AXIS: {
if (get_target_extruder_from_command()) return;
const int8_t target_extruder = get_target_extruder_from_command();
if (target_extruder < 0) return;
switch (target_extruder) {
#if AXIS_HAS_STEALTHCHOP(E0)
case 0: TMC_SET_PWMTHRS_E(0); break;