Browse Source

Merge pull request #9549 from thinkyhead/bf2_prevent_comments_resetting

[2.0.x] Prevent watchdog reset due to many comments
Scott Lahteine 7 years ago
parent
commit
3168f0e646
No account linked to committer's email address

+ 4
- 2
Marlin/src/Marlin.cpp View File

@@ -428,8 +428,10 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
428 428
   #endif
429 429
 
430 430
   #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
431
-    if (ELAPSED(ms, gcode.previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL)
432
-      && thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP) {
431
+    if (thermalManager.degHotend(active_extruder) > EXTRUDER_RUNOUT_MINTEMP
432
+      && ELAPSED(ms, gcode.previous_cmd_ms + (EXTRUDER_RUNOUT_SECONDS) * 1000UL)
433
+      && !planner.blocks_queued()
434
+    ) {
433 435
       #if ENABLED(SWITCHING_EXTRUDER)
434 436
         const bool oldstatus = E0_ENABLE_READ;
435 437
         enable_E0();

+ 1
- 1
Marlin/src/feature/power.cpp View File

@@ -45,7 +45,7 @@ bool Power::is_power_needed() {
45 45
     HOTEND_LOOP() if (thermalManager.autofan_speed[e] > 0) return true;
46 46
   #endif
47 47
 
48
-  #if ENABLED(AUTO_POWER_CONTROLLERFAN) && HAS_CONTROLLERFAN
48
+  #if ENABLED(AUTO_POWER_CONTROLLERFAN) && HAS_CONTROLLER_FAN
49 49
     if (controllerFanSpeed > 0) return true;
50 50
   #endif
51 51
 

+ 0
- 2
Marlin/src/gcode/config/M200-M205.cpp View File

@@ -89,8 +89,6 @@ void GcodeSuite::M203() {
89 89
  *    P = Printing moves
90 90
  *    R = Retract only (no X, Y, Z) moves
91 91
  *    T = Travel (non printing) moves
92
- *
93
- *  Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate
94 92
  */
95 93
 void GcodeSuite::M204() {
96 94
   if (parser.seen('S')) {  // Kept for legacy compatibility. Should NOT BE USED for new developments.

+ 7
- 4
Marlin/src/gcode/queue.cpp View File

@@ -30,6 +30,7 @@
30 30
 #include "../lcd/ultralcd.h"
31 31
 #include "../sd/cardreader.h"
32 32
 #include "../module/planner.h"
33
+#include "../module/temperature.h"
33 34
 #include "../Marlin.h"
34 35
 
35 36
 #if HAS_COLOR_LEDS
@@ -271,7 +272,7 @@ inline void get_serial_commands() {
271 272
 
272 273
   // If the command buffer is empty for too long,
273 274
   // send "wait" to indicate Marlin is still waiting.
274
-  #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0
275
+  #if NO_TIMEOUTS > 0
275 276
     static millis_t last_command_time = 0;
276 277
     const millis_t ms = millis();
277 278
     if (commands_in_queue == 0 && !serial_data_available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) {
@@ -297,7 +298,8 @@ inline void get_serial_commands() {
297 298
 
298 299
         serial_comment_mode[i] = false;                   // end of line == end of comment
299 300
 
300
-        if (!serial_count[i]) continue;                   // Skip empty lines
301
+        // Skip empty lines and comments
302
+        if (!serial_count[i]) { thermalManager.manage_heater(); continue; }
301 303
 
302 304
         serial_line_buffer[i][serial_count[i]] = 0;       // Terminate string
303 305
         serial_count[i] = 0;                              // Reset buffer
@@ -387,7 +389,7 @@ inline void get_serial_commands() {
387 389
       else if (serial_char == '\\') {  // Handle escapes
388 390
         // if we have one more character, copy it over
389 391
         if ((c = read_serial(i)) >= 0 && !serial_comment_mode[i])
390
-          serial_line_buffer[i][serial_count[i]++] = serial_char;
392
+          serial_line_buffer[i][serial_count[i]++] = (char)c;
391 393
       }
392 394
       else { // it's not a newline, carriage return or escape char
393 395
         if (serial_char == ';') serial_comment_mode[i] = true;
@@ -458,7 +460,8 @@ inline void get_serial_commands() {
458 460
 
459 461
         sd_comment_mode = false; // for new command
460 462
 
461
-        if (!sd_count) continue; // skip empty lines (and comment lines)
463
+        // Skip empty lines and comments
464
+        if (!sd_count) { thermalManager.manage_heater(); continue; }
462 465
 
463 466
         command_queue[cmd_queue_index_w][sd_count] = '\0'; // terminate string
464 467
         sd_count = 0; // clear sd line buffer

+ 2
- 2
Marlin/src/pins/pins_RAMBO.h View File

@@ -192,7 +192,7 @@
192 192
       #define STAT_LED_RED_PIN 22
193 193
       #define STAT_LED_BLUE_PIN 32
194 194
 
195
-    #else
195
+    #else // !VIKI2 && !miniVIKI
196 196
 
197 197
       #define BEEPER_PIN 79 // AUX-4
198 198
 
@@ -203,7 +203,7 @@
203 203
 
204 204
       #define SD_DETECT_PIN 81
205 205
 
206
-    #endif // VIKI2/miniVIKI
206
+    #endif // !VIKI2 && !miniVIKI
207 207
 
208 208
   #else // !NEWPANEL - old style panel with shift register
209 209
 

Loading…
Cancel
Save