Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -590,9 +587,10 @@ void resume_print(const float &slow_load_length/*=0*/, const float &fast_load_le
}
#endif

#if ENABLED(ULTRA_LCD)
ui.reset_status();
#endif
// Resume the print job timer if it was running
if (print_job_timer.isPaused()) print_job_timer.start();

ui.reset_status();
}

#endif // ADVANCED_PAUSE_FEATURE
9 changes: 5 additions & 4 deletions Marlin/src/gcode/feature/pause/M125.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
5 changes: 0 additions & 5 deletions Marlin/src/gcode/feature/pause/M600.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 changes: 1 addition & 1 deletion Marlin/src/gcode/sdcard/M20-M30_M32-M34_M524_M928.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
7 changes: 1 addition & 6 deletions Marlin/src/lcd/menu/menu_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 3 additions & 5 deletions Marlin/src/lcd/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
#include "../sd/cardreader.h"
#if ENABLED(EXTENSIBLE_UI)
#define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u)
#endif
Expand Down Expand Up @@ -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())
Expand All @@ -1257,4 +1255,4 @@ void MarlinUI::update() {
set_status_P(msg, -1);
}

#endif
#endif // HAS_SPI_LCD || EXTENSIBLE_UI
2 changes: 1 addition & 1 deletion Marlin/src/module/temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,7 @@ void Temperature::isr() {
;

/**
* Standard PWM modulation
* Standard heater PWM modulation
*/
if (pwm_count_tmp >= 127) {
pwm_count_tmp -= 127;
Expand Down
9 changes: 7 additions & 2 deletions Marlin/src/sd/cardreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down