Use IS_SD_PRINTING() more
This commit is contained in:
parent
4dbaa6369f
commit
488a17b3f5
7 changed files with 11 additions and 10 deletions
|
@ -357,11 +357,12 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
|
||||||
|
|
||||||
// Pause the print job and timer
|
// Pause the print job and timer
|
||||||
#if ENABLED(SDSUPPORT)
|
#if ENABLED(SDSUPPORT)
|
||||||
if (card.sdprinting) {
|
if (IS_SD_PRINTING()) {
|
||||||
card.pauseSDPrint();
|
card.pauseSDPrint();
|
||||||
++did_pause_print; // Indicate SD pause also
|
++did_pause_print; // Indicate SD pause also
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
print_job_timer.pause();
|
print_job_timer.pause();
|
||||||
|
|
||||||
// Save current position
|
// Save current position
|
||||||
|
|
|
@ -749,7 +749,7 @@ inline void get_serial_commands() {
|
||||||
|
|
||||||
card.printingHasFinished();
|
card.printingHasFinished();
|
||||||
|
|
||||||
if (card.sdprinting)
|
if (IS_SD_PRINTING())
|
||||||
sd_count = 0; // If a sub-file was printing, continue from call point
|
sd_count = 0; // If a sub-file was printing, continue from call point
|
||||||
else {
|
else {
|
||||||
SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
|
SERIAL_PROTOCOLLNPGM(MSG_FILE_PRINTED);
|
||||||
|
@ -888,7 +888,7 @@ void advance_command_queue() {
|
||||||
else {
|
else {
|
||||||
gcode.process_next_command();
|
gcode.process_next_command();
|
||||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||||
if (card.cardOK && card.sdprinting) save_job_recovery_info();
|
if (card.cardOK && IS_SD_PRINTING()) save_job_recovery_info();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,7 @@ void GcodeSuite::M30() {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void GcodeSuite::M32() {
|
void GcodeSuite::M32() {
|
||||||
if (card.sdprinting) planner.synchronize();
|
if (IS_SD_PRINTING()) planner.synchronize();
|
||||||
|
|
||||||
if (card.cardOK) {
|
if (card.cardOK) {
|
||||||
const bool call_procedure = parser.boolval('P');
|
const bool call_procedure = parser.boolval('P');
|
||||||
|
|
|
@ -570,7 +570,7 @@ namespace UI {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isPrintingFromMediaPaused() {
|
bool isPrintingFromMediaPaused() {
|
||||||
return IFSD(isPrintingFromMedia() && !card.sdprinting, false);
|
return IFSD(isPrintingFromMedia() && !IS_SD_PRINTING(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isPrintingFromMedia() {
|
bool isPrintingFromMedia() {
|
||||||
|
@ -728,7 +728,7 @@ void lcd_reset_status() {
|
||||||
if (print_job_timer.isPaused())
|
if (print_job_timer.isPaused())
|
||||||
msg = paused;
|
msg = paused;
|
||||||
#if ENABLED(SDSUPPORT)
|
#if ENABLED(SDSUPPORT)
|
||||||
else if (card.sdprinting)
|
else if (IS_SD_PRINTING())
|
||||||
return lcd_setstatus(card.longest_filename(), true);
|
return lcd_setstatus(card.longest_filename(), true);
|
||||||
#endif
|
#endif
|
||||||
else if (print_job_timer.isRunning())
|
else if (print_job_timer.isRunning())
|
||||||
|
|
|
@ -444,13 +444,13 @@ void lcd_update() {
|
||||||
// If there was a print in progress, we need to emit the final
|
// If there was a print in progress, we need to emit the final
|
||||||
// print status as {TQ:100}. Reset last percent done so a new print will
|
// print status as {TQ:100}. Reset last percent done so a new print will
|
||||||
// issue a percent of 0.
|
// issue a percent of 0.
|
||||||
const uint8_t percent_done = card.sdprinting ? card.percentDone() : last_printing_status ? 100 : 0;
|
const uint8_t percent_done = IS_SD_PRINTING() ? card.percentDone() : last_printing_status ? 100 : 0;
|
||||||
if (percent_done != last_percent_done) {
|
if (percent_done != last_percent_done) {
|
||||||
char message_buffer[10];
|
char message_buffer[10];
|
||||||
sprintf_P(message_buffer, PSTR("{TQ:%03i}"), percent_done);
|
sprintf_P(message_buffer, PSTR("{TQ:%03i}"), percent_done);
|
||||||
write_to_lcd(message_buffer);
|
write_to_lcd(message_buffer);
|
||||||
last_percent_done = percent_done;
|
last_percent_done = percent_done;
|
||||||
last_printing_status = card.sdprinting;
|
last_printing_status = IS_SD_PRINTING();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ void menu_main() {
|
||||||
#if ENABLED(SDSUPPORT)
|
#if ENABLED(SDSUPPORT)
|
||||||
if (card.cardOK) {
|
if (card.cardOK) {
|
||||||
if (card.isFileOpen()) {
|
if (card.isFileOpen()) {
|
||||||
if (card.sdprinting)
|
if (IS_SD_PRINTING())
|
||||||
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause);
|
MENU_ITEM(function, MSG_PAUSE_PRINT, lcd_sdcard_pause);
|
||||||
else
|
else
|
||||||
MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume);
|
MENU_ITEM(function, MSG_RESUME_PRINT, lcd_sdcard_resume);
|
||||||
|
|
|
@ -432,7 +432,7 @@ void lcd_reset_status() {
|
||||||
if (print_job_timer.isPaused())
|
if (print_job_timer.isPaused())
|
||||||
msg = paused;
|
msg = paused;
|
||||||
#if ENABLED(SDSUPPORT)
|
#if ENABLED(SDSUPPORT)
|
||||||
else if (card.sdprinting)
|
else if (IS_SD_PRINTING())
|
||||||
return lcd_setstatus(card.longest_filename(), true);
|
return lcd_setstatus(card.longest_filename(), true);
|
||||||
#endif
|
#endif
|
||||||
else if (print_job_timer.isRunning())
|
else if (print_job_timer.isRunning())
|
||||||
|
|
Loading…
Reference in a new issue