Skip to content

Commit 314c167

Browse files
huang-w-yscotthsl
authored andcommitted
Improvement: M600
1 parent eae8573 commit 314c167

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

Marlin/src/Marlin.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ void disable_all_steppers() {
532532
enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT));
533533
#else
534534
systemservice.PauseTrigger(TRIGGER_SOURCE_RUNOUT);
535+
RunoutResponseDelayed::modify_runout_distance_mm(FILAMENT_RUNOUT_DISTANCE_MM);
535536
#endif
536537
}
537538

Marlin/src/feature/runout.h

+8
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,14 @@ class FilamentSensorBase {
384384
#endif
385385
}
386386

387+
static inline void modify_runout_distance_mm(float distance) {
388+
#if EXTRUDERS > 1
389+
runout_mm_countdown[actual_extruder] = runout_distance_mm = distance;
390+
#else
391+
runout_mm_countdown[active_extruder] = runout_distance_mm = distance;
392+
#endif
393+
}
394+
387395
static inline bool has_run_out() {
388396
return runout_mm_countdown[active_extruder] < 0;
389397
}

Marlin/src/gcode/feature/pause/M600.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,18 @@ void GcodeSuite::M600() {
159159
#else
160160
#include "../../../gcode/gcode.h"
161161
#include "../snapmaker/src/module/toolhead_3dp.h"
162+
#include "../../../feature/runout.h"
162163
void GcodeSuite::M600() {
164+
planner.synchronize();
165+
if (systemservice.GetCurrentStatus() == SYSTAT_WORK) {
166+
RunoutResponseDelayed::modify_runout_distance_mm(0.001);
167+
}
168+
163169
#if EXTRUDERS > 1
164170
printer1->ResetFilamentState(0, actual_extruder);
165171
#else
166172
printer1->ResetFilamentState(0, active_extruder);
167173
#endif
168-
event_filament_runout();
169174
}
170175

171176
#endif // ADVANCED_PAUSE_FEATURE

Marlin/src/inc/Version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
/**
3939
* Marlin release version identifier
4040
*/
41-
#define SHORT_BUILD_VERSION "SM2-5.2.0"
41+
#define SHORT_BUILD_VERSION "SM2-5.2.1"
4242

4343
/**
4444
* Verbose version identifier which should contain a reference to the location
@@ -51,7 +51,7 @@
5151
* here we define this default string as the date where the latest release
5252
* version was tagged.
5353
*/
54-
#define STRING_DISTRIBUTION_DATE "2024-1113"
54+
#define STRING_DISTRIBUTION_DATE "2024-1216"
5555

5656
/**
5757
* Required minimum Configuration.h and Configuration_adv.h file versions.

snapmaker/src/service/system.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ ErrCode SystemService::ResumeOver() {
507507
switch (ModuleBase::toolhead()) {
508508
case MODULE_TOOLHEAD_3DP:
509509
case MODULE_TOOLHEAD_DUALEXTRUDER:
510+
RunoutResponseDelayed::modify_runout_distance_mm(FILAMENT_RUNOUT_DISTANCE_MM);
510511
if (runout.is_filament_runout()) {
511512
LOG_E("No filemant! Please insert filemant!\n");
512513
PauseTrigger(TRIGGER_SOURCE_RUNOUT);

0 commit comments

Comments
 (0)