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
   #endif
428
   #endif
429
 
429
 
430
   #if ENABLED(EXTRUDER_RUNOUT_PREVENT)
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
       #if ENABLED(SWITCHING_EXTRUDER)
435
       #if ENABLED(SWITCHING_EXTRUDER)
434
         const bool oldstatus = E0_ENABLE_READ;
436
         const bool oldstatus = E0_ENABLE_READ;
435
         enable_E0();
437
         enable_E0();

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

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

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

89
  *    P = Printing moves
89
  *    P = Printing moves
90
  *    R = Retract only (no X, Y, Z) moves
90
  *    R = Retract only (no X, Y, Z) moves
91
  *    T = Travel (non printing) moves
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
 void GcodeSuite::M204() {
93
 void GcodeSuite::M204() {
96
   if (parser.seen('S')) {  // Kept for legacy compatibility. Should NOT BE USED for new developments.
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
 #include "../lcd/ultralcd.h"
30
 #include "../lcd/ultralcd.h"
31
 #include "../sd/cardreader.h"
31
 #include "../sd/cardreader.h"
32
 #include "../module/planner.h"
32
 #include "../module/planner.h"
33
+#include "../module/temperature.h"
33
 #include "../Marlin.h"
34
 #include "../Marlin.h"
34
 
35
 
35
 #if HAS_COLOR_LEDS
36
 #if HAS_COLOR_LEDS
271
 
272
 
272
   // If the command buffer is empty for too long,
273
   // If the command buffer is empty for too long,
273
   // send "wait" to indicate Marlin is still waiting.
274
   // send "wait" to indicate Marlin is still waiting.
274
-  #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0
275
+  #if NO_TIMEOUTS > 0
275
     static millis_t last_command_time = 0;
276
     static millis_t last_command_time = 0;
276
     const millis_t ms = millis();
277
     const millis_t ms = millis();
277
     if (commands_in_queue == 0 && !serial_data_available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) {
278
     if (commands_in_queue == 0 && !serial_data_available() && ELAPSED(ms, last_command_time + NO_TIMEOUTS)) {
297
 
298
 
298
         serial_comment_mode[i] = false;                   // end of line == end of comment
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
         serial_line_buffer[i][serial_count[i]] = 0;       // Terminate string
304
         serial_line_buffer[i][serial_count[i]] = 0;       // Terminate string
303
         serial_count[i] = 0;                              // Reset buffer
305
         serial_count[i] = 0;                              // Reset buffer
387
       else if (serial_char == '\\') {  // Handle escapes
389
       else if (serial_char == '\\') {  // Handle escapes
388
         // if we have one more character, copy it over
390
         // if we have one more character, copy it over
389
         if ((c = read_serial(i)) >= 0 && !serial_comment_mode[i])
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
       else { // it's not a newline, carriage return or escape char
394
       else { // it's not a newline, carriage return or escape char
393
         if (serial_char == ';') serial_comment_mode[i] = true;
395
         if (serial_char == ';') serial_comment_mode[i] = true;
458
 
460
 
459
         sd_comment_mode = false; // for new command
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
         command_queue[cmd_queue_index_w][sd_count] = '\0'; // terminate string
466
         command_queue[cmd_queue_index_w][sd_count] = '\0'; // terminate string
464
         sd_count = 0; // clear sd line buffer
467
         sd_count = 0; // clear sd line buffer

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

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

Loading…
Cancel
Save