From ffe45bdef33a4a16d06fa5e5a966218eb3f2755b Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Fri, 15 Mar 2019 03:38:37 +0100 Subject: [PATCH] Disable mmu filament cutter feature. --- Firmware/mmu.cpp | 36 ++++++++++--------- Firmware/mmu.h | 2 ++ Firmware/ultralcd.cpp | 16 ++++++++- .../variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h | 1 + .../variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h | 1 + .../1_75mm_MK25S-RAMBo10a-E3Dv6full.h | 1 + .../1_75mm_MK25S-RAMBo13a-E3Dv6full.h | 1 + .../variants/1_75mm_MK3-EINSy10a-E3Dv6full.h | 1 + .../variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h | 1 + 9 files changed, 43 insertions(+), 17 deletions(-) diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index 65c73ca3..8cdfc6c6 100644 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -1365,25 +1365,27 @@ bFilamentAction=false; // NOT in "mmu_load_to_nozzle_ } } +#ifdef MMU_HAS_CUTTER void mmu_cut_filament(uint8_t filament_nr) { -bFilamentAction=false; // NOT in "mmu_load_to_nozzle_menu()" - if (degHotend0() > EXTRUDE_MINTEMP) - { - LcdUpdateDisabler disableLcdUpdate; - lcd_clear(); - lcd_set_cursor(0, 1); lcd_puts_P(_i("Cutting filament")); //// c=18 r=1 - lcd_print(" "); - lcd_print(filament_nr + 1); - mmu_filament_ramming(); - mmu_command(MmuCmd::K0 + filament_nr); - manage_response(false, false, MMU_UNLOAD_MOVE); - } - else - { - show_preheat_nozzle_warning(); - } + bFilamentAction=false; // NOT in "mmu_load_to_nozzle_menu()" + if (degHotend0() > EXTRUDE_MINTEMP) + { + LcdUpdateDisabler disableLcdUpdate; + lcd_clear(); + lcd_set_cursor(0, 1); lcd_puts_P(_i("Cutting filament")); //// c=18 r=1 + lcd_print(" "); + lcd_print(filament_nr + 1); + mmu_filament_ramming(); + mmu_command(MmuCmd::K0 + filament_nr); + manage_response(false, false, MMU_UNLOAD_MOVE); + } + else + { + show_preheat_nozzle_warning(); + } } +#endif //MMU_HAS_CUTTER void mmu_eject_filament(uint8_t filament, bool recover) { @@ -1457,11 +1459,13 @@ void mmu_continue_loading() if(mmu_load_fail < 255) eeprom_update_byte((uint8_t*)EEPROM_MMU_LOAD_FAIL, mmu_load_fail + 1); if(mmu_load_fail_tot < 65535) eeprom_update_word((uint16_t*)EEPROM_MMU_LOAD_FAIL_TOT, mmu_load_fail_tot + 1); +#ifdef MMU_HAS_CUTTER if (1 == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) { mmu_command(MmuCmd::K0 + tmp_extruder); manage_response(true, true, MMU_UNLOAD_MOVE); } +#endif //MMU_HAS_CUTTER mmu_command(MmuCmd::T0 + tmp_extruder); manage_response(true, true, MMU_TCODE_MOVE); diff --git a/Firmware/mmu.h b/Firmware/mmu.h index c2e8b713..9c233d05 100644 --- a/Firmware/mmu.h +++ b/Firmware/mmu.h @@ -132,7 +132,9 @@ extern bool mmu_check_version(); extern void mmu_show_warning(); extern void lcd_mmu_load_to_nozzle(uint8_t filament_nr); extern void mmu_eject_filament(uint8_t filament, bool recover); +#ifdef MMU_HAS_CUTTER extern void mmu_cut_filament(uint8_t filament_nr); +#endif //MMU_HAS_CUTTER extern void mmu_continue_loading(); extern void mmu_filament_ramming(); extern void mmu_wait_for_heater_blocking(); diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 6bd94642..15ca1121 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -142,7 +142,9 @@ static void lcd_menu_fails_stats_mmu_total(); static void mmu_fil_eject_menu(); static void mmu_load_to_nozzle_menu(); +#ifdef MMU_HAS_CUTTER static void mmu_cut_filament_menu(); +#endif //MMU_HAS_CUTTER #if defined(TMC2130) || defined(FILAMENT_SENSOR) static void lcd_menu_fails_stats(); @@ -2295,6 +2297,7 @@ void lcd_set_fan_check() { eeprom_update_byte((unsigned char *)EEPROM_FAN_CHECK_ENABLED, fans_check_enabled); } +#ifdef MMU_HAS_CUTTER void lcd_cutter_enabled() { if (1 == eeprom_read_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED)) @@ -2306,6 +2309,7 @@ void lcd_cutter_enabled() eeprom_update_byte((uint8_t*)EEPROM_MMU_CUTTER_ENABLED, 1); } } +#endif //MMU_HAS_CUTTER void lcd_set_filament_autoload() { fsensor_autoload_set(!fsensor_autoload_enabled); @@ -2536,10 +2540,12 @@ if(current_temperature[0]>(target_temperature[0]*0.95)) menu_submenu(mmu_fil_eject_menu); break; case e_FILAMENT_ACTION_mmuCut: +#ifdef MMU_HAS_CUTTER nLevel=bFilamentPreheatState?1:2; bFilamentAction=true; menu_back(nLevel); menu_submenu(mmu_cut_filament_menu); +#endif //MMU_HAS_CUTTER break; case e_FILAMENT_ACTION_none: break; @@ -5220,6 +5226,7 @@ do\ }\ while(0)\ +#ifdef MMU_HAS_CUTTER static bool settingsCutter() { if (mmu_enabled) @@ -5241,7 +5248,10 @@ do\ {\ if(settingsCutter()) return;\ }\ -while(0)\ +while(0) +#else +#define SETTINGS_CUTTER +#endif //MMU_HAS_CUTTER #ifdef TMC2130 #define SETTINGS_SILENT_MODE \ @@ -5919,6 +5929,7 @@ static void mmu_fil_eject_menu() } } +#ifdef MMU_HAS_CUTTER template static void mmu_cut_filament() { @@ -5950,6 +5961,7 @@ else { else mFilamentMenu(); } } +#endif //MMU_HAS_CUTTER #ifdef SNMM static void fil_unload_menu() @@ -6423,7 +6435,9 @@ static void lcd_main_menu() //bFilamentFirstRun=true; MENU_ITEM_SUBMENU_P(_T(MSG_UNLOAD_FILAMENT), extr_unload_); MENU_ITEM_SUBMENU_P(_i("Eject filament"), mmu_fil_eject_menu); +#ifdef MMU_HAS_CUTTER MENU_ITEM_SUBMENU_P(_i("Cut filament"), mmu_cut_filament_menu); +#endif //MMU_HAS_CUTTER } else { diff --git a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h index 40a3a229..18007e06 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo10a-E3Dv6full.h @@ -500,6 +500,7 @@ #define MMU_REQUIRED_FW_BUILDNR 132 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial +//#define MMU_HAS_CUTTER #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning diff --git a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h index e316c4f0..b79147ae 100644 --- a/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25-RAMBo13a-E3Dv6full.h @@ -501,6 +501,7 @@ #define MMU_REQUIRED_FW_BUILDNR 132 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial +//#define MMU_HAS_CUTTER #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning diff --git a/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h index d3badf6a..196cba00 100644 --- a/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25S-RAMBo10a-E3Dv6full.h @@ -500,6 +500,7 @@ #define MMU_REQUIRED_FW_BUILDNR 132 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial +//#define MMU_HAS_CUTTER #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning diff --git a/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h b/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h index 2563f848..68310625 100644 --- a/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK25S-RAMBo13a-E3Dv6full.h @@ -501,6 +501,7 @@ #define MMU_REQUIRED_FW_BUILDNR 132 #define MMU_FORCE_STEALTH_MODE #define MMU_DEBUG //print communication between MMU2 and printer on serial +//#define MMU_HAS_CUTTER #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning diff --git a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h index c400b016..04b73223 100644 --- a/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h @@ -626,6 +626,7 @@ #define MMU_REQUIRED_FW_BUILDNR 83 #define MMU_HWRESET #define MMU_DEBUG //print communication between MMU2 and printer on serial +//#define MMU_HAS_CUTTER #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning #endif //__CONFIGURATION_PRUSA_H diff --git a/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h b/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h index 37512071..edac6c0e 100644 --- a/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h +++ b/Firmware/variants/1_75mm_MK3S-EINSy10a-E3Dv6full.h @@ -626,6 +626,7 @@ #define MMU_REQUIRED_FW_BUILDNR 83 #define MMU_HWRESET #define MMU_DEBUG //print communication between MMU2 and printer on serial +//#define MMU_HAS_CUTTER #define MMU_IDLER_SENSOR_ATTEMPTS_NR 21 //max. number of attempts to load filament if first load failed; value for max bowden length and case when loading fails right at the beginning #endif //__CONFIGURATION_PRUSA_H