diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a31045843..d4323309f 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3349,6 +3349,7 @@ inline void gcode_M42() { */ inline void gcode_M104() { if (setTargetedHotend(104)) return; + if (marlin_debug_flags & DEBUG_DRYRUN) return; if (code_seen('S')) { float temp = code_value(); @@ -3448,6 +3449,7 @@ inline void gcode_M105() { */ inline void gcode_M109() { if (setTargetedHotend(109)) return; + if (marlin_debug_flags & DEBUG_DRYRUN) return; LCD_MESSAGEPGM(MSG_HEATING); @@ -3532,6 +3534,8 @@ inline void gcode_M109() { * Rxxx Wait for bed current temp to reach target temp. Waits when heating and cooling */ inline void gcode_M190() { + if (marlin_debug_flags & DEBUG_DRYRUN) return; + LCD_MESSAGEPGM(MSG_BED_HEATING); no_wait_for_cooling = code_seen('S'); if (no_wait_for_cooling || code_seen('R')) @@ -3567,7 +3571,20 @@ inline void gcode_M109() { * M111: Set the debug level */ inline void gcode_M111() { - marlin_debug_flags = code_seen('S') ? code_value_short() : DEBUG_INFO|DEBUG_ERRORS; + marlin_debug_flags = code_seen('S') ? code_value_short() : DEBUG_INFO|DEBUG_COMMUNICATION; + + SERIAL_ECHO_START; + if (marlin_debug_flags & DEBUG_ECHO) SERIAL_ECHOLNPGM(MSG_DEBUG_ECHO); + // FOR MOMENT NOT ACTIVE + //if (marlin_debug_flags & DEBUG_INFO) SERIAL_ECHOLNPGM(MSG_DEBUG_INFO); + //if (marlin_debug_flags & DEBUG_ERRORS) SERIAL_ECHOLNPGM(MSG_DEBUG_ERRORS); + if (marlin_debug_flags & DEBUG_DRYRUN) { + SERIAL_ECHOLNPGM(MSG_DEBUG_DRYRUN); + setTargetBed(0); + for (int8_t cur_hotend = 0; cur_hotend < EXTRUDERS; ++cur_hotend) { + setTargetHotend(0, cur_hotend); + } + } } /** @@ -3605,6 +3622,7 @@ inline void gcode_M112() { kill(PSTR(MSG_KILLED)); } * M140: Set bed temperature */ inline void gcode_M140() { + if (marlin_debug_flags & DEBUG_DRYRUN) return; if (code_seen('S')) setTargetBed(code_value()); } @@ -5908,6 +5926,7 @@ void mesh_plan_buffer_line(float x, float y, float z, const float e, float feed_ #ifdef PREVENT_DANGEROUS_EXTRUDE inline void prevent_dangerous_extrude(float &curr_e, float &dest_e) { + if (marlin_debug_flags & DEBUG_DRYRUN) return; float de = dest_e - curr_e; if (de) { if (degHotend(active_extruder) < extrude_min_temp) { diff --git a/Marlin/language_en.h b/Marlin/language_en.h index f2ca91bee..336fc3fe8 100644 --- a/Marlin/language_en.h +++ b/Marlin/language_en.h @@ -421,6 +421,20 @@ #define MSG_END_MINUTE "minutes" #endif +// Debug +#ifndef MSG_DEBUG_ECHO +#define MSG_DEBUG_ECHO "DEBUG ECHO ENABLED" +#endif +#ifndef MSG_DEBUG_INFO +#define MSG_DEBUG_INFO "DEBUG INFO ENABLED" +#endif +#ifndef MSG_DEBUG_ERRORS +#define MSG_DEBUG_ERRORS "DEBUG ERRORS ENABLED" +#endif +#ifndef MSG_DEBUG_DRYRUN +#define MSG_DEBUG_DRYRUN "DEBUG DRYRUN ENABLED" +#endif + #ifdef DELTA_CALIBRATION_MENU #ifndef MSG_DELTA_CALIBRATE #define MSG_DELTA_CALIBRATE "Delta Calibration" diff --git a/Marlin/language_it.h b/Marlin/language_it.h index 752107376..f5550919c 100644 --- a/Marlin/language_it.h +++ b/Marlin/language_it.h @@ -127,6 +127,12 @@ #define MSG_END_HOUR "ore" #define MSG_END_MINUTE "minuti" +// Debug +#define MSG_DEBUG_ECHO "DEBUG RIPETI" +#define MSG_DEBUG_INFO "DEBUG INFO" +#define MSG_DEBUG_ERRORS "DEBUG ERRORI" +#define MSG_DEBUG_DRYRUN "DEBUG STAMPA A VUOTO" + #ifdef DELTA_CALIBRATION_MENU #define MSG_DELTA_CALIBRATE "Calibraz. Delta" #define MSG_DELTA_CALIBRATE_X "Calibra X" diff --git a/Marlin/planner.cpp b/Marlin/planner.cpp index 02bde4877..46bba54fd 100644 --- a/Marlin/planner.cpp +++ b/Marlin/planner.cpp @@ -502,7 +502,7 @@ float junction_deviation = 0.1; #ifdef PREVENT_DANGEROUS_EXTRUDE if (de) { - if (degHotend(extruder) < extrude_min_temp) { + if (degHotend(extruder) < extrude_min_temp && !(marlin_debug_flags & DEBUG_DRYRUN)) { position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part de = 0; // no difference SERIAL_ECHO_START;