From 48f5da9cb8fbc216f86baaa190a621e4af444d58 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 6 Sep 2018 20:54:51 +0200 Subject: [PATCH 1/3] lcd_clicked fix --- Firmware/lcd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/lcd.cpp b/Firmware/lcd.cpp index 15ec744ce..ac2863fe2 100644 --- a/Firmware/lcd.cpp +++ b/Firmware/lcd.cpp @@ -687,7 +687,7 @@ LongTimer lcd_timeoutToStatus; uint8_t lcd_clicked(void) { bool clicked = LCD_CLICKED; - if(clicked) lcd_button_pressed = 1; + if(clicked) lcd_button_pressed = 0; return clicked; } From 66305b3e0413b64adc135e34ef9acabdf69e725b Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Thu, 6 Sep 2018 23:05:36 +0200 Subject: [PATCH 2/3] 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 cb2180196..05a5d49ef 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -8857,8 +8857,12 @@ void print_mesh_bed_leveling_table() 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; } @@ -8867,12 +8871,18 @@ uint8_t calc_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 2f02828273bc1c11bb993cf44c7ab91284b18d69 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Fri, 7 Sep 2018 02:02:35 +0200 Subject: [PATCH 3/3] time remaining fix --- Firmware/Marlin.h | 6 +++--- Firmware/Marlin_main.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 8512de1e4..bb40ce768 100644 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -357,13 +357,13 @@ extern bool mmu_print_saved; //estimated time to end of the print extern uint8_t print_percent_done_normal; -extern uint32_t print_time_remaining_normal; +extern uint16_t print_time_remaining_normal; extern uint8_t print_percent_done_silent; -extern uint32_t print_time_remaining_silent; +extern uint16_t print_time_remaining_silent; extern uint16_t mcode_in_progress; extern uint16_t gcode_in_progress; -#define PRINT_TIME_REMAINING_INIT 0xffffffff +#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 == CUSTOM_MSG_TYPE_TEMCAL) || saved_printing || (lcd_commands_type == LCD_COMMAND_V2_CAL) || card.paused || mmu_print_saved) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index cb2180196..7d9a58867 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -476,9 +476,9 @@ bool mmu_print_saved = false; // storing estimated time to end of print counted by slicer uint8_t print_percent_done_normal = PRINT_PERCENT_DONE_INIT; -uint32_t print_time_remaining_normal = PRINT_TIME_REMAINING_INIT; //estimated remaining print time in minutes +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; -uint32_t print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; //estimated remaining print time in minutes +uint16_t print_time_remaining_silent = PRINT_TIME_REMAINING_INIT; //estimated remaining print time in minutes //=========================================================================== //=============================Private Variables============================= @@ -8859,7 +8859,7 @@ 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; + if ((print_t != PRINT_TIME_REMAINING_INIT) && (feedmultiply != 0)) print_t = 100ul * print_t / feedmultiply; return print_t; }