From 622c7051fa674252670c5c1e5a6f2666bfb31042 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 7 Jun 2018 20:50:30 +0200 Subject: [PATCH 01/11] show estimated time to end of the print if available in gcode: initial version --- .gitignore | 11 ++ Firmware/Marlin.h | 15 +++ Firmware/Marlin_main.cpp | 56 ++++++++++ .../ultralcd_implementation_hitachi_HD44780.h | 105 +++++++++++------- 4 files changed, 144 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index b7035fd60..f0c277fec 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,14 @@ /Firmware/Firmware.vcxproj /Firmware/Firmware.sln /Firmware/Firmware - Shortcut.lnk +.settings +.project +.cproject +Debug +Firmware/Configuration_prusa.h +Firmware/Doc +/Firmware/.vs/Firmware/v14/.suo +/Firmware/Firmware.sln +/Firmware/Firmware.vcxproj +/Firmware/Firmware.vcxproj.filters +/Firmware/__vm diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index ff3ed9aa0..6fd26d5bb 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -340,6 +340,16 @@ extern bool sortAlpha; extern void calculate_volumetric_multipliers(); + +//estimated time to end of the print +extern uint8_t print_percent_done_normal; +extern uint16_t print_time_remaining_normal; +extern uint8_t print_percent_done_silent; +extern uint16_t print_time_remaining_silent; +#define PRINT_TIME_REMAINING_INIT 65535 +#define PRINT_PERCENT_DONE_INIT 255 +#define PRINTER_ACTIVE (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) || (lcd_commands_type == LCD_COMMAND_V2_CAL)) + // Similar to the default Arduino delay function, // but it keeps the background tasks running. extern void delay_keep_alive(unsigned int ms); @@ -364,6 +374,11 @@ void serialecho_temperatures(); void proc_commands(); bool check_commands(); +//estimated time to end of the print +extern uint16_t print_time_remaining(); +extern uint8_t print_percent_done(); +static void print_time_remaining_init(); + #ifdef HOST_KEEPALIVE_FEATURE // States for managing Marlin and host communication diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 32e1d34e1..aefc62a6b 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -134,6 +134,7 @@ // Call gcode file : "M32 P !filename#" and return to caller file after finishing (similar to #include). // The '#' is necessary when calling from within sd files, as it stops buffer prereading // M42 - Change pin status via gcode Use M42 Px Sy to set pin x to value y, when omitting Px the onboard led will be used. +// M73 - Show percent done and print time remaining // M80 - Turn on Power Supply // M81 - Turn off Power Supply // M82 - Set E codes absolute (default) @@ -401,6 +402,13 @@ bool no_response = false; uint8_t important_status; uint8_t saved_filament_type; + +// storing estimated time to end of print counted by slicer +uint8_t print_percent_done_normal = PRINT_PERCENT_DONE_INIT; +uint16_t print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; //estimated remaining print time in minutes +uint8_t print_percent_done_silent = PRINT_PERCENT_DONE_INIT; +uint16_t print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; //estimated remaining print time in minutes + //=========================================================================== //=============================Private Variables============================= //=========================================================================== @@ -4305,6 +4313,22 @@ Sigma_Exit: } #endif // Z_PROBE_REPEATABILITY_TEST #endif // ENABLE_AUTO_BED_LEVELING + case 73: //M73 show percent done and time remaining + if(code_seen('P')) print_percent_done_normal = code_value(); + if(code_seen('R')) print_time_remaining_normal = code_value(); + if(code_seen('Q')) print_percent_done_silent = code_value(); + if(code_seen('S')) print_time_remaining_silent = code_value(); + + SERIAL_ECHOPGM("NORMAL MODE: Percent done: "); + MYSERIAL.print(int(print_percent_done_normal)); + SERIAL_ECHOPGM("; print time remaining in mins: "); + MYSERIAL.println(print_time_remaining_normal); + SERIAL_ECHOPGM("SILENT MODE: Percent done: "); + MYSERIAL.print(int(print_percent_done_silent)); + SERIAL_ECHOPGM("; print time remaining in mins: "); + MYSERIAL.println(print_time_remaining_silent); + + break; case 104: // M104 if(setTargetedHotend(104)){ @@ -4602,6 +4626,8 @@ Sigma_Exit: #endif } } + //in the end of print set estimated time to end of print and extruders used during print to default values for next print + print_time_remaining_init(); snmm_filaments_used = 0; break; case 85: // M85 @@ -6997,3 +7023,33 @@ void serialecho_temperatures() { SERIAL_PROTOCOL_F(degBed(), 1); SERIAL_PROTOCOLLN(""); } + +uint16_t print_time_remaining() { + uint16_t print_t = PRINT_TIME_REMAINING_INIT; + if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_remaining_normal; + else print_t = print_time_remaining_silent; + if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100 * print_t / feedmultiply; + return print_t; +} + +uint8_t print_percent_done() { + //in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize + uint8_t percent_done = 0; + if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100) { + percent_done = print_percent_done_normal; + } + else if (print_percent_done_silent <= 100) { + percent_done = print_percent_done_silent; + } + else { + percent_done = card.percentDone(); + } + return percent_done; +} + +static void print_time_remaining_init() { + print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; + print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; + print_percent_done_normal = PRINT_PERCENT_DONE_INIT; + print_percent_done_silent = PRINT_PERCENT_DONE_INIT; +} diff --git a/Firmware/ultralcd_implementation_hitachi_HD44780.h b/Firmware/ultralcd_implementation_hitachi_HD44780.h index 275c96d27..bc3021239 100644 --- a/Firmware/ultralcd_implementation_hitachi_HD44780.h +++ b/Firmware/ultralcd_implementation_hitachi_HD44780.h @@ -679,6 +679,53 @@ void lcd_implementation_print_at(uint8_t x, uint8_t y, const char *str) lcd.print(str); } +static inline void lcd_print_percent_done() { + if (is_usb_printing) + { + lcd_printPGM(PSTR("USB")); + } + else if(IS_SD_PRINTING) + { + lcd_printPGM(PSTR("SD")); + } + else + { + lcd_printPGM(PSTR(" ")); + } + if (IS_SD_PRINTING || (PRINTER_ACTIVE && (print_percent_done_normal != PRINT_PERCENT_DONE_INIT))) + { + lcd.print(itostr3(print_percent_done())); + } + else + { + lcd_printPGM(PSTR("---")); + } + lcd.print('%'); +} + +static inline void lcd_print_time() { + //if remaining print time estimation is available print it else print elapsed time + //uses 8 characters + uint16_t print_t = 0; + if (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT){ + print_t = print_time_remaining(); + } + else if(starttime != 0){ + print_t = millis() / 60000 - starttime / 60000; + } + lcd.print(LCD_STR_CLOCK[0]); + if((PRINTER_ACTIVE) && ((print_time_remaining_normal != PRINT_TIME_REMAINING_INIT)||(starttime != 0))) + { + lcd.print(itostr2(print_t/60)); + lcd.print(':'); + lcd.print(itostr2(print_t%60)); + (print_time_remaining_normal != PRINT_TIME_REMAINING_INIT) ? lcd.print('R') : lcd.print(' '); + (feedmultiply == 100) ? lcd.print(' ') : lcd.print('?'); + }else{ + lcd_printPGM(PSTR("--:-- ")); + } +} + /* 20x4 |01234567890123456789| @@ -758,35 +805,14 @@ static void lcd_implementation_status_screen() //Print SD status lcd.setCursor(0, 2); - if (is_usb_printing) - { - lcd_printPGM(PSTR("--")); - } - else - { - lcd_printPGM(PSTR("SD")); - } - if (IS_SD_PRINTING) - { - lcd.print(itostr3(card.percentDone())); - lcd.print('%'); - } - else - { - if (is_usb_printing) - { - lcd_printPGM(PSTR(">USB")); - } - else - { - lcd_printPGM(PSTR("---")); - lcd.print('%'); - } - } - + lcd_print_percent_done(); + +} + // Farm number display if (farm_mode) { + lcd.setCursor(0, 6); lcd_printPGM(PSTR(" F")); lcd.print(farm_no); lcd_printPGM(PSTR(" ")); @@ -813,23 +839,16 @@ static void lcd_implementation_status_screen() #endif } - - - //Print time elapsed - lcd.setCursor(LCD_WIDTH - 8 -1, 2); - lcd_printPGM(PSTR(" ")); - lcd.print(LCD_STR_CLOCK[0]); - if(starttime != 0) - { - uint16_t time = millis() / 60000 - starttime / 60000; - lcd.print(itostr2(time/60)); - lcd.print(':'); - lcd.print(itostr2(time%60)); - }else{ - lcd_printPGM(PSTR("--:--")); - } - lcd_printPGM(PSTR(" ")); - +#ifdef CMD_DIAGNOSTICS + lcd.setCursor(LCD_WIDTH - 8 -1, 2); + lcd_printPGM(PSTR(" C")); + lcd.print(buflen); // number of commands in cmd buffer + if (buflen < 9) lcd_printPGM(" "); +#else + //Print time + lcd.setCursor(LCD_WIDTH - 8, 2); + lcd_print_time(); +#endif //CMD_DIAGNOSTICS #ifdef DEBUG_DISABLE_LCD_STATUS_LINE return; From 7acaff031b4dc82b4413eb816fd96b26343ce839 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 6 Sep 2018 23:05:36 +0200 Subject: [PATCH 02/11] MK25: always show "normal mode" remaining time --- Firmware/Marlin_main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index aefc62a6b..7a3f4e12e 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7026,8 +7026,12 @@ void serialecho_temperatures() { uint16_t print_time_remaining() { uint16_t print_t = PRINT_TIME_REMAINING_INIT; +#ifdef TMC2130 if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_remaining_normal; else print_t = print_time_remaining_silent; +#else + print_t = print_time_remaining_normal; +#endif //TMC2130 if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100 * print_t / feedmultiply; return print_t; } @@ -7035,12 +7039,18 @@ uint16_t print_time_remaining() { uint8_t print_percent_done() { //in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize uint8_t percent_done = 0; +#ifdef TMC2130 if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100) { percent_done = print_percent_done_normal; } else if (print_percent_done_silent <= 100) { percent_done = print_percent_done_silent; } +#else + if (print_percent_done_normal <= 100) { + percent_done = print_percent_done_normal; + } +#endif //TMC2130 else { percent_done = card.percentDone(); } From ed02b6286b4006f5275a82b21388da98367d2c1c Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Fri, 7 Sep 2018 02:02:35 +0200 Subject: [PATCH 03/11] time remaining fix --- Firmware/Marlin.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 6fd26d5bb..9cab60609 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -346,9 +346,12 @@ extern uint8_t print_percent_done_normal; extern uint16_t print_time_remaining_normal; extern uint8_t print_percent_done_silent; extern uint16_t print_time_remaining_silent; -#define PRINT_TIME_REMAINING_INIT 65535 -#define PRINT_PERCENT_DONE_INIT 255 -#define PRINTER_ACTIVE (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) || (lcd_commands_type == LCD_COMMAND_V2_CAL)) + +#define PRINT_TIME_REMAINING_INIT 0xffff +#define PRINT_PERCENT_DONE_INIT 0xff +#define PRINTER_ACTIVE (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) || (lcd_commands_type == LCD_COMMAND_V2_CAL) || card.paused || mmu_print_saved) + +extern void calculate_extruder_multipliers(); // Similar to the default Arduino delay function, // but it keeps the background tasks running. From 02672b7a51655f90f498fd6a40962c3e44d0fb78 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 4 Apr 2019 15:25:12 +0200 Subject: [PATCH 04/11] time remaining fix 2 --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 7a3f4e12e..e6c0a071c 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7032,7 +7032,7 @@ uint16_t print_time_remaining() { #else print_t = print_time_remaining_normal; #endif //TMC2130 - if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100 * print_t / feedmultiply; + if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; return print_t; } From ec2c37ef17b2a2a7961c408b10084df2a2dde17c Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 4 Apr 2019 15:28:14 +0200 Subject: [PATCH 05/11] remove unused code (MK3 specific) --- Firmware/Marlin.h | 1 - Firmware/Marlin_main.cpp | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 9cab60609..c17433567 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -349,7 +349,6 @@ extern uint16_t print_time_remaining_silent; #define PRINT_TIME_REMAINING_INIT 0xffff #define PRINT_PERCENT_DONE_INIT 0xff -#define PRINTER_ACTIVE (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) || (lcd_commands_type == LCD_COMMAND_V2_CAL) || card.paused || mmu_print_saved) extern void calculate_extruder_multipliers(); diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index e6c0a071c..ed5c48c1f 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -7026,12 +7026,7 @@ void serialecho_temperatures() { uint16_t print_time_remaining() { uint16_t print_t = PRINT_TIME_REMAINING_INIT; -#ifdef TMC2130 - if (SilentModeMenu == SILENT_MODE_OFF) print_t = print_time_remaining_normal; - else print_t = print_time_remaining_silent; -#else print_t = print_time_remaining_normal; -#endif //TMC2130 if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; return print_t; } @@ -7039,18 +7034,9 @@ uint16_t print_time_remaining() { uint8_t print_percent_done() { //in case that we have information from M73 gcode return percentage counted by slicer, else return percentage counted as byte_printed/filesize uint8_t percent_done = 0; -#ifdef TMC2130 - if (SilentModeMenu == SILENT_MODE_OFF && print_percent_done_normal <= 100) { - percent_done = print_percent_done_normal; - } - else if (print_percent_done_silent <= 100) { - percent_done = print_percent_done_silent; - } -#else if (print_percent_done_normal <= 100) { percent_done = print_percent_done_normal; } -#endif //TMC2130 else { percent_done = card.percentDone(); } From 88f8faaaec9dd1ec6ec3fea46b5cfaf3c15b7140 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 4 Apr 2019 15:32:07 +0200 Subject: [PATCH 06/11] enlarge end file section for incomplete file check --- Firmware/variants/1_75mm_MK1-RAMBo10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK1-RAMBo13a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h | 2 +- Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Firmware/variants/1_75mm_MK1-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK1-RAMBo10a-E3Dv6full.h index f05f8ba5f..60a993304 100644 --- a/Firmware/variants/1_75mm_MK1-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK1-RAMBo10a-E3Dv6full.h @@ -406,6 +406,6 @@ THERMISTORS SETTINGS #define DEFAULT_RETRACTION 1 //used for PINDA temp calibration -#define END_FILE_SECTION 10000 //number of bytes from end of file used for checking if file is complete +#define END_FILE_SECTION 20000 //number of bytes from end of file used for checking if file is complete #endif //__CONFIGURATION_PRUSA_H diff --git a/Firmware/variants/1_75mm_MK1-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK1-RAMBo13a-E3Dv6full.h index 764f1e949..cb9d76e15 100644 --- a/Firmware/variants/1_75mm_MK1-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK1-RAMBo13a-E3Dv6full.h @@ -406,6 +406,6 @@ THERMISTORS SETTINGS #define DEFAULT_RETRACTION 1 //used for PINDA temp calibration -#define END_FILE_SECTION 10000 //number of bytes from end of file used for checking if file is complete +#define END_FILE_SECTION 20000 //number of bytes from end of file used for checking if file is complete #endif //__CONFIGURATION_PRUSA_H diff --git a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h index ffed5e268..506fb4d5b 100644 --- a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo10a-E3Dv6full.h @@ -403,7 +403,7 @@ THERMISTORS SETTINGS #define DEFAULT_RETRACTION 1 //used for PINDA temp calibration and pause print #endif -#define END_FILE_SECTION 10000 //number of bytes from end of file used for checking if file is complete +#define END_FILE_SECTION 20000 //number of bytes from end of file used for checking if file is complete #ifndef SNMM #define SUPPORT_VERBOSITY diff --git a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h index 14fed3ece..c953740eb 100644 --- a/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-MultiMaterial-RAMBo13a-E3Dv6full.h @@ -405,7 +405,7 @@ THERMISTORS SETTINGS #define DEFAULT_RETRACTION 1 //used for PINDA temp calibration and pause print #endif -#define END_FILE_SECTION 10000 //number of bytes from end of file used for checking if file is complete +#define END_FILE_SECTION 20000 //number of bytes from end of file used for checking if file is complete #ifndef SNMM #define SUPPORT_VERBOSITY diff --git a/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h index 6bb14493a..96bf8dd03 100644 --- a/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-RAMBo10a-E3Dv6full.h @@ -403,7 +403,7 @@ THERMISTORS SETTINGS #define DEFAULT_RETRACTION 1 //used for PINDA temp calibration and pause print #endif -#define END_FILE_SECTION 10000 //number of bytes from end of file used for checking if file is complete +#define END_FILE_SECTION 20000 //number of bytes from end of file used for checking if file is complete #ifndef SNMM #define SUPPORT_VERBOSITY diff --git a/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h index 33ed46da3..150176698 100644 --- a/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK2-RAMBo13a-E3Dv6full.h @@ -405,7 +405,7 @@ THERMISTORS SETTINGS #define DEFAULT_RETRACTION 1 //used for PINDA temp calibration and pause print #endif -#define END_FILE_SECTION 10000 //number of bytes from end of file used for checking if file is complete +#define END_FILE_SECTION 20000 //number of bytes from end of file used for checking if file is complete #ifndef SNMM #define SUPPORT_VERBOSITY From 9ab6fbe3df3241886a2d0c33bbda9a573e006826 Mon Sep 17 00:00:00 2001 From: Robert Pelnar Date: Wed, 31 Jan 2018 15:20:27 +0100 Subject: [PATCH 07/11] cardreader - new member "paused" tmc2130 - decreased crash sensitivity for Y --- Firmware/cardreader.cpp | 10 +++++++--- Firmware/cardreader.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Firmware/cardreader.cpp b/Firmware/cardreader.cpp index bef12a130..6e6db946a 100644 --- a/Firmware/cardreader.cpp +++ b/Firmware/cardreader.cpp @@ -24,6 +24,7 @@ CardReader::CardReader() sdpos = 0; sdprinting = false; cardOK = false; + paused = false; saving = false; logging = false; autostart_atmillis=0; @@ -243,9 +244,10 @@ void CardReader::startFileprint() if(cardOK) { sdprinting = true; - #ifdef SDCARD_SORT_ALPHA - // flush_presort(); - #endif + paused = false; + #ifdef SDCARD_SORT_ALPHA + //flush_presort(); + #endif } } @@ -254,6 +256,7 @@ void CardReader::pauseSDPrint() if(sdprinting) { sdprinting = false; + paused = true; } } @@ -327,6 +330,7 @@ void CardReader::openFile(char* name,bool read, bool replace_current/*=true*/) SERIAL_ECHOLN(name); } sdprinting = false; + paused = false; SdFile myDir; diff --git a/Firmware/cardreader.h b/Firmware/cardreader.h index 3ce327d62..e00dc3a77 100644 --- a/Firmware/cardreader.h +++ b/Firmware/cardreader.h @@ -73,6 +73,7 @@ public: bool logging; bool sdprinting ; bool cardOK ; + bool paused ; char filename[13]; uint16_t creationTime, creationDate; uint32_t cluster, position; From 54e9a4fa58f27e4008aaa8e389c741fe558bc200 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 4 Apr 2019 15:49:32 +0200 Subject: [PATCH 08/11] print_time_remaining_init() declaration --- Firmware/Marlin.h | 2 +- Firmware/Marlin_main.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index c17433567..c9a06c7d9 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -349,6 +349,7 @@ extern uint16_t print_time_remaining_silent; #define PRINT_TIME_REMAINING_INIT 0xffff #define PRINT_PERCENT_DONE_INIT 0xff +#define PRINTER_ACTIVE (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) || (lcd_commands_type == LCD_COMMAND_V2_CAL) || card.paused || mmu_print_saved) extern void calculate_extruder_multipliers(); @@ -379,7 +380,6 @@ bool check_commands(); //estimated time to end of the print extern uint16_t print_time_remaining(); extern uint8_t print_percent_done(); -static void print_time_remaining_init(); #ifdef HOST_KEEPALIVE_FEATURE diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index ed5c48c1f..e47d5f067 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -509,6 +509,8 @@ static int saved_feedmultiply_mm = 100; //=============================Routines====================================== //=========================================================================== +static void print_time_remaining_init(); + void get_arc_coordinates(); bool setTargetedHotend(int code); From 43425876d1263a1fa7afc2069378b35c8c5ddcd4 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 4 Apr 2019 15:50:35 +0200 Subject: [PATCH 09/11] removed unused mmu_print_saved --- Firmware/Marlin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index c9a06c7d9..1aa237046 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -349,7 +349,7 @@ extern uint16_t print_time_remaining_silent; #define PRINT_TIME_REMAINING_INIT 0xffff #define PRINT_PERCENT_DONE_INIT 0xff -#define PRINTER_ACTIVE (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) || (lcd_commands_type == LCD_COMMAND_V2_CAL) || card.paused || mmu_print_saved) +#define PRINTER_ACTIVE (IS_SD_PRINTING || is_usb_printing || isPrintPaused || (custom_message_type == 4) || (lcd_commands_type == LCD_COMMAND_V2_CAL) || card.paused) extern void calculate_extruder_multipliers(); From 449bd58125efdc947c52789f431183be9fcd9773 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 4 Apr 2019 16:35:51 +0200 Subject: [PATCH 10/11] compilation error fix --- Firmware/ultralcd_implementation_hitachi_HD44780.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/ultralcd_implementation_hitachi_HD44780.h b/Firmware/ultralcd_implementation_hitachi_HD44780.h index bc3021239..542756f62 100644 --- a/Firmware/ultralcd_implementation_hitachi_HD44780.h +++ b/Firmware/ultralcd_implementation_hitachi_HD44780.h @@ -807,7 +807,7 @@ static void lcd_implementation_status_screen() lcd.setCursor(0, 2); lcd_print_percent_done(); -} + // Farm number display if (farm_mode) From 9a4cfd97c8bc1087d1ebe62369930ed045698d0e Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Mon, 8 Apr 2019 20:37:21 +0200 Subject: [PATCH 11/11] M27 updated --- Firmware/cardreader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Firmware/cardreader.cpp b/Firmware/cardreader.cpp index 6e6db946a..3ca557375 100644 --- a/Firmware/cardreader.cpp +++ b/Firmware/cardreader.cpp @@ -517,8 +517,11 @@ void CardReader::getStatus() SERIAL_PROTOCOL(itostr2(time%60)); SERIAL_PROTOCOLPGM("\n"); } + else if (paused) { + SERIAL_PROTOCOLLNPGM("SD print paused"); + } else{ - SERIAL_PROTOCOLLNRPGM("Not printing"); + SERIAL_PROTOCOLLNPGM("Not SD printing"); } } void CardReader::write_command(char *buf)