|
@ -38,6 +38,10 @@ |
|
|
#include "../../feature/power_loss_recovery.h" |
|
|
#include "../../feature/power_loss_recovery.h" |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
|
|
|
#include "../../sd/cardreader.h" |
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
void lcd_pause() { |
|
|
void lcd_pause() { |
|
|
#if ENABLED(POWER_LOSS_RECOVERY) |
|
|
#if ENABLED(POWER_LOSS_RECOVERY) |
|
|
if (recovery.enabled) recovery.save(true, false); |
|
|
if (recovery.enabled) recovery.save(true, false); |
|
@ -49,7 +53,7 @@ void lcd_pause() { |
|
|
#elif ENABLED(SDSUPPORT) |
|
|
#elif ENABLED(SDSUPPORT) |
|
|
enqueue_and_echo_commands_P(PSTR("M25")); |
|
|
enqueue_and_echo_commands_P(PSTR("M25")); |
|
|
#elif defined(ACTION_ON_PAUSE) |
|
|
#elif defined(ACTION_ON_PAUSE) |
|
|
SERIAL_ECHOLNPGM("//action:" ACTION_ON_PAUSE); |
|
|
host_action_pause(); |
|
|
#endif |
|
|
#endif |
|
|
planner.synchronize(); |
|
|
planner.synchronize(); |
|
|
} |
|
|
} |
|
@ -58,29 +62,28 @@ void lcd_resume() { |
|
|
#if ENABLED(SDSUPPORT) |
|
|
#if ENABLED(SDSUPPORT) |
|
|
if (card.isPaused()) enqueue_and_echo_commands_P(PSTR("M24")); |
|
|
if (card.isPaused()) enqueue_and_echo_commands_P(PSTR("M24")); |
|
|
#elif defined(ACTION_ON_RESUME) |
|
|
#elif defined(ACTION_ON_RESUME) |
|
|
SERIAL_ECHOLNPGM("//action:" ACTION_ON_RESUME); |
|
|
host_action_resume(); |
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
void lcd_stop() { |
|
|
|
|
|
#if ENABLED(SDSUPPORT) |
|
|
#include "../../sd/cardreader.h" |
|
|
|
|
|
|
|
|
|
|
|
void lcd_sdcard_stop() { |
|
|
|
|
|
wait_for_heatup = wait_for_user = false; |
|
|
wait_for_heatup = wait_for_user = false; |
|
|
card.flag.abort_sd_printing = true; |
|
|
card.flag.abort_sd_printing = true; |
|
|
ui.set_status_P(PSTR(MSG_PRINT_ABORTED), -1); |
|
|
#endif |
|
|
ui.return_to_status(); |
|
|
#ifdef ACTION_ON_CANCEL |
|
|
} |
|
|
host_action_cancel(); |
|
|
|
|
|
#endif |
|
|
void menu_sdcard_abort_confirm() { |
|
|
ui.set_status_P(PSTR(MSG_PRINT_ABORTED), -1); |
|
|
START_MENU(); |
|
|
ui.return_to_status(); |
|
|
MENU_BACK(MSG_MAIN); |
|
|
} |
|
|
MENU_ITEM(function, MSG_STOP_PRINT, lcd_sdcard_stop); |
|
|
|
|
|
END_MENU(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif // SDSUPPORT
|
|
|
void menu_abort_confirm() { |
|
|
|
|
|
START_MENU(); |
|
|
|
|
|
MENU_BACK(MSG_MAIN); |
|
|
|
|
|
MENU_ITEM(function, MSG_STOP_PRINT, lcd_stop); |
|
|
|
|
|
END_MENU(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void menu_tune(); |
|
|
void menu_tune(); |
|
|
void menu_motion(); |
|
|
void menu_motion(); |
|
@ -100,9 +103,8 @@ void menu_main() { |
|
|
|
|
|
|
|
|
if (busy) { |
|
|
if (busy) { |
|
|
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_pause); |
|
|
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_pause); |
|
|
#if ENABLED(SDSUPPORT) |
|
|
#if ENABLED(SDSUPPORT) || defined(ACTION_ON_CANCEL) |
|
|
if (card.isFileOpen()) |
|
|
MENU_ITEM(submenu, MSG_STOP_PRINT, menu_abort_confirm); |
|
|
MENU_ITEM(submenu, MSG_STOP_PRINT, menu_sdcard_abort_confirm); |
|
|
|
|
|
#endif |
|
|
#endif |
|
|
#if !defined(ACTION_ON_RESUME) && ENABLED(SDSUPPORT) |
|
|
#if !defined(ACTION_ON_RESUME) && ENABLED(SDSUPPORT) |
|
|
if (card.isFileOpen()) |
|
|
if (card.isFileOpen()) |
|
|