|
@@ -1209,25 +1209,22 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
1209
|
1209
|
|
1210
|
1210
|
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
1211
|
1211
|
|
|
1212
|
+ #define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
|
1213
|
+ #include "../core/debug_out.h"
|
|
1214
|
+
|
1212
|
1215
|
bool extruder_migration() {
|
1213
|
1216
|
|
1214
|
1217
|
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
1215
|
1218
|
if (thermalManager.targetTooColdToExtrude(active_extruder)) {
|
1216
|
|
- #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
1217
|
|
- SERIAL_ECHOLN("Migration Source Too Cold");
|
1218
|
|
- #endif
|
|
1219
|
+ DEBUG_ECHOLNPGM("Migration Source Too Cold");
|
1219
|
1220
|
return false;
|
1220
|
1221
|
}
|
1221
|
1222
|
#endif
|
1222
|
1223
|
|
1223
|
1224
|
// No auto-migration or specified target?
|
1224
|
1225
|
if (!migration.target && active_extruder >= migration.last) {
|
1225
|
|
- #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
1226
|
|
- SERIAL_ECHO_MSG("No Migration Target");
|
1227
|
|
- SERIAL_ECHO_MSG("Target: ", migration.target,
|
1228
|
|
- " Last: ", migration.last,
|
1229
|
|
- " Active: ", active_extruder);
|
1230
|
|
- #endif
|
|
1226
|
+ DEBUG_ECHO_MSG("No Migration Target");
|
|
1227
|
+ DEBUG_ECHO_MSG("Target: ", migration.target, " Last: ", migration.last, " Active: ", active_extruder);
|
1231
|
1228
|
migration.automode = false;
|
1232
|
1229
|
return false;
|
1233
|
1230
|
}
|
|
@@ -1237,9 +1234,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
1237
|
1234
|
uint8_t migration_extruder = active_extruder;
|
1238
|
1235
|
|
1239
|
1236
|
if (migration.target) {
|
1240
|
|
- #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
1241
|
|
- SERIAL_ECHOLN("Migration using fixed target");
|
1242
|
|
- #endif
|
|
1237
|
+ DEBUG_ECHOLNPGM("Migration using fixed target");
|
1243
|
1238
|
// Specified target ok?
|
1244
|
1239
|
const int16_t t = migration.target - 1;
|
1245
|
1240
|
if (t != active_extruder) migration_extruder = t;
|
|
@@ -1248,16 +1243,12 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
1248
|
1243
|
migration_extruder++;
|
1249
|
1244
|
|
1250
|
1245
|
if (migration_extruder == active_extruder) {
|
1251
|
|
- #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
1252
|
|
- SERIAL_ECHOLN("Migration source matches active");
|
1253
|
|
- #endif
|
|
1246
|
+ DEBUG_ECHOLNPGM("Migration source matches active");
|
1254
|
1247
|
return false;
|
1255
|
1248
|
}
|
1256
|
1249
|
|
1257
|
1250
|
// Migration begins
|
1258
|
|
- #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
1259
|
|
- SERIAL_ECHOLN("Beginning migration");
|
1260
|
|
- #endif
|
|
1251
|
+ DEBUG_ECHOLNPGM("Beginning migration");
|
1261
|
1252
|
|
1262
|
1253
|
migration.in_progress = true; // Prevent runout script
|
1263
|
1254
|
planner.synchronize();
|
|
@@ -1303,9 +1294,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
1303
|
1294
|
|
1304
|
1295
|
planner.synchronize();
|
1305
|
1296
|
planner.set_e_position_mm(current_position.e); // New extruder primed and ready
|
1306
|
|
- #if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
1307
|
|
- SERIAL_ECHOLN("Migration Complete");
|
1308
|
|
- #endif
|
|
1297
|
+ DEBUG_ECHOLNPGM("Migration Complete");
|
1309
|
1298
|
return true;
|
1310
|
1299
|
}
|
1311
|
1300
|
|