From f02b0d80e3a8e7631b469d6305d21b6efc4b6d46 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Fri, 10 Aug 2018 15:19:35 +0200 Subject: [PATCH 1/6] Split settings menu into separate macros. --- Firmware/ultralcd.cpp | 254 ++++++++++++++++++++++++++---------------- 1 file changed, 156 insertions(+), 98 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 37114398..63affbaf 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -4511,6 +4511,154 @@ void lcd_settings_linearity_correction_menu(void) } } +#ifdef FILAMENT_SENSOR +#define SETTINGS_FILAMENT_SENSOR \ +do\ +{\ + if (FSensorStateMenu == 0)\ + {\ + if (fsensor_not_responding)\ + {\ + /* Filament sensor not working*/\ + MENU_ITEM_FUNCTION_P(_i("Fil. sensor [N/A]"), lcd_fsensor_state_set);/*////MSG_FSENSOR_NA c=0 r=0*/\ + MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_fsensor_fail);\ + }\ + else\ + {\ + /* Filament sensor turned off, working, no problems*/\ + MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_OFF), lcd_fsensor_state_set);\ + if (mmu_enabled == false)if (mmu_enabled == false)\ + {\ + MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_filament_autoload_info);\ + }\ + }\ + }\ + else\ + {\ + /* Filament sensor turned on, working, no problems*/\ + MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_ON), lcd_fsensor_state_set);\ + if (mmu_enabled == false)\ + {\ + if (fsensor_autoload_enabled)\ + MENU_ITEM_FUNCTION_P(_i("F. autoload [on]"), lcd_set_filament_autoload);/*////MSG_FSENS_AUTOLOAD_ON c=17 r=1*/\ + else\ + MENU_ITEM_FUNCTION_P(_i("F. autoload [off]"), lcd_set_filament_autoload);/*////MSG_FSENS_AUTOLOAD_OFF c=17 r=1*/\ + }\ + }\ +}\ +while(0) + +#else //FILAMENT_SENSOR +#define SETTINGS_FILAMENT_SENSOR do{}while(0) +#endif //FILAMENT_SENSOR + +#ifdef TMC2130 +#define SETTINGS_SILENT_MODE \ +do\ +{\ + if(!farm_mode)\ + {\ + if (SilentModeMenu == SILENT_MODE_NORMAL)\ + {\ + MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_OFF), lcd_silent_mode_set);\ + }\ + else MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_ON), lcd_silent_mode_set);\ + if (SilentModeMenu == SILENT_MODE_NORMAL)\ + {\ + if (CrashDetectMenu == 0)\ + {\ + MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_OFF), lcd_crash_mode_set);\ + }\ + else MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_ON), lcd_crash_mode_set);\ + }\ + else MENU_ITEM_SUBMENU_P(_T(MSG_CRASHDETECT_NA), lcd_crash_mode_info);\ + }\ +}\ +while (0) + +#else //TMC2130 +#define SETTINGS_SILENT_MODE \ +do\ +{\ + if(!farm_mode)\ + {\ + switch (SilentModeMenu)\ + {\ + case SILENT_MODE_POWER:\ + MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set);\ + break;\ + case SILENT_MODE_SILENT:\ + MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_ON), lcd_silent_mode_set);\ + break;\ + case SILENT_MODE_AUTO:\ + MENU_ITEM_FUNCTION_P(_T(MSG_AUTO_MODE_ON), lcd_silent_mode_set);\ + break;\ + default:\ + MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set);\ + break; /* (probably) not needed*/\ + }\ + }\ +}\ +while (0) +#endif //TMC2130 + +#ifdef SDCARD_SORT_ALPHA +#define SETTINGS_SD \ +do\ +{\ + if (card.ToshibaFlashAir_isEnabled())\ + MENU_ITEM_FUNCTION_P(_i("SD card [flshAir]"), lcd_toshiba_flash_air_compatibility_toggle);/*////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON c=19 r=1*/\ + else\ + MENU_ITEM_FUNCTION_P(_i("SD card [normal]"), lcd_toshiba_flash_air_compatibility_toggle);/*////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF c=19 r=1*/\ +\ + if (!farm_mode)\ + {\ + uint8_t sdSort;\ + EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort));\ + switch (sdSort)\ + {\ + case SD_SORT_TIME: MENU_ITEM_FUNCTION_P(_i("Sort: [time]"), lcd_sort_type_set); break;/*////MSG_SORT_TIME c=17 r=1*/\ + case SD_SORT_ALPHA: MENU_ITEM_FUNCTION_P(_i("Sort: [alphabet]"), lcd_sort_type_set); break;/*////MSG_SORT_ALPHA c=17 r=1*/\ + default: MENU_ITEM_FUNCTION_P(_i("Sort: [none]"), lcd_sort_type_set);/*////MSG_SORT_NONE c=17 r=1*/\ + }\ + }\ +}\ +while (0) +#else // SDCARD_SORT_ALPHA +#define SETTINGS_SD \ +do\ +{\ + if (card.ToshibaFlashAir_isEnabled())\ + MENU_ITEM_FUNCTION_P(_i("SD card [flshAir]"), lcd_toshiba_flash_air_compatibility_toggle);/*////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON c=19 r=1*/\ + else\ + MENU_ITEM_FUNCTION_P(_i("SD card [normal]"), lcd_toshiba_flash_air_compatibility_toggle);/*////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF c=19 r=1*/\ +}\ +while (0) +#endif // SDCARD_SORT_ALPHA + +#define SETTINGS_SOUND \ +do\ +{\ + switch(eSoundMode)\ + {\ + case e_SOUND_MODE_LOUD:\ + MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);\ + break;\ + case e_SOUND_MODE_ONCE:\ + MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_ONCE),lcd_sound_state_set);\ + break;\ + case e_SOUND_MODE_SILENT:\ + MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_SILENT),lcd_sound_state_set);\ + break;\ + case e_SOUND_MODE_MUTE:\ + MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_MUTE),lcd_sound_state_set);\ + break;\ + default:\ + MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set);\ + }\ +}\ +while (0) + static void lcd_settings_menu() { EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu)); @@ -4519,76 +4667,22 @@ static void lcd_settings_menu() MENU_ITEM_SUBMENU_P(_i("Temperature"), lcd_control_temperature_menu);////MSG_TEMPERATURE c=0 r=0 if (!homing_flag) - MENU_ITEM_SUBMENU_P(_i("Move axis"), lcd_move_menu_1mm);////MSG_MOVE_AXIS c=0 r=0 + MENU_ITEM_SUBMENU_P(_i("Move axis"), lcd_move_menu_1mm);////MSG_MOVE_AXIS c=0 r=0 if (!isPrintPaused) - MENU_ITEM_GCODE_P(_i("Disable steppers"), PSTR("M84"));////MSG_DISABLE_STEPPERS c=0 r=0 + MENU_ITEM_GCODE_P(_i("Disable steppers"), PSTR("M84"));////MSG_DISABLE_STEPPERS c=0 r=0 -#ifndef TMC2130 - if (!farm_mode) - { //dont show in menu if we are in farm mode - switch (SilentModeMenu) - { - case SILENT_MODE_POWER: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set); break; - case SILENT_MODE_SILENT: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_ON), lcd_silent_mode_set); break; - case SILENT_MODE_AUTO: MENU_ITEM_FUNCTION_P(_T(MSG_AUTO_MODE_ON), lcd_silent_mode_set); break; - default: MENU_ITEM_FUNCTION_P(_T(MSG_SILENT_MODE_OFF), lcd_silent_mode_set); break; // (probably) not needed - } - } -#endif //TMC2130 - -#ifdef FILAMENT_SENSOR - if (FSensorStateMenu == 0) - { - if (fsensor_not_responding) - { - // Filament sensor not working - MENU_ITEM_FUNCTION_P(_i("Fil. sensor [N/A]"), lcd_fsensor_state_set);////MSG_FSENSOR_NA c=0 r=0 - MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_fsensor_fail); - } - else - { - // Filament sensor turned off, working, no problems - MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_OFF), lcd_fsensor_state_set); - if (mmu_enabled == false) - { - MENU_ITEM_SUBMENU_P(_T(MSG_FSENS_AUTOLOAD_NA), lcd_filament_autoload_info); - } - } - } - else - { - // Filament sensor turned on, working, no problems - MENU_ITEM_FUNCTION_P(_T(MSG_FSENSOR_ON), lcd_fsensor_state_set); - if (mmu_enabled == false) - { - if (fsensor_autoload_enabled) - MENU_ITEM_FUNCTION_P(_i("F. autoload [on]"), lcd_set_filament_autoload);////MSG_FSENS_AUTOLOAD_ON c=17 r=1 - else - MENU_ITEM_FUNCTION_P(_i("F. autoload [off]"), lcd_set_filament_autoload);////MSG_FSENS_AUTOLOAD_OFF c=17 r=1 - } - } -#endif //FILAMENT_SENSOR + SETTINGS_FILAMENT_SENSOR; if (fans_check_enabled == true) MENU_ITEM_FUNCTION_P(_i("Fans check [on]"), lcd_set_fan_check);////MSG_FANS_CHECK_ON c=17 r=1 else MENU_ITEM_FUNCTION_P(_i("Fans check [off]"), lcd_set_fan_check);////MSG_FANS_CHECK_OFF c=17 r=1 -#ifdef TMC2130 - if(!farm_mode) - { - if (SilentModeMenu == SILENT_MODE_NORMAL) { MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_OFF), lcd_silent_mode_set); } - else MENU_ITEM_FUNCTION_P(_T(MSG_STEALTH_MODE_ON), lcd_silent_mode_set); - if (SilentModeMenu == SILENT_MODE_NORMAL) - { - if (CrashDetectMenu == 0) { MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_OFF), lcd_crash_mode_set); } - else MENU_ITEM_FUNCTION_P(_T(MSG_CRASHDETECT_ON), lcd_crash_mode_set); - } - else MENU_ITEM_SUBMENU_P(_T(MSG_CRASHDETECT_NA), lcd_crash_mode_info); - } + SETTINGS_SILENT_MODE; +#if defined (TMC2130) && defined (LINEARITY_CORRECTION) MENU_ITEM_SUBMENU_P(_i("Lin. correction"), lcd_settings_linearity_correction_menu); -#endif //TMC2130 +#endif //LINEARITY_CORRECTION && TMC2130 if (temp_cal_active == false) MENU_ITEM_FUNCTION_P(_i("Temp. cal. [off]"), lcd_temp_calibration_set);////MSG_TEMP_CALIBRATION_OFF c=20 r=1 @@ -4609,45 +4703,9 @@ static void lcd_settings_menu() MENU_ITEM_SUBMENU_P(_i("Select language"), lcd_language_menu);////MSG_LANGUAGE_SELECT c=0 r=0 #endif //(LANG_MODE != 0) - if (card.ToshibaFlashAir_isEnabled()) - MENU_ITEM_FUNCTION_P(_i("SD card [flshAir]"), lcd_toshiba_flash_air_compatibility_toggle);////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON c=19 r=1 - else - MENU_ITEM_FUNCTION_P(_i("SD card [normal]"), lcd_toshiba_flash_air_compatibility_toggle);////MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF c=19 r=1 + SETTINGS_SD; + SETTINGS_SOUND; -#ifdef SDCARD_SORT_ALPHA - if (!farm_mode) - { - uint8_t sdSort; - EEPROM_read(EEPROM_SD_SORT, (uint8_t*)&sdSort, sizeof(sdSort)); - switch (sdSort) - { - case SD_SORT_TIME: MENU_ITEM_FUNCTION_P(_i("Sort: [time]"), lcd_sort_type_set); break;////MSG_SORT_TIME c=17 r=1 - case SD_SORT_ALPHA: MENU_ITEM_FUNCTION_P(_i("Sort: [alphabet]"), lcd_sort_type_set); break;////MSG_SORT_ALPHA c=17 r=1 - default: MENU_ITEM_FUNCTION_P(_i("Sort: [none]"), lcd_sort_type_set);////MSG_SORT_NONE c=17 r=1 - } - } -#endif // SDCARD_SORT_ALPHA - - -//-// -switch(eSoundMode) - { - case e_SOUND_MODE_LOUD: - MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set); - break; - case e_SOUND_MODE_ONCE: - MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_ONCE),lcd_sound_state_set); - break; - case e_SOUND_MODE_SILENT: - MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_SILENT),lcd_sound_state_set); - break; - case e_SOUND_MODE_MUTE: - MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_MUTE),lcd_sound_state_set); - break; - default: - MENU_ITEM_FUNCTION_P(_i(MSG_SOUND_MODE_LOUD),lcd_sound_state_set); - } -//-// if (farm_mode) { MENU_ITEM_SUBMENU_P(PSTR("Farm number"), lcd_farm_no); From 8279aba4d7b03b2c4d5698f4da0103da2c2ec3d5 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Fri, 10 Aug 2018 16:10:49 +0200 Subject: [PATCH 2/6] Add auto deplete setting. --- Firmware/eeprom.h | 1 + Firmware/ultralcd.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Firmware/eeprom.h b/Firmware/eeprom.h index 28498f13..54a21648 100644 --- a/Firmware/eeprom.h +++ b/Firmware/eeprom.h @@ -144,6 +144,7 @@ // Sound Mode //#define EEPROM_SOUND_MODE (EEPROM_EXTRUDEMULTIPLY-1) // uint8 #define EEPROM_SOUND_MODE (EEPROM_UVLO_TINY_Z_MICROSTEPS-1) // uint8 +#define EEPROM_AUTO_DEPLETE (EEPROM_SOUND_MODE-1) //bool // !!!!! // !!!!! this is end of EEPROM section ... all updates MUST BE inserted before this mark !!!!! diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 63affbaf..e3a38aa9 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -88,6 +88,7 @@ unsigned long display_time; //just timer for showing pid finished message on lcd float pid_temp = DEFAULT_PID_TEMP; static bool forceMenuExpire = false; +static bool autoDeplete; static float manual_feedrate[] = MANUAL_FEEDRATE; @@ -4659,6 +4660,11 @@ do\ }\ while (0) +static void auto_deplete_switch() +{ + autoDeplete = !autoDeplete; + eeprom_update_byte((unsigned char *)EEPROM_AUTO_DEPLETE, autoDeplete); +} static void lcd_settings_menu() { EEPROM_read(EEPROM_SILENT, (uint8_t*)&SilentModeMenu, sizeof(SilentModeMenu)); @@ -4673,6 +4679,9 @@ static void lcd_settings_menu() SETTINGS_FILAMENT_SENSOR; + if (autoDeplete) MENU_ITEM_FUNCTION_P(_i("Auto deplete [on]"), auto_deplete_switch); + else MENU_ITEM_FUNCTION_P(_i("Auto deplete[off]"), auto_deplete_switch); + if (fans_check_enabled == true) MENU_ITEM_FUNCTION_P(_i("Fans check [on]"), lcd_set_fan_check);////MSG_FANS_CHECK_ON c=17 r=1 else @@ -7056,6 +7065,12 @@ void menu_action_sddirectory(const char* filename, char* longFilename) void ultralcd_init() { + { + uint8_t autoDepleteRaw = eeprom_read_byte(reinterpret_cast(EEPROM_AUTO_DEPLETE)); + if (0xff == autoDepleteRaw) autoDeplete = false; + else autoDeplete = autoDepleteRaw; + + } lcd_init(); lcd_refresh(); lcd_longpress_func = menu_lcd_longpress_func; From 1cdb7a48cb80cb5b5aa60d0d465f121b07d32680 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Fri, 10 Aug 2018 16:25:13 +0200 Subject: [PATCH 3/6] Show auto deplete only when mmu unit present. --- Firmware/ultralcd.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index e3a38aa9..4129a608 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -4679,8 +4679,11 @@ static void lcd_settings_menu() SETTINGS_FILAMENT_SENSOR; - if (autoDeplete) MENU_ITEM_FUNCTION_P(_i("Auto deplete [on]"), auto_deplete_switch); - else MENU_ITEM_FUNCTION_P(_i("Auto deplete[off]"), auto_deplete_switch); + if (mmu_enabled) + { + if (autoDeplete) MENU_ITEM_FUNCTION_P(_i("Auto deplete [on]"), auto_deplete_switch); + else MENU_ITEM_FUNCTION_P(_i("Auto deplete[off]"), auto_deplete_switch); + } if (fans_check_enabled == true) MENU_ITEM_FUNCTION_P(_i("Fans check [on]"), lcd_set_fan_check);////MSG_FANS_CHECK_ON c=17 r=1 From b08ae955682831c5c6fc11249aa0080c3b041217 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Mon, 27 Aug 2018 19:36:54 +0200 Subject: [PATCH 4/6] Rename autoDeplete to lcd_autoDeplete and make it global. When filament runs out, call M600 AUTO if lcd_autoDeplete is enabled. Shorten finda polling period to 300 ms. --- Firmware/mmu.cpp | 6 ++++-- Firmware/ultralcd.cpp | 12 ++++++------ Firmware/ultralcd.h | 1 + 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index 73caf79d..37f78db6 100644 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -9,6 +9,7 @@ #include "Configuration_prusa.h" #include "fsensor.h" #include "cardreader.h" +#include "ultralcd.h" extern const char* lcd_display_message_fullscreen_P(const char *msg); @@ -192,7 +193,7 @@ void mmu_loop(void) } mmu_cmd = 0; } - else if ((mmu_last_response + 800) < millis()) //request every 800ms + else if ((mmu_last_response + 300) < millis()) //request every 300ms { puts_P(PSTR("MMU <= 'P0'")); mmu_puts_P(PSTR("P0\n")); //send 'read finda' request @@ -208,7 +209,8 @@ void mmu_loop(void) if (!mmu_finda && CHECK_FINDA && fsensor_enabled) { fsensor_stop_and_save_print(); enquecommand_front_P(PSTR("FSENSOR_RECOVER")); //then recover - enquecommand_front_P(PSTR("M600")); //save print and run M600 command + if (lcd_autoDeplete) enquecommand_front_P(PSTR("M600 AUTO")); //save print and run M600 command + else enquecommand_front_P(PSTR("M600")); //save print and run M600 command } mmu_state = 1; if (mmu_cmd == 0) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 4129a608..ea85049f 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -88,7 +88,7 @@ unsigned long display_time; //just timer for showing pid finished message on lcd float pid_temp = DEFAULT_PID_TEMP; static bool forceMenuExpire = false; -static bool autoDeplete; +bool lcd_autoDeplete; static float manual_feedrate[] = MANUAL_FEEDRATE; @@ -4662,8 +4662,8 @@ while (0) static void auto_deplete_switch() { - autoDeplete = !autoDeplete; - eeprom_update_byte((unsigned char *)EEPROM_AUTO_DEPLETE, autoDeplete); + lcd_autoDeplete = !lcd_autoDeplete; + eeprom_update_byte((unsigned char *)EEPROM_AUTO_DEPLETE, lcd_autoDeplete); } static void lcd_settings_menu() { @@ -4681,7 +4681,7 @@ static void lcd_settings_menu() if (mmu_enabled) { - if (autoDeplete) MENU_ITEM_FUNCTION_P(_i("Auto deplete [on]"), auto_deplete_switch); + if (lcd_autoDeplete) MENU_ITEM_FUNCTION_P(_i("Auto deplete [on]"), auto_deplete_switch); else MENU_ITEM_FUNCTION_P(_i("Auto deplete[off]"), auto_deplete_switch); } @@ -7070,8 +7070,8 @@ void ultralcd_init() { { uint8_t autoDepleteRaw = eeprom_read_byte(reinterpret_cast(EEPROM_AUTO_DEPLETE)); - if (0xff == autoDepleteRaw) autoDeplete = false; - else autoDeplete = autoDepleteRaw; + if (0xff == autoDepleteRaw) lcd_autoDeplete = false; + else lcd_autoDeplete = autoDepleteRaw; } lcd_init(); diff --git a/Firmware/ultralcd.h b/Firmware/ultralcd.h index 29a13a9c..3d334a9a 100644 --- a/Firmware/ultralcd.h +++ b/Firmware/ultralcd.h @@ -111,6 +111,7 @@ extern int8_t SilentModeMenu; extern bool cancel_heatup; extern bool isPrintPaused; +extern bool lcd_autoDeplete; void lcd_ignore_click(bool b=true); From 2a00e5d34830c1ab1a648a20779fd93c12ab87ec Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Mon, 27 Aug 2018 20:09:22 +0200 Subject: [PATCH 5/6] Fix loading filament screen hangs if changed automatically. --- Firmware/Marlin_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index e9fea8c2..c06e6c75 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3124,6 +3124,8 @@ void gcode_M600(bool automatic, float x_position, float y_position, float z_shif if(!automatic) M600_check_state(); + lcd_update_enable(true); + //Not let's go back to print fanSpeed = fanSpeedBckp; @@ -8881,7 +8883,6 @@ void M600_check_state() // Everything good default: lcd_change_success(); - lcd_update_enable(true); break; } } From 9611401b691c6ef088a16b4a38660bd591954163 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Mon, 27 Aug 2018 20:23:43 +0200 Subject: [PATCH 6/6] Fix mmu_M600_load_filament increments tmp_extruder, which is not set in case of automatic == true. --- Firmware/mmu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index 37f78db6..e4ef322a 100644 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -418,11 +418,10 @@ void mmu_M600_load_filament(bool automatic) bool response = false; bool yes = false; + tmp_extruder = mmu_extruder; if (!automatic) { yes = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Do you want to switch extruder?"), false); if(yes) tmp_extruder = choose_extruder_menu(); - else tmp_extruder = mmu_extruder; - } else { tmp_extruder = (tmp_extruder+1)%5; @@ -444,6 +443,7 @@ void mmu_M600_load_filament(bool automatic) mmu_load_to_nozzle(); + st_synchronize(); current_position[E_AXIS]+= FILAMENTCHANGE_FINALFEED ; plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2, active_extruder);