From c4dbedd5b690175af2a2ec075b8f2c0f644deaa2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 9 Feb 2018 01:42:34 -0600 Subject: [PATCH 1/4] Prevent watchdog reset due to many comments Addressing #7449 --- Marlin/Marlin_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7dc33e77f..6a2af4968 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1051,7 +1051,8 @@ inline void get_serial_commands() { serial_comment_mode = false; // end of line == end of comment - if (!serial_count) continue; // Skip empty lines + // Skip empty lines and comments + if (!serial_count) { thermalManager.manage_heater(); continue; } serial_line_buffer[serial_count] = 0; // Terminate string serial_count = 0; // Reset buffer @@ -1211,7 +1212,8 @@ inline void get_serial_commands() { sd_comment_mode = false; // for new command - if (!sd_count) continue; // skip empty lines (and comment lines) + // Skip empty lines and comments + if (!sd_count) { thermalManager.manage_heater(); continue; } command_queue[cmd_queue_index_w][sd_count] = '\0'; // terminate string sd_count = 0; // clear sd line buffer From 06dff0b7ec7a16e778437ed0d79cfa988c1ca1f3 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 9 Feb 2018 03:33:45 -0600 Subject: [PATCH 2/4] Fix HAS_CONTROLLER_FAN in is_power_needed --- Marlin/power.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/power.cpp b/Marlin/power.cpp index 1214bddd0..e3af4406f 100644 --- a/Marlin/power.cpp +++ b/Marlin/power.cpp @@ -45,7 +45,7 @@ bool Power::is_power_needed() { HOTEND_LOOP() if (thermalManager.autofan_speed[e] > 0) return true; #endif - #if ENABLED(AUTO_POWER_CONTROLLERFAN) && HAS_CONTROLLERFAN + #if ENABLED(AUTO_POWER_CONTROLLERFAN) && HAS_CONTROLLER_FAN if (controllerFanSpeed > 0) return true; #endif From 68cc5c72fd0f3b5d432b11029df8a85c34aaabfd Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 9 Feb 2018 03:36:42 -0600 Subject: [PATCH 3/4] No EXTRUDER_RUNOUT_PREVENT during print --- Marlin/Marlin_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 6a2af4968..93be9e1f9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -13450,8 +13450,10 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #endif #if ENABLED(EXTRUDER_RUNOUT_PREVENT) - if (ELAPSED(ms, previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) - && thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) { + if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP + && ELAPSED(ms, previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) + && !planner.blocks_queued() + ) { #if ENABLED(SWITCHING_EXTRUDER) const bool oldstatus = E0_ENABLE_READ; enable_E0(); From 96bcf08477baa8b5bea5d6334839bb4ea1d4a0fb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 9 Feb 2018 04:06:44 -0600 Subject: [PATCH 4/4] Tweak escape handling in serial input --- Marlin/Marlin_main.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 93be9e1f9..af3b19573 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1135,12 +1135,9 @@ inline void get_serial_commands() { // Keep fetching, but ignore normal characters beyond the max length // The command will be injected when EOL is reached } - else if (serial_char == '\\') { // Handle escapes - if ((c = MYSERIAL.read()) >= 0) { - // if we have one more character, copy it over - serial_char = c; - if (!serial_comment_mode) serial_line_buffer[serial_count++] = serial_char; - } + else if (serial_char == '\\') { // Handle escapes + if ((c = MYSERIAL.read()) >= 0 && !serial_comment_mode) // if we have one more character, copy it over + serial_line_buffer[serial_count++] = (char)c; // otherwise do nothing } else { // it's not a newline, carriage return or escape char