Browse Source

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

pull/1/head
Scott Lahteine 6 years ago
committed by GitHub
parent
commit
03ef2d6c82
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      Marlin/src/feature/pause.cpp
  2. 9
      Marlin/src/gcode/feature/pause/M125.cpp
  3. 5
      Marlin/src/gcode/feature/pause/M600.cpp
  4. 2
      Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp
  5. 7
      Marlin/src/lcd/menu/menu_main.cpp
  6. 6
      Marlin/src/lcd/ultralcd.cpp
  7. 2
      Marlin/src/module/temperature.cpp
  8. 9
      Marlin/src/sd/cardreader.cpp

12
Marlin/src/feature/pause.cpp

@ -45,10 +45,7 @@
#include "../feature/runout.h"
#endif
#if HAS_LCD_MENU
#include "../lcd/ultralcd.h"
#endif
#include "../lcd/ultralcd.h"
#include "../libs/buzzer.h"
#include "../libs/nozzle.h"
#include "pause.h"
@ -531,7 +528,7 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
SERIAL_ECHOPAIR("\nextruder_duplication_enabled:", extruder_duplication_enabled);
SERIAL_ECHOPAIR("\nactive_extruder:", active_extruder);
SERIAL_ECHOPGM("\n\n");
*/
//*/
if (!did_pause_print) return;
@ -590,9 +587,10 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
}
#endif
#if ENABLED(ULTRA_LCD)
// Resume the print job timer if it was running
if (print_job_timer.isPaused()) print_job_timer.start();
ui.reset_status();
#endif
}
#endif // ADVANCED_PAUSE_FEATURE

9
Marlin/src/gcode/feature/pause/M125.cpp

@ -68,15 +68,16 @@ void GcodeSuite::M125() {
park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0);
#endif
const bool job_running = print_job_timer.isRunning(),
sd_printing = IS_SD_PRINTING();
if (pause_print(retract, park_point)) {
#if ENABLED(SDSUPPORT)
const bool sd_printing = IS_SD_PRINTING() || parser.boolval('S'); // Undocumented parameter
#else
constexpr bool sd_printing = false;
#endif
if (!sd_printing) {
wait_for_confirmation();
resume_print();
}
if (job_running) print_job_timer.start();
}
}

5
Marlin/src/gcode/feature/pause/M600.cpp

@ -129,8 +129,6 @@ void GcodeSuite::M600() {
#endif
);
const bool job_running = print_job_timer.isRunning();
if (pause_print(retract, park_point, unload_length, true DXC_PASS)) {
wait_for_confirmation(true, beep_count DXC_PASS);
resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count DXC_PASS);
@ -141,9 +139,6 @@ void GcodeSuite::M600() {
if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, 0, true);
#endif
// Resume the print job timer if it was running
if (job_running) print_job_timer.start();
}
#endif // ADVANCED_PAUSE_FEATURE

2
Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp

@ -113,7 +113,7 @@ void GcodeSuite::M25() {
print_job_timer.pause();
#if ENABLED(PARK_HEAD_ON_PAUSE)
enqueue_and_echo_commands_P(PSTR("M125")); // Must be enqueued with pauseSDPrint set to be last in the buffer
enqueue_and_echo_commands_P(PSTR("M125 S")); // To be last in the buffer, must enqueue after pauseSDPrint
#endif
}

7
Marlin/src/lcd/menu/menu_main.cpp

@ -45,12 +45,7 @@
#if ENABLED(POWER_LOSS_RECOVERY)
if (recovery.enabled) recovery.save(true, false);
#endif
card.pauseSDPrint();
print_job_timer.pause();
#if ENABLED(PARK_HEAD_ON_PAUSE)
enqueue_and_echo_commands_P(PSTR("M125"));
#endif
ui.reset_status();
enqueue_and_echo_commands_P(PSTR("M25"));
}
void lcd_sdcard_resume() {

6
Marlin/src/lcd/ultralcd.cpp

@ -26,9 +26,7 @@
#if HAS_SPI_LCD || ENABLED(MALYAN_LCD) || ENABLED(EXTENSIBLE_UI)
#include "ultralcd.h"
MarlinUI ui;
#if ENABLED(SDSUPPORT)
#include "../sd/cardreader.h"
#endif
#if ENABLED(EXTENSIBLE_UI)
#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u)
#endif
@ -1243,7 +1241,7 @@ void MarlinUI::update() {
static const char printing[] PROGMEM = MSG_PRINTING;
static const char welcome[] PROGMEM = WELCOME_MSG;
PGM_P msg;
if (print_job_timer.isPaused())
if (!IS_SD_PRINTING() && print_job_timer.isPaused())
msg = paused;
#if ENABLED(SDSUPPORT)
else if (IS_SD_PRINTING())
@ -1257,4 +1255,4 @@ void MarlinUI::update() {
set_status_P(msg, -1);
}
#endif
#endif // HAS_SPI_LCD || EXTENSIBLE_UI

2
Marlin/src/module/temperature.cpp

@ -1922,7 +1922,7 @@ void Temperature::isr() {
;
/**
* Standard PWM modulation
* Standard heater PWM modulation
*/
if (pwm_count_tmp >= 127) {
pwm_count_tmp -= 127;

9
Marlin/src/sd/cardreader.cpp

@ -1027,15 +1027,20 @@ void CardReader::printingHasFinished() {
#if ENABLED(SD_FINISHED_STEPPERRELEASE) && defined(SD_FINISHED_RELEASECOMMAND)
planner.finish_and_disable();
#endif
print_job_timer.stop();
if (print_job_timer.duration() > 60)
enqueue_and_echo_commands_P(PSTR("M31"));
if (print_job_timer.duration() > 60) enqueue_and_echo_commands_P(PSTR("M31"));
#if ENABLED(SDCARD_SORT_ALPHA)
presort();
#endif
#if ENABLED(ULTRA_LCD) && ENABLED(LCD_SET_PROGRESS_MANUALLY)
ui.progress_bar_percent = 0;
#endif
ui.reset_status();
#if ENABLED(SD_REPRINT_LAST_SELECTED_FILE)
ui.reselect_last_file();
#endif

Loading…
Cancel
Save