From 963a92ceda9492e47bd7ec92d55ab623926dfc46 Mon Sep 17 00:00:00 2001
From: Scott Lahteine <sourcetree@thinkyhead.com>
Date: Fri, 18 Mar 2016 22:22:40 -0700
Subject: [PATCH] Patch idle forevermore
---
Marlin/Marlin.h | 6 +++++-
Marlin/Marlin_main.cpp | 21 +++++++++++----------
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h
index 42f8af2c6e..99176089af 100644
--- a/Marlin/Marlin.h
+++ b/Marlin/Marlin.h
@@ -103,7 +103,11 @@ FORCE_INLINE void serialprintPGM(const char* str) {
void get_command();
-void idle(); // the standard idle routine calls manage_inactivity(false)
+void idle(
+ #if ENABLED(FILAMENTCHANGEENABLE)
+ bool no_stepper_sleep=false // pass true to keep steppers from disabling on timeout
+ #endif
+);
void manage_inactivity(bool ignore_stepper_queue = false);
diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index 550cea0f0e..2f2c557fc6 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -5391,13 +5391,6 @@ inline void gcode_M503() {
#if ENABLED(FILAMENTCHANGEENABLE)
- inline void idle2() {
- manage_heater();
- manage_inactivity(true);
- host_keepalive();
- lcd_update();
- }
-
/**
* M600: Pause for filament change
*
@@ -5484,7 +5477,7 @@ inline void gcode_M503() {
lcd_quick_feedback();
next_tick = ms + 2500; // feedback every 2.5s while waiting
}
- idle2();
+ idle(true);
#else
current_position[E_AXIS] += AUTO_FILAMENT_CHANGE_LENGTH;
destination[E_AXIS] = current_position[E_AXIS];
@@ -7040,9 +7033,17 @@ void disable_all_steppers() {
/**
* Standard idle routine keeps the machine alive
*/
-void idle() {
+void idle(
+ #if ENABLED(FILAMENTCHANGEENABLE)
+ bool no_stepper_sleep/*=false*/
+ #endif
+) {
manage_heater();
- manage_inactivity();
+ manage_inactivity(
+ #if ENABLED(FILAMENTCHANGEENABLE)
+ no_stepper_sleep
+ #endif
+ );
host_keepalive();
lcd_update();
}
--
GitLab