Use PGM serial strings
This commit is contained in:
parent
ea80b2c8fc
commit
21ce39aa9b
@ -40,8 +40,9 @@ bool FilamentMonitorBase::enabled = true,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||||
//#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE
|
|
||||||
#include "../module/tool_change.h"
|
#include "../module/tool_change.h"
|
||||||
|
#define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
||||||
|
#include "../core/debug_out.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAS_FILAMENT_RUNOUT_DISTANCE
|
#if HAS_FILAMENT_RUNOUT_DISTANCE
|
||||||
@ -74,15 +75,11 @@ void event_filament_runout() {
|
|||||||
|
|
||||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||||
if (migration.in_progress) {
|
if (migration.in_progress) {
|
||||||
#if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
DEBUG_ECHOLNPGM("Migration Already In Progress");
|
||||||
SERIAL_ECHOLN("Migration Already In Progress");
|
|
||||||
#endif
|
|
||||||
return; // Action already in progress. Purge triggered repeated runout.
|
return; // Action already in progress. Purge triggered repeated runout.
|
||||||
}
|
}
|
||||||
if (migration.automode) {
|
if (migration.automode) {
|
||||||
#if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
DEBUG_ECHOLNPGM("Migration Starting");
|
||||||
SERIAL_ECHOLN("Migration Starting");
|
|
||||||
#endif
|
|
||||||
if (extruder_migration()) return;
|
if (extruder_migration()) return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -109,9 +106,7 @@ void event_filament_runout() {
|
|||||||
if (run_runout_script
|
if (run_runout_script
|
||||||
&& ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600")
|
&& ( strstr(FILAMENT_RUNOUT_SCRIPT, "M600")
|
||||||
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M125")
|
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M125")
|
||||||
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|| TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25"))
|
||||||
|| strstr(FILAMENT_RUNOUT_SCRIPT, "M25")
|
|
||||||
#endif
|
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
host_action_paused(false);
|
host_action_paused(false);
|
||||||
|
@ -754,8 +754,8 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
|
|||||||
case 511: M511(); break; // M511: Unlock Printer
|
case 511: M511(); break; // M511: Unlock Printer
|
||||||
#endif
|
#endif
|
||||||
#if ENABLED(PASSWORD_CHANGE_GCODE)
|
#if ENABLED(PASSWORD_CHANGE_GCODE)
|
||||||
case 512: M512(); break;
|
case 512: M512(); break; // M512: Set/Change/Remove Password
|
||||||
#endif // M512: Set/Change/Remove Password
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(SDSUPPORT)
|
#if ENABLED(SDSUPPORT)
|
||||||
|
@ -294,7 +294,7 @@ namespace Anycubic {
|
|||||||
void ChironTFT::SendtoTFTLN(PGM_P str = nullptr) {
|
void ChironTFT::SendtoTFTLN(PGM_P str = nullptr) {
|
||||||
if (str != nullptr) {
|
if (str != nullptr) {
|
||||||
#if ACDEBUG(AC_SOME)
|
#if ACDEBUG(AC_SOME)
|
||||||
SERIAL_ECHO("> ");
|
SERIAL_ECHOPGM("> ");
|
||||||
#endif
|
#endif
|
||||||
SendtoTFT(str);
|
SendtoTFT(str);
|
||||||
#if ACDEBUG(AC_SOME)
|
#if ACDEBUG(AC_SOME)
|
||||||
|
@ -189,12 +189,12 @@ void Touch::touch(touch_control_t *control) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (calibration_state == CALIBRATION_SUCCESS) {
|
if (calibration_state == CALIBRATION_SUCCESS) {
|
||||||
SERIAL_ECHOLN("Touch screen calibration completed");
|
SERIAL_ECHOLNPGM("Touch screen calibration completed");
|
||||||
SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_X ", calibration.x);
|
SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_X ", calibration.x);
|
||||||
SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y);
|
SERIAL_ECHOLNPAIR("TOUCH_CALIBRATION_Y ", calibration.y);
|
||||||
SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x);
|
SERIAL_ECHOLNPAIR("TOUCH_OFFSET_X ", calibration.offset_x);
|
||||||
SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y);
|
SERIAL_ECHOLNPAIR("TOUCH_OFFSET_Y ", calibration.offset_y);
|
||||||
SERIAL_ECHO("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLN("TOUCH_LANDSCAPE"); else SERIAL_ECHOLN("TOUCH_PORTRAIT");
|
SERIAL_ECHOPGM("TOUCH_ORIENTATION "); if (calibration.orientation == TOUCH_LANDSCAPE) SERIAL_ECHOLNPGM("TOUCH_LANDSCAPE"); else SERIAL_ECHOLNPGM("TOUCH_PORTRAIT");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
|
@ -1209,25 +1209,22 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
|||||||
|
|
||||||
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
#if ENABLED(TOOLCHANGE_MIGRATION_FEATURE)
|
||||||
|
|
||||||
|
#define DEBUG_OUT ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
||||||
|
#include "../core/debug_out.h"
|
||||||
|
|
||||||
bool extruder_migration() {
|
bool extruder_migration() {
|
||||||
|
|
||||||
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
||||||
if (thermalManager.targetTooColdToExtrude(active_extruder)) {
|
if (thermalManager.targetTooColdToExtrude(active_extruder)) {
|
||||||
#if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
DEBUG_ECHOLNPGM("Migration Source Too Cold");
|
||||||
SERIAL_ECHOLN("Migration Source Too Cold");
|
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// No auto-migration or specified target?
|
// No auto-migration or specified target?
|
||||||
if (!migration.target && active_extruder >= migration.last) {
|
if (!migration.target && active_extruder >= migration.last) {
|
||||||
#if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
DEBUG_ECHO_MSG("No Migration Target");
|
||||||
SERIAL_ECHO_MSG("No Migration Target");
|
DEBUG_ECHO_MSG("Target: ", migration.target, " Last: ", migration.last, " Active: ", active_extruder);
|
||||||
SERIAL_ECHO_MSG("Target: ", migration.target,
|
|
||||||
" Last: ", migration.last,
|
|
||||||
" Active: ", active_extruder);
|
|
||||||
#endif
|
|
||||||
migration.automode = false;
|
migration.automode = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1237,9 +1234,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
|||||||
uint8_t migration_extruder = active_extruder;
|
uint8_t migration_extruder = active_extruder;
|
||||||
|
|
||||||
if (migration.target) {
|
if (migration.target) {
|
||||||
#if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
DEBUG_ECHOLNPGM("Migration using fixed target");
|
||||||
SERIAL_ECHOLN("Migration using fixed target");
|
|
||||||
#endif
|
|
||||||
// Specified target ok?
|
// Specified target ok?
|
||||||
const int16_t t = migration.target - 1;
|
const int16_t t = migration.target - 1;
|
||||||
if (t != active_extruder) migration_extruder = t;
|
if (t != active_extruder) migration_extruder = t;
|
||||||
@ -1248,16 +1243,12 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
|||||||
migration_extruder++;
|
migration_extruder++;
|
||||||
|
|
||||||
if (migration_extruder == active_extruder) {
|
if (migration_extruder == active_extruder) {
|
||||||
#if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
DEBUG_ECHOLNPGM("Migration source matches active");
|
||||||
SERIAL_ECHOLN("Migration source matches active");
|
|
||||||
#endif
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migration begins
|
// Migration begins
|
||||||
#if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
DEBUG_ECHOLNPGM("Beginning migration");
|
||||||
SERIAL_ECHOLN("Beginning migration");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
migration.in_progress = true; // Prevent runout script
|
migration.in_progress = true; // Prevent runout script
|
||||||
planner.synchronize();
|
planner.synchronize();
|
||||||
@ -1303,9 +1294,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
|
|||||||
|
|
||||||
planner.synchronize();
|
planner.synchronize();
|
||||||
planner.set_e_position_mm(current_position.e); // New extruder primed and ready
|
planner.set_e_position_mm(current_position.e); // New extruder primed and ready
|
||||||
#if ENABLED(DEBUG_TOOLCHANGE_MIGRATION_FEATURE)
|
DEBUG_ECHOLNPGM("Migration Complete");
|
||||||
SERIAL_ECHOLN("Migration Complete");
|
|
||||||
#endif
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include "../inc/MarlinConfigPre.h"
|
#include "../inc/MarlinConfigPre.h"
|
||||||
#include "../core/types.h"
|
#include "../core/types.h"
|
||||||
|
|
||||||
|
//#define DEBUG_TOOLCHANGE_MIGRATION_FEATURE
|
||||||
|
|
||||||
#if HAS_MULTI_EXTRUDER
|
#if HAS_MULTI_EXTRUDER
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user