Bladeren bron

Fix pause/resume SD print

Followup to #12551, addressing #12566
Scott Lahteine 6 jaren geleden
bovenliggende
commit
261c6f4b96

+ 1
- 1
Marlin/src/feature/pause.h Bestand weergeven

92
 
92
 
93
 bool unload_filament(const float &unload_length, const bool show_lcd=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT);
93
 bool unload_filament(const float &unload_length, const bool show_lcd=false, const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT);
94
 
94
 
95
-#endif //ADVANCED_PAUSE_FEATURE
95
+#endif // ADVANCED_PAUSE_FEATURE

+ 6
- 5
Marlin/src/gcode/feature/pause/M125.cpp Bestand weergeven

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
+  #if ENABLED(SDSUPPORT)
72
+    const bool sd_printing = IS_SD_PRINTING();
73
+  #else
74
+    constexpr bool sd_printing = false;
75
+  #endif
76
+
71
   if (pause_print(retract, park_point)) {
77
   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
77
     if (!sd_printing) {
78
     if (!sd_printing) {
78
       wait_for_confirmation();
79
       wait_for_confirmation();
79
       resume_print();
80
       resume_print();

+ 7
- 12
Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp Bestand weergeven

91
 
91
 
92
   #if ENABLED(POWER_LOSS_RECOVERY)
92
   #if ENABLED(POWER_LOSS_RECOVERY)
93
     if (parser.seenval('S')) card.setIndex(parser.value_long());
93
     if (parser.seenval('S')) card.setIndex(parser.value_long());
94
+    if (parser.seenval('T')) print_job_timer.resume(parser.value_long());
94
   #endif
95
   #endif
95
 
96
 
96
   card.startFileprint();
97
   card.startFileprint();
97
-
98
-  #if ENABLED(POWER_LOSS_RECOVERY)
99
-    if (parser.seenval('T'))
100
-      print_job_timer.resume(parser.value_long());
101
-    else
102
-  #endif
103
-      print_job_timer.start();
104
-
98
+  print_job_timer.start();
105
   ui.reset_status();
99
   ui.reset_status();
106
 }
100
 }
107
 
101
 
109
  * M25: Pause SD Print
103
  * M25: Pause SD Print
110
  */
104
  */
111
 void GcodeSuite::M25() {
105
 void GcodeSuite::M25() {
112
-  card.pauseSDPrint();
113
-  print_job_timer.pause();
114
-
115
   #if ENABLED(PARK_HEAD_ON_PAUSE)
106
   #if ENABLED(PARK_HEAD_ON_PAUSE)
116
-    enqueue_and_echo_commands_P(PSTR("M125 S")); // To be last in the buffer, must enqueue after pauseSDPrint
107
+    M125();
108
+  #else
109
+    card.pauseSDPrint();
110
+    print_job_timer.pause();
111
+    ui.reset_status();
117
   #endif
112
   #endif
118
 }
113
 }
119
 
114
 

+ 1
- 1
Marlin/src/lcd/menu/menu_main.cpp Bestand weergeven

54
     #else
54
     #else
55
       card.startFileprint();
55
       card.startFileprint();
56
       print_job_timer.start();
56
       print_job_timer.start();
57
+      ui.reset_status();
57
     #endif
58
     #endif
58
-    ui.reset_status();
59
   }
59
   }
60
 
60
 
61
   void lcd_sdcard_stop() {
61
   void lcd_sdcard_stop() {

+ 2
- 2
Marlin/src/libs/stopwatch.cpp Bestand weergeven

71
   else return false;
71
   else return false;
72
 }
72
 }
73
 
73
 
74
-void Stopwatch::resume(const millis_t duration) {
74
+void Stopwatch::resume(const millis_t with_time) {
75
   #if ENABLED(DEBUG_STOPWATCH)
75
   #if ENABLED(DEBUG_STOPWATCH)
76
     Stopwatch::debug(PSTR("resume"));
76
     Stopwatch::debug(PSTR("resume"));
77
   #endif
77
   #endif
78
 
78
 
79
   reset();
79
   reset();
80
-  if ((accumulator = duration)) state = RUNNING;
80
+  if ((accumulator = with_time)) state = RUNNING;
81
 }
81
 }
82
 
82
 
83
 void Stopwatch::reset() {
83
 void Stopwatch::reset() {

+ 1
- 1
Marlin/src/libs/stopwatch.h Bestand weergeven

75
      * @brief Resume the stopwatch
75
      * @brief Resume the stopwatch
76
      * @details Resume a timer from a given duration
76
      * @details Resume a timer from a given duration
77
      */
77
      */
78
-    static void resume(const millis_t duration);
78
+    static void resume(const millis_t with_time);
79
 
79
 
80
     /**
80
     /**
81
      * @brief Reset the stopwatch
81
      * @brief Reset the stopwatch

Laden…
Annuleren
Opslaan