Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix problem with Ender-3 V2 menu system not properly stopping SD prints. #19642

Merged
merged 2 commits into from
Oct 6, 2020
Merged
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
41 changes: 12 additions & 29 deletions Marlin/src/lcd/dwin/e3v2/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ uint8_t index_file = MROWS,
index_leveling = MROWS,
index_tune = MROWS;

bool dwin_abort_flag = false;
bool dwin_abort_flag = false; // Flag to reset feedrate, return to Home

constexpr float default_max_feedrate[] = DEFAULT_MAX_FEEDRATE;
constexpr float default_max_acceleration[] = DEFAULT_MAX_ACCELERATION;
Expand Down Expand Up @@ -1801,8 +1801,8 @@ void HMI_SDCardUpdate() {
// TODO: Move card removed abort handling
// to CardReader::manage_media.
card.flag.abort_sd_printing = true;
wait_for_heatup = false;
dwin_abort_flag = true;
wait_for_heatup = wait_for_user = false;
dwin_abort_flag = true; // Reset feedrate, return to Home
}
}
DWIN_UpdateLCD();
Expand Down Expand Up @@ -2097,7 +2097,7 @@ void HMI_Printing() {
if (HMI_flag.done_confirm_flag) {
if (encoder_diffState == ENCODER_DIFF_ENTER) {
HMI_flag.done_confirm_flag = false;
dwin_abort_flag = true;
dwin_abort_flag = true; // Reset feedrate, return to Home
}
return;
}
Expand Down Expand Up @@ -2206,25 +2206,15 @@ void HMI_PauseOrStop() {
}
else if (select_print.now == 2) { // stop window
if (HMI_flag.select_flag) {
wait_for_heatup = false; // Stop waiting for heater

#if 0
// TODO: In ExtUI or MarlinUI add a common stop event
// card.flag.abort_sd_printing = true;
#else
checkkey = Back_Main;
// Wait for planner moves to finish!
if (HMI_flag.home_flag) planner.synchronize();
card.endFilePrint();
#ifdef ACTION_ON_CANCEL
host_action_cancel();
#endif
#ifdef EVENT_GCODE_SD_ABORT
Popup_Window_Home(true);
queue.inject_P(PSTR(EVENT_GCODE_SD_ABORT));
#endif
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved
dwin_abort_flag = true;
checkkey = Back_Main;
if (HMI_flag.home_flag) planner.synchronize(); // Wait for planner moves to finish!
wait_for_heatup = wait_for_user = false; // Stop waiting for heating/user
card.flag.abort_sd_printing = true; // Let the main loop handle SD abort
dwin_abort_flag = true; // Reset feedrate, return to Home
#ifdef ACTION_ON_CANCEL
host_action_cancel();
#endif
Popup_Window_Home(true);
}
else
Goto_PrintProcess(); // cancel stop
Expand Down Expand Up @@ -3584,13 +3574,6 @@ void EachMomentUpdate() {
dwin_abort_flag = false;
HMI_ValueStruct.print_speed = feedrate_percentage = 100;
dwin_zoffset = TERN0(HAS_BED_PROBE, probe.offset.z);

planner.finish_and_disable();

#if DISABLED(SD_ABORT_NO_COOLDOWN)
thermalManager.disable_all_heaters();
#endif

select_page.set(0);
Goto_MainMenu();
}
Expand Down