Browse Source

Fix "paused" message and M125 called by M25 (#12551)

Scott Lahteine 6 years ago
parent
commit
03ef2d6c82
No account linked to committer's email address

+ 6
- 8
Marlin/src/feature/pause.cpp View File

45
   #include "../feature/runout.h"
45
   #include "../feature/runout.h"
46
 #endif
46
 #endif
47
 
47
 
48
-#if HAS_LCD_MENU
49
-  #include "../lcd/ultralcd.h"
50
-#endif
51
-
48
+#include "../lcd/ultralcd.h"
52
 #include "../libs/buzzer.h"
49
 #include "../libs/buzzer.h"
53
 #include "../libs/nozzle.h"
50
 #include "../libs/nozzle.h"
54
 #include "pause.h"
51
 #include "pause.h"
531
   SERIAL_ECHOPAIR("\nextruder_duplication_enabled:", extruder_duplication_enabled);
528
   SERIAL_ECHOPAIR("\nextruder_duplication_enabled:", extruder_duplication_enabled);
532
   SERIAL_ECHOPAIR("\nactive_extruder:", active_extruder);
529
   SERIAL_ECHOPAIR("\nactive_extruder:", active_extruder);
533
   SERIAL_ECHOPGM("\n\n");
530
   SERIAL_ECHOPGM("\n\n");
534
-  */
531
+  //*/
535
 
532
 
536
   if (!did_pause_print) return;
533
   if (!did_pause_print) return;
537
 
534
 
590
     }
587
     }
591
   #endif
588
   #endif
592
 
589
 
593
-  #if ENABLED(ULTRA_LCD)
594
-    ui.reset_status();
595
-  #endif
590
+  // Resume the print job timer if it was running
591
+  if (print_job_timer.isPaused()) print_job_timer.start();
592
+
593
+  ui.reset_status();
596
 }
594
 }
597
 
595
 
598
 #endif // ADVANCED_PAUSE_FEATURE
596
 #endif // ADVANCED_PAUSE_FEATURE

+ 5
- 4
Marlin/src/gcode/feature/pause/M125.cpp View File

68
     park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0);
68
     park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0);
69
   #endif
69
   #endif
70
 
70
 
71
-  const bool job_running = print_job_timer.isRunning(),
72
-             sd_printing = IS_SD_PRINTING();
73
-
74
   if (pause_print(retract, park_point)) {
71
   if (pause_print(retract, park_point)) {
72
+    #if ENABLED(SDSUPPORT)
73
+      const bool sd_printing = IS_SD_PRINTING() || parser.boolval('S'); // Undocumented parameter
74
+    #else
75
+      constexpr bool sd_printing = false;
76
+    #endif
75
     if (!sd_printing) {
77
     if (!sd_printing) {
76
       wait_for_confirmation();
78
       wait_for_confirmation();
77
       resume_print();
79
       resume_print();
78
     }
80
     }
79
-    if (job_running) print_job_timer.start();
80
   }
81
   }
81
 }
82
 }
82
 
83
 

+ 0
- 5
Marlin/src/gcode/feature/pause/M600.cpp View File

129
     #endif
129
     #endif
130
   );
130
   );
131
 
131
 
132
-  const bool job_running = print_job_timer.isRunning();
133
-
134
   if (pause_print(retract, park_point, unload_length, true DXC_PASS)) {
132
   if (pause_print(retract, park_point, unload_length, true DXC_PASS)) {
135
     wait_for_confirmation(true, beep_count DXC_PASS);
133
     wait_for_confirmation(true, beep_count DXC_PASS);
136
     resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count DXC_PASS);
134
     resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count DXC_PASS);
141
     if (active_extruder_before_filament_change != active_extruder)
139
     if (active_extruder_before_filament_change != active_extruder)
142
       tool_change(active_extruder_before_filament_change, 0, true);
140
       tool_change(active_extruder_before_filament_change, 0, true);
143
   #endif
141
   #endif
144
-
145
-  // Resume the print job timer if it was running
146
-  if (job_running) print_job_timer.start();
147
 }
142
 }
148
 
143
 
149
 #endif // ADVANCED_PAUSE_FEATURE
144
 #endif // ADVANCED_PAUSE_FEATURE

+ 1
- 1
Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp View File

113
   print_job_timer.pause();
113
   print_job_timer.pause();
114
 
114
 
115
   #if ENABLED(PARK_HEAD_ON_PAUSE)
115
   #if ENABLED(PARK_HEAD_ON_PAUSE)
116
-    enqueue_and_echo_commands_P(PSTR("M125")); // Must be enqueued with pauseSDPrint set to be last in the buffer
116
+    enqueue_and_echo_commands_P(PSTR("M125 S")); // To be last in the buffer, must enqueue after pauseSDPrint
117
   #endif
117
   #endif
118
 }
118
 }
119
 
119
 

+ 1
- 6
Marlin/src/lcd/menu/menu_main.cpp View File

45
     #if ENABLED(POWER_LOSS_RECOVERY)
45
     #if ENABLED(POWER_LOSS_RECOVERY)
46
       if (recovery.enabled) recovery.save(true, false);
46
       if (recovery.enabled) recovery.save(true, false);
47
     #endif
47
     #endif
48
-    card.pauseSDPrint();
49
-    print_job_timer.pause();
50
-    #if ENABLED(PARK_HEAD_ON_PAUSE)
51
-      enqueue_and_echo_commands_P(PSTR("M125"));
52
-    #endif
53
-    ui.reset_status();
48
+    enqueue_and_echo_commands_P(PSTR("M25"));
54
   }
49
   }
55
 
50
 
56
   void lcd_sdcard_resume() {
51
   void lcd_sdcard_resume() {

+ 3
- 5
Marlin/src/lcd/ultralcd.cpp View File

26
 #if HAS_SPI_LCD || ENABLED(MALYAN_LCD) || ENABLED(EXTENSIBLE_UI)
26
 #if HAS_SPI_LCD || ENABLED(MALYAN_LCD) || ENABLED(EXTENSIBLE_UI)
27
   #include "ultralcd.h"
27
   #include "ultralcd.h"
28
   MarlinUI ui;
28
   MarlinUI ui;
29
-  #if ENABLED(SDSUPPORT)
30
-    #include "../sd/cardreader.h"
31
-  #endif
29
+  #include "../sd/cardreader.h"
32
   #if ENABLED(EXTENSIBLE_UI)
30
   #if ENABLED(EXTENSIBLE_UI)
33
     #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u)
31
     #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u)
34
   #endif
32
   #endif
1243
     static const char printing[] PROGMEM = MSG_PRINTING;
1241
     static const char printing[] PROGMEM = MSG_PRINTING;
1244
     static const char welcome[] PROGMEM = WELCOME_MSG;
1242
     static const char welcome[] PROGMEM = WELCOME_MSG;
1245
     PGM_P msg;
1243
     PGM_P msg;
1246
-    if (print_job_timer.isPaused())
1244
+    if (!IS_SD_PRINTING() && print_job_timer.isPaused())
1247
       msg = paused;
1245
       msg = paused;
1248
     #if ENABLED(SDSUPPORT)
1246
     #if ENABLED(SDSUPPORT)
1249
       else if (IS_SD_PRINTING())
1247
       else if (IS_SD_PRINTING())
1257
     set_status_P(msg, -1);
1255
     set_status_P(msg, -1);
1258
   }
1256
   }
1259
 
1257
 
1260
-#endif
1258
+#endif // HAS_SPI_LCD || EXTENSIBLE_UI

+ 1
- 1
Marlin/src/module/temperature.cpp View File

1922
     ;
1922
     ;
1923
 
1923
 
1924
     /**
1924
     /**
1925
-     * Standard PWM modulation
1925
+     * Standard heater PWM modulation
1926
      */
1926
      */
1927
     if (pwm_count_tmp >= 127) {
1927
     if (pwm_count_tmp >= 127) {
1928
       pwm_count_tmp -= 127;
1928
       pwm_count_tmp -= 127;

+ 7
- 2
Marlin/src/sd/cardreader.cpp View File

1027
     #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
1027
     #if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
1028
       planner.finish_and_disable();
1028
       planner.finish_and_disable();
1029
     #endif
1029
     #endif
1030
+
1030
     print_job_timer.stop();
1031
     print_job_timer.stop();
1031
-    if (print_job_timer.duration() > 60)
1032
-      enqueue_and_echo_commands_P(PSTR("M31"));
1032
+    if (print_job_timer.duration() > 60) enqueue_and_echo_commands_P(PSTR("M31"));
1033
+
1033
     #if ENABLED(SDCARD_SORT_ALPHA)
1034
     #if ENABLED(SDCARD_SORT_ALPHA)
1034
       presort();
1035
       presort();
1035
     #endif
1036
     #endif
1037
+
1036
     #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
1038
     #if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
1037
       ui.progress_bar_percent = 0;
1039
       ui.progress_bar_percent = 0;
1038
     #endif
1040
     #endif
1041
+
1042
+    ui.reset_status();
1043
+
1039
     #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
1044
     #if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
1040
       ui.reselect_last_file();
1045
       ui.reselect_last_file();
1041
     #endif
1046
     #endif

Loading…
Cancel
Save