From b7053156fed8b492c3517ea6bf4986fcd9cdb433 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 9 Feb 2018 01:52:28 -0600 Subject: [PATCH 1/5] Minor comment/condition cleanup --- Marlin/src/gcode/config/M200-M205.cpp | 2 -- Marlin/src/gcode/queue.cpp | 2 +- Marlin/src/pins/pins_RAMBO.h | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 01e26f2fa..9692fedfe 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -89,8 +89,6 @@ void GcodeSuite::M203() { * P = Printing moves * R = Retract only (no X, Y, Z) moves * T = Travel (non printing) moves - * - * Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate */ void GcodeSuite::M204() { if (parser.seen('S')) { // Kept for legacy compatibility. Should NOT BE USED for new developments. diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index d5ad43550..ce619814a 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -271,7 +271,7 @@ inline void get_serial_commands() { // If the command buffer is empty for too long, // send "wait" to indicate Marlin is still waiting. - #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0 + #if NO_TIMEOUTS > 0 static millis_t last_command_time = 0; const millis_t ms = millis(); if (commands_in_queue == 0 && !serial_data_available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) { diff --git a/Marlin/src/pins/pins_RAMBO.h b/Marlin/src/pins/pins_RAMBO.h index 20f8b6b16..b294a169f 100644 --- a/Marlin/src/pins/pins_RAMBO.h +++ b/Marlin/src/pins/pins_RAMBO.h @@ -192,7 +192,7 @@ #define STAT_LED_RED_PIN 22 #define STAT_LED_BLUE_PIN 32 - #else + #else // !VIKI2 && !miniVIKI #define BEEPER_PIN 79 // AUX-4 @@ -203,7 +203,7 @@ #define SD_DETECT_PIN 81 - #endif // VIKI2/miniVIKI + #endif // !VIKI2 && !miniVIKI #else // !NEWPANEL - old style panel with shift register From c30a8067ab7b108ff8c55ad3fb21be0618877363 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 9 Feb 2018 01:50:14 -0600 Subject: [PATCH 2/5] Prevent watchdog reset due to many comments Addressing #7449 --- Marlin/src/gcode/queue.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index ce619814a..7aecaf3c0 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -30,6 +30,7 @@ #include "../lcd/ultralcd.h" #include "../sd/cardreader.h" #include "../module/planner.h" +#include "../module/temperature.h" #include "../Marlin.h" #if HAS_COLOR_LEDS @@ -297,7 +298,8 @@ inline void get_serial_commands() { serial_comment_mode[i] = false; // end of line == end of comment - if (!serial_count[i]) continue; // Skip empty lines + // Skip empty lines and comments + if (!serial_count[i]) { thermalManager.manage_heater(); continue; } serial_line_buffer[i][serial_count[i]] = 0; // Terminate string serial_count[i] = 0; // Reset buffer @@ -458,7 +460,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 112917cfef8dfff360cb60f930a2c34dae471f95 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 9 Feb 2018 03:32:40 -0600 Subject: [PATCH 3/5] No EXTRUDER_RUNOUT_PREVENT during print --- Marlin/src/Marlin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 177e424f2..d9c5c9b45 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -428,8 +428,10 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) { #endif #if ENABLED(EXTRUDER_RUNOUT_PREVENT) - if (ELAPSED(ms, gcode.previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) - && thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) { + if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP + && ELAPSED(ms, gcode.previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL) + && !planner.blocks_queued() + ) { #if ENABLED(SWITCHING_EXTRUDER) const bool oldstatus = E0_ENABLE_READ; enable_E0(); From cc9cef7f7a9d178f28ffeed83cd34acd92a9eecc Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 9 Feb 2018 03:33:16 -0600 Subject: [PATCH 4/5] Fix HAS_CONTROLLER_FAN in is_power_needed --- Marlin/src/feature/power.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/feature/power.cpp b/Marlin/src/feature/power.cpp index ce452aa0d..d713cb3dd 100644 --- a/Marlin/src/feature/power.cpp +++ b/Marlin/src/feature/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 da693a636e603512c3195a4e184117a63a532e06 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 9 Feb 2018 04:02:42 -0600 Subject: [PATCH 5/5] Fix handling of escapes in serial input --- Marlin/src/gcode/queue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 7aecaf3c0..67471cb80 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -389,7 +389,7 @@ inline void get_serial_commands() { else if (serial_char == '\\') { // Handle escapes // if we have one more character, copy it over if ((c = read_serial(i)) >= 0 && !serial_comment_mode[i]) - serial_line_buffer[i][serial_count[i]++] = serial_char; + serial_line_buffer[i][serial_count[i]++] = (char)c; } else { // it's not a newline, carriage return or escape char if (serial_char == ';') serial_comment_mode[i] = true;