1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-26 21:36:21 +00:00

🐛 Prevent stepper sleep during long UBL idle (#22137)

This commit is contained in:
Scott Lahteine 2021-06-14 18:44:27 -05:00 committed by Scott Lahteine
parent dec083dcc1
commit 781257bc64
3 changed files with 10 additions and 11 deletions

View File

@ -421,19 +421,18 @@ void startOrResumeJob() {
* - Check if an idle but hot extruder needs filament extruded (EXTRUDER_RUNOUT_PREVENT)
* - Pulse FET_SAFETY_PIN if it exists
*/
inline void manage_inactivity(const bool ignore_stepper_queue=false) {
inline void manage_inactivity(const bool no_stepper_sleep=false) {
queue.get_available_commands();
const millis_t ms = millis();
// Prevent steppers timing-out in the middle of M600
// unless PAUSE_PARK_NO_STEPPER_TIMEOUT is disabled
const bool parked_or_ignoring = ignore_stepper_queue
// Prevent steppers timing-out
const bool do_reset_timeout = no_stepper_sleep
|| TERN0(PAUSE_PARK_NO_STEPPER_TIMEOUT, did_pause_print);
// Reset both the M18/M84 activity timeout and the M85 max 'kill' timeout
if (parked_or_ignoring) gcode.reset_stepper_timeout(ms);
if (do_reset_timeout) gcode.reset_stepper_timeout(ms);
if (gcode.stepper_max_timed_out(ms)) {
SERIAL_ERROR_MSG(STR_KILL_INACTIVE_TIME, parser.command_ptr);
@ -449,7 +448,7 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
// activity timeout and the M85 max 'kill' timeout
if (planner.has_blocks_queued())
gcode.reset_stepper_timeout(ms);
else if (!parked_or_ignoring && gcode.stepper_inactive_timeout()) {
else if (!do_reset_timeout && gcode.stepper_inactive_timeout()) {
if (!already_shutdown_steppers) {
already_shutdown_steppers = true; // L6470 SPI will consume 99% of free time without this
@ -732,14 +731,14 @@ inline void manage_inactivity(const bool ignore_stepper_queue=false) {
* - Update the Průša MMU2
* - Handle Joystick jogging
*/
void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
void idle(bool no_stepper_sleep/*=false*/) {
#if ENABLED(MARLIN_DEV_MODE)
static uint16_t idle_depth = 0;
if (++idle_depth > 5) SERIAL_ECHOLNPAIR("idle() call depth: ", idle_depth);
#endif
// Core Marlin activities
manage_inactivity(TERN_(ADVANCED_PAUSE_FEATURE, no_stepper_sleep));
manage_inactivity(no_stepper_sleep);
// Manage Heaters (and Watchdog)
thermalManager.manage_heater();

View File

@ -34,8 +34,8 @@
void stop();
// Pass true to keep steppers from timing out
void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep=false));
inline void idle_no_sleep() { idle(TERN_(ADVANCED_PAUSE_FEATURE, true)); }
void idle(bool no_stepper_sleep=false);
inline void idle_no_sleep() { idle(true); }
#if ENABLED(G38_PROBE_TARGET)
extern uint8_t G38_move; // Flag to tell the ISR that G38 is in progress, and the type

View File

@ -1025,7 +1025,7 @@ void set_message_with_feedback(PGM_P const msg_P) {
SET_SOFT_ENDSTOP_LOOSE(true);
do {
idle();
idle_no_sleep();
new_z = ui.ubl_mesh_value();
TERN_(UBL_MESH_EDIT_MOVES_Z, do_blocking_move_to_z(h_offset + new_z)); // Move the nozzle as the point is edited
SERIAL_FLUSH(); // Prevent host M105 buffer overrun.